From 46ba8b9d21a84839ae43742a1faa5be7a3f68d53 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 20 Apr 2012 20:02:35 +0000 Subject: [PATCH] Updated non-English Administrative interface translations and static builds git-svn-id: svn://192.168.202.10@1808 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../vicidial_br/AST_CLOSER_service_level.php | 597 +- .../LANG_www/vicidial_br/AST_CLOSERstats.php | 1531 +- .../vicidial_br/AST_CLOSERsummary_hourly.php | 601 +- .../LANG_www/vicidial_br/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_br/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_br/AST_IVRstats.php | 653 +- .../vicidial_br/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_br/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 671 +- .../LANG_www/vicidial_br/AST_VDADstats.php | 517 +- .../vicidial_br/AST_VICIDIAL_hopperlist.php | 106 +- .../vicidial_br/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_br/AST_admin_template_maker.php | 447 + .../vicidial_br/AST_agent_days_detail.php | 317 +- .../AST_agent_performance_detail.php | 731 +- .../vicidial_br/AST_agent_status_detail.php | 328 +- .../vicidial_br/AST_agent_time_detail.php | 495 +- .../vicidial_br/AST_agent_time_sheet.php | 309 +- .../AST_agent_timeclock_detail.php | 208 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_br/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_br/AST_hangup_cause_report.php | 413 + .../vicidial_br/AST_inbound_daily_report.php | 1794 +++ .../vicidial_br/AST_server_performance.php | 66 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_br/AST_timeonVDADall.php | 1339 +- .../vicidial_br/AST_timeonVDADallSUMMARY.php | 491 +- .../LANG_www/vicidial_br/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_br/admin.php | 12927 ++++++++++++--- .../vicidial_br/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_br/admin_header.php | 428 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_br/admin_lists_custom.php | 1802 +++ .../vicidial_br/admin_modify_lead.php | 1042 +- .../vicidial_br/admin_phones_bulk_insert.php | 538 + .../vicidial_br/admin_search_lead.php | 312 +- .../LANG_www/vicidial_br/audio_store.php | 44 +- .../trunk/LANG_www/vicidial_br/calendar_db.js | 2 +- .../vicidial_br/call_report_export.php | 604 +- .../LANG_www/vicidial_br/callcard_admin.php | 943 ++ .../LANG_www/vicidial_br/campaign_debug.php | 191 + .../LANG_www/vicidial_br/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_br/dbconnect.php | 18 +- .../trunk/LANG_www/vicidial_br/fcstats.php | 513 +- .../trunk/LANG_www/vicidial_br/functions.php | 108 +- .../vicidial_br/group_hourly_stats.php | 135 +- .../vicidial_br/horizontalbargraph.css | 104 + .../vicidial_br/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_br/line.js | 183 + .../LANG_www/vicidial_br/list_download.php | 419 +- .../trunk/LANG_www/vicidial_br/listloader.pl | 56 +- .../LANG_www/vicidial_br/listloaderMAIN.php | 43 +- .../LANG_www/vicidial_br/listloader_super.pl | 56 +- .../vicidial_br/new_listloader_superL.php | 610 +- .../LANG_www/vicidial_br/non_agent_api.php | 4030 ++++- .../vicidial_br/project_auth_entries.txt | 2 + .../LANG_www/vicidial_br/realtime_report.php | 1526 ++ .../LANG_www/vicidial_br/remote_dispo.php | 65 +- .../LANG_www/vicidial_br/send_CID_call.php | 132 + .../trunk/LANG_www/vicidial_br/sheet2tab.pl | 363 + .../LANG_www/vicidial_br/timeclock_edit.php | 7 +- .../LANG_www/vicidial_br/timeclock_report.php | 556 +- .../LANG_www/vicidial_br/timeclock_status.php | 374 +- .../vicidial_br/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_br/user_stats.php | 1408 +- .../LANG_www/vicidial_br/user_status.php | 134 +- .../LANG_www/vicidial_br/user_territories.php | 132 +- .../trunk/LANG_www/vicidial_br/vdremote.php | 13 +- .../LANG_www/vicidial_br/verticalbargraph.css | 57 + .../vicidial_br/vicidial_sales_viewer.php | 2 +- .../trunk/LANG_www/vicidial_br/voice_lab.php | 312 + .../LANG_www/vicidial_br/vtiger_search.php | 6 +- .../LANG_www/vicidial_br/vtiger_user.php | 23 +- .../trunk/LANG_www/vicidial_br/welcome.php | 2 +- .../LANG_www/vicidial_br/welcome_demo.php | 11 +- .../vicidial_br/welcome_languages.php | 13 +- .../LANG_www/vicidial_br/wz_jsgraphics.js | 943 ++ .../vicidial_de/AST_CLOSER_service_level.php | 597 +- .../LANG_www/vicidial_de/AST_CLOSERstats.php | 1531 +- .../vicidial_de/AST_CLOSERsummary_hourly.php | 597 +- .../LANG_www/vicidial_de/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_de/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_de/AST_IVRstats.php | 654 +- .../vicidial_de/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_de/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 667 +- .../LANG_www/vicidial_de/AST_VDADstats.php | 515 +- .../vicidial_de/AST_VICIDIAL_hopperlist.php | 106 +- .../vicidial_de/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_de/AST_admin_log_display.php | 118 - .../vicidial_de/AST_admin_template_maker.php | 447 + .../vicidial_de/AST_agent_days_detail.php | 319 +- .../AST_agent_performance_detail.php | 731 +- .../vicidial_de/AST_agent_status_detail.php | 332 +- .../vicidial_de/AST_agent_time_detail.php | 485 +- .../vicidial_de/AST_agent_time_sheet.php | 309 +- .../AST_agent_timeclock_detail.php | 199 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_de/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_de/AST_hangup_cause_report.php | 413 + .../vicidial_de/AST_inboundEXTstats.php | 4 +- .../vicidial_de/AST_inbound_daily_report.php | 1794 +++ .../vicidial_de/AST_server_performance.php | 66 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_de/AST_timeonVDADall.php | 1608 +- .../vicidial_de/AST_timeonVDADallSUMMARY.php | 491 +- .../LANG_www/vicidial_de/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_de/admin.php | 13120 ++++++++++++--- .../vicidial_de/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_de/admin_header.php | 428 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_de/admin_lists_custom.php | 1802 +++ .../vicidial_de/admin_modify_lead.php | 1211 +- .../vicidial_de/admin_phones_bulk_insert.php | 538 + .../vicidial_de/admin_search_lead.php | 501 +- .../LANG_www/vicidial_de/audio_store.php | 77 +- .../trunk/LANG_www/vicidial_de/calendar_db.js | 2 +- .../vicidial_de/call_report_export.php | 600 +- .../LANG_www/vicidial_de/callcard_admin.php | 943 ++ .../LANG_www/vicidial_de/campaign_debug.php | 191 + .../LANG_www/vicidial_de/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_de/dbconnect.php | 89 +- .../trunk/LANG_www/vicidial_de/fcstats.php | 513 +- .../trunk/LANG_www/vicidial_de/functions.php | 108 +- .../vicidial_de/group_hourly_stats.php | 135 +- .../vicidial_de/horizontalbargraph.css | 104 + .../vicidial_de/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_de/line.js | 183 + .../LANG_www/vicidial_de/list_download.php | 419 +- .../trunk/LANG_www/vicidial_de/listloader.pl | 56 +- .../LANG_www/vicidial_de/listloaderMAIN.php | 43 +- .../LANG_www/vicidial_de/listloader_super.pl | 56 +- .../vicidial_de/new_listloader_superL.php | 612 +- .../LANG_www/vicidial_de/non_agent_api.php | 4030 ++++- .../LANG_www/vicidial_de/realtime_report.php | 1526 ++ .../LANG_www/vicidial_de/remote_dispo.php | 65 +- .../LANG_www/vicidial_de/send_CID_call.php | 132 + .../LANG_www/vicidial_de/server_stats.php | 97 - .../trunk/LANG_www/vicidial_de/sheet2tab.pl | 363 + .../LANG_www/vicidial_de/timeclock_edit.php | 7 +- .../LANG_www/vicidial_de/timeclock_report.php | 556 +- .../LANG_www/vicidial_de/timeclock_status.php | 374 +- .../vicidial_de/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_de/user_stats.php | 1408 +- .../LANG_www/vicidial_de/user_status.php | 134 +- .../LANG_www/vicidial_de/user_territories.php | 96 +- .../trunk/LANG_www/vicidial_de/vdremote.php | 13 +- .../LANG_www/vicidial_de/verticalbargraph.css | 57 + .../trunk/LANG_www/vicidial_de/voice_lab.php | 312 + .../LANG_www/vicidial_de/vtiger_search.php | 6 +- .../LANG_www/vicidial_de/vtiger_user.php | 23 +- .../trunk/LANG_www/vicidial_de/welcome.php | 2 +- .../LANG_www/vicidial_de/welcome_demo.php | 11 +- .../vicidial_de/welcome_languages.php | 13 +- .../LANG_www/vicidial_de/wz_jsgraphics.js | 943 ++ .../vicidial_el/AST_CLOSER_service_level.php | 597 +- .../LANG_www/vicidial_el/AST_CLOSERstats.php | 1531 +- .../vicidial_el/AST_CLOSERsummary_hourly.php | 601 +- .../LANG_www/vicidial_el/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_el/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_el/AST_IVRstats.php | 654 +- .../vicidial_el/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_el/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 671 +- .../LANG_www/vicidial_el/AST_VDADstats.php | 517 +- .../vicidial_el/AST_VICIDIAL_hopperlist.php | 106 +- .../vicidial_el/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_el/AST_admin_log_display.php | 118 - .../vicidial_el/AST_admin_template_maker.php | 447 + .../vicidial_el/AST_agent_days_detail.php | 319 +- .../AST_agent_performance_detail.php | 731 +- .../vicidial_el/AST_agent_status_detail.php | 332 +- .../vicidial_el/AST_agent_time_detail.php | 497 +- .../vicidial_el/AST_agent_time_sheet.php | 309 +- .../AST_agent_timeclock_detail.php | 213 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_el/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_el/AST_hangup_cause_report.php | 413 + .../vicidial_el/AST_inbound_daily_report.php | 1794 +++ .../vicidial_el/AST_server_performance.php | 66 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_el/AST_timeonVDADall.php | 1610 +- .../vicidial_el/AST_timeonVDADallSUMMARY.php | 491 +- .../LANG_www/vicidial_el/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_el/admin.php | 13165 ++++++++++++--- .../vicidial_el/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_el/admin_header.php | 428 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_el/admin_lists_custom.php | 1802 +++ .../vicidial_el/admin_modify_lead.php | 1211 +- .../vicidial_el/admin_phones_bulk_insert.php | 538 + .../vicidial_el/admin_search_lead.php | 501 +- .../LANG_www/vicidial_el/audio_store.php | 77 +- .../trunk/LANG_www/vicidial_el/calendar_db.js | 2 +- .../vicidial_el/call_report_export.php | 604 +- .../LANG_www/vicidial_el/callcard_admin.php | 943 ++ .../LANG_www/vicidial_el/campaign_debug.php | 191 + .../LANG_www/vicidial_el/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_el/dbconnect.php | 89 +- .../trunk/LANG_www/vicidial_el/fcstats.php | 513 +- .../trunk/LANG_www/vicidial_el/functions.php | 108 +- .../vicidial_el/group_hourly_stats.php | 135 +- .../vicidial_el/horizontalbargraph.css | 104 + .../vicidial_el/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_el/line.js | 183 + .../LANG_www/vicidial_el/list_download.php | 419 +- .../trunk/LANG_www/vicidial_el/listloader.pl | 56 +- .../LANG_www/vicidial_el/listloaderMAIN.php | 43 +- .../LANG_www/vicidial_el/listloader_super.pl | 56 +- .../vicidial_el/new_listloader_superL.php | 612 +- .../LANG_www/vicidial_el/non_agent_api.php | 4030 ++++- .../LANG_www/vicidial_el/realtime_report.php | 1526 ++ .../LANG_www/vicidial_el/remote_dispo.php | 65 +- .../LANG_www/vicidial_el/send_CID_call.php | 132 + .../LANG_www/vicidial_el/server_stats.php | 97 - .../trunk/LANG_www/vicidial_el/sheet2tab.pl | 363 + .../LANG_www/vicidial_el/timeclock_edit.php | 7 +- .../LANG_www/vicidial_el/timeclock_report.php | 556 +- .../LANG_www/vicidial_el/timeclock_status.php | 374 +- .../vicidial_el/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_el/user_stats.php | 1408 +- .../LANG_www/vicidial_el/user_status.php | 134 +- .../LANG_www/vicidial_el/user_territories.php | 132 +- .../trunk/LANG_www/vicidial_el/vdremote.php | 13 +- .../LANG_www/vicidial_el/verticalbargraph.css | 57 + .../vicidial_el/vicidial_sales_viewer.php | 2 +- .../trunk/LANG_www/vicidial_el/voice_lab.php | 312 + .../LANG_www/vicidial_el/vtiger_search.php | 6 +- .../LANG_www/vicidial_el/vtiger_user.php | 23 +- .../trunk/LANG_www/vicidial_el/welcome.php | 2 +- .../LANG_www/vicidial_el/welcome_demo.php | 11 +- .../vicidial_el/welcome_languages.php | 13 +- .../LANG_www/vicidial_el/wz_jsgraphics.js | 943 ++ .../vicidial_es/AST_CLOSER_service_level.php | 565 +- .../LANG_www/vicidial_es/AST_CLOSERstats.php | 1328 +- .../vicidial_es/AST_CLOSERsummary_hourly.php | 570 +- .../LANG_www/vicidial_es/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_es/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_es/AST_IVRstats.php | 623 +- .../vicidial_es/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_es/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 613 +- .../LANG_www/vicidial_es/AST_VDADstats.php | 407 +- .../vicidial_es/AST_VICIDIAL_hopperlist.php | 88 +- .../vicidial_es/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_es/AST_admin_log_display.php | 118 - .../vicidial_es/AST_admin_template_maker.php | 447 + .../vicidial_es/AST_agent_days_detail.php | 239 +- .../AST_agent_performance_detail.php | 666 +- .../vicidial_es/AST_agent_status_detail.php | 250 +- .../vicidial_es/AST_agent_time_detail.php | 392 +- .../vicidial_es/AST_agent_time_sheet.php | 265 +- .../AST_agent_timeclock_detail.php | 169 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_es/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_es/AST_hangup_cause_report.php | 413 + .../vicidial_es/AST_inbound_daily_report.php | 1794 +++ .../vicidial_es/AST_server_performance.php | 2 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_es/AST_timeonVDADall.php | 1073 +- .../vicidial_es/AST_timeonVDADallSUMMARY.php | 424 +- .../LANG_www/vicidial_es/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_es/admin.php | 9409 ++++++++--- .../vicidial_es/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_es/admin_header.php | 225 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_es/admin_lists_custom.php | 1802 +++ .../vicidial_es/admin_modify_lead.php | 1016 +- .../vicidial_es/admin_phones_bulk_insert.php | 538 + .../vicidial_es/admin_search_lead.php | 255 +- .../LANG_www/vicidial_es/audio_store.php | 42 +- .../trunk/LANG_www/vicidial_es/calendar_db.js | 2 +- .../vicidial_es/call_report_export.php | 410 +- .../LANG_www/vicidial_es/callcard_admin.php | 943 ++ .../LANG_www/vicidial_es/campaign_debug.php | 191 + .../LANG_www/vicidial_es/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_es/dbconnect.php | 4 +- .../trunk/LANG_www/vicidial_es/fcstats.php | 467 +- .../trunk/LANG_www/vicidial_es/functions.php | 108 +- .../vicidial_es/group_hourly_stats.php | 135 +- .../vicidial_es/horizontalbargraph.css | 104 + .../vicidial_es/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_es/line.js | 183 + .../LANG_www/vicidial_es/list_download.php | 22 +- .../LANG_www/vicidial_es/listloaderMAIN.php | 43 +- .../vicidial_es/new_listloader_superL.php | 66 +- .../LANG_www/vicidial_es/non_agent_api.php | 3454 +++- .../LANG_www/vicidial_es/realtime_report.php | 1526 ++ .../LANG_www/vicidial_es/remote_dispo.php | 65 +- .../LANG_www/vicidial_es/send_CID_call.php | 132 + .../LANG_www/vicidial_es/server_stats.php | 97 - .../trunk/LANG_www/vicidial_es/sheet2tab.pl | 363 + .../LANG_www/vicidial_es/timeclock_edit.php | 7 +- .../LANG_www/vicidial_es/timeclock_report.php | 507 +- .../LANG_www/vicidial_es/timeclock_status.php | 318 +- .../vicidial_es/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_es/user_stats.php | 850 +- .../LANG_www/vicidial_es/user_status.php | 131 +- .../LANG_www/vicidial_es/user_territories.php | 132 +- .../trunk/LANG_www/vicidial_es/vdremote.php | 13 +- .../LANG_www/vicidial_es/verticalbargraph.css | 57 + .../vicidial_es/vicidial_sales_viewer.php | 2 +- .../trunk/LANG_www/vicidial_es/voice_lab.php | 312 + .../trunk/LANG_www/vicidial_es/welcome.php | 2 +- .../LANG_www/vicidial_es/welcome_demo.php | 5 +- .../vicidial_es/welcome_languages.php | 5 +- .../LANG_www/vicidial_es/wz_jsgraphics.js | 943 ++ .../vicidial_fr/AST_CLOSER_service_level.php | 597 +- .../LANG_www/vicidial_fr/AST_CLOSERstats.php | 1531 +- .../vicidial_fr/AST_CLOSERsummary_hourly.php | 601 +- .../LANG_www/vicidial_fr/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_fr/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_fr/AST_IVRstats.php | 654 +- .../vicidial_fr/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_fr/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 671 +- .../LANG_www/vicidial_fr/AST_VDADstats.php | 517 +- .../vicidial_fr/AST_VICIDIAL_hopperlist.php | 106 +- .../vicidial_fr/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_fr/AST_admin_log_display.php | 118 - .../vicidial_fr/AST_admin_template_maker.php | 447 + .../vicidial_fr/AST_agent_days_detail.php | 319 +- .../AST_agent_performance_detail.php | 731 +- .../vicidial_fr/AST_agent_status_detail.php | 332 +- .../vicidial_fr/AST_agent_time_detail.php | 491 +- .../vicidial_fr/AST_agent_time_sheet.php | 309 +- .../AST_agent_timeclock_detail.php | 211 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_fr/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_fr/AST_hangup_cause_report.php | 413 + .../vicidial_fr/AST_inbound_daily_report.php | 1794 +++ .../vicidial_fr/AST_server_performance.php | 66 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_fr/AST_timeonVDADall.php | 1610 +- .../vicidial_fr/AST_timeonVDADallSUMMARY.php | 491 +- .../LANG_www/vicidial_fr/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_fr/admin.php | 13186 +++++++++++++--- .../vicidial_fr/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_fr/admin_header.php | 428 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_fr/admin_lists_custom.php | 1802 +++ .../vicidial_fr/admin_modify_lead.php | 1211 +- .../vicidial_fr/admin_phones_bulk_insert.php | 538 + .../vicidial_fr/admin_search_lead.php | 501 +- .../LANG_www/vicidial_fr/audio_store.php | 77 +- .../trunk/LANG_www/vicidial_fr/calendar_db.js | 2 +- .../vicidial_fr/call_report_export.php | 600 +- .../LANG_www/vicidial_fr/callcard_admin.php | 943 ++ .../LANG_www/vicidial_fr/campaign_debug.php | 191 + .../LANG_www/vicidial_fr/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_fr/dbconnect.php | 89 +- .../trunk/LANG_www/vicidial_fr/fcstats.php | 513 +- .../trunk/LANG_www/vicidial_fr/functions.php | 108 +- .../vicidial_fr/group_hourly_stats.php | 135 +- .../vicidial_fr/horizontalbargraph.css | 104 + .../vicidial_fr/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_fr/line.js | 183 + .../LANG_www/vicidial_fr/list_download.php | 419 +- .../trunk/LANG_www/vicidial_fr/listloader.pl | 56 +- .../LANG_www/vicidial_fr/listloaderMAIN.php | 43 +- .../LANG_www/vicidial_fr/listloader_super.pl | 56 +- .../vicidial_fr/new_listloader_superL.php | 612 +- .../LANG_www/vicidial_fr/non_agent_api.php | 4030 ++++- .../LANG_www/vicidial_fr/realtime_report.php | 1526 ++ .../LANG_www/vicidial_fr/remote_dispo.php | 65 +- .../LANG_www/vicidial_fr/send_CID_call.php | 132 + .../trunk/LANG_www/vicidial_fr/sheet2tab.pl | 363 + .../LANG_www/vicidial_fr/timeclock_edit.php | 7 +- .../LANG_www/vicidial_fr/timeclock_report.php | 556 +- .../LANG_www/vicidial_fr/timeclock_status.php | 374 +- .../vicidial_fr/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_fr/user_stats.php | 1408 +- .../LANG_www/vicidial_fr/user_status.php | 134 +- .../LANG_www/vicidial_fr/user_territories.php | 128 +- .../trunk/LANG_www/vicidial_fr/vdremote.php | 13 +- .../LANG_www/vicidial_fr/verticalbargraph.css | 57 + .../vicidial_fr/vicidial_sales_viewer.php | 2 +- .../trunk/LANG_www/vicidial_fr/voice_lab.php | 312 + .../LANG_www/vicidial_fr/vtiger_search.php | 6 +- .../LANG_www/vicidial_fr/vtiger_user.php | 23 +- .../trunk/LANG_www/vicidial_fr/welcome.php | 2 +- .../LANG_www/vicidial_fr/welcome_demo.php | 11 +- .../vicidial_fr/welcome_languages.php | 13 +- .../LANG_www/vicidial_fr/wz_jsgraphics.js | 943 ++ .../vicidial_it/AST_CLOSER_service_level.php | 565 +- .../LANG_www/vicidial_it/AST_CLOSERstats.php | 1328 +- .../vicidial_it/AST_CLOSERsummary_hourly.php | 572 +- .../LANG_www/vicidial_it/AST_DIDstats.php | 1083 ++ .../LANG_www/vicidial_it/AST_IVRfilter.php | 493 +- .../LANG_www/vicidial_it/AST_IVRstats.php | 623 +- .../vicidial_it/AST_LISTS_campaign_stats.php | 966 ++ .../vicidial_it/AST_LIST_UPDATEstats.php | 242 + .../AST_OUTBOUNDsummary_interval.php | 613 +- .../LANG_www/vicidial_it/AST_VDADstats.php | 405 +- .../vicidial_it/AST_VICIDIAL_hopperlist.php | 88 +- .../vicidial_it/AST_VICIDIAL_ingrouplist.php | 213 + .../vicidial_it/AST_admin_log_display.php | 118 - .../vicidial_it/AST_admin_template_maker.php | 447 + .../vicidial_it/AST_agent_days_detail.php | 239 +- .../AST_agent_performance_detail.php | 666 +- .../vicidial_it/AST_agent_status_detail.php | 250 +- .../vicidial_it/AST_agent_time_detail.php | 396 +- .../vicidial_it/AST_agent_time_sheet.php | 265 +- .../AST_agent_timeclock_detail.php | 175 +- .../AST_campaign_status_list_report.php | 471 + .../vicidial_it/AST_carrier_log_report.php | 325 + .../AST_dialer_inventory_report.php | 899 ++ .../vicidial_it/AST_hangup_cause_report.php | 413 + .../vicidial_it/AST_inbound_daily_report.php | 1794 +++ .../vicidial_it/AST_server_performance.php | 2 +- .../AST_team_performance_detail.php | 1330 ++ .../vicidial_it/AST_timeonVDADall.php | 1071 +- .../vicidial_it/AST_timeonVDADallSUMMARY.php | 424 +- .../LANG_www/vicidial_it/AST_timeonpark.php | 2 +- agc_2-X/trunk/LANG_www/vicidial_it/admin.php | 9363 ++++++++--- .../vicidial_it/admin_campaign_multi_alt.php | 435 + .../LANG_www/vicidial_it/admin_header.php | 225 +- .../admin_listloader_fourth_gen.php | 2862 ++++ .../admin_listloader_third_gen.php | 2356 +++ .../vicidial_it/admin_lists_custom.php | 1802 +++ .../vicidial_it/admin_modify_lead.php | 1016 +- .../vicidial_it/admin_phones_bulk_insert.php | 538 + .../vicidial_it/admin_search_lead.php | 249 +- .../LANG_www/vicidial_it/audio_store.php | 42 +- .../trunk/LANG_www/vicidial_it/calendar_db.js | 2 +- .../vicidial_it/call_report_export.php | 412 +- .../LANG_www/vicidial_it/callcard_admin.php | 943 ++ .../LANG_www/vicidial_it/campaign_debug.php | 191 + .../LANG_www/vicidial_it/count_functions.inc | 456 + .../trunk/LANG_www/vicidial_it/dbconnect.php | 4 +- .../trunk/LANG_www/vicidial_it/fcstats.php | 467 +- .../trunk/LANG_www/vicidial_it/functions.php | 108 +- .../vicidial_it/group_hourly_stats.php | 135 +- .../vicidial_it/horizontalbargraph.css | 104 + .../vicidial_it/lead_report_export.php | 944 ++ .../leadloader_template_display.php | 203 + agc_2-X/trunk/LANG_www/vicidial_it/line.js | 183 + .../LANG_www/vicidial_it/list_download.php | 22 +- .../LANG_www/vicidial_it/listloaderMAIN.php | 43 +- .../vicidial_it/new_listloader_superL.php | 66 +- .../LANG_www/vicidial_it/non_agent_api.php | 3454 +++- .../LANG_www/vicidial_it/realtime_report.php | 1526 ++ .../LANG_www/vicidial_it/remote_dispo.php | 65 +- .../LANG_www/vicidial_it/send_CID_call.php | 132 + .../trunk/LANG_www/vicidial_it/sheet2tab.pl | 363 + .../LANG_www/vicidial_it/timeclock_edit.php | 7 +- .../LANG_www/vicidial_it/timeclock_report.php | 507 +- .../LANG_www/vicidial_it/timeclock_status.php | 318 +- .../vicidial_it/user_group_bulk_change.php | 73 +- .../trunk/LANG_www/vicidial_it/user_stats.php | 848 +- .../LANG_www/vicidial_it/user_status.php | 131 +- .../LANG_www/vicidial_it/user_territories.php | 130 +- .../trunk/LANG_www/vicidial_it/vdremote.php | 13 +- .../LANG_www/vicidial_it/verticalbargraph.css | 57 + .../trunk/LANG_www/vicidial_it/voice_lab.php | 312 + .../trunk/LANG_www/vicidial_it/welcome.php | 2 +- .../LANG_www/vicidial_it/welcome_demo.php | 5 +- .../vicidial_it/welcome_languages.php | 5 +- .../LANG_www/vicidial_it/wz_jsgraphics.js | 943 ++ .../trunk/translations/br_language_admin.txt | 946 +- .../trunk/translations/de_language_admin.txt | 942 +- .../trunk/translations/el_language_admin.txt | 942 +- .../trunk/translations/es_language_admin.txt | 946 +- .../trunk/translations/fr_language_admin.txt | 942 +- .../trunk/translations/it_language_admin.txt | 942 +- .../TO_BE_TRANSLATED_2.4.txt | 19 +- agc_2-X/trunk/www/vicidial/images/br.gif | Bin 0 -> 397 bytes agc_2-X/trunk/www/vicidial/images/de.gif | Bin 0 -> 162 bytes agc_2-X/trunk/www/vicidial/images/dk.gif | Bin 0 -> 1707 bytes agc_2-X/trunk/www/vicidial/images/el.gif | Bin 0 -> 245 bytes agc_2-X/trunk/www/vicidial/images/en.gif | Bin 0 -> 322 bytes agc_2-X/trunk/www/vicidial/images/es.gif | Bin 0 -> 222 bytes agc_2-X/trunk/www/vicidial/images/fr.gif | Bin 0 -> 217 bytes agc_2-X/trunk/www/vicidial/images/it.gif | Bin 0 -> 198 bytes agc_2-X/trunk/www/vicidial/images/nl.gif | Bin 0 -> 250 bytes agc_2-X/trunk/www/vicidial/images/pl.gif | Bin 0 -> 276 bytes agc_2-X/trunk/www/vicidial/images/pt.gif | Bin 0 -> 208 bytes agc_2-X/trunk/www/vicidial/images/ru.gif | Bin 0 -> 166 bytes agc_2-X/trunk/www/vicidial/images/se.gif | Bin 0 -> 712 bytes agc_2-X/trunk/www/vicidial/images/sk.gif | Bin 0 -> 334 bytes agc_2-X/trunk/www/vicidial/images/tw.gif | Bin 0 -> 1259 bytes .../vicidial/leadloader_template_display.php | 2 +- 497 files changed, 291705 insertions(+), 39212 deletions(-) create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_VICIDIAL_ingrouplist.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/project_auth_entries.txt create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/send_CID_call.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_br/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_VICIDIAL_ingrouplist.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_log_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/send_CID_call.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/server_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_de/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_VICIDIAL_ingrouplist.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_log_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/send_CID_call.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/server_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_el/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_VICIDIAL_ingrouplist.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_log_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/send_CID_call.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/server_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_es/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_VICIDIAL_ingrouplist.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_log_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/send_CID_call.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_fr/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_DIDstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_LISTS_campaign_stats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_LIST_UPDATEstats.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_VICIDIAL_ingrouplist.php delete mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_log_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_template_maker.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_campaign_status_list_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_carrier_log_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_dialer_inventory_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_hangup_cause_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_inbound_daily_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/AST_team_performance_detail.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/admin_campaign_multi_alt.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_fourth_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_third_gen.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/admin_lists_custom.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/admin_phones_bulk_insert.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/callcard_admin.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/campaign_debug.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/count_functions.inc create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/horizontalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/lead_report_export.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/leadloader_template_display.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/line.js create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/realtime_report.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/send_CID_call.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/sheet2tab.pl create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/verticalbargraph.css create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/voice_lab.php create mode 100644 agc_2-X/trunk/LANG_www/vicidial_it/wz_jsgraphics.js create mode 100644 agc_2-X/trunk/www/vicidial/images/br.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/de.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/dk.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/el.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/en.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/es.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/fr.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/it.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/nl.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/pl.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/pt.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/ru.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/se.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/sk.gif create mode 100644 agc_2-X/trunk/www/vicidial/images/tw.gif diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSER_service_level.php index 5de47198..d22dcc23 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90801-0923 - Added in-group name to pulldown # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,33 +39,57 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Service Level Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -69,6 +99,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -76,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Service Level Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
"; +$MAIN.="
"; -echo "
\n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ALTERAR | RELATÓRIOS \n"; -echo "
\n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ALTERAR | RELATÓRIOS"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
\n\n";
+$MAIN.="
\n\n";
 
 
 if (!$group)
 	{
-	echo "\n\n";
-	echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	$MAIN.="\n\n";
+	$MAIN.="POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	echo "$HEADER";
+	require("admin_header.php");
+	echo "$MAIN";
 	}
 
 else
@@ -261,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
 	$DURATIONday++;
 	}
 
-echo "Inbound Service Level Report                      $NOW_TIME\n";
-echo "\n";
-echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
+$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
+$MAIN.="\n";
+$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
 #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
+$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
+$CSV_text.="\n";
+$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
 
 $d=0;
 while ($d < $DURATIONday)
@@ -370,7 +457,7 @@ $TOTintervals = $j;
 ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
 $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
+if ($DB) {$MAIN.="$stmt\n";}
 $records_to_grab = mysql_num_rows($rslt);
 $i=0;
 while ($i < $records_to_grab)
@@ -489,12 +576,40 @@ while ($j < $TOTintervals)
 
 ###################################################
 ### TOTALS SUMMARY SECTION ###
-echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
-echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
-echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
-echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
-echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
+$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
+$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
+$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
 
+
+$graph_stats=array();
+$max_drops=1;
+$max_droppct=1;
+$max_avgdrops=1;
+$max_hold=1;
+$max_holdpct=1;
+$max_avgholds=1;
+$max_avgholdstotal=1;
+$max_calls=1;
+$max_totalcalltime=1;
+$max_avgcalltime=1;
+
+$GRAPH="

"; +$GRAPH.=""; +$GRAPH.="
DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTIME MIN:SECAVG CALLTIME SECONDS

 


"; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -538,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -551,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -605,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
INBOUND SERVICE NÍVEL REPORT
STATUSDROPS
DROP %
AVG DROP(s)
HOLD
HOLD %
AVG HOLD(s) HOLD
AVG HOLD(s) TOTAL
CALLS
TOTAL CALLTIME MIN:SEC
AVG CALLTIME SECONDS
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
".$graph_stats[$d][0]."".$graph_stats[$d][3]."
".$graph_stats[$d][0]."".$graph_stats[$d][4]."
".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
".$graph_stats[$d][0]."".$graph_stats[$d][6]."
".$graph_stats[$d][0]."".$graph_stats[$d][7]."
".$graph_stats[$d][0]."".$graph_stats[$d][8]."
".$graph_stats[$d][0]."".$graph_stats[$d][10]."
".$graph_stats[$d][0]."".$graph_stats[$d][11]."
TOTAL:".trim($FtotDROPS)."
"; + $DROPPCT_graph.="
TOTAL:".trim($FtotDROPSpct)."%
"; + $AVGDROPS_graph.="
TOTAL:".trim($FtotDROPSavg)."
"; + $HOLD_graph.="TOTAL:".trim($FtotQUEUE).""; + $HOLDPCT_graph.="TOTAL:".trim($FtotQUEUEpct)."%"; + $AVGHOLDS_graph.="TOTAL:".trim($FtotQUEUEavg).""; + $AVGHOLDSTOTAL_graph.="TOTAL:".trim($FtotQUEUEtot).""; + $CALLS_graph.="TOTAL:".trim($FtotCALLS).""; + $TOTALCALLTIME_graph.="TOTAL:".trim($totTIME_MS).""; + $AVGCALLTIME_graph.="TOTAL:".trim($FtotCALLSavg).""; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -860,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- TEMPO DE ESPERA POR SEGUNDOS\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RESPOSTA (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- TEMPO DE ESPERA POR SEGUNDOS\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RESPOSTA (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"TEMPO DE ESPERA POR SEGUNDOS\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE RESPOSTA(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -947,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -973,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERstats.php index cd897e3d..2503c95a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -27,6 +27,14 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -47,8 +55,14 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -56,23 +70,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -82,13 +114,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +135,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,19 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -126,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -141,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -156,128 +245,138 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Inbound Stats\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
"; +$MAIN.="
"; if ($DB > 0) { - echo "
\n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
\n"; - echo "$shift|$query_date|$end_date\n"; - echo "
\n"; + $MAIN.="
\n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
\n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
\n"; } -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "Período:
\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Período:
\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo "
\n"; -echo "Grupos de Entrada: \n"; -echo "\n"; -echo "\n"; +if ($DID=='Y') + {$MAIN.="Inbound DIDs: \n";} +else + {$MAIN.="Grupos de Entrada: \n";} +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; -echo "ALTERAR | "; -echo "RELATÓRIOS | "; -echo "IVR REPORT \n"; -echo "\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; +if ($DID!='Y') + { + $MAIN.="ALTERAR | "; + $MAIN.="IVR REPORT | \n"; + } +$MAIN.="RELATÓRIOS | "; +$MAIN.="\n"; -echo "
\n"; +$MAIN.="
\n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
\n"; -echo "\n\n"; - -echo "
\n\n";
+#$MAIN.="\n";
+$MAIN.="Shift: \n";
+$MAIN.="
Mostrar as:  "; +$MAIN.="\n
"; +$MAIN.="   \n"; +$MAIN.="
\n"; +$MAIN.="\n\n"; +$MAIN.="
\n\n";
 
 
 if ($groups_to_print < 1)
-{
-echo "\n\n";
-echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
-}
+	{
+	$MAIN.="\n\n";
+	if ($DID=='Y')
+		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";}
+	else
+		{$MAIN.="POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";}
+	}
 
 else
 {
@@ -305,38 +404,125 @@ $query_date_END = "$end_date $time_END";
 
 
 
-echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
+$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        DOWNLOAD\n";
+
+$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
 
 
+if ($DID=='Y')
+	{
+	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$MAIN.="$stmt\n";}
+	$dids_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $dids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$did_id[$i] = $row[0];
+		$did_SQL .= "'$row[0]',";
+		$i++;
+		}
+	$did_SQL = eregi_replace(",$",'',$did_SQL);
+	if (strlen($did_SQL)<3) {$did_SQL="''";}
 
+	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$MAIN.="$stmt\n";}
+	$unids_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $unids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$unid_SQL .= "'$row[0]',";
+		$i++;
+		}
+	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
+	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
 
+	if ($DB > 0)
+		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
 
+	}
 
 if ($group_ct > 1)
 	{
-	echo "\n";
-	echo "---------- MULTI-GROUP BREAKDOWN:\n";
-	echo "+----------------------+---------+---------+---------+---------+\n";
-	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
-	echo "+----------------------+---------+---------+---------+---------+\n";
+	$ASCII_text.="\n";
+	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
+
+	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
+
+	if ($DID=='Y')
+		{
+		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
+		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
+		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
+		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
+		}
+	else
+		{
+		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
+		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
+		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
+		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
+		}
 
 	$i=0;
 	while($i < $group_ct)
 		{
-		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
+		$did_id[$i]='0';
+		$DIDunid_SQL='';
+		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
 		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
+		if ($DB) {$ASCII_text.="$stmt\n";}
+		$Sdids_to_print = mysql_num_rows($rslt);
+		if ($Sdids_to_print > 0)
+			{
+			$row=mysql_fetch_row($rslt);
+			$did_id[$i] = $row[0];
+			}
+
+		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {$ASCII_text.="$stmt\n";}
+		$DIDunids_to_print = mysql_num_rows($rslt);
+		$k=0;
+		while ($k < $DIDunids_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+			$DIDunid_SQL .= "'$row[0]',";
+			$k++;
+			}
+		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
+		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
+
+		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
+			}
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {$ASCII_text.="$stmt\n";}
 		$row=mysql_fetch_row($rslt);
 
 		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
+			}
 		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
+		if ($DB) {$ASCII_text.="$stmt\n";}
 		$rowx=mysql_fetch_row($rslt);
 
 		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
+			}
 		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
+		if ($DB) {$ASCII_text.="$stmt\n";}
 		$rowy=mysql_fetch_row($rslt);
+		if ($row[0]>$max_value) {$max_value=$row[0];}
 
 		$groupDISPLAY =	sprintf("%20s", $group[$i]);
 		$gTOTALcalls =	sprintf("%7s", $row[0]);
@@ -351,32 +537,94 @@ if ($group_ct > 1)
 			}
 		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
 
-		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
+		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
+		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
+		$graph_data_ary[$i][0]=$groupDISPLAY;
+		$graph_data_ary[$i][1]=$gTOTALcalls;
+		$graph_data_ary[$i][2]=$gDROPcalls;
+		$graph_data_ary[$i][3]=$gDROPpercent;
+		$graph_data_ary[$i][4]=$gIVRcalls;
+
 		$i++;
 		}
 
-	echo "+----------------------+---------+---------+---------+---------+\n";
+	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
 
 	}
 
+	if ($report_display_type=="HTML") {
+		$max_value=1;
+		$graph_height=240;
+		$scale = 1;
+		$w=0;
+		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
+			if ($graph_data_ary[$i][1]>0) {$w++;}
+		}
+		$scale = $graph_height / $max_value;
 
-echo "\n";
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS\n";
+
+		$GRAPH_text.="";
+		for ($d=0; $d0) {
+				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
+				$GRAPH_text.="  \n";
+			}
+		}
+		$GRAPH_text.="
MULTI-GROUP BREAKDOWN
GROUPIVRS / DROPS / CALLS
".$graph_data_ary[$d][0]."
".$graph_data_ary[$d][3]."% drops
 
\n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
  • ".$graph_data_ary[$d][1]."
  • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
  • ".$graph_data_ary[$d][2]."
  • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
  • ".$graph_data_ary[$d][4]."
  • "; + } + $GRAPH_text.="
\n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


"; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALS\n"; + +$CSV_text1.="\n\"Time range:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; +if ($DID=='Y') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -408,19 +656,30 @@ else } -echo "Total de chamadas recebidas pelo Grupo: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $RESPOSTAEDcalls $RESPOSTAEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Grupo: $IVRcalls\n"; +$MAIN.="Total de chamadas recebidas pelo Grupo: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $RESPOSTAEDcalls $RESPOSTAEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Grupo: $IVRcalls\n"; +$CSV_text1.="\"Total de chamadas recebidas pelo Grupo:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$RESPOSTAEDcalls\",\"$RESPOSTAEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- DERRUBADAS\n"; +$MAIN.="\n"; +$MAIN.="---------- DERRUBADAS\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -450,56 +709,70 @@ else $DROP_RESPOSTAEDpercent = round($DROP_RESPOSTAEDpercent, 0); } -echo "Total de chamadas derrubadas: $DROPcalls $DROPpercent% drop/answered: $DROP_RESPOSTAEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Total de chamadas derrubadas: $DROPcalls $DROPpercent% drop/answered: $DROP_RESPOSTAEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_RESPOSTAEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) { - $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $Sanswer_sec_pct_rt_stat_one = $row[0]; - $Sanswer_sec_pct_rt_stat_two = $row[1]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_one = $row[0]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_two = $row[0]; - - if ( ($RESPOSTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + if ($DID!='Y') { - $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RESPOSTAEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); - #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); - $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RESPOSTAEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); - #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $Sanswer_sec_pct_rt_stat_one = $row[0]; + $Sanswer_sec_pct_rt_stat_two = $row[1]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_one = $row[0]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_two = $row[0]; + + if ( ($RESPOSTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + { + $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RESPOSTAEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); + #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); + $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RESPOSTAEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); + #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Chamadas totais atendidas in to this In-Group): $RESPOSTAEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_RESPOSTAEDpercent%\n"; -echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; -echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Chamadas totais atendidas in to this In-Group): $RESPOSTAEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_RESPOSTAEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Chamadas totais atendidas in to this In-Group):\",\"$RESPOSTAEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_RESPOSTAEDpercent%\"\n"; + +if ($DID!='Y') + { + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; + } # GET LIST OF ALL STATUSES and create SQL from human_answered statuses $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -516,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -534,12 +807,18 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -569,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -580,17 +863,27 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- TEMPO DE ESPERA POR SEGUNDOS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- TEMPO DE ESPERA POR SEGUNDOS DOWNLOAD\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"TEMPO DE ESPERA POR SEGUNDOS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -633,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
\n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -643,17 +1008,26 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -696,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
\n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -707,15 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL RESPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL RESPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL RESPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -899,31 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
\n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; +if ($DID=='Y') + { + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -932,42 +1465,105 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO
REASON CALLS
\"\"".$ct_ary[$i][0]."
TOTAL DE CHAMADAS:".trim($TOTALcalls)."
\n"; + $GRAPH_text.="
\n";
+	$MAIN.=$GRAPH_text;
+	}
+else
+	{
+	$MAIN.=$ASCII_text;
+	}
 
 ##############################
 #########  CALL STATUS STATS
 
 $TOTALcalls = 0;
 
-echo "\n";
-echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
-echo "| STATUS | DESCRIPTION          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
-echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+$ASCII_text="\n";
+$ASCII_text.="---------- CALL STATUS STATS       DOWNLOAD\n";
+$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+$ASCII_text.="| STATUS | DESCRIPTION          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
+$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+
+$GRAPH="

"; +$GRAPH.=""; +$GRAPH.="
CALLSTOTAL TIMEAVG TIMECALLS/HR

 


"; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"CATEGORIA\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;"; +if ($DID=='Y') + { + $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -995,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1015,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1045,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
CALL STATUS STATS
STATUSCALLS
TOTAL TIME
AVG TIME
CALLS/HR
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
".$graph_stats[$d][0]."".$graph_stats[$d][4]."
TOTAL:".trim($TOTALcalls)."
"; + $TOTALTIME_graph.="
TOTAL:".trim($TOTALhours)."
"; + $AVGTIME_graph.="
TOTAL:".trim($TOTALavg)."
"; + $CALLSHOUR_graph.="TOTAL:".trim($TOTALrate).""; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS CATEGORIA STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| CATEGORIA | CALLS | DESCRIPTION |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS CATEGORIA STATS DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| CATEGORIA | CALLS | DESCRIPTION |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS CATEGORIA STATS\"\n"; +$CSV_text5.="\"CATEGORIA\",\"CALLS\",\"DESCRIPTION\"\n"; $TOTCATcalls=0; $r=0; @@ -1070,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1078,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
CUSTOM STATUS CATEGORIA STATS
CATEGORIA CALLS
".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
TOTAL:".trim($TOTCATcalls)."
\n"; + $GRAPH_text.="
\n";
+	$MAIN.=$GRAPH_text;
+	}
+else 
+	{
+	$MAIN.=$ASCII_text;
+	}
 
 
 ##############################
@@ -1088,15 +1793,23 @@ echo "+----------------------+------------+\n";
 
 $TOTALcalls = 0;
 
-echo "\n";
-echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
-echo "+-------------------------------------------------------------------------------------+------------+\n";
-echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
-echo "+-------------------------------------------------------------------------------------+------------+\n";
+$ASCII_text="\n";
+$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       DOWNLOAD\n";
+$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
+$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
+$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
+
+$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
+$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
+
 
 $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
+	}
 $rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
+if ($DB) {$ASCII_text.="$stmt\n";}
 $positions_to_print = mysql_num_rows($rslt);
 $i=0;
 while ($i < $positions_to_print)
@@ -1139,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
 
 $TOTALcalls =		sprintf("%10s", $TOTALcalls);
 
-echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
-echo "+-------------------------------------------------------------------------------------+------------+\n";
+$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
+$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
 
+$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
 
+if ($report_display_type=="HTML") 
+	{
+	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
+	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
+	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
+	if ($DID=='Y')
+		{
+		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
+		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
+		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
+		}
+	if ($DB) {$GRAPH_text.=$stmt."\n";}
+	$ms_rslt=mysql_query($ms_stmt, $link);
+	$ms_row=mysql_fetch_row($ms_rslt);
+	$max_position=$ms_row[0];
+	if ($max_position>25) {$max_position=26;}
+	for ($i=1; $i<=$max_position; $i++) {
+		$sec_ary[$i]=0;
+	}
+
+	$mc_rslt=mysql_query($mc_stmt, $link);
+	$mc_row=mysql_fetch_row($mc_rslt);
+	$max_calls=$ms_row[0];
+	if ($max_calls<=10) {
+		while ($maxcalls%5!=0) {
+			$maxcalls++;
+		}
+	} else if ($max_calls<=100) {
+		while ($maxcalls%10!=0) {
+			$maxcalls++;
+		}
+	} else if ($max_calls<=1000) {
+		while ($maxcalls%50!=0) {
+			$maxcalls++;
+		}
+	} else {
+		while ($maxcalls%500!=0) {
+			$maxcalls++;
+		}
+	}
+	$rslt=mysql_query($stmt, $link);
+	
+	$GRAPH_text="
\n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1152,15 +1935,35 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- AGENTE STATS\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| AGENTE | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- AGENTE STATS DOWNLOAD\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| AGENTE | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"AGENTE STATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

"; +$GRAPH.=""; +$GRAPH.="
CALLSTIME H:M:SAVERAGE

 


"; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +if ($DID=='Y') + { + $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1183,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1210,26 +2022,73 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
AGENTE STATS
AGENTCALLS
TIME H:M:S
AVERAGE
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
TOTAL:".trim($TOTALcalls)."
"; +$TIMEHMS_graph.="TOTAL:".trim($TOTtime).""; +$AVERAGE_graph.="TOTAL:".trim($TOTavg).""; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTAL Agentes: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- ESTATÍSTICAS DE TEMPO\n"; +$MAIN.="\n"; +$MAIN.="---------- ESTATÍSTICAS DE TEMPO
DOWNLOAD\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## ######### 15-minute increment breakdowns of total calls and drops, then answered table $BDansweredCALLS = 0; $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1240,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1255,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1313,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1343,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1364,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1378,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1394,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1410,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
HOURDROPS / CALLS
\n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
  • ".$graph_stats[$d][1]."
  • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
  • ".$graph_stats[$d][2]."
  • "; + } + $GRAPH_text.="
\n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL RESPOSTAED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL RESPOSTAED TIME BREAKDOWN IN SECONDS DOWNLOAD\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL RESPOSTAED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1508,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1516,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALS| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALS| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALS\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="
"; +$MAIN.=""; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php index 2c5f60dc..6029f242 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 90809-0216 - Added Exclude Outbound Drop Group option # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -40,10 +46,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -52,23 +62,38 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} +$report_name = 'Resumen horario de entrada Informe'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -78,21 +103,70 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -100,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -116,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -124,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -139,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -155,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -168,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Summary Hourly Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
"; + $MAIN.="
"; if ($DB > 0) { - echo "
\n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
\n"; - echo "$shift|$query_date|$end_date\n"; - echo "
\n"; + $MAIN.="
\n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
\n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
\n"; } - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
\n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Período:
\n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; + $MAIN.=" \n"; - echo "
  \n"; - echo "\n"; - echo "Inbound Groups:
\n"; - echo "
  \n"; + $MAIN.="\n"; + $MAIN.="Grupos de Entrada:
\n"; + $MAIN.="\n"; - echo "
\n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

\n"; - echo "   Exclude Outbound Drop Groups:
"; - echo "   \n"; - echo "
                      "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ALTERAR | "; + $MAIN.="RELATÓRIOS"; + $MAIN.="\n"; + $MAIN.="
  Mostrar as: "; + $MAIN.="\n
"; + $MAIN.="   Exclude Outbound Drop Groups:
"; + $MAIN.="   \n"; + $MAIN.="
                      "; + $MAIN.="\n"; - echo "
\n"; + $MAIN.="
\n"; - echo "Call Time:
\n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
\n"; + $MAIN.="
\n"; + $MAIN.="\n\n"; - echo "
\n\n";
+	$MAIN.="
\n\n";
 	}
 
 if ($groups_to_print < 1)
 	{
-	echo "\n\n";
-	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
+	$MAIN.="\n\n";
+	$MAIN.="POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
 	}
 
 else
@@ -309,7 +389,7 @@ else
 		{
 		$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='$shift';";
 		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
+		if ($DB) {$MAIN.="$stmt\n";}
 		$calltimes_to_print = mysql_num_rows($rslt);
 		if ($calltimes_to_print > 0)
 			{
@@ -352,18 +432,48 @@ else
 	$query_date_END = "$end_date 23:59:59";
 
 
-	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
+	$MAIN .= "Resumen horario de entrada Informe: $group_string          $NOW_TIME\n";
+	$CSV_main.="Resumen horario de entrada Informe:,$NOW_TIME\n";
 
 
+	$JS_text.="\n";
+
 	if ($costformat > 0)
 		{
-		echo "
\n"; + $ASCII_text.="
\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
"; + + echo ""; + + } + } - - ?> - -
- - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_DIDstats.php new file mode 100644 index 00000000..0e464d8a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
\n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
\n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
\n"; + } + +$MAIN.="
"; + +$MAIN.="
\n"; +$MAIN.="
\n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
to
"; + +$MAIN.="\n"; + +$MAIN.="
\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ALTERAR | RELATÓRIOS \n"; +$MAIN.="
\n"; +$MAIN.="
\n"; + +$MAIN.="
";
+
+
+if (!$group)
+	{
+	$MAIN.="\n\n";
+	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";
+	}
+
+else
+	{
+	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
+
+	if ($shift == 'AM') 
+		{
+	#	$time_BEGIN=$AM_shift_BEGIN;
+	#	$time_END=$AM_shift_END;
+	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
+		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
+	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
+	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
+		}
+	if ($shift == 'PM') 
+		{
+	#	$time_BEGIN=$PM_shift_BEGIN;
+	#	$time_END=$PM_shift_END;
+	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	if ($shift == 'DAYTIME') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+	if ($shift == '10AM-6PM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
+		}
+	if ($shift == '9AM-1AM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+	if ($shift == '845-1745') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
+		}
+	if ($shift == '1745-100') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
+	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
+	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
+	$EQdate_ARY =	explode(' ',$query_date_END);
+	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
+	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
+
+	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
+
+	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
+	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
+
+	$DURATIONsec = ($EQepoch - $SQepoch);
+	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
+
+	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
+		{
+		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
+		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
+		$DURATIONday++;
+		}
+
+	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
+	$MAIN.="\n";
+	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
+	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
+
+	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
+	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
+
+	$d=0;
+	while ($d < $DURATIONday)
+		{
+		$dSQepoch = ($SQepoch + ($d * 86400) );
+		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
+
+		if ($EQsec < $SQsec)
+			{
+			$dEQepoch = ($dEQepoch + 86400);
+			}
+
+		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
+		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
+
+		$d++;
+		}
+
+	##########################################################################
+	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
+
+	### BUILD HOUR:MIN DISPLAY ARRAY ###
+	$i=0;
+	$h=4;
+	$j=0;
+	$Zhour=1;
+	$active_time=0;
+	$hour =		($SQtime_ARY[0] - 1);
+	$startSEC = ($SQsec - 900);
+	$endSEC =	($SQsec - 1);
+	if ($SQtime_ARY[1] > 14) 
+		{
+		$h=1;
+		$hour++;
+		if ($hour < 10) {$hour = "0$hour";}
+		}
+	if ($SQtime_ARY[1] > 29) {$h=2;}
+	if ($SQtime_ARY[1] > 44) {$h=3;}
+	while ($i < 96)
+		{
+		$startSEC = ($startSEC + 900);
+		$endSEC = ($endSEC + 900);
+		$time = '      ';
+		if ($h >= 4)
+			{
+			$hour++;
+			if ($Zhour == '00') 
+				{
+				$startSEC=0;
+				$endSEC=899;
+				}
+			$h=0;
+			if ($hour < 10) {$hour = "0$hour";}
+			$Stime="$hour:00";
+			$Etime="$hour:15";
+			$time = "+$Stime-$Etime+";
+			}
+		if ($h == 1)
+			{
+			$Stime="$hour:15";
+			$Etime="$hour:30";
+			$time = " $Stime-$Etime ";
+			}
+		if ($h == 2)
+			{
+			$Stime="$hour:30";
+			$Etime="$hour:45";
+			$time = " $Stime-$Etime ";
+			}
+		if ($h == 3)
+			{
+			$Zhour=$hour;
+			$Zhour++;
+			if ($Zhour < 10) {$Zhour = "0$Zhour";}
+			if ($Zhour == 24) {$Zhour = "00";}
+			$Stime="$hour:45";
+			$Etime="$Zhour:00";
+			$time = " $Stime-$Etime ";
+			if ($Zhour == '00') 
+				{$hour = ($Zhour - 1);}
+			}
+
+		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
+			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
+			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
+			{
+			$HMdisplay[$j] =	$time;
+			$HMstart[$j] =		$Stime;
+			$HMend[$j] =		$Etime;
+			$HMSepoch[$j] =		$startSEC;
+			$HMEepoch[$j] =		$endSEC;
+
+			$j++;
+			}
+
+		$h++;
+		$i++;
+		}
+
+	$TOTintervals = $j;
+
+
+	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
+	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$MAIN.="$stmt\n";}
+	$records_to_grab = mysql_num_rows($rslt);
+	$i=0;
+	$extension[0]='';
+	while ($i < $records_to_grab)
+		{
+		$row=mysql_fetch_row($rslt);
+		$dt[$i] =			0;
+		$ut[$i] =			($row[0] - $SQepochDAY);
+		$extension[$i] =	$row[1];
+		while($ut[$i] >= 86400) 
+			{
+			$ut[$i] = ($ut[$i] - 86400);
+			$dt[$i]++;
+			}
+		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
+			{
+			$dt[$i] = ($dt[$i] - 1);
+			}
+
+		$i++;
+		}
+
+	### Find default route
+	$default_route='';
+	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$MAIN.="$stmt\n";}
+	$Drecords_to_grab = mysql_num_rows($rslt);
+	if ($Drecords_to_grab > 0)
+		{
+		$row=mysql_fetch_row($rslt);
+		$default_route =	$row[0];
+		}
+
+	###################################################
+	### TOTALS DID SUMMARY SECTION ###
+	if (strlen($extension[0]) > 0)
+		{
+		$ASCII_text.="DID Summary:\n";
+		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
+		$ASCII_text.="| DID                | DESCRIPTION                    | ROUTE      | CALLS      |\n";
+		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
+
+		$CSV_text1.="\"DID Summary:\"\n";
+		$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
+
+		$GRAPH_text.="
\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
DID Summary:
DIDCALLS
\"\"".$graph_stats[$d][0]."
TOTAL DE CHAMADAS:".trim($totCALLS)."
\n";
+
+			$FtotCALLS =	sprintf("%10s", $totCALLS);
+
+		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
+		$ASCII_text.="|                                                           TOTALS | $FtotCALLS |\n";
+		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
+		$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
+		#$MAIN.=$GRAPH;
+
+		}
+
+
+
+	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
+	$MT[0]='0';
+	$totCALLS=0;
+	$totCALLSmax=0;
+	$totCALLSdate=$MT;
+	$qrtCALLS=$MT;
+	$qrtCALLSavg=$MT;
+	$qrtCALLSmax=$MT;
+	$j=0;
+	while ($j < $TOTintervals)
+		{
+		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
+		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
+		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
+		$i=0;
+		while ($i < $records_to_grab)
+			{
+			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
+				{
+				$totCALLS++;
+				$qrtCALLS[$j]++;
+				$dtt = $dt[$i];
+				$totCALLSdate[$dtt]++;
+				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
+				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
+
+				if ($qs[$i] == 0) {$hd__0[$j]++;}
+				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
+				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
+				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
+				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
+				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
+				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
+				if ($qs[$i] > 120) {$hd121[$j]++;}
+				}
+			
+			$i++;
+			}
+
+		$j++;
+		}
+
+
+
+
+	###################################################
+	### TOTALS DATE SUMMARY SECTION ###
+	$ASCII_text.="\nDate Summary:\n";
+	$ASCII_text.="+-------------------------------------------+--------+\n";
+	$ASCII_text.="| SHIFT                                     |        |\n";
+	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
+	$ASCII_text.="+-------------------------------------------+--------+\n";
+
+	$CSV_text1.="\n\"Date Summary:\"\n";
+	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
+
+	$GRAPH_text.="
\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
Date Summary:
SHIFT DATE-TIME RANGECALLS
\"\"".$graph_stats[$d][0]."
TOTAL DE CHAMADAS:".trim($totCALLS)."
\n";
+
+
+	$FtotCALLS =	sprintf("%6s", $totCALLS);
+
+	$ASCII_text.="+-------------------------------------------+--------+\n";
+	$ASCII_text.="|                                    TOTALS | $FtotCALLS |\n";
+	$ASCII_text.="+-------------------------------------------+--------+\n";
+	$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
+	#$MAIN.=$GRAPH;
+
+	if ($report_display_type=="HTML")
+		{
+		$MAIN.=$GRAPH_text;
+		}
+	else
+		{
+		$MAIN.=$ASCII_text;
+		}
+
+
+	## FORMAT OUTPUT ##
+	$i=0;
+	$hi_hour_count=0;
+	$hi_hold_count=0;
+
+	while ($i < $TOTintervals)
+		{
+		if ($qrtCALLS[$i] > 0)
+			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
+
+		if ($qrtCALLS[$i] > $hi_hour_count) 
+			{$hi_hour_count = $qrtCALLS[$i];}
+
+		$i++;
+		}
+
+	if ($hi_hour_count < 1)
+		{$hour_multiplier = 0;}
+	else
+		{$hour_multiplier = (70 / $hi_hour_count);}
+	if ($hi_hold_count < 1)
+		{$hold_multiplier = 0;}
+	else
+		{$hold_multiplier = (70 / $hi_hold_count);}
+
+
+
+
+	###################################################################
+	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
+
+	$MAIN.="\n";
+	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
+
+	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
+
+	$ASCII_text.="";
+
+	$ASCII_text.="";
+	$ASCII_text.="\n";
+	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
+
+	$k=1;
+	$Mk=0;
+	$call_scale = '0';
+	while ($k <= 72) 
+		{
+		if ( ($k < 1) or ($hour_multiplier <= 0) )
+			{$scale_num = 70;}
+		else
+			{
+			$TMPscale_num=(73 / $hour_multiplier);
+			$TMPscale_num = round($TMPscale_num, 0);
+			$scale_num=($k / $hour_multiplier);
+			$scale_num = round($scale_num, 0);
+			}
+		$tmpscl = "$call_scale$TMPscale_num";
+
+		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
+			{
+			$Mk=0;
+			$LENscale_num = (strlen($scale_num));
+			$k = ($k + $LENscale_num);
+			$call_scale .= "$scale_num";
+			}
+		else
+			{
+			$call_scale .= " ";
+			$k++;   $Mk++;
+			}
+		}
+	$k=1;
+	$Mk=0;
+	$hold_scale = '0';
+	while ($k <= 72) 
+		{
+		if ( ($k < 1) or ($hold_multiplier <= 0) )
+			{$scale_num = 70;}
+		else
+			{
+			$TMPscale_num=(73 / $hold_multiplier);
+			$TMPscale_num = round($TMPscale_num, 0);
+			$scale_num=($k / $hold_multiplier);
+			$scale_num = round($scale_num, 0);
+			}
+		$tmpscl = "$hold_scale$TMPscale_num";
+
+		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
+			{
+			$Mk=0;
+			$LENscale_num = (strlen($scale_num));
+			$k = ($k + $LENscale_num);
+			$hold_scale .= "$scale_num";
+			}
+		else
+			{
+			$hold_scale .= " ";
+			$k++;   $Mk++;
+			}
+		}
+
+
+	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
+	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
+	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
+	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
+
+	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
+
+
+
+	$max_calls=1;
+	$graph_stats=array();
+	$GRAPH_text="";
+
+
+	$i=0;
+	while ($i < $TOTintervals)
+		{
+		$char_counter=0;
+		### BEGIN HOLD TIME TOTALS GRAPH ###
+			$Ghour_count = $qrtCALLS[$i];
+		if ($Ghour_count > 0) {$no_lines_yet=0;}
+
+		$Gavg_hold = $qrtQUEUEavg[$i];
+		if ($Gavg_hold < 1) 
+			{
+			if ($i < 0)
+				{
+				$do_nothing=1;
+				}
+			else
+				{
+				$TOT_lines++;
+				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
+				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
+				$ASCII_text.="|$HMdisplay[$i]|";
+				$CSV_text1.="\"$HMdisplay[$i]\",";
+			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
+			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
+				}
+			}
+		else
+			{
+			$TOT_lines++;
+			$no_lines_yet=0;
+			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
+			$Yavg_hold = (19 - $Xavg_hold);
+
+			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
+			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
+
+		#	$ASCII_text.="|$HMdisplay[$i]|";
+			$ASCII_text.="|$HMdisplay[$i]|";
+			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
+		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
+		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
+		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
+		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
+		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
+		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
+			}
+		### END HOLD TIME TOTALS GRAPH ###
+
+		$char_counter=0;
+		### BEGIN CALLS TOTALS GRAPH ###
+		$Ghour_count = $qrtCALLS[$i];
+		if ($Ghour_count < 1) 
+			{
+			if ($i < 0)
+				{
+				$do_nothing=1;
+				}
+			else
+				{
+				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
+				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+			#	$ASCII_text.="  |";
+				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
+				$ASCII_text.="| $qrtCALLS[$i] |\n";
+				$CSV_text1.="\"0\"\n";
+				}
+			}
+		else
+			{
+			$no_lines_yet=0;
+			$Xhour_count = ($Ghour_count * $hour_multiplier);
+			$Yhour_count = (69 - $Xhour_count);
+
+			$Gdrop_count = $qrtDROPS[$i];
+			if ($Gdrop_count < 1) 
+				{
+				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
+				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+
+				$ASCII_text.="";
+				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
+				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
+				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
+				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
+					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
+				$ASCII_text.="| $qrtCALLS[$i] |\n";
+				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
+				}
+			else
+				{
+				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
+
+			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
+
+				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
+
+				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
+				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
+
+				$ASCII_text.="";
+				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
+				$ASCII_text.="D";   $char_counter++;
+				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
+				$ASCII_text.="C";   $char_counter++;
+				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
+				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
+
+				$ASCII_text.="| $qrtCALLS[$i] |\n";
+				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
+				}
+			}
+		### END CALLS TOTALS GRAPH ###
+		$graph_stats[$i][0]=$HMdisplay[$i];
+		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
+		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
+		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
+		$i++;
+		}
+
+
+	if ($totQUEUEsec > 0)
+		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
+	else
+		{$totQUEUEavgRAW = 0;}
+	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
+	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
+	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
+	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
+	$totDROPS =	sprintf("%5s", $totDROPS);
+	$totCALLS =	sprintf("%5s", $totCALLS);
+
+
+	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
+	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
+	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
+
+
+	for ($d=0; $d\n";
+	}
+	$GRAPH_text.="
HOLD TIME, CALL AND DROP STATS
TIME 15-MIN INTDROPS / CALLS
\n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
  • ".$graph_stats[$d][1]."
  • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
  • ".$graph_stats[$d][2]."
  • "; + } + $GRAPH_text.="
\n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
TOTALS:".trim($totCALLS)."
"; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
\n"; + $MAIN.="
\n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRfilter.php index 32810a0e..29788848 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
"; +$HTML_text.="
"; -echo "
\n"; -echo "\n"; +$HTML_text.="
\n"; -echo "\n"; -echo "Período:
\n"; -echo "\n"; -echo " to \n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "RELATÓRIOS\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
\n"; +$HTML_text.="\n"; +$HTML_text.="Período:
\n"; +$HTML_text.="\n"; -echo "
\n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
\n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
\n\n";
+$HTML_text.="\n";
+
+$HTML_text.="
Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="RELATÓRIOS\n"; +$HTML_text.="\n"; + +$HTML_text.="
\n"; + +$HTML_text.="   \n"; +$HTML_text.="
\n"; +$HTML_text.="\n\n"; + +$HTML_text.="
\n\n";
 
 $shift = 'ALL';
 
@@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
 
 
 
-echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
+$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [DOWNLOAD]\n";
+
+$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
+
+$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
+$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
+
+$i=0;
+while($start_date<$end_date) {
+	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
+	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
+	for ($j=0; $j<16; $j++) {
+		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
+	}
+	
+	$i++;
+	$start_date+=$date_int;
+}
+
+$total=0;
+$Utotal=0;
+$totalstq=0;
+$Utotalstq=0;
+$totalnocid=0;
+$Utotalnocid=0;
+$totaldnc=0;
+$Utotaldnc=0;
+$totalsale=0;
+$Utotalsale=0;
+$totalarch=0;
+$Utotalarch=0;
+$totaltiq=0;
+$Utotaltiq=0;
+$totalsta=0;
+$Utotalsta=0;
+
+	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
+	$rsltA=mysql_query($stmtA, $link);
+	if ($DB) {$HTML_text.="$stmtA\n";}
+	while ($rowA=mysql_fetch_row($rsltA)) {
+		$count_ary[$rowA[2]][0]+=$rowA[0];
+		$count_ary[$rowA[2]][1]+=$rowA[1];
+		$count_ary[$rowA[2]][14]+=$rowA[0];
+		$count_ary[$rowA[2]][15]+=$rowA[1];
+		$total+=$rowA[0];
+		$Utotal+=$rowA[1];
+		$totalstq+=$rowA[0];
+		$Utotalstq+=$rowA[1];
+	}
+
+	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
+	$rsltB=mysql_query($stmtB, $link);
+	if ($DB) {$HTML_text.="$stmtB\n";}
+	while ($rowB=mysql_fetch_row($rsltB)) {
+		$count_ary[$rowB[2]][2]+=$rowB[0];
+		$count_ary[$rowB[2]][3]+=$rowB[1];
+		$total+=$rowB[0];
+		$Utotal+=$rowB[1];
+		$count_ary[$rowB[2]][14]+=$rowB[0];
+		$count_ary[$rowB[2]][15]+=$rowB[1];
+		$totalnocid+=$rowB[0];
+		$Utotalnocid+=$rowB[1];
+	}
+
+	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
+	$rsltC=mysql_query($stmtC, $link);
+	if ($DB) {$HTML_text.="$stmtC\n";}
+	while ($rowC=mysql_fetch_row($rsltC)) {
+		$count_ary[$rowC[2]][4]+=$rowC[0];
+		$count_ary[$rowC[2]][5]+=$rowC[1];
+		$total+=$rowC[0];
+		$Utotal+=$rowC[1];
+		$count_ary[$rowC[2]][14]+=$rowC[0];
+		$count_ary[$rowC[2]][15]+=$rowC[1];
+		$totaldnc+=$rowC[0];
+		$Utotaldnc+=$rowC[1];
+	}
+
+	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
+	$rsltD=mysql_query($stmtD, $link);
+	if ($DB) {$HTML_text.="$stmtD\n";}
+	while ($rowD=mysql_fetch_row($rsltD)) {
+		$count_ary[$rowD[2]][6]+=$rowD[0];
+		$count_ary[$rowD[2]][7]+=$rowD[1];
+		$total+=$rowD[0];
+		$Utotal+=$rowD[1];
+		$count_ary[$rowD[2]][14]+=$rowD[0];
+		$count_ary[$rowD[2]][15]+=$rowD[1];
+		$totalsale+=$rowD[0];
+		$Utotalsale+=$rowD[1];
+	}
+
+	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
+	$rsltE=mysql_query($stmtE, $link);
+	if ($DB) {$HTML_text.="$stmtE\n";}
+	while ($rowE=mysql_fetch_row($rsltE)) {
+		$count_ary[$rowE[2]][8]+=$rowE[0];
+		$count_ary[$rowE[2]][9]+=$rowE[1];
+		$total+=$rowE[0];
+		$Utotal+=$rowE[1];
+		$count_ary[$rowE[2]][14]+=$rowE[0];
+		$count_ary[$rowE[2]][15]+=$rowE[1];
+		$totalarch+=$rowE[0];
+		$Utotalarch+=$rowE[1];
+	}
+
+	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
+	$rsltF=mysql_query($stmtF, $link);
+	if ($DB) {$HTML_text.="$stmtF\n";}
+	while ($rowF=mysql_fetch_row($rsltF)) {
+		$count_ary[$rowF[2]][10]+=$rowF[0];
+		$count_ary[$rowF[2]][11]+=$rowF[1];
+		$totaltiq+=$rowF[0];
+		$Utotaltiq+=$rowF[1];
+	}
+
+	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
+	$rsltG=mysql_query($stmtG, $link);
+	if ($DB) {$HTML_text.="$stmtG\n";}
+	while ($rowG=mysql_fetch_row($rsltG)) {
+		$count_ary[$rowG[2]][12]+=$rowG[0];
+		$count_ary[$rowG[2]][13]+=$rowG[1];
+		$totalsta+=$rowG[0];
+		$Utotalsta+=$rowG[1];
+	}
 
 
-echo "\n";
-echo "+----------------------+---------+---------+---------+\n";
-echo "| CATEGORIA             | CALLS   | UNIQUE  |      %  |\n";
-echo "+----------------------+---------+---------+---------+\n";
+	$HTML_text.="\n";
+	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
+	$HTML_text.="|                              |          TOTALS         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
+	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
+	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
+	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
+	
+	$CSV_text.="\n";
+	$CSV_text.="\"\",\"\",\"TOTALS\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
+	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
+
+	for($i=0; $i
-
-
+ // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRstats.php index 80291e02..6fe6b235 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -13,6 +13,13 @@ # 91112-0719 - Added in-group names to select list # 100214-1421 - Sort menu alphabetically # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -28,39 +35,71 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} + +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} +$db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "IVR Stats Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
"; +$MAIN.="
"; if ($DB > 0) { - echo "
\n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
\n"; - echo "$shift|$query_date|$end_date\n"; - echo "
\n"; + $MAIN.="
\n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
\n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
\n"; } -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "Período:
\n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Período:
\n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
to
"; +$MAIN.="
to
"; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
\n"; -echo "Grupos de Entrada: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Grupos de Entrada: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ALTERAR | "; + $MAIN.="RELATÓRIOS | "; + $MAIN.="RELATÓRIO DE FINALIZADOR(CLOSER) \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Campanhas: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ALTERAR | "; + $MAIN.="RELATÓRIOS | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "ALTERAR | "; -echo "RELATÓRIOS | "; -echo "RELATÓRIO DE FINALIZADOR(CLOSER) \n"; -echo "\n"; -echo "
\n"; +$MAIN.="
\n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
Mostrar as:  "; +$MAIN.="\n
"; +$MAIN.="    \n"; -   -
\n"; +$MAIN.="\n\n"; -echo "
\n"; -echo "\n\n"; - -echo "
\n\n";
+$MAIN.="
\n\n";
 
 
 if ($groups_to_print < 1)
 	{
-	echo "\n\n";
-	echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	$MAIN.="\n\n";
+	$MAIN.="POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
 	}
 
 else
 	{
-	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
-	echo "                  $group_string\n";
+	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
+	$MAIN.="                  $group_string\n";
+
+	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
 
 	$TOTALcalls=0;
 	$NOCALLERIDcalls=0;
@@ -339,9 +463,16 @@ else
 	$totFLOWtotal_time=0;
 
 	##### Grab all records for the IVR for the specified time period
-	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
+	if ($type == 'inbound')
+		{
+		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
+		}
+	else
+		{
+		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
+		}
 	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
+	if ($DB) {$MAIN.="$stmt\n";}
 	$logs_to_print = mysql_num_rows($rslt);
 	$p=0;
 	while ($p < $logs_to_print)
@@ -366,11 +497,11 @@ else
 	$r=-1;
 	while ($p < $logs_to_print)
 		{
-		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
+		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
 		if ($last_uniqueid === "$uniqueid[$p]")
 			{
 			$unique_calls[$r] .= "----------$comment_b[$p]";
-			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
+			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
 			$last_epoch[$r]=$epoch[$p];
 			}
 		else
@@ -392,7 +523,7 @@ else
 			$unique_calls[$r] = $comment_b[$p];
 			$FLOWuniqueid[$r] = "$uniqueid[$p]";
 			$last_uniqueid = "$uniqueid[$p]";
-			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
+			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
 			}
 		$p++;
 		}
@@ -409,7 +540,7 @@ else
 	$s=0;
 	while ($s <= $r)
 		{
-		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
+		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
 		if ($last_Suniqueid === "$unique_calls[$s]")
 			{
 			$STunique_calls_count[$p]++;
@@ -437,11 +568,15 @@ else
 		}
 
 	#### PRINT TOTAL DE CHAMADAS INTO THIS IVR
-	echo "\n";
-	echo "Calls taken into this IVR:   $TOTALcalls\n";
-	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
-	echo "Unique Callers:              $UNIQUEcallers\n";
-	echo "\n";
+	$MAIN.="\n";
+	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
+	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
+	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
+	$MAIN.="\n";
+
+	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
+	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
+	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
 
 	### sort call flows for counting
 	if ($p > 0)
@@ -476,11 +611,32 @@ else
 	### put call flows and counts together for sorting again
 	$s=0;
 
-	echo "+--------+--------+--------+--------+------+------+\n";
-	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
-	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
-	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
-	echo "+--------+--------+--------+--------+------+------+------------\n";
+	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
+	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
+	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
+	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
+	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
+
+	######## GRAPHING #########
+	$graph_stats=array();
+	$max_ivr_calls=1;
+	$max_queue_calls=1;
+	$max_queue_drops=1;
+	$max_queue_drops_percent=1;
+	$max_ivr_avg=1;
+	$max_total_avg=1;
+	$GRAPH="";
+	$GRAPH.="";
+	$GRAPH.="
IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

 


"; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
IVR STATS
IVR CALLSCALL PATH
"; + $QUEUEDROPCALLS_graph="
IVR STATS
QUEUE CALLSCALL PATH
"; + $QUEUEDROPPERCENT_graph="
IVR STATS
QUEUE DROP CALLSCALL PATH
"; + $IVRAVGTIME_graph="
IVR STATS
QUEUE DROP PERCENTCALL PATH
"; + $TOTALAVGTIME_graph="
IVR STATS
IVR AVG TIMECALL PATH
"; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -494,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -529,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -558,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
IVR STATS
TOTAL AVG TIMECALL PATH
".$graph_stats[$d][0]."
".$graph_stats[$d][2]."".$graph_stats[$d][0]."
".$graph_stats[$d][3]."".$graph_stats[$d][0]."
".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
".$graph_stats[$d][5]."".$graph_stats[$d][0]."
".$graph_stats[$d][6]."".$graph_stats[$d][0]."
".trim($TOTALcalls)."TOTAL
"; + $QUEUECALLS_graph.="
".trim($totFLOWtotal)."TOTAL
"; + $QUEUEDROPCALLS_graph.="
".trim($totFLOWdrop)."TOTAL
"; + $QUEUEDROPPERCENT_graph.="
".trim($totFLOWdropPCT)."%TOTAL
"; + $IVRAVGTIME_graph.="".trim($TavgFLOWivr_time)."TOTAL"; + $TOTALAVGTIME_graph.="".trim($TavgFLOWtotal_time)."TOTAL"; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- ESTATÍSTICAS DE TEMPO\n"; + $MAIN.="\n"; + $MAIN.="---------- ESTATÍSTICAS DE TEMPO\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -577,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -587,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -624,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -654,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -689,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -702,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -716,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="\n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..e1404750 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Listas Status da Campanha Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..daf1305f --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
\n"; + echo "$query_date|$end_date\n"; + echo "
\n"; + } + +echo "
"; + +echo "
\n"; +echo "
\n"; +echo "\n"; +echo "
to
\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           RELATÓRIOS \n"; +echo "
\n"; +echo "
\n"; + +echo "
";
+
+
+if (!$query_date)
+{
+echo "\n\n";
+echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK ENVIAR\n";
+}
+
+else
+{
+echo "List Update Process Report                      $NOW_TIME\n";
+echo "\n";
+echo "Time range $query_date to $end_date\n\n";
+
+
+### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
+echo "List Update Summary:\n";
+echo "+----------------------------------------------------+------------+----------+----------+\n";
+echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
+echo "+----------------------------------------------------+------------+----------+----------+\n";
+
+$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$records_to_grab = mysql_num_rows($rslt);
+$i=0;
+while ($i < $records_to_grab)
+	{
+	$row=mysql_fetch_row($rslt);
+	$TOTcount = ($TOTcount + $row[0]);
+	$TOTupdated = ($TOTupdated + $row[3]);
+	$count =	sprintf("%-8s", $row[0]);
+	$filename =	sprintf("%-50s", trim($row[1]));
+	$result =	sprintf("%-10s", $row[2]);
+	$updated =	sprintf("%-8s", $row[3]);
+	echo "| $filename | $result | $count | $updated |\n";
+
+	$i++;
+	}
+$TOTcount =	sprintf("%-8s", $TOTcount);
+$TOTupdated =	sprintf("%-8s", $TOTupdated);
+
+echo "+----------------------------------------------------+------------+----------+----------+\n";
+echo "                                                                  | $TOTcount | $TOTupdated |\n";
+echo "                                                                  +----------+----------+\n";
+echo "\n
\n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Detalhes:
\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
DATE/TIMELEAD_IDVENDOR_IDPHONESTATUSOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

\nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
+ + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php index 4ce1906b..ce3ddb67 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 091129-0017 - Added Sales-type and DNC-type tallies # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,10 +44,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -50,23 +60,40 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Summary Interval Report'; +$db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Outbound Summary Interval Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
"; + $MAIN.="
"; if ($DB > 0) { - echo "
\n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
\n"; - echo "$shift|$query_date|$end_date\n"; - echo "
\n"; + $MAIN.="
\n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
\n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
\n"; } - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
\n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Período:
\n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
Campaigns:
"; - echo "
Campanhas:
"; + $MAIN.="\n"; - echo "
"; - echo "Include Drop  
Rollover:
"; - echo "
\n"; - echo "Time Interval:
"; - echo "\n"; + $MAIN.="
"; + $MAIN.="Include Drop  
Rollover:
"; + $MAIN.="
\n"; + $MAIN.="Time Interval:
"; + $MAIN.="\n"; - echo "
\n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

\n"; - echo "
        "; - echo "\n"; + {$MAIN.="\n";} - echo "
\n"; - echo "Call Time:
\n"; - echo "\n"; + $MAIN.="
\n"; + $MAIN.="         "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ALTERAR | "; + $MAIN.="RELATÓRIOS"; + $MAIN.="

\n"; + $MAIN.="Mostrar as:
"; + $MAIN.="\n
"; + $MAIN.="
        "; + $MAIN.="\n"; + + $MAIN.="
\n"; + + $MAIN.="Call Time:
\n"; + $MAIN.="\n"; - echo "
\n"; - echo "
\n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
\n"; + $MAIN.="
\n"; + $MAIN.="\n\n"; - echo "
\n\n";
+	$MAIN.="
\n\n";
 	}
 
 if ($group_ct < 1)
 	{
-	echo "\n\n";
-	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
+	$MAIN.="\n\n";
+	$MAIN.="PLEASE SELECT A CAMPANHA AND DATE RANGE ABOVE AND CLICK ENVIAR\n";
 	}
 
 else
@@ -483,7 +526,7 @@ else
 		{
 		$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='$shift';";
 		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
+		if ($DB) {$MAIN.="$stmt\n";}
 		$calltimes_to_print = mysql_num_rows($rslt);
 		if ($calltimes_to_print > 0)
 			{
@@ -553,7 +596,7 @@ else
 			$Hcalltime_HHMM[$h] = "$H_test";
 			}
 		if ($DB)
-			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
+			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
 		$h++;
 		}
 
@@ -563,19 +606,49 @@ else
 
 	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
 
-
+	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
 
 
 	##### Loop through each campaign and gether stats
 	if ($group_ct > 0)
 		{
-		$MAIN .= "\n";
-		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
-		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
-		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
-		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
-		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
-		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+		$ASCII_text .= "\n";
+		$ASCII_text .= "---------- MULTI-CAMPANHA BREAKDOWN:\n";
+		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+		$ASCII_text .= "|                                          |        | SYSTEM | AGENTE  |        |        | NO     |        | AGENTE      | AGENTE      |\n";
+		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | RESPOSTA | DROP   | LOGIN      | PAUSE      |\n";
+		$ASCII_text .= "| CAMPANHA                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
+		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+
+		$CSV_main.="\"MULTI-CAMPANHA BREAKDOWN:\"\n";
+		$CSV_main.="\"CAMPANHA\",\"TOTAL DE CHAMADAS\",\"SYSTEM RELEASE CALLS\",\"AGENTE RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RESPOSTA PERCENT\",\"DROP PERCENT\",\"AGENTE LOGIN TIME(H:M:S)\",\"AGENTE PAUSE TIME(H:M:S)\"\n";
+		$CSV_subreports="";
+		
+		######## GRAPHING #########
+		$max_calls=1;
+		$max_system_release=1;
+		$max_agent_release=1;
+		$max_sales=1;
+		$max_dncs=1;
+		$max_nas=1;
+		$max_drops=1;
+		$max_login_time=1;
+		$max_pause_time=1;
+
+		$GRAPH="

"; + $GRAPH.=""; + $GRAPH.="
CALLSSYSTEM RELEASE CALLSAGENTE RELEASE CALLSSALE CALLSDNC CALLSNO RESPOSTA PERCENTDROP PERCENTAGENTE LOGIN TIMEAGENTE PAUSE TIME

 


"; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -596,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -614,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -641,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -655,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -732,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hRESPOSTAcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -815,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -823,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -953,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -961,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -978,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1004,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1025,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gRESPOSTAcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1040,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | AGENTE | | | NO | | AGENTE | AGENTE |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | RESPOSTA | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"TOTAL DE CHAMADAS\",\"SYSTEM RELEASE CALLS\",\"AGENTE RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RESPOSTA PERCENT\",\"DROP PERCENT\",\"AGENTE LOGIN TIME (H:M:S)\",\"AGENTE PAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

MULTI-CAMPANHA BREAKDOWN
CAMPANHASTOTAL DE CHAMADAS
SYSTEM RELEASE CALLS
AGENTE RELEASE CALLS
SALE CALLS
DNC CALLS
NO RESPOSTA PERCENT
DROP PERCENT
AGENTE LOGIN TIME (H:M:S)
AGENTE PAUSE TIME (H:M:S)
"; + $SUBGRAPH.=""; + $SUBGRAPH.="
CALLSSYSTEM RELEASE CALLSAGENTE RELEASE CALLSSALE CALLSDNC CALLSNO RESPOSTA PERCENTDROP PERCENTAGENTE LOGIN TIMEAGENTE PAUSE TIME

 


"; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1105,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1124,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hRESPOSTAcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1140,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1167,8 +1317,8 @@ else $hTOTcalls_count = sprintf("%6s", $hTOTcalls_count); $hTOTsystem_count = sprintf("%6s", $hTOTsystem_count); $hTOTagent_count = sprintf("%6s", $hTOTagent_count); - $hTOTptp_count = sprintf("%6s", $hTOTrtp_count); - $hTOTrtp_count = sprintf("%6s", $hTOTptp_count); + $hTOTptp_count = sprintf("%6s", $hTOTptp_count); + $hTOTrtp_count = sprintf("%6s", $hTOTrtp_count); if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) ) {$hTOTna_percent=0;} else @@ -1190,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
$SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
INTERVALTOTAL DE CHAMADAS
SYSTEM RELEASE CALLS
AGENTE RELEASE CALLS
SALE CALLS
DNC CALLS
NO RESPOSTA PERCENT
DROP PERCENT
AGENTE LOGIN TIME (H:M:S)
AGENTE PAUSE TIME (H:M:S)
".$SUBgraph_stats[$d][1]."
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
TOTAL:".trim($hTOTcalls_count)."
"; + $SUBSYSTEMRELEASE_graph.="
TOTAL:".trim($hTOTsystem_count)."
"; + $SUBAGENTRELEASE_graph.="
TOTAL:".trim($hTOTagent_count)."
"; + $SUBSALES_graph.="TOTAL:".trim($hTOTptp_count).""; + $SUBDNCS_graph.="TOTAL:".trim($hTOTrtp_count).""; + $SUBNAS_graph.="TOTAL:".trim($hTOTna_percent)."%"; + $SUBDROPS_graph.="TOTAL:".trim($hTOTdrop_percent)."%"; + $SUBLOGINTIME_graph.="TOTAL:".trim($hTOTagent_sec).""; + $SUBPAUSETIME_graph.="TOTAL:".trim($hTOTpause_sec).""; + $JS_onload.="\tDraw".$SUBrpt_campaign."CampanhaGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."CampanhaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1244,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALS Campanhas: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALS Campanhas: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d".$graph_stats[$d][1].""; + $SYSTEMRELEASE_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][2].""; + $AGENTRELEASE_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][3].""; + $SALES_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][4].""; + $DNCS_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][5].""; + $NAS_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%"; + $DROPS_graph.=" ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%"; + $LOGINTIME_graph.=" ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H').""; + $PAUSETIME_graph.=" ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H').""; + } + $CALLS_graph.="TOTAL:".trim($TOTcalls_count).""; + $SYSTEMRELEASE_graph.="TOTAL:".trim($TOTsystem_count).""; + $AGENTRELEASE_graph.="TOTAL:".trim($TOTagent_count).""; + $SALES_graph.="TOTAL:".trim($TOTptp_count).""; + $DNCS_graph.="TOTAL:".trim($TOTrtp_count).""; + $NAS_graph.="TOTAL:".trim($TOTna_percent)."%"; + $DROPS_graph.="TOTAL:".trim($TOTdrop_percent)."%"; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiCampanhaGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiCampanhaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; } ?> - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_VDADstats.php index 59814637..40e38374 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -26,6 +26,12 @@ # 100202-1034 - Added statuses to no-answer section # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100814-2307 - Added display of preset dials if presets are enabled in the campaign +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -73,10 +81,14 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';} if (strlen($carrier_stats)<2) {$carrier_stats='NO';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Calling Report'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; -echo "Outbound Stats\n"; +echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -333,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

Mostrar as:
"; +echo "\n
"; echo "Shift:  
"; echo "\n"; -#echo "\n"; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           ALTERAR \n"; +echo "\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+	{
+	echo "\n\n";
+	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK ENVIAR\n";
+	}
+
+else
+	{
+	echo "Live Current Agentes logged in to take calls from $group - $selected_name         $NOW_TIME\n";
+
+	echo "\n";
+
+	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALagents =	sprintf("%10s", $row[0]);
+
+	echo "Total agents:       $TOTALagents\n";
+
+
+	##############################
+	#########  LIVE AGENTE STATS
+	$user_list='|';
+	echo "\n";
+	echo "---------- LIVE AGENTS IN IN-GROUP\n";
+	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
+	echo "| #    | USUÁRIO                        | CAMPANHA             | STATUS | LAST ACTIVITY       |\n";
+	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
+
+	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$users_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$i++;
+
+		$FMT_i =		sprintf("%-4s", $i);
+		$user =			sprintf("%-30s", "$row[0] - $row[1]");
+			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
+		$campaign_id =	sprintf("%-8s", $row[2]);
+		$status =		sprintf("%-6s", $row[3]);
+		$time =			sprintf("%-19s", $row[4]);
+		$user_list .=	"$row[0]---$row[3]|";
+
+		echo "| $FMT_i | $user | $campaign_id   Tempo Real | $status | $time |\n";
+		}
+
+	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
+
+	
+	if ($DB) {echo "\n$user_list\n";}
+
+	##############################
+	#########  ALL AGENTE STATS
+
+	echo "\n";
+	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
+	echo "+------+--------------------------------+-----------+\n";
+	echo "| #    | USUÁRIO                        | LOGGED IN |\n";
+	echo "+------+--------------------------------+-----------+\n";
+
+	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$Xusers_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $Xusers_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$i++;
+
+		$FMT_i =		sprintf("%-4s", $i);
+		$user =			sprintf("%-30s", "$row[0] - $row[1]");
+			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
+		if (preg_match("/\|$row[0]---/",$user_list))
+			{
+			$userstatusARY =	explode("|$row[0]---",$user_list);
+			$userstatus =		explode('|',$userstatusARY[1]);
+			$status_line =		sprintf("%-9s", $userstatus[0]);
+
+			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
+			}
+		else
+			{$status_line = '         ';}
+
+		echo "| $FMT_i | $user | $status_line |\n";
+		}
+
+	echo "+------+--------------------------------+-----------+\n";
+	
+	}
+
+
+?>
+
+ + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_admin_template_maker.php new file mode 100644 index 00000000..df4b1474 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="Enviar modelo" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
**NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="Apagar Modelo" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
**$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"AJUDA\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
+ + +
Listloader Criador modelo personalizado
+ +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
$error_msg
$success_msg
Criar um novo modeloExcluir um modelo existente
+
+ Exemplo de arquivo de modelo de montagem:
()


+
+
Selecione modelo para excluir:


+
        VOLTAR PARA ADMIN         Go to Lead Loader    
+ +
+ + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_days_detail.php index dddf0a58..84150b06 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,6 +11,11 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -39,12 +44,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Status Diário Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -172,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
\n";
+	$ASCII_text.="\n";
+	$ASCII_text.="
\n";
+	$GRAPH_text.="
\n";
 	}
 
 if (strlen($group[0]) < 1)
@@ -212,10 +314,12 @@ else
 
 	if ($file_download < 1)
 		{
-		echo "Agent Status Diário Report: $user                     $NOW_TIME\n";
-
-		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-		echo "---------- AGENTE Detalhess -------------\n\n";
+		$ASCII_text.="Agent Status Diário Report: $user                     $NOW_TIME\n";
+		$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
+		$ASCII_text.="---------- AGENTE Detalhess -------------\n\n";
+		$GRAPH_text.="Agent Status Diário Report: $user                     $NOW_TIME\n";
+		$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
+		$GRAPH_text.="---------- AGENTE Detalhess -------------\n";
 		}
 	else
 		{
@@ -235,7 +339,7 @@ else
 	$date_namesARY[0]='';
 	$k=0;
 
-	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
+	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -271,10 +375,17 @@ else
 
 	if ($file_download < 1)
 		{
-		echo "LEAD STATS BREAKDOWN:\n";
-		echo "+------------+--------+--------+--------+$statusesHEAD\n";
-		echo "| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
-		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
+		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
+		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
+		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
+		for ($i=0; $i$SstatusTXT";
+		}
+
 		}
 	else
 		{
@@ -285,6 +396,18 @@ else
 	$m=0;
 	$CIScountTOT=0;
 	$DNCcountTOT=0;
+
+	$graph_stats=array();
+	$max_calls=1;
+	$max_cicalls=1;
+	$max_dncci=1;
+	$GRAPH="

"; + $GRAPH2=""; + $graph_header="
CALLSCI/CALLSDNC/CI
"; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -300,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -318,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -357,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -397,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -426,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -445,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -460,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -487,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
LEAD STATS BREAKDOWN
STATUSCALLS
CI CALLS
DNC/CI%
$Sstatus
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".$graph_stats[$d][2]."
".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
".$graph_stats[$d][($e+4)]."
TOTAL:".trim($TOTcalls)."
"; + $CICALLS_graph.="
TOTAL:".trim($CIScountTOT)."
"; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
 


"; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n"; } else { @@ -522,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
\n"; echo "
Datas:
"; @@ -572,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
"; +echo "Mostrar as:   
"; +echo "\n

"; echo "
Usuário:
"; echo "\n"; echo "
Shift:
"; @@ -596,38 +814,41 @@ else echo "RELATÓRIOS \n"; echo "
"; -echo "
\n\n"; +echo "\n\n
$db_source"; echo "\n"; -echo "\n"; -echo "
\n\n\n\n\n\n\n\n\n\n";
 
-$m=0;
-while ($m < $k)
+if ($report_display_type=="TEXT" || !$report_display_type) 
 	{
-	$sort_split = explode("-----",$TOPsort[$m]);
-	$i = $sort_split[1];
-	$sort_order[$m] = "$i";
+	echo "\n";
+	echo "
\n\n\n\n\n\n\n\n\n\n";
 
-	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
-		{echo "              \n";}
-	else
+	$m=0;
+	while ($m < $k)
 		{
-		echo "              ";
-		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
-		$h=0;
-		while ($h <= $TOPsortPLOT)
+		$sort_split = explode("-----",$TOPsort[$m]);
+		$i = $sort_split[1];
+		$sort_order[$m] = "$i";
+
+		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+			{echo "              \n";}
+		else
 			{
-			echo " ";
-			$h++;
+			echo "              ";
+			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
+			$h=0;
+			while ($h <= $TOPsortPLOT)
+				{
+				echo " ";
+				$h++;
+				}
+			echo "\n";
 			}
-		echo "\n";
+		$m++;
 		}
-	$m++;
+
+	echo "\n";
 	}
-
-echo "\n";
-
 ?>
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_performance_detail.php
index 243b9b4d..53189c13 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_performance_detail.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_performance_detail.php
@@ -1,7 +1,7 @@
     LICENSE: AGPLv2
+# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
 #
 # CHANGES
 #
@@ -23,6 +23,13 @@
 # 100203-1131 - Added CUSTOMER time statistics
 # 100214-1421 - Sort menu alphabetically
 # 100216-0042 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
+# 110703-1739 - Added file download option
+# 111007-0709 - Changed user and fullname to use non-truncated for output file
+# 111104-1249 - Added user_group restrictions for selecting in-groups
+# 120224-0910 - Added HTML display option with bar graphs
 #
 
 require("dbconnect.php");
@@ -49,36 +56,61 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
 	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
 if (isset($_GET["ENVIAR"]))					{$ENVIAR=$_GET["ENVIAR"];}
 	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+if (isset($_GET["file_download"]))				{$file_download=$_GET["file_download"];}
+	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
+if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
+	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
 
 
 if (strlen($shift)<2) {$shift='ALL';}
 
-$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
+$report_name = 'Agent Performance Detalhes';
+$db_source = 'M';
+$JS_text="\n";
-echo "\n";
+$HTML_head.="\n";
+$HTML_head.="\n";
+$HTML_head.="\n";
 
-echo "\n";
-echo "Agent Performance Detalhes\n";
+
+$HTML_head.="\n";
+$HTML_head.="\n";
+$HTML_head.="\n";
+
+$HTML_head.="\n";
+$HTML_head.="$report_name\n";
 
 	$short_header=1;
 
-	require("admin_header.php");
+#	require("admin_header.php");
 
-echo "
"; +$HTML_text.="
"; -echo "
\n"; -echo "
Datas:
"; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
Datas:
"; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$HTML_text.="\n"; -echo "
to
"; +$HTML_text.="
to
"; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$HTML_text.="\n"; -echo "
Campanhas:
"; -echo "
Campanhas:
"; +$HTML_text.="\n"; -echo "
Grupos de Usuário:
"; -echo "\n"; +$HTML_text.="
Grupos de Usuário:
"; +$HTML_text.="\n"; -echo "
Shift:
"; -echo "

\n"; -echo "\n"; -echo "
        "; +$HTML_text.="\n"; +$HTML_text.="Shift:
"; +$HTML_text.="

\n"; +$HTML_text.="Mostrar as:
"; +$HTML_text.="\n

"; +$HTML_text.="\n"; +$HTML_text.="
        "; -echo "          \n"; -echo " RELATÓRIOS \n"; -echo "\n"; -echo "
"; +$HTML_text.="          \n"; +$HTML_text.=" RELATÓRIOS \n"; +$HTML_text.="\n"; +$HTML_text.="
"; -echo "
\n\n"; +$HTML_text.="\n\n"; -echo "
\n";
+$HTML_text.="
\n";
 
 
 if (!$group)
 {
-echo "\n";
-echo "POR FAVOR SELECIONE UMA CAMPANHA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
-echo " NOTE: stats taken from shift specified\n";
+$HTML_text.="\n";
+$HTML_text.="POR FAVOR SELECIONE UMA CAMPANHA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+$HTML_text.=" NOTE: stats taken from shift specified\n";
 }
 
 else
@@ -300,10 +403,10 @@ $query_date_END = "$end_date $time_END";
 if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
 else {$ugSQL='';}
 
-echo "Agent Performance Detalhes                        $NOW_TIME\n";
+$HTML_text.="Agent Performance Detalhes                        $NOW_TIME\n";
 
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Detalhess -------------\n\n";
+$HTML_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
+$HTML_text.="---------- AGENTS Detalhess -------------\n\n";
 
 
 
@@ -312,6 +415,12 @@ echo "---------- AGENTS Detalhess -------------\n\n";
 $statuses='-';
 $statusesTXT='';
 $statusesHEAD='';
+
+$CSV_header="\"Agent Performance Detalhes                        $NOW_TIME\"\n";
+$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
+$CSV_header.="\"---------- AGENTS Detalhess -------------\"\n";
+$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
+
 $statusesHTML='';
 $statusesARY[0]='';
 $j=0;
@@ -320,10 +429,44 @@ $usersARY[0]='';
 $user_namesARY[0]='';
 $k=0;
 
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
+$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
 $rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
+if ($DB) {$HTML_text.="$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
+
+$graph_stats=array();
+$max_calls=1;
+$max_time=1;
+$max_pause=1;
+$max_pauseavg=1;
+$max_wait=1;
+$max_waitavg=1;
+$max_talk=1;
+$max_talkavg=1;
+$max_dispo=1;
+$max_dispoavg=1;
+$max_dead=1;
+$max_deadavg=1;
+$max_customer=1;
+$max_customeravg=1;
+$GRAPH="

"; +$GRAPH2=""; +$graph_header="
CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
"; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -340,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -347,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -362,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [DOWNLOAD]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -383,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -390,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -405,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -412,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -443,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -459,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -490,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -499,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -521,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -532,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -553,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -622,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
USERCALLS
TIME
PAUSE
PAUSE AVG
WAIT
WAIT AVG
TALK
TALK AVG
DISPO
DISPO AVG
DEAD
DEAD AVG
CUST
CUST AVG
$Sstatus
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
TOTAL:".trim($TOTcalls)."
"; +$TIME_graph.="
TOTAL:".trim($TOTtime_MS)."
"; +$PAUSE_graph.="
TOTAL:".trim($TOTtotPAUSE_MS)."
"; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
 


"; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -646,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

"; +$GRAPH2=""; +$graph_header="
TOTALNONPAUSEPAUSE
"; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -665,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -675,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -688,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [DOWNLOAD]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Detalhes $NOW_TIME\"\n"; +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -715,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -722,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -737,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -744,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -769,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -781,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -807,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -814,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -829,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -859,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
PAUSE CODE BREAKDOWN
STATUSTOTAL
NONPAUSE
PAUSE
$Sstatus
".sec_convert($graph_stats[$d][1], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
".sec_convert($graph_stats[$d][($e+4)], 'H')."
TOTAL:".trim($TOTtotTOTAL_MS)."
"; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
 


"; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
$db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_status_detail.php index 796cea31..9e5db951 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,11 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -40,12 +45,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Detalhes'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Status Detalhes Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -218,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
\n";
+	$ASCII_text.="\n";
+	$ASCII_text.="\n\n\n
\n";
+	$GRAPH.="
\n";
 	}
 
 if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
 	{
-	echo "\n";
+	echo "
\n\n\n";
 	echo "POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE ENVIAR\n";
 	echo " NOTE: stats taken from shift specified\n";
 	}
@@ -258,10 +359,12 @@ else
 
 	if ($file_download < 1)
 		{
-		echo "Agent Status Detalhes Report                     $NOW_TIME\n";
-
-		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-		echo "---------- AGENTE Detalhess -------------\n\n";
+		$ASCII_text.="

Agent Status Detalhes Report $NOW_TIME\n"; + $ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- AGENTE Detalhess -------------\n\n"; + $GRAPH.="

Agent Status Detalhes Report $NOW_TIME\n"; + $GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- AGENTE Detalhess -------------"; } else { @@ -285,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -304,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -319,10 +428,18 @@ else if ($file_download < 1) { - echo "CALLS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { @@ -334,6 +451,18 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

"; + $GRAPH2=""; + $graph_header="
CALLSCI/CALLSDNC/CI
"; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; @@ -350,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -367,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -376,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -420,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -459,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -487,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -506,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -521,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -550,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
CALL STATS BREAKDOWN
STATUSCALLS
CI CALLS
DNC/CI%
$Sstatus
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".$graph_stats[$d][2]."
".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
TOTAL:".trim($TOTcalls)."
"; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
 


"; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -583,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
\n"; echo "
Datas:
"; @@ -654,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

\n"; +echo "Mostrar as:
"; +echo "\n

"; echo "\n"; echo "
        "; @@ -663,38 +888,41 @@ echo " RELATÓRIOS \n"; echo "\n"; echo "
"; -echo "
\n\n"; +echo "\n\n
$db_source"; echo "\n"; -echo "\n"; -echo "
\n\n\n\n\n\n\n\n\n\n";
 
-$m=0;
-while ($m < $k)
+if (!$report_display_type || $report_display_type=="TEXT")
 	{
-	$sort_split = explode("-----",$TOPsort[$m]);
-	$i = $sort_split[1];
-	$sort_order[$m] = "$i";
+	echo "\n";
+	echo "
\n\n\n\n\n\n\n\n\n\n";
 
-	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
-		{echo "                              \n";}
-	else
+	$m=0;
+	while ($m < $k)
 		{
-		echo "                              ";
-		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
-		$h=0;
-		while ($h <= $TOPsortPLOT)
+		$sort_split = explode("-----",$TOPsort[$m]);
+		$i = $sort_split[1];
+		$sort_order[$m] = "$i";
+
+		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+			{echo "                              \n";}
+		else
 			{
-			echo " ";
-			$h++;
+			echo "                              ";
+			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
+			$h=0;
+			while ($h <= $TOPsortPLOT)
+				{
+				echo " ";
+				$h++;
+				}
+			echo "\n";
 			}
-		echo "\n";
+		$m++;
 		}
-	$m++;
+
+	echo "\n";
 	}
-
-echo "\n";
-
 ?>
 
 
\ No newline at end of file
diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_detail.php
index bc97301f..97a8971f 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_detail.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_detail.php
@@ -4,7 +4,7 @@
 # Pulls time stats per agent selectable by campaign or user group
 # should be most accurate agent stats of all of the reports
 #
-# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
+# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
 #
 # CHANGES
 # 90522-0723 - First build
@@ -12,6 +12,17 @@
 # 100203-1147 - Added CUSTOMER time statistics
 # 100214-1421 - Sort menu alphabetically
 # 100216-0042 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
+# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
+# 101207-1719 - Fixed download file formatting bugs(issue 394)
+# 101208-0320 - Fixed issue 404
+# 110307-1057 - Added user_case setting in options.php
+# 110623-0728 - Fixed user group selection bug
+# 110708-1727 - Added options.php setting for time precision
+# 111104-1248 - Added user_group restrictions for selecting in-groups
+# 120224-0910 - Added HTML display option with bar graphs
 #
 
 require("dbconnect.php");
@@ -38,15 +49,37 @@ if (isset($_GET["DB"]))						{$DB=$_GET["DB"];}
 	elseif (isset($_POST["DB"]))			{$DB=$_POST["DB"];}
 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["ENVIAR"]))					{$ENVIAR=$_GET["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
+	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
 
 if (strlen($shift)<2) {$shift='ALL';}
 if (strlen($stage)<2) {$stage='NAME';}
 
+$report_name = 'Agente Tiempo Detalle';
+$db_source = 'M';
+$JS_text="\n";
 	echo "\n";
+	echo "\n";
 
 	echo "\n";
-	echo "Agent Time Detail\n";
+	echo "$report_name\n";
 	echo "";
 
 	$short_header=1;
@@ -198,7 +321,7 @@ if ($file_download < 1)
 if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
 	{
 	echo "\n";
-	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
+	echo "POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE ENVIAR\n";
 	echo " NOTE: stats taken from shift specified\n";
 	}
 
@@ -236,13 +359,13 @@ else
 
 	if ($file_download < 1)
 		{
-		echo "Agent Time Detail                     $NOW_TIME\n";
+		echo "Agente Tiempo Detalle                     $NOW_TIME\n";
 
 		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 		}
 	else
 		{
-		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
+		$file_output .= "Agente Tiempo Detalle                     $NOW_TIME\n";
 		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
 		}
 
@@ -253,11 +376,34 @@ else
 	############################################################################
 
 	### BEGIN gather user IDs and names for matching up later
-	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
+	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$users_to_print = mysql_num_rows($rslt);
 	$i=0;
+	$graph_stats=array();
+	$max_calls=1;
+	$max_timeclock=1;
+	$max_agenttime=1;
+	$max_wait=1;
+	$max_talk=1;
+	$max_dispo=1;
+	$max_pause=1;
+	$max_dead=1;
+	$max_customer=1;
+	$GRAPH="";
+	$GRAPH2="";
+	$graph_header="
CALLSTIME CLOCKAGENTE TIMEWAITTALKDISPOPAUSEDEADCUSTOMER
"; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -269,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -296,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -317,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -331,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -350,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -419,14 +568,16 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="AGENTE TIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | AGENTE TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { - $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENTE TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -450,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -493,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -502,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -529,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -582,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -618,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -630,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
\n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -653,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -680,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -695,53 +899,132 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
AGENTE TIME BREAKDOWN
STATUSCALLS
TIME CLOCK
AGENTE TIME
WAIT
TALK
DISPO
PAUSE
DEAD
CUSTOMER
$Sstatus
".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
TOTAL:".trim($hTOTcalls)."
"; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
 


"; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -782,8 +1065,22 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
\n"; -echo "
Dates:
"; +echo "
Datas:
"; echo "\n"; echo ""; @@ -796,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Segunda week start
Campaigns:
"; +echo "
Campanhas:
"; echo "\n"; -echo "
User Groups:
"; +echo "
Grupos de Usuário:
"; echo "

\n"; -echo "\n"; +echo "Mostrar as:
"; +echo "\n

"; +echo "\n"; echo "
        "; echo "          \n"; echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " RELATÓRIOS \n"; echo "\n"; echo "
"; -echo "\n\n"; +echo "\n\n
$db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_sheet.php index b5c0e6fb..c17bc6c8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,46 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); require("functions.php"); +$report_name = 'Usuário Planilha de Tempo'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -45,20 +64,28 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,27 +93,70 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "Agent Planilha de Tempo"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -107,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentPlanilha de Horáriofor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "Usuário ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentPlanilha de Horáriofor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="Usuário ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -136,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentPlanilha de Horário $NOW_TIME\n"; +$MAIN.="AgentPlanilha de Horário $NOW_TIME\n"; + +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentPlanilha de Horário- $NOW_TIME\"\n"; +$CSV_text_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"AGENTE TIME SHEET: $agent - $full_name\"\n\n"; -echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -176,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "TOTAL DE CHAMADAS TAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="TOTAL DE CHAMADAS TAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[DOWNLOAD]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"TOTAL DE CHAMADAS TAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE AGENTE TIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -227,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; +$MAIN.="<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"HORAS:MINUTOS\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -255,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -269,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -285,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE>\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_timeclock_detail.php index e3d7b036..5f59a166 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_agent_timeclock_detail.php @@ -3,11 +3,16 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -35,15 +40,19 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'UsuarioRelógio Ponto Detalle Informe'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,28 +60,100 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -90,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -101,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -186,10 +267,11 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -204,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE ENVIAR\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -242,13 +324,13 @@ else if ($file_download < 1) { - echo "User Time-Clock Detail $NOW_TIME\n"; + echo "Usuário Time-Clock Detalhes $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; } else { - $file_output .= "User Time-Clock Detail $NOW_TIME\n"; + $file_output .= "Usuário Time-Clock Detalhes $NOW_TIME\n"; $file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n"; } @@ -259,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -301,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| USER NAME | ID | USER GROUP | TIME CLOCK | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="AGENTE TIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| USER NAME | ID | GRUPO DE USUÁRIOS | TIME CLOCK | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } else { @@ -323,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -360,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -376,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -429,7 +524,12 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -461,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -471,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i".$graph_stats[$i][0]."\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
\n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
\n";} ### BEGIN sort through output to display properly ### @@ -498,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -527,12 +636,22 @@ else if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.="
AGENTE TIME-CLOCK DETAIL
USER/GRUPO DE USUÁRIOSTIME CLOCK TIME CLOCK PUNCHES
\"\"".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."".$graph_stats[$i][3]."
TOTALSAGENTS: $TOT_AGENTS$TOTtimeTC
\n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.=""; + $GRAPH.=""; } else { @@ -569,12 +688,20 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section ############################################################################ echo "
\n"; -echo "
Dates:
"; +echo "
Datas:
"; echo "\n"; echo "\n"; echo "\n"; @@ -589,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Segunda week start \n"; -echo "
User Groups:
"; +echo "
Grupos de Usuário:
"; echo "\n"; +echo "
"; +echo "Mostrar as:   
"; +echo "\n

"; echo "
Shift:
"; echo " +
        "; echo "          \n"; echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " RELATÓRIOS \n"; echo "\n"; echo "
"; @@ -685,7 +817,7 @@ echo "\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "$RUNtime\n"; +echo "$RUNtime|$db_source\n"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_campaign_status_list_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_campaign_status_list_report.php new file mode 100644 index 00000000..170b6c00 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_campaign_status_list_report.php @@ -0,0 +1,471 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110815-2138 - First build +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$report_name="Campanha Status List Report"; +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;} +if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;} +if (!isset($query_date_T)) {$query_date_T="00:00:00";} +if (!isset($end_date_T)) {$end_date_T="23:59:59";} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $HTML_text.="\n"; + } + +$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER); +$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (preg_match("/-ALL/",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = preg_replace("/,\$/",'',$group_SQL); + $group_SQL_str=$group_SQL; + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$query_date="$query_date_D $query_date_T"; +$end_date="$end_date_D $end_date_T"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; +$short_header=1; + +# require("admin_header.php"); + +$HTML_text.="
"; + +$HTML_text.="
\n"; +$HTML_text.="
Datas:
"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
to
"; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
Campanhas:
"; +$HTML_text.="\n"; + +$HTML_text.="
 \n"; +$HTML_text.="\n"; +$HTML_text.="Mostrar as:
"; +$HTML_text.="\n

"; +$HTML_text.="\n"; +$HTML_text.="
        "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" RELATÓRIOS \n"; +$HTML_text.="\n"; +$HTML_text.="
"; +$HTML_text.="
\n\n"; + +$HTML_text.="
";
+$i=0;
+$group_string='|';
+$group_ct = count($group);
+$JS_text.="\n";
+
+if ($report_display_type=="HTML")
+	{
+	$HTML_text.=$JS_text.$GRAPH;
+	}
+else
+	{
+	$HTML_text.=$ASCII_text;
+	}
+
+$HTML_text.="
"; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_carrier_log_report.php new file mode 100644 index 00000000..ca147f66 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
"; +$MAIN.="
\n"; +$MAIN.="
\n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

"; + +$MAIN.="
to
"; + +$MAIN.="
IP do Servidor:
\n"; +$MAIN.="
\n"; +$MAIN.="

\n"; +$MAIN.="
\n"; +if ($ENVIAR && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
\n";
+	if ($DB) {$MAIN.=$stmt."\n";}
+	if (mysql_num_rows($rslt)>0) {
+		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
+		$MAIN.="+--------------+-------------+---------+\n";
+		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
+		$MAIN.="+--------------+-------------+---------+\n";
+		$total_count=0;
+		while ($row=mysql_fetch_array($rslt)) {
+			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
+			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
+			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
+			$MAIN.="|\n";
+			$total_count+=$row["ct"];
+		}
+		$MAIN.="+--------------+-------------+---------+\n";
+		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
+		$MAIN.="+--------------+-------------+---------+\n\n\n";
+
+		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
+		$rpt_rslt=mysql_query($rpt_stmt, $link);
+		if ($DB) {$MAIN.=$rpt_stmt."\n";}
+
+		if (!$lower_limit) {$lower_limit=1;}
+		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
+		
+		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVIDOR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RESPOSTAED TIME | PHONE NUMBER |\n";
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVIDOR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RESPOSTAED TIME\",\"PHONE NUMBER\"\n";
+
+		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
+			$row=mysql_fetch_array($rpt_rslt);
+			$phone_number=""; $phone_note="";
+
+			if (strlen($row["phone_number"])==0) {
+				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
+				$rslt2=mysql_query($stmt2, $link);
+				$channel=$row["channel"];
+				while ($row2=mysql_fetch_array($rslt2)) {
+					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
+					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
+					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
+				}
+			} else {
+				$phone_number=$row["phone_number"];
+			}
+
+			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
+			if ($i>=$lower_limit && $i<=$upper_limit) {
+				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
+				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
+				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
+				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
+				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
+				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
+				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
+				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
+				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
+				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
+				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
+			}
+		}
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+
+		$carrier_rpt_hf="";
+		$ll=$lower_limit-1000;
+		if ($ll>=1) {
+			$carrier_rpt_hf.="[<<< PREV 1000 records]";
+		} else {
+			$carrier_rpt_hf.=sprintf("%-23s", " ");
+		}
+		$carrier_rpt_hf.=sprintf("%-145s", " ");
+		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
+			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
+		} else {
+			$carrier_rpt_hf.=sprintf("%23s", " ");
+		}
+		$carrier_rpt_hf.="\n";
+		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
+	} else {
+		$MAIN.="*** NO RECORDS FOUND ***\n";
+	}
+	$MAIN.="
\n"; + + $MAIN.="
\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_dialer_inventory_report.php new file mode 100644 index 00000000..3dd08797 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Relatório de Inventário'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Campanhas:
"; +$campaign_span_txt.=""; + +$list_span_txt="Listas:
"; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
"; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
\n";
+
+$rpt_header="";
+####### STAT GENERATION #######
+require("count_functions.inc");
+function GetListCount($list_id, $inventory_ptnstr) 
+	{
+	global $list_start_inv;
+	global $new_count;
+	global $link;
+	global $total_calls;
+	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
+	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
+	$ct_rslt=mysql_query($ct_stmt, $link);
+	$new_count=0; $total_calls=0;
+	while ($ct_row=mysql_fetch_row($ct_rslt)) 
+		{
+		$list_start_inv+=$ct_row[2];
+		$total_calls+=($ct_row[1]*$ct_row[2]);
+		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
+		}
+	}
+
+if ($ENVIAR) 
+	{
+
+	$total_list_start_inv=0;
+	$total_dialable_count=0;
+	$total_dialable_count_nofilter=0;
+	$total_dialable_count_oneoff=0;
+	$total_dialable_count_inactive=0;
+	$total_total_calls=0;
+	$total_average_call_count=0;
+	$total_penetration=0;
+
+	if ($snapshot_time && $report_source=="SNAPSHOT") 
+		{
+		$rpt_header="SNAPSHOT from $snapshot_time\n";
+		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
+		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
+		$rslt=mysql_query($stmt, $link);
+		$shift_SQL_str="";
+		while ($shift_row=mysql_fetch_array($rslt)) 
+			{
+			$shift_data1=explode("|", $shift_row["shift_data"]);
+			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
+		$shift_rslt=mysql_query($shift_stmt, $link);
+		$c=0;
+		while($shift_row=mysql_fetch_array($shift_rslt)) 
+			{
+			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
+			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
+			$rpt_header_SHIFTS_lower.="          |";
+			$rpt_header_Border.="----------+";
+			$shift_ary[$c]=$shift_row["shift_id"];
+			$total_varname="total_".$shift_row["shift_id"];
+			$$total_varname=0;
+			if ($DB > 0) {echo "
-$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPANHAS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
-$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPANHAS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_Border.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPANHAS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPANHA STATUS DE DISC.: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUS RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUS RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
$shift_row[0]
\n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPANHA STATUS DE DISC.: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " STATUS DE DISC.: |$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUS RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUS RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
$shift_row[0]
\n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + $rpt_header.="| Call list | List description | Campanha | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Campanha\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + #### PRINT TOTALS #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + } +$HTML_header.="
\n"; +############################### + +$HTML_text="
\n"; +$HTML_text.="\n"; +$HTML_text.="
\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
Report type:
Campanhas
List
\n"; +$HTML_text.="
 \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
Time setting:
Server
Local
Ignore local campaign call time
(default to 24 hours)
\n"; +$HTML_text.="
\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
Report source:
Snapshot
Real-time
 
$snapshot_span_txt\n"; +$HTML_text.="
\n"; +$HTML_text.="
\n"; +$HTML_text.="           DOWNLOAD | RELATÓRIOS

\n"; +$HTML_text.="\n"; +$HTML_text.="
\n"; +$HTML_text.="
\n\n";
+
+$HTML_text.="$rpt_header";
+$HTML_text.="$rpt_body";
+$HTML_text.="$rpt_footer";
+
+$time_end = microtime(true);
+$ENDtime = date("U");
+$time = $ENDtime - $STARTtime;
+
+$HTML_text.="Executed in $time seconds\n";
+$HTML_text.="
\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_hangup_cause_report.php new file mode 100644 index 00000000..8330c082 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
"; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
\n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

"; + +$MAIN.="
to
"; + +$MAIN.="
IP do Servidor:
\n"; +$MAIN.="
Hangup Cause/Dial Status:
"; +$MAIN.="
"; + +$MAIN.="\n"; +$MAIN.="

\n"; +$MAIN.="
\n"; +if ($ENVIAR && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
\n";
+	if ($DB) {$MAIN.=$stmt."\n";}
+	if (mysql_num_rows($rslt)>0) {
+		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
+		$MAIN.="+--------------+-------------+---------+\n";
+		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
+		$MAIN.="+--------------+-------------+---------+\n";
+		$total_count=0;
+		while ($row=mysql_fetch_array($rslt)) {
+			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
+			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
+			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
+			$MAIN.="|\n";
+			$total_count+=$row["ct"];
+		}
+		$MAIN.="+--------------+-------------+---------+\n";
+		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
+		$MAIN.="+--------------+-------------+---------+\n\n\n";
+
+		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
+		$rpt_rslt=mysql_query($rpt_stmt, $link);
+		if ($DB) {$MAIN.=$rpt_stmt."\n";}
+
+		if (!$lower_limit) {$lower_limit=1;}
+		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
+		
+		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVIDOR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RESPOSTAED TIME | PHONE NUMBER |\n";
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVIDOR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RESPOSTAED TIME\",\"PHONE NUMBER\"\n";
+
+		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
+			$row=mysql_fetch_array($rpt_rslt);
+			$phone_number=""; $phone_note="";
+
+			if (strlen($row["phone_number"])==0) {
+				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
+				$rslt2=mysql_query($stmt2, $link);
+				$channel=$row["channel"];
+				while ($row2=mysql_fetch_array($rslt2)) {
+					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
+					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
+					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
+				}
+			} else {
+				$phone_number=$row["phone_number"];
+			}
+
+			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
+			if ($i>=$lower_limit && $i<=$upper_limit) {
+				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
+				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
+				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
+				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
+				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
+				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
+				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
+				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
+				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
+				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
+				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
+			}
+		}
+		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
+
+		$carrier_rpt_hf="";
+		$ll=$lower_limit-1000;
+		if ($ll>=1) {
+			$carrier_rpt_hf.="[<<< PREV 1000 records]";
+		} else {
+			$carrier_rpt_hf.=sprintf("%-23s", " ");
+		}
+		$carrier_rpt_hf.=sprintf("%-145s", " ");
+		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
+			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
+		} else {
+			$carrier_rpt_hf.=sprintf("%23s", " ");
+		}
+		$carrier_rpt_hf.="\n";
+		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
+	} else {
+		$MAIN.="*** NO RECORDS FOUND ***\n";
+	}
+	$MAIN.="
\n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_inbound_daily_report.php new file mode 100644 index 00000000..fb6f75e2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
"; + +$MAIN.="
\n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ALTERAR | RELATÓRIOS
Show hourly results
\n"; +$MAIN.="
\n\n"; + +$MAIN.="
\n\n";
+
+
+if (!$group)
+	{
+	$MAIN.="\n\n";
+	$MAIN.="POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	echo "$HEADER";
+	require("admin_header.php");
+	echo "$MAIN";
+	}
+
+else
+	{
+	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
+
+	if ($shift == 'AM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
+		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
+		}
+	if ($shift == 'PM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	if ($shift == 'DAYTIME') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+	if ($shift == '10AM-6PM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
+		}
+	if ($shift == '9AM-1AM') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+	if ($shift == '845-1745') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
+		}
+	if ($shift == '1745-100') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
+		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+		}
+
+	$time1 = strtotime($time_BEGIN);
+	$time2 = strtotime($time_END)+1;
+
+	$hpd = ceil(($time2 - $time1) / 3600);
+	if ($hpd<0) {$hpd+=24;}
+
+
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
+	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
+	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
+	$EQdate_ARY =	explode(' ',$query_date_END);
+	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
+	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
+
+	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
+
+	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
+	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
+
+	$DURATIONsec = ($EQepoch - $SQepoch);
+	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
+
+	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
+		{
+		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
+		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
+		$DURATIONday++;
+		}
+
+	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
+	$MAIN.="Selected in-group: $group\n";
+	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
+	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
+	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
+	$CSV_text.="Selected in-group: $group\n";
+	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
+
+	$d=0; $q=0; $hr=0;
+	while ($d < $DURATIONday)
+		{
+		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
+
+		if ($hourly_breakdown) 
+			{
+			$dEQepoch = $dSQepoch+3599;
+			}
+			else
+			{
+			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
+			if ($EQsec < $SQsec)
+				{
+				$dEQepoch = ($dEQepoch + 86400);
+				}
+			}
+
+		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
+		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
+
+	#  || $time_END<=date("H:i:s", $dEQepoch)
+		if ($hr>=($hpd-1) || !$hourly_breakdown) 
+			{
+			$d++;
+			$hr=0;
+			if (date("H:i:s", $dEQepoch)>$time_END) 
+				{
+				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
+				}
+			}
+			else
+			{
+			$hr++;
+			}
+		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
+		$q++;
+
+		}
+	$prev_week=$daySTART[0];
+	$prev_month=$daySTART[0];
+	$prev_qtr=$daySTART[0];
+	##########################################################################
+	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
+
+	### BUILD HOUR:MIN DISPLAY ARRAY ###
+	$i=0;
+	$h=4;
+	$j=0;
+	$Zhour=1;
+	$active_time=0;
+	$hour =		($SQtime_ARY[0] - 1);
+	$startSEC = ($SQsec - 900);
+	$endSEC =	($SQsec - 1);
+	if ($SQtime_ARY[1] > 14) 
+		{
+		$h=1;
+		$hour++;
+		if ($hour < 10) {$hour = "0$hour";}
+		}
+	if ($SQtime_ARY[1] > 29) {$h=2;}
+	if ($SQtime_ARY[1] > 44) {$h=3;}
+	while ($i < 96)
+		{
+		$startSEC = ($startSEC + 900);
+		$endSEC = ($endSEC + 900);
+		$time = '      ';
+		if ($h >= 4)
+			{
+			$hour++;
+			if ($Zhour == '00') 
+				{
+				$startSEC=0;
+				$endSEC=899;
+				}
+			$h=0;
+			if ($hour < 10) {$hour = "0$hour";}
+			$Stime="$hour:00";
+			$Etime="$hour:15";
+			$time = "+$Stime-$Etime+";
+			}
+		if ($h == 1)
+			{
+			$Stime="$hour:15";
+			$Etime="$hour:30";
+			$time = " $Stime-$Etime ";
+			}
+		if ($h == 2)
+			{
+			$Stime="$hour:30";
+			$Etime="$hour:45";
+			$time = " $Stime-$Etime ";
+			}
+		if ($h == 3)
+			{
+			$Zhour=$hour;
+			$Zhour++;
+			if ($Zhour < 10) {$Zhour = "0$Zhour";}
+			if ($Zhour == 24) {$Zhour = "00";}
+			$Stime="$hour:45";
+			$Etime="$Zhour:00";
+			$time = " $Stime-$Etime ";
+			if ($Zhour == '00') 
+				{$hour = ($Zhour - 1);}
+			}
+
+		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
+			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
+			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
+			{
+			$HMdisplay[$j] =	$time;
+			$HMstart[$j] =		$Stime;
+			$HMend[$j] =		$Etime;
+			$HMSepoch[$j] =		$startSEC;
+			$HMEepoch[$j] =		$endSEC;
+
+			$j++;
+			}
+
+		$h++;
+		$i++;
+		}
+
+	$TOTintervals = $q;
+
+
+	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
+	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$ASCII_text.="$stmt\n";}
+	$records_to_grab = mysql_num_rows($rslt);
+	$i=0;
+	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
+	while ($i < $records_to_grab)
+		{
+		$row=mysql_fetch_row($rslt);
+		$qs[$i] = $row[0];
+		$dt[$i] = 0;
+		$ut[$i] = ($row[1] - $SQepochDAY);
+		while($ut[$i] >= $epoch_interval) 
+			{
+			$ut[$i] = ($ut[$i] - $epoch_interval);
+			$dt[$i]++;
+			}
+		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
+			{
+			$dt[$i] = ($dt[$i] - 1);
+			}
+		$ls[$i] = $row[2];
+		$st[$i] = $row[3];
+		$tr[$i] = $row[4];
+		$at[$i] = $row[5]; # Actual time
+
+		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
+
+		$i++;
+		}
+
+	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
+	$MT[0]='0';
+	$totCALLS=0;
+	$totDROPS=0;
+	$totQUEUE=0;
+	$totCALLSsec=0;
+	$totDROPSsec=0;
+	$totQUEUEsec=0;
+	$totCALLSmax=0;
+	$totDROPSmax=0;
+	$totQUEUEmax=0;
+	$totCALLSdate=$MT;
+	$totDROPSdate=$MT;
+	$totQUEUEdate=$MT;
+	$qrtCALLS=$MT;
+	$qrtDROPS=$MT;
+	$qrtQUEUE=$MT;
+	$qrtCALLSsec=$MT;
+	$qrtDROPSsec=$MT;
+	$qrtQUEUEsec=$MT;
+	$qrtCALLSavg=$MT;
+	$qrtDROPSavg=$MT;
+	$qrtQUEUEavg=$MT;
+	$qrtCALLSmax=$MT;
+	$qrtDROPSmax=$MT;
+	$qrtQUEUEmax=$MT;
+
+	$totABANDONSdate=$MT;
+	$totRESPOSTASdate=$MT;
+
+	$totRESPOSTAS=0;
+	$totABANDONS=0;
+	$totRESPOSTASsec=0;
+	$totABANDONSsec=0;
+	$totRESPOSTASspeed=0;
+
+	$FtotRESPOSTAS=0;
+	$FtotABANDONS=0;
+	$FtotRESPOSTASsec=0;
+	$FtotABANDONSsec=0;
+	$FtotRESPOSTASspeed=0;
+
+	$j=0;
+	while ($j < $TOTintervals)
+		{
+	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
+	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
+	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
+	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
+	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
+		$totABANDONSdate[$j]=0;
+		$totABANDONSsecdate[$j]=0;
+		$totRESPOSTASdate[$j]=0;
+		$totRESPOSTASsecdate[$j]=0;
+		$totRESPOSTASspeeddate[$j]=0;
+		$i=0;
+		while ($i < $records_to_grab)
+			{
+			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
+				{
+				$totCALLS++;
+				$totCALLSsec = ($totCALLSsec + $ls[$i]);
+				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
+	#			$qrtCALLS[$j]++;
+	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
+	#			$dtt = $dt[$i];
+				$totCALLSdate[$j]++;
+				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
+				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
+				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
+					{
+					$totABANDONSdate[$j]++;
+					$totABANDONSsecdate[$j]+=$ls[$i];
+					$FtotABANDONS++;
+					$FtotABANDONSsec+=$ls[$i];
+					}
+					else 
+					{
+					$totRESPOSTASdate[$j]++;
+					$totRESPOSTASsecdate[$j]+=($ls[$i]-$qs[$i]-15);
+					$totRESPOSTASspeeddate[$j]+=$qs[$i];
+					$FtotRESPOSTAS++;
+					$FtotRESPOSTASsec+=($ls[$i]-$qs[$i]-15);
+					$FtotRESPOSTASspeeddate+=$qs[$i];
+					}
+				if (ereg('DROP',$st[$i])) 
+					{
+					$totDROPS++;
+					$totDROPSsec = ($totDROPSsec + $ls[$i]);
+					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
+	#				$qrtDROPS[$j]++;
+	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
+					$totDROPSdate[$j]++;
+	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
+	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
+					}
+				if ($qs[$i] > 0) 
+					{
+					$totQUEUE++;
+					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
+					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
+	#				$qrtQUEUE[$j]++;
+	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
+					$totQUEUEdate[$j]++;
+	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
+	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
+					}
+	/*
+				if ($qs[$i] == 0) {$hd__0[$j]++;}
+				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
+				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
+				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
+				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
+				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
+				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
+				if ($qs[$i] > 120) {$hd121[$j]++;}
+	*/
+				}
+			
+			$i++;
+			}
+
+		$j++;
+		}
+
+
+	###################################################
+	### TOTALS SUMMARY SECTION ###
+	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
+	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
+	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | RESPOSTA | TALK   | TALK       | WRAP       | CALL       |\n";
+	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | RESPOSTAED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
+	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
+	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
+	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"RESPOSTA\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
+	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"RESPOSTAED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
+
+	##########################
+	$JS_text="\n";
+
+	if ($report_display_type=="HTML") 
+		{
+		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
+		}
+	else
+		{
+		$MAIN.=$ASCII_text;
+		}
+
+	if ($hi_hour_count < 1)
+		{$hour_multiplier = 0;}
+	else
+		{$hour_multiplier = (20 / $hi_hour_count);}
+	if ($hi_hold_count < 1)
+		{$hold_multiplier = 0;}
+	else
+		{$hold_multiplier = (20 / $hi_hold_count);}
+
+
+	$ENDtime = date("U");
+	$RUNtime = ($ENDtime - $STARTtime);
+	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
+	$MAIN.="
\n"; + $MAIN.="
\n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_server_performance.php index 915c1eb6..997e0ce3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?>
- +
+ \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_team_performance_detail.php new file mode 100644 index 00000000..0518b7f7 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Detalhes'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
"; + +$HTML_text.="
\n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
Datas:
"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Período:
\n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
to
"; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
Campanhas:
"; +$HTML_text.="\n"; + +$HTML_text.="
Teams/Grupos de Usuário:
"; +$HTML_text.="\n"; +$HTML_text.="
Show additional statuses:
"; +$HTML_text.="
\n"; +$HTML_text.="Mostrar as:
"; +$HTML_text.="\n

"; +$HTML_text.="\n"; +$HTML_text.="
        "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" RELATÓRIOS \n"; +$HTML_text.="\n"; +$HTML_text.="
"; +$HTML_text.="
\n\n"; + +if ($ENVIAR=="ENVIAR") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
";
+	$total_average_sale_time=0;
+	$total_average_contact_time=0;
+	$total_talk_time=0; 
+	$total_system_time=0; 
+	$total_calls=0;	
+	$total_leads=0;
+	$total_contacts=0;
+	$total_sales=0;
+	$total_inc_sales=0;
+	$total_cnc_sales=0;
+	$total_callbacks=0;
+	$total_stcall=0;
+	for ($q=0; $q".$call_status[$q]."";
+	}
+	$total_graph_stats[]="";
+	$max_totalcalls=1;
+	$max_totalleads=1;
+	$max_totalcontacts=1;
+	$max_totalcontactratio=1;
+	$max_totalsystemtime=1;
+	$max_totaltalktime=1;
+	$max_totalsales=1;
+	$max_totalsalesleadsratio=1;
+	$max_totalsalescontactsratio=1;
+	$max_totalsalesperhour=1;
+	$max_totalincsales=1;
+	$max_totalcancelledsales=1;
+	$max_totalcallbacks=1;
+	$max_totalfirstcall=1;
+	$max_totalavgsaletime=1;
+	$max_totalavgcontacttime=1;
+	$TOTALGRAPH="

"; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

 


"; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALSALES_graph=$TOTALGRAPH_header.""; + $TOTALSALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

CALL CENTER TOTAL
USERCALLS
LEADS
CONTACTS
CONTACT RATIO
SYSTEM TIME
TALK TIME
SALES
SALES TO LEADS RATIO
SALES TO CONTACTS RATIO
SALES PER HOUR
INCOMPLETE SALES
CANCELLED SALES
CALLBACKS
FIRST CALLS
AVG SALE TIME
AVG CONTACT TIME
"; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

 


"; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALS ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
TEAM: $user_group[$i] - $group_name
USERCALLS
LEADS
CONTACTS
CONTACT RATIO
SYSTEM TIME
TALK TIME
SALES
SALES TO LEADS RATIO
SALES TO CONTACTS RATIO
SALES PER HOUR
INCOMPLETE SALES
CANCELLED SALES
CALLBACKS
FIRST CALLS
AVG SALE TIME
AVG CONTACT TIME
".$graph_stats[$d][0]."".$graph_stats[$d][1]."
".$graph_stats[$d][0]."".$graph_stats[$d][2]."
".$graph_stats[$d][0]."".$graph_stats[$d][3]."
".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
".$graph_stats[$d][0]."".$graph_stats[$d][7]."
".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
".$graph_stats[$d][0]."".$graph_stats[$d][10]."
".$graph_stats[$d][0]."".$graph_stats[$d][11]."
".$graph_stats[$d][0]."".$graph_stats[$d][12]."
".$graph_stats[$d][0]."".$graph_stats[$d][13]."
".$graph_stats[$d][0]."".$graph_stats[$d][14]."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
TOTAL:".trim($group_calls)."
"; + $LEADS_graph.="
TOTAL:".trim($group_leads)."
"; + $CONTACTS_graph.="
TOTAL:".trim($group_contacts)."
"; + $CONTACTRATIO_graph.="
TOTAL:".trim($group_contact_ratio)."%
"; + $SYSTEMTIME_graph.="
TOTAL:".sec_convert($group_system_time,'H')."
"; + $TALKTIME_graph.="
TOTAL:".sec_convert($group_talk_time,'H')."
"; + $SALES_graph.="
TOTAL:".trim($group_sales)."
"; + $SALESLEADSRATIO_graph.="TOTAL:".trim($group_sales_ratio)."%"; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALSYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALSALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALSALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALSALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALSYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALSALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALSALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALSALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALSALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALSYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALSALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALSALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALSALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALSALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADall.php index cceb0a6b..d43a9c81 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -61,10 +61,25 @@ # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents # 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.2.0-52'; -$build = '100303-0930'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -126,11 +141,26 @@ if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} +$report_name = 'Tempo Real Main Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -139,13 +169,25 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -164,7 +206,7 @@ if (!isset($with_inbound)) } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -232,7 +274,6 @@ $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); $epochTWENTYFOURhoursAGO = ($STARTtime - 86400); $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); - $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -243,13 +284,99 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -260,7 +387,43 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -273,29 +436,58 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -307,9 +499,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -317,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -351,6 +569,20 @@ while ($groups_to_print > $o) } $select_list .= ""; $select_list .= "
(Para selecionar mais de 1 campanha, aperte Ctrl e clique)"; + +$select_list .= "

Select Grupos de Usuário:
"; +$select_list .= ""; + $select_list .= ""; $select_list .= "Fechar Painel

"; $select_list .= ""; @@ -436,6 +668,39 @@ $select_list .= "
"; + $select_list .= "Mostrar Estatísticas Presets: < - - -\n"; + // function to display in-groups selected for a specific agent + function ingroup_info(agent_user,count) + { + var cursorheight = (document.REALTIMEform.cursorY.value - 0); + var newheight = (cursorheight + 10); + document.getElementById("agent_ingroup_display").style.top = newheight; + // alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user); + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + var monitorQuery = "source=realtime&function=agent_ingroup_info&stage=change&user=" + user + "&pass=" + pass + "&agent_user=" + agent_user; + xmlhttp.open('POST', 'non_agent_api.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(monitorQuery); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var Xoutput = null; + Xoutput = xmlhttp.responseText; + var regXFerr = new RegExp("ERROR","g"); + if (Xoutput.match(regXFerr)) + {alert(xmlhttp.responseText);} + else + { + document.getElementById("agent_ingroup_display").visibility = "visible"; + document.getElementById("agent_ingroup_display").innerHTML = Xoutput; + } + } + } + delete xmlhttp; + } + } + + // function to display in-groups selected for a specific agent + function hide_ingroup_info() + { + document.getElementById("agent_ingroup_display").visibility = "hidden"; + document.getElementById("agent_ingroup_display").innerHTML = ''; + } + + + + + + \n"; + + echo "\n"; + echo"\n"; + echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + + } $stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; $rslt=mysql_query($stmt, $link); @@ -738,58 +1023,55 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; -echo "\n"; -echo"\n"; -echo "Tempo Real Report: $group\n"; - $short_header=1; - - require("admin_header.php"); - -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"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Tempo Real Report                                                                               \n"; -echo "\n"; -echo "
\n"; -echo "Escolher Opções do Relat."; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       ALTERAR | \n"; - } -else - { - echo "       ALTERAR | \n"; - } -echo "SUMMARY \n"; -echo "\n\n"; + echo ""; } -# http://svn.eflo.net:40080/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) @@ -1166,7 +1483,7 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } @@ -1290,11 +1607,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1305,15 +1624,15 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1341,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1377,6 +1697,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1397,7 +1722,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1407,6 +1732,10 @@ else $DIALorder = "Mesclagem de Lista: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Tempo Real Report                                                                               \n"; + echo "\n"; + echo "
\n"; + echo "Escolher Opções do Relat."; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "SLOW | "; + echo "GO"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ALTERAR | \n"; + } + else + { + echo "       ALTERAR | \n"; + } + echo "SUMMARY \n"; + echo "\n\n"; + } if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} @@ -831,10 +1113,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -1153,7 +1434,43 @@ if ($CARRIERstats > 0) $CARRIERstatsHTML .= "
"; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
  AGENTE DIAL PRESETS:     PRESET NAMES                 CALLS  
            $row[0]     $row[1]  
no log entries
"; + $PRESETstatsHTML .= "
"; echo ""; @@ -1418,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1441,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1461,8 +1794,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1481,63 +1861,67 @@ echo ""; echo ""; echo "
DIAL NÍVEL:  $DIALlev   
- min   MAX NÍVEL:  $maxDIALlev   $min_link  MAX NÍVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
HOPPER NÍVEL:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     DROPPED / RESPOSTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUS:  $DIALstatuses     ORDER:  $DIALorder    
AGENTE AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
"; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       ESCONDER GRUPO DE USUÁRIOS"; - } -else - { - echo "       VIEW GRUPO DE USUÁRIOS"; - } -if ($SERVdisplay>0) - { - echo "       ESCONDER SERVIDOR INFO"; - } -else - { - echo "       MOSTRAR SERVIDOR INFO"; - } -if ($CALLSdisplay>0) - { - echo "       ESCONDER WAITING CALLS"; - } -else - { - echo "       MOSTRAR WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       ESCONDER GRUPO DE USUÁRIOS"; + } + else + { + echo "       VIEW GRUPO DE USUÁRIOS"; + } + if ($SERVdisplay>0) + { + echo "       ESCONDER SERVIDOR INFO"; + } + else + { + echo "       MOSTRAR SERVIDOR INFO"; + } + if ($CALLSdisplay>0) + { + echo "       ESCONDER WAITING CALLS"; + } + else + { + echo "       MOSTRAR WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       ESCONDER IN-GROUP STATS"; + } + else + { + echo "       MOSTRAR IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       ESCONDER PHONES"; + } + else + { + echo "       MOSTRAR PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       ESCONDER CUSTPHONES"; + } + else + { + echo "       MOSTRAR CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       ESCONDER IN-GROUP STATS"; - } -else - { - echo "       MOSTRAR IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       ESCONDER PHONES"; - } -else - { - echo "       MOSTRAR PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       ESCONDER CUSTPHONES"; - } -else - { - echo "       MOSTRAR CUSTPHONES"; - } echo "
"; @@ -1583,7 +1967,7 @@ if ($campaign_allow_inbound > 0) { if (eregi('ALL-ACTIVE',$group_string)) { - $stmt="select closer_campaigns from vicidial_campaigns $group_SQLwhere"; + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; $rslt=mysql_query($stmt, $link); $closer_campaigns=""; while ($row=mysql_fetch_row($rslt)) @@ -1627,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1765,6 +2165,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1794,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; +if ($RTajax > 0) + {$HTuser = " USER ";} if ($UidORname>0) { - $HTuser .= "MOSTRAR ID "; + if ($RTajax > 0) + {$HTuser .= "MOSTRAR ID ";} + else + { + $HTuser .= "MOSTRAR ID "; + } } else { - $HTuser .= "MOSTRAR NAME"; + if ($RTajax > 0) + {$HTuser .= "MOSTRAR NAME";} + else + { + $HTuser .= "MOSTRAR NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " GRUPO DE USUÁRIOS |"; +$HTusergroup = " GRUPO DE USUÁRIOS |"; +if ($RTajax > 0) + {$HTusergroup = " GRUPO DE USUÁRIOS |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1826,9 +2243,13 @@ $HTserver_ip = " SERVIDOR IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVIDOR IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPANHA |"; +$HTcampaign = " CAMPANHA |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPANHA |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1877,9 +2298,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1903,12 +2331,16 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -1935,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -1953,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -2133,7 +2594,7 @@ $calls_to_list = mysql_num_rows($rslt); {$CM='A';} else { - if (eregi("ENTRANTE",$comments)) + if (eregi("INBOUND",$comments)) {$CM='I';} else {$CM='M';} @@ -2176,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2205,7 +2667,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2216,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2248,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2265,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2293,14 +2763,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " Carga do Sistema Average: $load_ave\n\n"; + $Aecho .= " Carga do Sistema Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2315,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2328,6 +2810,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE agentes em chamadas perdidas      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
";
 		echo "";
@@ -2340,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt);
 	echo "
$Cecho";
 	}
 
+echo "
"; + +if ($RTajax < 1) + { + echo "
"; + } ?> - -
diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php index 652f014e..9d347951 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -16,10 +16,15 @@ # 80525-1040 - Added IVR status summary display for inbound calls # 90310-2119 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100709-1806 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -31,24 +36,64 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='MOSTRAR ALL CAMPANHAS';} + +$report_name = 'Tempo Real Campanha Summary'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -56,13 +101,49 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -74,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "Tempo Real All Campanhas Summary\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
"; +$MAIN.="
"; +$MAIN.=""; +$MAIN.="
"; -echo "Tempo Real All Campanhas Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; +$MAIN.="Tempo Real All Campanhas Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="SLOW | "; +$MAIN.="GO "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + $MAIN.="+ VIEW MORE SETTINGS"; } else { - echo "- VIEW LESS SETTINGS"; + $MAIN.="- VIEW LESS SETTINGS"; } -echo "       RELATÓRIOS"; -echo "

\n\n"; +$MAIN.="      DOWNLOAD | RELATÓRIOS"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
DIAL NÍVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
"; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"DIAL NÍVEL:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTER:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX NÍVEL:\",\"$maxDIALlev\",\"DROPPED MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"DIAL TIMEOUT:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"DIALABLE LEADS:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"AVG AGENTS:\",\"$agentsONEMIN\",\"MÉTODO DE DISC.:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"HOPPER NÍVEL:\",\"$HOPlev\",\"DROPPED / RESPOSTAED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"STATUS:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDER:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"AGENTE AVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
DIAL NÍVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  MAX NÍVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
  MAX NÍVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     MÉTODO DE DISC.:  $DIALmethod    
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     MÉTODO DE DISC.:  $DIALmethod    
HOPPER NÍVEL:  $HOPlev     DROPPED / RESPOSTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUS:  $DIALstatuses    
HOPPER NÍVEL:  $HOPlev     DROPPED / RESPOSTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUS:  $DIALstatuses    
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +$MAIN.="
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +$MAIN.="
"; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
"; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
AGENTE AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
"; ### Header finish @@ -307,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -341,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo "SEM CHAMADAS EM ESPERA\n"; + $MAIN.="SEM CHAMADAS EM ESPERA\n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -366,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -419,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
\n"; + $MAIN.="\n
\n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
+		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
+		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
+		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
+		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
+		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
+				
+		$MAIN.="
";
+		$MAIN.="";
 	}
 	else
 	{
-	echo " NO AGENTS ON CALLS
\n"; + $MAIN.=" NO AGENTS ON CALLS
\n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -442,16 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
"; +$MAIN.="
\n\n
"; -echo "
\n\n"; $k++; } +$MAIN.="\n\n
"; +$MAIN.="\n"; +$MAIN.="
\n"; + +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } ?> -
- - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonpark.php index d32cf6b6..2d1aaafb 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Agentes Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Agentes Time On Entrada Calls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin.php index 209385a8..9ae6c4c4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,6 +103,13 @@ $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, Tempo Real Main Report, Tempo Real Campanha Summary , Entrada Report, Entrada Service Level Report, Resumen horario de entrada Informe, Entrada Daily Report, Entrada DID Report, Entrada IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listas Status da Campanha Report, Campanha Status List Report, Exportar Relatórios de Chamadas, Exportação lidera Relatório , Agente Tiempo Detalle, Agent Status Detalhes, Agent Performance Detalhes, Team Performance Detalhes, Single Agent Daily , UsuárioRelógio Ponto Report, Grupo do UsuárioRelógio Ponto Status Report, UsuarioRelógio Ponto Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estatísticas de Usuário, Usuário Planilha de Tempo, Download List, Dialer Relatório de Inventário, Maximum System Stats, Maximum Stats Detalhes, Search Leads Logs'; + +$UGreports = 'ALL RELATÓRIOS, NONE, Tempo Real Main Report, Tempo Real Campanha Summary , Entrada Report, Entrada Service Level Report, Resumen horario de entrada Informe, Entrada Daily Report, Entrada DID Report, Entrada IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listas Status da Campanha Report, Campanha Status List Report, Exportar Relatórios de Chamadas , Exportação lidera Relatório , Agente Tiempo Detalle, Agent Status Detalhes, Agent Performance Detalhes, Team Performance Detalhes, Single Agent Daily , UsuárioRelógio Ponto Report, Grupo do UsuárioRelógio Ponto Status Report, UsuarioRelógio Ponto Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estatísticas de Usuário, Usuário Planilha de Tempo, Download List, Dialer Relatório de Inventário, Custom Relatórios Links, CallCard Search, Maximum System Stats, Maximum Stats Detalhes, Search Leads Logs'; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -321,16 +338,16 @@ 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_fast_refrescar"])) {$enable_fast_refrescar=$_GET["enable_fast_refrescar"];} + elseif (isset($_POST["enable_fast_refrescar"])) {$enable_fast_refrescar=$_POST["enable_fast_refrescar"];} 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["fast_refrescar_rate"])) {$fast_refrescar_rate=$_GET["fast_refrescar_rate"];} + elseif (isset($_POST["fast_refrescar_rate"])) {$fast_refrescar_rate=$_POST["fast_refrescar_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"];} @@ -595,8 +612,8 @@ 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["campaign_stats_refrescar"])) {$campaign_stats_refrescar=$_GET["campaign_stats_refrescar"];} + elseif (isset($_POST["campaign_stats_refrescar"])){$campaign_stats_refrescar=$_POST["campaign_stats_refrescar"];} 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"];} @@ -687,6 +704,8 @@ 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"];} @@ -1167,9 +1186,553 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n 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_refrescar"])) {$admin_modify_refrescar=$_GET["admin_modify_refrescar"];} + elseif (isset($_POST["admin_modify_refrescar"])) {$admin_modify_refrescar=$_POST["admin_modify_refrescar"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + + +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) { @@ -1179,25 +1742,49 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1265,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_refrescar = ereg_replace("[^0-9]","",$enable_fast_refrescar); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_refrescar_rate = ereg_replace("[^0-9]","",$fast_refrescar_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1299,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1307,7 +1893,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1951,70 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_refrescar = ereg_replace("[^0-9]","",$admin_modify_refrescar); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1397,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_refrescar = ereg_replace("[^NY]","",$campaign_stats_refrescar); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1433,6 +2083,37 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +2161,24 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +2193,8 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +2206,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1582,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1610,11 +2310,10 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -1632,6 +2331,78 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2416,47 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,53 +2465,96 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -1716,7 +2562,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,8 +2578,19 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); + ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -1761,7 +2617,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,8 +2627,14 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -1783,6 +2645,11 @@ if ($non_latin < 1) # $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 @@ -2046,46 +2913,187 @@ else # 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 -# 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones -# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links +# 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 # + # 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.2.0-236'; -$build = '100413-2328'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_refrescar_set=0; +$modify_footer_refrescar=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2100,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refrescar,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2111,6 +3119,10 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; + $SSadmin_modify_refrescar = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2122,84 +3134,189 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_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 ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($SSwebroot_writable > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2208,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_refrescar_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2221,13 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Incluir Campanha";} if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copiar Campanha";} if ($ADD==111) {$hh='lists'; echo "Incluir Lista";} if ($ADD==121) {$hh='lists'; echo "Novo Bloqueio";} +if ($ADD==171) {$hh='ingroups'; echo "Números do Grupo Filtro de telefone";} if ($ADD==1111) {$hh='ingroups'; echo "Incluir Grupo de Entrada";} if ($ADD==1211) {$hh='ingroups'; echo "Copiar Grupo de Entrada";} if ($ADD==1311) {$hh='ingroups'; echo "IncluirDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopiarDID";} if ($ADD==1511) {$hh='ingroups'; echo "Incluir Menu de Chamada";} if ($ADD==1611) {$hh='ingroups'; echo "Copiar Menu de Chamada";} +if ($ADD==1711) {$hh='ingroups'; echo "Adicionar Grupo de telefone Filtro";} if ($ADD==11111) {$hh='remoteagent'; echo "Incluir Usuário Remoto";} +if ($ADD==12111) {$hh='remoteagent'; echo "Adicionar Grupo de Extensão";} if ($ADD==111111) {$hh='usergroups'; echo "Incluir Grupo de Usuários";} if ($ADD==1111111) {$hh='scripts'; echo "Incluir Script";} if ($ADD==11111111) {$hh='filters'; echo "Incluir Novo Filtro";} @@ -2240,9 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "INCLUIR ALIAS DE GRUPO" if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NOVO SERVIDOR";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "INCLUIR TEMPLATE CONF";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Incluir Operadora";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD CARRIER COPIADO";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRADA";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW contestador";} +if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "ADD NEW LABEL TELA";} +if ($ADD==191111111111) {$hh='admin'; $sh='cts'; echo "Adicionar novo contato";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NOVA CONFERÊNCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Novo usuário";} @@ -2256,6 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Novo Status de Disc. Alt. if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Novo Código de Pausa";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem Adicionado";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mesclagem de Listas Incluído";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Predefinição Campanha Adicionado";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Modificar Campanha CódigoDeÁrea CID";} if ($ADD==211) {$hh='lists'; echo "Nova Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Novo Grupo de Entrada";} if ($ADD==2011) {$hh='ingroups'; echo "Inclusão de Grupo de Entrada Copiada";} @@ -2263,7 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Incluir DDR";} if ($ADD==2411) {$hh='ingroups'; echo "Inclusão de DDR por cópia";} if ($ADD==2511) {$hh='ingroups'; echo "Novo Menu de Chamada";} if ($ADD==2611) {$hh='ingroups'; echo "Novo Menu de Chamada";} +if ($ADD==2711) {$hh='ingroups'; echo "Grupo Telefone novo filtro";} if ($ADD==21111) {$hh='remoteagent'; echo "Novo Agente Remoto";} +if ($ADD==22111) {$hh='remoteagent'; echo "Adição de Extensão de Novo Grupo";} if ($ADD==211111) {$hh='usergroups'; echo "Novo Grupo de Usuários";} if ($ADD==2111111) {$hh='scripts'; echo "Novo Script";} if ($ADD==21111111) {$hh='filters'; echo "Novo Filtro";} @@ -2277,9 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADICIONANDO SERVIDOR"; if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIONANDO TRUNK DO SERVIDOR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "INCLUINDO TEMPLATE CONF";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "INCLUIR OPERADORA";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADICIONANDO CARRIER COPIADO";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "AGREGAR NUEVO TTS ENTRADA";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "AGREGAR NUEVO contestador";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "ADICIONANDO LABEL TELA NOVA";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "ADICIONAR CONTATO NOVO";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADICIONANDO CONFERÊNCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "INCLUINDO STATUS DE SISTEMA DO VICIDIAL";} @@ -2298,6 +3448,8 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Mesclagem de Listaes";} if ($SUB=='20A') {echo " - Pesquisa";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2310,6 +3462,8 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Mesclagem de Listaes";} if ($SUB=='20A') {echo " - Pesquisa";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Status da Campanha";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Atalhos da Campanha";} @@ -2318,11 +3472,16 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Status de Disc. Alt. da C if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos de Pausa de Agente da Campanha";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem da Campanha";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mesclagem de Listas";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Presets de campanha";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "CódigoDeÁrea Campanha CID";} if ($ADD==311) {$hh='lists'; echo "Alterar Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Alterar Groupo de Entrada";} if ($ADD==3311) {$hh='ingroups'; echo "AlterarDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Modificar DID RA Extensão Substitui";} if ($ADD==3511) {$hh='ingroups'; echo "Alterar Menu de Chamada";} +if ($ADD==3711) {$hh='ingroups'; echo "Modificar Grupo Telefone Filtro";} if ($ADD==31111) {$hh='remoteagent'; echo "Alterar Agentes Remotos";} +if ($ADD==32111) {$hh='remoteagent'; echo "Modificar Grupo de Extensão";} if ($ADD==311111) {$hh='usergroups'; echo "Alterar Grupos de Usuários";} if ($ADD==3111111) {$hh='scripts'; echo "Alterar Script";} if ($ADD==31111111) {$hh='filters'; echo "Alterar Filtro";} @@ -2339,6 +3498,8 @@ if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "ALTERAR OPERADORA";} if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "MODIFICAR LABEL TELA";} +if ($ADD==391111111111) {$hh='admin'; $sh='cts'; echo "MODIFICAR CONTATO";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ALTERAR CONFERÊNCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ALTERAR CONFIG. DE SISTEMA DO VICIDIAL";} @@ -2356,12 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Alterar Reciclagem de reg if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Alterar Código de Pausa";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Alterar Configurações de CQ";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Alterar Mesclagem de Listas";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modificar Predefinição Campanha";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Alterar Campanha de Pesquisa";} if ($ADD==411) {$hh='lists'; echo "Alterar Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Alterar Groupo de Entrada";} if ($ADD==4311) {$hh='ingroups'; echo "AlterarDID";} if ($ADD==4511) {$hh='ingroups'; echo "Alterar Menu de Chamada";} +if ($ADD==4711) {$hh='ingroups'; echo "Modificar Grupo Telefone Filtro";} if ($ADD==41111) {$hh='remoteagent'; echo "Alterar Agentes Remotos";} +if ($ADD==42111) {$hh='remoteagent'; echo "Modificar Grupo de Extensão";} if ($ADD==411111) {$hh='usergroups'; echo "Alterar Grupos de Usuários";} if ($ADD==4111111) {$hh='scripts'; echo "Alterar Script";} if ($ADD==41111111) {$hh='filters'; echo "Alterar Filtro";} @@ -2378,6 +3542,8 @@ if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "ALTERAR OPERADORA";} if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "MODIFICAR LABEL TELA";} +if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo "MODIFICAR CONTATO";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ALTERAR CONFERÊNCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ALTERAR CONFIG. DE SISTEMA DO VICIDIAL";} @@ -2392,7 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "RemoverList";} if ($ADD==5111) {$hh='ingroups'; echo "RemoverIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "RemoverDID";} if ($ADD==5511) {$hh='ingroups'; echo "Remover Menu de Chamada";} +if ($ADD==5711) {$hh='ingroups'; echo "Excluir Grupo Telefone Filtro";} if ($ADD==51111) {$hh='remoteagent'; echo "Apagar Usuários Remotos";} +if ($ADD==52111) {$hh='remoteagent'; echo "Excluir Grupo de Extensão";} if ($ADD==511111) {$hh='usergroups'; echo "Apagar Usuários Group";} if ($ADD==5111111) {$hh='scripts'; echo "Apagar Scripts";} if ($ADD==51111111) {$hh='filters'; echo "Apagar Filtro";} @@ -2408,6 +3576,8 @@ if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "REMOVER OPERADORA";} if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "Suprimir a etiqueta TELA";} +if ($ADD==591111111111) {$hh='admin'; $sh='cts'; echo "Excluir contato";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "RemoverUsuário";} @@ -2419,11 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Remover Status de Disc. A if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Apagar Código de Pausa";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem Removido";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Listas de Campanha Removida";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Predefinição Campanha Removido";} if ($ADD==611) {$hh='lists'; echo "RemoverList";} if ($ADD==6111) {$hh='ingroups'; echo "RemoverIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "RemoverDID";} if ($ADD==6511) {$hh='ingroups'; echo "Remover Menu de Chamada";} +if ($ADD==6711) {$hh='ingroups'; echo "Excluir Grupo Telefone Filtro";} if ($ADD==61111) {$hh='remoteagent'; echo "Apagar Usuários Remotos";} +if ($ADD==62111) {$hh='remoteagent'; echo "Excluir Grupo de Extensão";} if ($ADD==611111) {$hh='usergroups'; echo "Apagar Usuários Group";} if ($ADD==6111111) {$hh='scripts'; echo "Apagar Scripts";} if ($ADD==61111111) {$hh='filters'; echo "Apagar Filtro";} @@ -2440,6 +3613,8 @@ if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "REMOVER OPERADORA";} if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "Suprimir a etiqueta TELA";} +if ($ADD==691111111111) {$hh='admin'; $sh='cts'; echo "Excluir contato";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Total de Registros Discáveis";} @@ -2457,8 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campanhas";} if ($ADD==100) {$hh='lists'; echo "Listas";} if ($ADD==1000) {$hh='ingroups'; echo "Groupos de Entrada";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Modificar DID RA Extensão Substitui";} if ($ADD==1500) {$hh='ingroups'; echo "Menus de Chamada";} +if ($ADD==1700) {$hh='ingroups'; echo "Filtro de Grupos de telefone";} if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} +if ($ADD==12000) {$hh='remoteagent'; echo "Grupos de Extensão";} if ($ADD==100000) {$hh='usergroups'; echo "Grupos de Usuário";} if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} if ($ADD==10000000) {$hh='filters'; echo "Filtros";} @@ -2474,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "LISTA DE OPERADORAS" if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS LISTA INSCRITOS";} if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "MÚSICA EN ESPERA LISTA DE ENTRADA";} if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "LISTA DE CORREO DE VOZ CAJAS";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "Lista de rótulos TELA";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "LISTA DE CONTATOS";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERÊNCIAS";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERÊNCIAS";} if ($ADD==550) {$hh='users'; echo "Formulário de Pesquisa";} @@ -2482,11 +3662,19 @@ if ($ADD==660) {$hh='users'; echo "RESULTADOS DA PESQUISA";} if ($ADD==661) {$hh='users'; echo "RESULTADO DA PESQUISA DE RAMAIS";} if ($ADD==99999) {$hh='users'; echo "AJUDA";} if ($ADD==999999) {$hh='reports'; echo "RELATÓRIOS";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "MUDAR SENHA";} +if ($ADD==999996) {$hh='reports'; echo "Instalação inicial BEM-VINDO";} +if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT LICENÇA MARCA";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "STATS RESUMO";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM STATS RESUMO";} -if ( ($ADD>9) && ($ADD < 99998) ) + +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; @@ -2501,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; @@ -2517,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -2531,30 +3719,17 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPANHA</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $RANKcampaigns_list="<tr><td>CAMPANHA</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) @@ -2571,18 +3746,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$calls_today=0; $SELECT_campaign_rank=0; $SELECT_campaign_grade=1; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { $stmt_grp_values=''; @@ -2590,30 +3766,37 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$campaign_rank = $SELECT_campaign_rank;} + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2621,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPANHAS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -2651,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -2664,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2675,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2714,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2722,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>ENTRANTE GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2745,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -2754,40 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$group_rank = $SELECT_group_rank;} + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2820,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -2828,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -2841,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2856,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -2871,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPANHAS-"'; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPANHAS-"';} $qc_campaigns_value=''; $qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPANHAS-"'; $qc_groups_value=''; @@ -2881,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPANHAS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPANHAS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPANHAS-"; + } } if (eregi('ALL-CAMPANHAS',$qc_campaigns[$p])) { @@ -2896,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPANHAS - USUÁRIOS PODEM VER QUALQUER CAMPANHA</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPANHAS - USUÁRIOS PODEM VER QUALQUER CAMPANHA</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPANHAS - USUÁRIOS PODEM FAZER CQ EM QUALQUER CAMPANHA</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - USUÁRIOS PODEM FAZER CQ EM QUALQUER GRUPO DE ENTRADA</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2934,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -2966,10 +4188,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +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 from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2978,7 +4200,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n"; $o++; } } @@ -3017,7 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Senha -</B> Este campo é onde deve ser configurada a senha do usuário do VICIDIAL. Deve ter pelo menos 2 caracteres de comprimento. + <B>Senha -</B> Este campo é onde deve ser configurada a senha do usuário do VICIDIAL. Deve ter pelo menos 2 caracteres de comprimento. Uma palavra-passe utilizador forte deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número. + + <BR> + <A NAME="vicidial_users-force_change_password"> + <BR> + <B>Forçar alteração de senha -</B> Se esta opção estiver definida para Y, então o usuário será solicitado a alterar sua senha na próxima vez que efetuar login na página de administração. O padrão é N. <BR> <A NAME="vicidial_users-full_name"> @@ -3049,6 +4276,11 @@ if ($ADD==99999) <BR> <B>Ativo - </B> Este campo define se o usuário está ativo no sistema e pode usar os recursos do VICIDIAL. O padrão é Y + <BR> + <A NAME="vicidial_users-voicemail_id"> + <BR> + <B>ID de correo de voz -</B> Esta é a caixa de correio de voz que as chamadas serão direcionadas para em um AGENTDIRECT em grupo no momento, se a queda no grupo tem o método da gota definida para a caixa postal eo campo Correio de Voz definido para AGENTVMAIL. + <BR> <A NAME="vicidial_users-optional"> <BR> @@ -3062,12 +4294,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_choose_ingroups"> <BR> - <B>Agente Escolhe Grupos de Entrada -</B> Esta opção com valor 1, permite ao usuário escolher os grupos de entrada que quer receber chamadas quando fazem sogon em uma campanha CLOSER ou ENTRANTE. Caso contrário, o Gerente vai precisar configurar isto na tela de detalhes do cadastro de usuários no site admin. + <B>Agente Escolhe Grupos de Entrada -</B> Esta opção com valor 1, permite ao usuário escolher os grupos de entrada que quer receber chamadas quando fazem sogon em uma campanha CLOSER ou INBOUND. Caso contrário, o Gerente vai precisar configurar isto na tela de detalhes do cadastro de usuários no site admin. + + <BR> + <A NAME="vicidial_users-agent_choose_blended"> + <BR> + <B>Agente Escolha Blended -</B> Esta opção se definido como 1 permite ao usuário escolher se o agente tem o seu conjunto campanha para misto ou não, e se não, então a configuração padrão misturado será usado. O padrão é 1 para habilitado. <BR> <A NAME="vicidial_users-agent_choose_territories"> <BR> - <B>Agente Elija territorios -</B> Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña ENTRANTE_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección. + <B>Agente Elija territorios -</B> Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña INBOUND_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección. <BR> <A NAME="vicidial_users-scheduled_callbacks"> @@ -3116,6 +4353,16 @@ if ($ADD==99999) <BR> <B>Sobrepor Controle de Turno do Agente -</B> Esta configuração irá sobrepor qualquer configuração feita no grupo do agente para controle de turno. DISABLED irá usár a configuração do grupo. OFF não irá forçar turnos. START irá somente forçar o horário de login do turno mas não terá efeito sobre horário acima do final do turno se o usuário ainda estiver logado. ALL irá forçar o inicio do turno e irá fazer logout do agente caso passe do final do horário do turno. O padrão é DISABLED. + <BR> + <A NAME="vicidial_users-agent_call_log_view_override"> + <BR> + <B>Call Agent View Log Override -</B> Esta definição irá substituir o que o grupo de usuários usuários estabeleceu para Agente Ver registro de chamadas. DEFICIENTES usará a configuração grupo de usuários. N não vai permitir mostrar o registro de chamadas de usuários. Y vai permitir mostrar o registro de chamadas do usuário. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Agente Override Pesquisa chumbo -</B> Esta definição irá substituir o que a campanha criou para pesquisa de chumbo agente. NOT_ACTIVE usará o cenário de campanha. ENABLED permitirá a pesquisa de chumbo e deficientes não permitirá a pesquisa de chumbo. O padrão é NOT_ACTIVE. + <BR> <A NAME="vicidial_users-alert_enabled"> <BR> @@ -3127,9 +4374,14 @@ if ($ADD==99999) <B>Permitir Alertas -</B> Este campo le da la capacidad para permitir navegador agente de alertas para ser habilitado por el agente para cuando las llamadas entran en su período de sesiones vicidial.php. Por defecto es 0 para el NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>Rankings da Campanha -</B> Nessa sessão você define o ranking que cada agente terá em cada campanha. Esses rankings podem ser usados para permitir roteamento preferencial de chamadas quando o campo Próximo Agente está como campaign_rank. Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo + <B>Contato Busca predefinido -</B> Se o usuário estiver conectado em uma campanha que tem Presets de transferência definida como CONTACTOS, essa configuração pode desativar contato procurando por este único usuário. O padrão é NOT_ACTIVE que vão usar o que o cenário de campanha é. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>Rankings da Campanha -</B> Nessa sessão você define o ranking que cada agente terá em cada campanha. Esses rankings podem ser usados para permitir roteamento preferencial de chamadas quando o campo Próximo Agente está como campaign_rank. Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo Outro campo nesta secção é grau, o que permite a campaign_grade_random próximo agente Chamada definindo a ser usado. Esta configuração grau irá aumentar ou diminuir a probabilidade de que o agente vai receber a chamada. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3149,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Los campos de usuario personalizada -</B> Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente. + <B>Los campos de usuario personalizada -</B> Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente. O campo 5 personalizado pode ser usado como um campo para definir um número dialplan para enviar uma chamada para a partir de um AGENTDIRECT em grupo, se o usuário não estiver disponível, você só precisa colocar AGENTEXT no campo da mensagem ou extensão no AGENTDIRECT em grupo eo sistema irá procurar o campo de cinco personalizada e enviar a chamada para esse número dialplan. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3196,6 +4448,15 @@ if ($ADD==99999) <B>Carregar Registros -</B> Esta opção, quando configurada como 1, permite ao usuário carregar novos registros de clientes na tabela vicidial_list atravéz do carregador de arquivos no client web. <?php } + if ($SScustom_fields_enabled > 0) + { + ?> + <BR> + <A NAME="vicidial_users-custom_fields_modify"> + <BR> + <B>Campos Personalizados Modificar -</B> Esta opção se definido como 1 permite ao usuário modificar campos personalizados da lista. + <?php + } ?> <BR> @@ -3332,14 +4593,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Exportar Relatórios -</B> Esta configuração quando configurada como 1 irá permitir ao gerente acessar o ítem de exportação de relatórios na tela de relatórios. O padrão é 0 -: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Exportar Relatórios -</B> Esta configuração se definido como 1 irá permitir que um gerente para acessar a chamada exportação e relatórios de chumbo na tela RELATÓRIOS. O padrão é 0. Para a exportação Chama e Leads relatórios, a ordem dos campos a seguir é usado para as exportações: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> <BR> <B>Remover da Lista de Bloqueio -</B> Esta configuração quando 1 permite que o gerente remova números de telefone da lista de bloqueio no sistema VICIDIAL . + <BR> + <A NAME="vicidial_users-realtime_block_user_info"> + <BR> + <B>Informações do usuário em tempo real Bloco -</B> Esta configuração se definido como 1 irá bloquear as informações do usuário e da estação que está sendo exibido no relatório em tempo real. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Modificar o nível mesmo usuário -</B> Esta definição aplica-se apenas ao nível 9 usuários. Se ativado ele permite que o usuário 9 nível para modificar as suas próprias definições, bem como outras de nível 9 usuários. O padrão é 1 para habilitado. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Administrador Ocultar dados levam -</B> Esta definição aplica-se apenas ao nível 7, 8 e 9 usuários. Se ativado ele substitui os dados dos clientes de chumbo nos muitos relatórios e telas do sistema com Xs. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Administrador Ocultar dados do telefone -</B> Esta definição aplica-se apenas ao nível 7, 8 e 9 usuários. Se ativado ele substitui os números de telefone dos clientes nos diversos relatórios e telas do sistema com Xs. As configurações dígitos irão mostrar apenas os dígitos últimos X do número de telefone. O padrão é 0 para deficientes físicos. + @@ -3362,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Descrição da Campanha -</B> Este é um campo de texto para a campanha, é opicional e pode ter no máximo 255 caracteres de comprimento. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esta campanha, o que permite a visualização de administrador esta campanha, bem como as listas atribuídos a essa campanha para ser restringido por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador com permissões de usuário de campanha do grupo para ver esta campanha. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -3378,10 +4663,20 @@ if ($ADD==99999) <B>Última fecha de convocatoria de la Campaña -</B> Esta es la última vez que una llamada fue manejado por un agente registrado en esta campaña. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Máxima diária Stats -</B> Estas são as estatísticas que são geradas pelo sistema a cada dia durante todo o dia até que o relógio de ponto final do dia, como é definido nas configurações do sistema. Estes números são gerados a partir dos registos dentro do sistema para permitir a exibição muito mais rápido. As estatísticas estão incluídos são - Total de chamadas, Agentes máximo, máximo de chamadas de entrada, Máximo chamadas de saída. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_refrescar"> <BR> <B>Atualizar Estat. da Campanha -</B> Este checkbox irá permitir que você force uma atualizaão das estatísticas, mesmo se a campanha não estiver ativa. + <BR> + <A NAME="vicidial_campaigns-realtime_agent_time_stats"> + <BR> + <B>Tempo Real Tempo Estatísticas do Agente -</B> Configurando isso para nada, mas desativado permitirá a recolha de estatísticas em tempo agente para hoje para esta campanha, que são visíveis através do relatório em tempo real. As chamadas são a média chama manipulados por agente, ESPERA é o tempo médio de espera, agente CUST é o tempo médio de conversação do cliente, ACW é a média do tempo de trabalho Depois de chamada, PAUSE é o tempo de pausa média. O padrão é DISABLED. + <BR> <A NAME="vicidial_campaigns-active"> <BR> @@ -3390,17 +4685,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Exten do Estacionamento -</B> Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que a extensão existe no extensions.conf e que aponta para o nome de arquivo abaixo. + <B>Park Music-on-Hold -</B> Isto é onde você pode definir o contexto de música em espera para esta campanha. Certifique-se de selecionar uma música válido no contexto espera a partir da lista de seleção e que o contexto que você selecionou tem arquivos válidos na mesma. O padrão é padrão. <BR> <A NAME="vicidial_campaigns-park_file_name"> <BR> - <B>Nome do arquivo de Estacionamento -</B> Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que o nome do arquivo tem 10 ou menos caracteres de comprimento e que o arquivo está na pasta /var/lib/asterisk/sounds . + <B>Park File Name -</B> NOT USED. <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Formulário Web -</B> Aqui é onde você configura a página web customizada que é aberta quando o usuário clica no botão WEB FORM. Para personalizar a string de pesquisa do formulário web, simplesmente inicie o formulário web com VAR e então a URL que você quer usar, substituindo as variáveis com os nomes de variável que você quer usar --A--phone_number--B-- da mesma forma que na seção SCRIPTS. + <B>Formulário Web -</B> Aqui é onde você configura a página web customizada que é aberta quando o usuário clica no botão WEB FORM. Para personalizar a string de pesquisa do formulário web, simplesmente inicie o formulário web com VAR e então a URL que você quer usar, substituindo as variáveis com os nomes de variável que você quer usar --A--phone_number--B-- da mesma forma que na seção SCRIPTS. Se você quiser usar campos personalizados em um endereço de formulário web, você precisa adicionar &CF_uses_custom_fields=Y como parte de sua URL. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -3461,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Comienza con las zonas horarias del Este y del Oeste de obras <BR>   - DOWN TIMEZONE: Comienza con las zonas horarias occidental y oriental de obras + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Ordem Randomize Lista -</B> Esta opção permite que você embaralhar a ordem dos leads no funil de carga dentro dos resultados definidos pelos critérios estabelecidos acima. Por exemplo, a ordem de lista será preservada, mas os resultados serão randomizados dentro que a triagem. Definir esta opção como Y vai ativar esse recurso. Padrão é n para deficientes físicos. Note que, se você tem um grande número de leva esta opção pode diminuir a velocidade do script de carregamento funil. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Ordem lista secundária -</B> Esta opção permite que você selecione a ordem de classificação segundo os leads no funil de carga após a Ordem de lista e dentro dos resultados definidos pelos critérios estabelecidos acima. Por exemplo, a ordem de lista irá ser utilizado para o primeiro tipo de os fios, mas os resultados serão classificados uma segunda vez no que ordenação através do mesmo conjunto da Ordem primeira lista. Por exemplo, se você tiver Ordem Lista definido para contagem decrescente e você só tem ligações que foram tentadas 1 e 2 vezes, então se você tem o conjunto Ordem lista secundária para LEAD_ASCEND todas as tentativas 1 ligações serão classificados por mais antigas pistas primeira e será colocada no funil de que maneira. O padrão é LEAD_ASCEND. Note que, se você tem um grande número de ligações usando uma das opções CALLTIME pode diminuir a velocidade do script de carregamento funil. Se Ordem Lista Randomize é ativada, esta opção será ignorada. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Nível de Hopper -</B> Aqui é onde fica configurado quantos registros o VDhopper mantém na tabela vicidial_hopper para esta campanha. Se estiver rodando VDhopper a cada minuto, tenha a garantia que é acima do número de registros discados por minuto. + <B>Nível Hopper mínimo -</B> Este é o número mínimo de leva o script VDhopper tenta manter na tabela vicidial_hopper para esta campanha. Se executar o script VDhopper cada minuto, fazem deste um pouco maior que o número de leva você passar em um minuto. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Nível Hopper automática -</B> Definindo-a para Y permitirá Vicidial para ajustar automaticamente o funil baseado fora as configurações que você tem em sua campanha. A fórmula que utiliza para fazer isto é:<BR>Number of Ativo Agentes * Nível de Discagem Automática * ( 60 seconds / Tempo de Espera da Discagem ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Multiplicador Hopper automática -</B> Esta é multiplicador para o Auto Hopper. Definir este menos de 1 fará com que o algoritmo de Hopper Auto para carregar leva menos do que normalmente. Definir este maior do que 1 fará com que o algoritmo de Hopper Auto para carregar mais ligações do que normalmente. O padrão é 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Auto Trim Hopper -</B> Definindo-a para Y permitirá Vicidial para remover automaticamente excesso leva do funil. O padrão é Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Hopper VLC Dup Confira -</B> Definindo-a para Y irá resultar em todas as pistas que está sendo inserido dentro do depósito que está sendo verificado por vendor_lead_code para se certificar de que não há duplicar leva inseridos com o vendor_lead_code mesmo. Isto é muito útil quando o Auto-Alt-Discagem com MULTI_LEAD. O padrão é N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Filtro de Registros -</B> Este é um método de filtrar os registros usando um fragmento de uma query SQL. Use este recurso com cuidado, é fácil parar de discar acidentalmente com uma pequena alteração no comando SQL. O padrão é NONE. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Contagem contas Limite -</B> Isso impõe um limite no número de tentativas de chamadas para os terminais marcados nesta campanha. A liderança pode ultrapassar esse limite se ligeiramente reciclagem de chumbo ou Auto-Alt-discagem está ativado. O padrão é 0 para sem limite. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Contagem contas Alvo -</B> Esta opção só é usada para fins de relatório e não tem efeito em ligações discadas. O padrão é 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -3484,18 +4819,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-dial_method"> <BR> - <B>Método de discagem -</B> Esta é a definição de como a discagem deve ser feita. Se MANUAL então o níver de discagem automática ficará travado em 0 a não ser que o método seja alterado. Se RATIO então a discagem será feita baseada na quantidade de agentes livres. ADAPT_HARD_LIMIT irá discar preditivamente até o nível de chamadas derrubadas e não discará agressivamente após o nível ter sido alcançado até que abaixe novamente. ADAPT_TAPERED permite se passar do nível de derrubadas na primeira metade do turno, conforme definido no horário de campanha, e fica menos agressivo conforme o turno avança. ADAPT_AVERAGE tenta manter uma média no percentual de derrubadas não impondo limites e não sendo tão agressivo como os outros dois métodos. Você não pode mudar o nível de discagem automática se você usar alguns dos métodos ADAPT. Somente o Discador pode mudar o nível no modo preditivo. ENTRANTE_MAN permite ao agente fazer chamadas manuais a partir de uma campanha enquanto está disponível para receber chamadas entrantes, entre as chamadas manuais. + <B>Método de discagem -</B> Esta é a definição de como a discagem deve ser feita. Se MANUAL então o níver de discagem automática ficará travado em 0 a não ser que o método seja alterado. Se RATIO então a discagem será feita baseada na quantidade de agentes livres. ADAPT_HARD_LIMIT irá discar preditivamente até o nível de chamadas derrubadas e não discará agressivamente após o nível ter sido alcançado até que abaixe novamente. ADAPT_TAPERED permite se passar do nível de derrubadas na primeira metade do turno, conforme definido no horário de campanha, e fica menos agressivo conforme o turno avança. ADAPT_AVERAGE tenta manter uma média no percentual de derrubadas não impondo limites e não sendo tão agressivo como os outros dois métodos. Você não pode mudar o nível de discagem automática se você usar alguns dos métodos ADAPT. Somente o Discador pode mudar o nível no modo preditivo. INBOUND_MAN permite ao agente fazer chamadas manuais a partir de uma campanha enquanto está disponível para receber chamadas entrantes, entre as chamadas manuais. <BR> <A NAME="vicidial_campaigns-auto_dial_level"> <BR> <B>Nível de Discagem Automática -</B> Aqui deve ser configurado quantas linhas o VICIDIAL deve usar por agente ativo. Zero(0) significa que o discador automático está desligado e os agentes devem clicar para discar cada número. Caso contrário o VICIDIAL irá manter discando na quantidade de linhas igual ao número de agentes livres multiplicado pelo valor deste campo. O checkbox SOBREPOR APAPT permite que você force um nível de discagem mesmo que o método seja um dos ADAPT. Isto é útil quando existe uma mudança grande na qualidade dos registros e você quer mudar manualmente o nível. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Auto Threshold Nível Dial -</B> Essa configuração só funciona com um ADAPT ou RATIO Método de marcação, e deve ser definido para algo diferente de Desativado eo número de agentes de configuração deve estar acima de 0. Este recurso permite que você defina um número mínimo de agentes que o algoritmo preditivo vai trabalhar. Se o número de agentes é inferior ao número que você definiu, então o nível de ligação vai a 1,0 até mais agentes login ou ir para o estado selecionado. LOGGED de IN_AGENTS contará todos os agentes registrados na campanha, NÃO PAUSED_AGENTS só vai contar com agentes que estão à espera ou falar, e WAITING_AGENTS só contam os agentes que estão à espera de uma chamada. O padrão é DISABLED. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Somente Lista Autom. -</B> Este campo quando configurado como Y não considera a quantidade de chamadas entrantes nem em fila de espera para calcular a quantidade de chamadas para discagem automática. O padrão é N. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Threshold Tally disponível somente -</B> Essa configuração só funciona com um ADAPT ou RATIO Método de marcação, Tally disponível apenas deve ser definido como N, essa configuração deve ser definido para algo diferente de Desativado eo número de agentes de configuração deve estar acima de 0. Este recurso permite que você defina o número de agentes abaixo do qual Tally disponível apenas será habilitado. Se o número de agentes é inferior ao número que você definiu, então a configuração Tally disponível apenas com ir para Y temporariamente até que os agentes mais fazer login ou ir para o estado selecionado. LOGGED de IN_AGENTS contará todos os agentes registrados na campanha, NÃO PAUSED_AGENTS só vai contar com agentes que estão à espera ou falar, e WAITING_AGENTS só contam os agentes que estão à espera de uma chamada. O padrão é DISABLED. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -3519,7 +4864,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Alvo da Diferença de Nível -</B> Este campo é usado para definir se você quer alcançar um número específico de agentes esperando chamadas ou chamadas esperando agentes. Por exemplo: se você gostaria de sempre ter em média um agente livre para receber chamadas imediatamente, você configura como -1, se você gostaria que sempre houvesse uma chamada esperando por agente, você configura como 1. O padrão é 0. Este campo não é usado pelos métodos MANUAL e RATIO. + <B>Alvo de Diferença de Nível -</B> Este campo é utilizado para definir se você deseja atingir com um número específico de agentes à espera de chamadas ou chamadas de espera para os agentes. Por exemplo, se você sempre gostaria de ter em média um agente livre para receber chamadas imediatamente você deve definir como -1, se você gostaria de ter sempre como alvo uma chamada em espera à espera de um agente, você deve definir esta a 1. O padrão é 0. Este campo não é usado pelo MANUAL ou métodos de marcação INBOUND_MAN. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Disque nível do método alvo Diferença -</B> Esta opção permite definir se o disco de nível fixação de metas diferença é aplicada apenas para o cálculo do nível de discagem ou também para a marcação real em cada servidor de discagem. Se você estiver executando uma campanha pequena, com agentes logados em vários servidores que você pode querer usar a opção ADAPT_CALC_ONLY, porque a opção CALLS_PLACED pode resultar em menos chamadas que estão sendo colocadas de deisred. Esta opção só está activo se Dial-alvo diferença de nível é definido como algo diferente de 0. O padrão é ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -3529,17 +4879,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>Prioridade da Fila - </B> Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended. + <B>Prioridade da Fila - </B> Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended. Nós não recomendamos a configuração chamadas de entrada para uma prioridade maior do que as chamadas de saída de campanha porque as pessoas que fazem escala em que esperar e pessoas a serem chamadas de esperar de alguém para estar lá no telefone. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> <BR> <B>Varias campañas Drop Rate Grupo -</B> Esta característica le permite establecer una campaña como miembro de una campaña de la velocidad de descenso del Grupo, o un grupo de campañas cuyas llamadas contestadas y llamadas Humanos Drop para todas las campañas en el grupo se combinarán en un porcentaje de caída compartida, o tasa de abandono. Esto le permite ejecutar varias campañas a la vez y más fácil de controlar su tasa de caída. Esto es particularmente útil en el Reino Unido, donde las regulaciones lo permiten esta disminución método del tipo de cálculo con la campaña de la agrupación por la misma empresa, incluso si hay varias campañas que la empresa está ejecutando en el mismo día. Para habilitar esta para una campaña, sólo tienes que seleccionar un grupo de la lista. Hay 10 grupos definidos en el sistema por defecto, puede ponerse en contacto con el administrador del sistema para añadir más. Desactivado por defecto. + <BR> + <A NAME="vicidial_campaigns-inbound_queue_no_dial"> + <BR> + <B>Fila de entrada no Disque -</B> Este recurso se definido como ENABLED permite evitar saída discagem automática desta campanha se existem chamadas de entrada na fila de espera que fazem parte dos grupos permitidos entrada definidos nesta campanha. Definindo-a para ALL_SERVERS vai mudar o algoritmo para calcular todas as chamadas de entrada como as chamadas ativas neste servidor, mesmo se eles estiverem em outro servidor que irá reduzir a chance de colocar desnecessários chamadas de saída se você tiver chamadas que entram em outro servidor. O padrão é DISABLED. + <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Auto Discar Alternativo -</B> Esta configuração é usada para automaticamente discar números alternativos enquanto os métodos RATIO e ADAPT são usados e não há contato no telefone principal para um registro com status NA, B, DC e N. Esta configuração não é usada pelo método MANUAL de discagem. EXTENDIDOS são números alternativos que são carregados no sistema fora da tela padrão de informações sobre registros. Usando EXTENDED você pode ter centenas de números de telefone para um único registro de cliente. + <B>Auto Discar Alternativo -</B> Esta configuração é usada para automaticamente discar números alternativos enquanto os métodos RATIO e ADAPT são usados e não há contato no telefone principal para um registro com status NA, B, DC e N. Esta configuração não é usada pelo método MANUAL de discagem. EXTENDIDOS são números alternativos que são carregados no sistema fora da tela padrão de informações sobre registros. Usando EXTENDED você pode ter centenas de números de telefone para um único registro de cliente. Usando MULTI_LEAD permite que você use um cabo separado para cada número de uma conta de cliente que compartilham vendor_lead_code comum, eo tipo de número de telefone para cada um é definido com uma etiqueta no campo Proprietário. Esta opção irá desativar algumas opções na tela Modificar campanha e mostrar um link para o Multi-Alt página de configurações que permite que você defina os tipos de telefone cujo número, definidas pelo rótulo de cada ligação, será marcado e em que ordem. Isto irá criar um filtro especial de chumbo e vai alterar o campo de classificação de todas as ligações no interior das listas definidas para esta campanha, a fim de chamá-los na ordem que você especificou. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -3549,14 +4904,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Extensão VDAD da Campanha -</B> Este campo permite personalizar a extensão de transferência do VDAD. Isso permite que você use métodos de controle da chamada dependendo da sua campanha - - 8364 - mesma que 8368 - - 8365 - Irá enviar a chamada somente para o servidor no qual o agente está logado - - 8366 - Utilizado somente para campanhas de pressione-1 e pesquisa - - 8367 - Irá tentar enviar a chamada para um agente no servidor local, então irá procurar em outros servidores - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8368 - - 8373 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8366 + <B>Roteamento de Extensão -</B> Este campo permite uma extensão de encaminhamento personalizado de saída. Isto permite-lhe usar métodos de manipulação de chamada diferentes, dependendo de como você quer rotear chamadas através de sua campanha de saída. Extensão VDAD Anteriormente chamado de Campanha. + <BR>- 8364 - mesma 8368 + <BR>- 8365 - Vou enviar o convite apenas a um agente no mesmo servidor como a chamada é colocada em + <BR>- 8366 - Usado para campanhas de imprensa-1 de radiodifusão e vistoria + <BR>- 8367 - Vai tentar primeiro enviar a chamada para um agente no servidor local, então ele vai procurar em outros servidores + <BR>- 8368 - PADRÃO - Vou enviar a chamada para o próximo agente disponível não importa o que eles estão no servidor + <BR>- 8369 - Utilizada para Detecção de Máquina Respondendo depois disso, mesmo comportamento 8368 + <BR>- 8373 - Utilizada para Detecção de Máquina Respondendo depois que o mesmo comportamento como 8366 + <BR>- 8374 - Usado para campanhas de imprensa-1 de radiodifusão, e pesquisa com Cepstral Text-to-speech + <BR>- 8375 - Utilizada para Detecção de Máquina Respondendo em seguida, pressione-1 de radiodifusão e vistoria campanhas com Cepstral Text-to-speech <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -3598,6 +4955,16 @@ if ($ADD==99999) <BR> <B>Exten do Porto Seguro -</B> Esta é a extensão do plano de discagem designada para o porto seguro, deve tocar o arquivo de mensagem localizado no seu servidor. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Áudio Safe Harbor -</B> Este é o arquivo de áudio prompt que é jogado, se a ação de soltar for definido como AUDIO. O padrão é o zumbido. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Menu de chamada Safe Harbor -</B> Este é o menu de chamada que uma chamada é enviada para se a ação de soltar for definido como CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -3616,12 +4983,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-no_hopper_dialing"> <BR> - <B>N marcado Hopper -</B> Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o ENTRANTE_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados. + <B>N marcado Hopper -</B> Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o INBOUND_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados. <BR> <A NAME="vicidial_campaigns-agent_dial_owner_only"> <BR> - <B>Único propietario de marcado -</B> Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o ENTRANTE_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados. + <B>Único propietario de marcado -</B> Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o INBOUND_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados. <?php if ($SSuser_territories_active > 0) @@ -3698,7 +5065,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Método de Pesquisa - </B> Esta opção define o que acontece com uma chamada após o cliente ter aceitado a pesquisa. AGENT_XFER irá enviar a chamada para o próximo agente disponível. VOICEMAIL irá enviar a chamada para o voicemail especificado no campo Correio de Voz. EXTENSION irá enviar o cliente para uma extensão definida no campo Extensão de Transf. HANGUP irá desligar o cliente. CAMPREC_60_WAV irá enviar o cliente para que grave uma resposta, esta gravação ficará na pasta com o nome da campanha, dentro do diretório de gravações da Campanha de Pesquisa + <B>Método de Pesquisa - </B> Esta opção define o que acontece com uma chamada após o cliente ter aceitado a pesquisa. AGENT_XFER irá enviar a chamada para o próximo agente disponível. VOICEMAIL irá enviar a chamada para o voicemail especificado no campo Correio de Voz. EXTENSION irá enviar o cliente para uma extensão definida no campo Extensão de Transf. HANGUP irá desligar o cliente. CAMPREC_60_WAV irá enviar o cliente para que grave uma resposta, esta gravação ficará na pasta com o nome da campanha, dentro do diretório de gravações da Campanha de Pesquisa CALLMENU irá enviar o cliente para o menu de chamada definido na lista de seleção abaixo. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -3750,6 +5117,16 @@ if ($ADD==99999) <BR> <B>Agente de pantalla Dialable Leads -</B> Esta opción se mostrará si está habilitado el número de derivaciones dialable disponibles en la campaña en la pantalla del agente. Este segundo número se actualiza en el sistema una vez por minuto y se actualiza en la pantalla del agente por cada par de. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Menu de chamada pesquisa -</B> Se o método é definida como CALLMENU, este é o menu de chamada que o cliente é enviado para se optar por. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Gravação de pesquisa -</B> Se ativado, isto irá iniciar a gravação quando a chamada é atendida. Apenas recomendado se o método não está definido para transferir a um agente. Padrão é n para deficientes físicos. Se definido como Y_WITH_AMD mesmo atendedor chamadas mensagens detectados serão registrados. + <?php } ?> @@ -3763,6 +5140,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada. <BR>   - overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas. <BR>   - campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo. + <BR>   - campaign_grade_random: dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados. <BR>   - fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro. <BR>   - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. @@ -3776,6 +5154,11 @@ if ($ADD==99999) <BR> <B>Prefixo de Discagem -</B> Este campo permite que facilmente configuremos o caminho de discagem sem precisar alteração de configurações de servidor e sem precisar recarregar o Asterisk. O padrão é 9 baseado em 91NXXNXXXXXX no plano de discagem - extensions.conf. + <BR> + <A NAME="vicidial_campaigns-manual_dial_prefix"> + <BR> + <B>Prefixo de discagem manual -</B> Este campo opcional permite que você defina o prefixo de discagem para ser usado somente quando fazer chamadas de discagem manual do agente de interface, como usar o recurso de discagem manual, ou Disque o próximo número, quando no método de discagem manual, manual ou marcação de números alt, ou programado pelo usuário apenas callbacks. O padrão é vazio para deficientes físicos, que utilizam o prefixo de discagem definido no campo acima. Esta opção não interfere com a opção 3way Prefixo de Discagem. + <BR> <A NAME="vicidial_campaigns-omit_phone_code"> <BR> @@ -3786,6 +5169,11 @@ if ($ADD==99999) <BR> <B>CallerID da Campanha-</B> Este campo permite que seja enviado um número customizado de CallerID nas chamadas saintes. Este número irá ser mostrado no Identificador da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discar esta opção está disponível apenas se estiver usando PRIs - ISDN T1 ou E1 - que tenham o recurso de customizar o callerID habilitados, isso nao irá funcionar em circuitos RBS (Robbed-bit Service). Isto também funciona na maioria dos provedores SIP ou IAX que permitem customizar callerID. O callerID customizado se aplica apenas a chamadas feitas por campanhas VICIDIAL diretamente, qualquer chamadas de terceiros ou transferências nao receberá o callerID customizado. ATENÇÃO: algumas vezes colocando-se UNKNOWN ou PRIVATE neste campo pode causar que seja enviado o callerID da sua operadora. Você pode testar isso colocando 00000000000 no campo callerid se você nao quer enviar seu CallerID . + <BR> + <A NAME="vicidial_campaigns-use_custom_cid"> + <BR> + <B>Personalizado CallerID -</B> Quando definido como Y, esta opção permite que você use o campo security_phrase na tabela vicidial_list como o CallerID para enviar ao colocar para cada ligação específica. Se este campo não tem CID nele, então a Campanha CallerID definido acima será usado. Esta opção irá desativar o CallerID lista Substituir se houver um presente CID no campo security_phrase. O padrão é N. Quando ajustado para CódigoDeÁrea você tem a possibilidade de ir para o submenu AC-CID e definir callerids múltiplas a serem utilizados por areacode. + <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -3799,13 +5187,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Nome do Arquivo de Gravação -</B> Este campo permite que seja customizado o nome do arquivo de gravação quando a configuração de gravação da campanha esteja em ONDEMAND ou ALLCALLS. As variáveis permitidas sao CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENTE e se parece assim: 20051020-103108-6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que se parece assim: TESTCAMP_51020103108_312551212. 50 char max. + <B>Nome do Arquivo de Gravação da Campanha -</B> Este campo permite que você personalize o nome da gravação quando a gravação da campanha é OnDemand ou ALLCALLS. As variáveis ​​são permitidos CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. O padrão é FULLDATE_AGENTE e ficaria assim 20051020-103108_6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que ficaria assim TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>Atraso de Gravação -</B> Somente para gravações ALLCALLS e ALLFORCE. Esta configuração irá atrasar a gravação da chamada o tempo em segundos especificado no campo. O padrão é 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Chame Notes por chamada -</B> Definir esta opção como ENABLED vai permitir que agentes para entrar em notas para cada chamada lidar com eles na interface do agente. O campo de entrada de notas irá aparecer abaixo do campo Observações na interface do agente. Além disso, se o Grupo Usuário Agent tem permissão para ver registros de chamadas, em seguida, o agente será capaz de ver as notas de chamada passado para a liderança a qualquer momento. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Pesquisa de chumbo agente -</B> Definir esta opção como ENABLED permitirá que agentes para procurar pistas e visualizar informações de chumbo durante uma pausa na interface do agente. Além disso, se o Grupo Usuário Agent tem permissão para ver registros de chamadas, em seguida, o agente será capaz de ver as notas de chamada passado por qualquer dica que eles estão vendo informações sobre. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Agente Método de Pesquisa de chumbo -</B> Se a pesquisa de chumbo Agente está habilitado, essa configuração define onde o agente será permitido a procurar por pistas. O sistema irá procurar todo o sistema, CAMPANHALISTS irá procurar dentro de todas as listas de ativos dentro da campanha, CAMPLISTS_ALL irá procurar dentro de todas as listas de ativos e inativos dentro da campanha, LISTA irá procurar somente dentro do ID manual Dial lista, conforme definida na campanha . O padrão é CAMPLISTS_ALL. Uma dessas opções com USER_ na frente só vai procurar dentro de leads que têm o campo proprietário correspondente ao ID do usuário do agente, as opções com GROUP_ na frente só vai procurar dentro de leads que têm o campo proprietário correspondente ao grupo de usuários que o usuário é um membro, as opções com TERRITORY_ na frente só vai procurar dentro de leads que têm o campo proprietário combinando os territórios que o agente tem selecionados. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -3814,7 +5217,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Abrir com Chamada -</B> Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. + <B>Abrir com Chamada -</B> Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. Se os campos personalizados da lista estão habilitados em seu sistema, formulário será aberto no separador FORMULÁRIO na conexão de uma chamada para um agente. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -3824,17 +5227,47 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Rápida transferencia Button -</B> Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. + <B>Rápida transferencia Button -</B> Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. As opções bloqueadas são usados ​​para bloquear o valor para o botão Quick Transfer mesmo que o agente usa os recursos de conferência de transferência durante uma chamada antes de usar o botão Quick Transfer. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Personalizado Transferência Botão 3-Way -</B> Esta opção irá adicionar um botão personalizado Transferência para a tela do agente abaixo do botão de transferência de Conf, que permitirá um clique de três vias chamadas usando o pré-selecionada ou campo. As opções PRESET_ irá efetuar chamadas usando o valor definido predefinido. As opções field_ irá efetuar chamadas usando o número no campo selecionado a partir do chumbo. DEFICIENTES não vai mostrar o botão na tela do agente. As opções PARK_ irá estacionar o cliente antes de discar. O padrão é DISABLED. A opção VIEW_PRESET simplesmente abrir o quadro de transferência e do quadro pré-. A opção VIEW_CONTACTS irá abrir uma janela de busca de contatos, isto só irá funcionar se Presets Enable está configurada para CONTACTOS. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> <BR> <B>Transferencia de rellenar previamente Preset -</B> Esta opción le proporcione el número telefónico al campo en el marco de la Conferencia de transferencia de la pantalla si el agente definido. Por defecto es n para discapacitados. + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Habilitar Presets de transferência -</B> Esta opção permitirá que os Presets Sub menu a aparecer no topo da página Modificação da campanha, e você também terá a capacidade para especificar números de discagem pré-selecionadas para Agentes de utilizar no quadro de transferência de Conferência de o agente de interface. O padrão é DISABLED. CONTACTOS é uma opção apenas se contact_information está habilitado em seu sistema, que é um recurso personalizado. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Habilitar Presets de transferência -</B> Esta opção permitirá que os Presets Sub menu a aparecer no topo da página Modificação da campanha, e você também terá a capacidade para especificar números de discagem pré-selecionadas para Agentes de utilizar no quadro de transferência de Conferência de o agente de interface. O padrão é DISABLED. CONTACTOS é uma opção apenas se contact_information está habilitado em seu sistema, que é um recurso personalizado. + + <BR> + <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> + <BR> + <B>Esconder número de transferência para discar -</B> Esta opção irá esconder o número a ser discado campo no quadro de transferência de Conferência de o agente de interface. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call"> + <BR> + <B>Estacionamento de chamadas IVR -</B> Esta opção vai permitir que um agente para estacionar uma chamada com um botão separado CHAMADA IVR PARK em sua interface agente se este está habilitado ou ENABLED_PARK_ONLY. A opção ENABLED_PARK_ONLY vai permitir ao agente para enviar a chamada para estacionar, mas não clique para recuperar a chamada como a opção Enabled. A opção ENABLED_BUTTON_HIDDEN permite que a função através da API só. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call_agi"> + <BR> + <B>Estacionamento de chamadas IVR AGI -</B> Se o Parque campo IVR chamada não está desativado, então este campo é usado como a seqüência de aplicação AGI que o cliente seja enviado. Esta é uma configuração que deve ser definido pelo administrador, se possível. + <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. + <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. HANGUP irá desligar a chamada quando o cronômetro é disparado, CALLMENU enviará a chamada para o menu de chamada especificado no campo Destino Temporizador Ação, EXTENSÃO enviará a chamada para o ramal que está especificado no campo Destino Temporizador Ação, IN_GROUP enviará a chamada para o No Grupo-especificado no campo Destino Temporizador Ação. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -3846,11 +5279,46 @@ if ($ADD==99999) <BR> <B>Temporizador Segundos Acción -</B> Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. + <BR> + <A NAME="vicidial_campaigns-timer_action_destination"> + <BR> + <B>Destino Ação temporizador -</B> Este campo é onde você especificar a chamada do menu de extensão, ou em grupo que você deseja a chamada enviada se o tempo de ação é definido como EXTENSÃO CALLMENU, ou IN_GROUP. O padrão é vazio. + <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Chamadas Agendadas -</B> Permite um agente classificar uma chamada como CALLBK e escolher uma data e hora na qual deseja que o registro seja discado. + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> + <BR> + <B>Callbacks alerta agendadas -</B> Esta opção permite que a linha de status callbacks na interface do agente a ser vermelho, piscar ou piscar em vermelho quando há AGENTONLY agendada callbacks que atingiram o seu tempo de disparo e data. O padrão é NONE para a linha de status padrão. As opções de adiar irá parar de piscar e ou exibição no vermelho quando você verificar os retornos de chamada, até que o número de retornos de chamada mudanças. + + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_count"> + <BR> + <B>Callbacks agendadas Contagem -</B> Esta opção permite que você defina se apenas callbacks VIVOS, pelo usuário apenas retornos de chamada programadas que atingiram a sua data de disparo e de tempo, ou callbacks ALL_ACTIVE, o usuário somente callbacks que estão ativos no sistema, bem como callbacks VIVOS, deve BE3 contados int ele agente seção alerta de retorno de chamada na tela do agente. O padrão é ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Programado Callbacks Limite Dias -</B> Esta opção permite que você reduza o agente callbacks programadas do calendário para um número selecionável de dias a partir de hoje, o calendário do mês completa 12 ainda será exibido, mas apenas o número de dias será selecionável. O padrão é 0 para ilimitado. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Programado Callbacks Bloco Horas -</B> Esta opção permite que você restringir um callback USERONLY agendado seja exibido na lista de chamada de retorno agente até X horas depois de ter sido definido. O padrão é 0 para nenhum bloco. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Callbacks agendadas Bloco Calltime -</B> Esta opção, se habilitado irá impedir o retorno agendado na lista de chamada de retorno do agente de que está sendo chamado se estiver fora do calltime prevista para a campanha. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Meu padrão Checkbox Callbacks -</B> Esta opção permite-lhe pré-definir a opção de chamada de retorno na tela My callback agente programado. CHECKED irá verificar a caixa de seleção automaticamente para cada chamada. O padrão é UNCHECKED. + <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -3861,6 +5329,26 @@ if ($ADD==99999) <BR> <B>Mensagem de Pós Atendimento -</B> É uma mensagem específica da campanha a ser mostrada na tela de pós atendimento se o tempo de pós atendimento for configurado. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Desativar Tela Dispo -</B> Esta opção permite que você desabilite a tela disposição na interface do agente. O Desabilitar campo Status Dispo abaixo devem ser preenchidos para que essa opção funcione. O padrão é DISPO_ENABLED. A opção DISPO_SELECT_DISABLED não irá desativar a tela dispo completamente, mas vai exibir a tela dispo sem quaisquer disposições, esta opção só deve ser usado se você quiser forçar os agentes a usar o software de CRM que vai enviar o status para o sistema através da API. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Desativar Status Dispo -</B> Se a opção Desativar Tela Dispo está definido para DISPO_DISABLED, então este campo deve ser preenchido polegadas Você pode usar qualquer disposição que você deseja para este campo, desde que ele é de 1 a 6 caracteres de comprimento com apenas letras e números. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Tela Etiquetas Agente -</B> Você pode selecionar um conjunto de etiquetas de agente de tela para usar com esta opção. O padrão é - configurações de sistema - para os rótulos padrão. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Mostrar campos de status -</B> Você pode selecionar quais variáveis ​​para as chamadas serão exibidos na linha de status da tela do agente. CALLID irá exibir a 20 caracteres ID chamada única, LEADID irá exibir a ID principal do sistema, ListId irá exibir o ID lista. O padrão é CALLID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -3881,6 +5369,21 @@ if ($ADD==99999) <BR> <B>Códigos de Pausa do Agente Ativos -</B> Permite aos agentes selecionar códigos de pausa quando eles clicam o botão pausa no vicidial.php. Códigos de pausa são definidos por campanha no final da página de detalhes da campanha e são guardados na tabela vicidial_agent_log. O padrão é N. FORCE irá forçar o agente escolher um código de pausa se eles clicar no botão pausa. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Auto Pausa trabalho de pré-Call -</B> Em auto dial-modo, esta definição se habilitado irá definir o agente para uma pausa automaticamente quando os cliques do agente em qualquer das seguintes funções que os obriga a ser pausado-Manual Dial, Dial pesquisa rápida e chumbo, Call Log View, Callbacks Verifique, Digite o Código Pause. Padrão é n para inativos. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Auto Resume Pré-Call Work -</B> Em auto dial-modo, esta definição se habilitado irá definir o agente ativo automaticamente quando o agente clica para fora, ou cancela, em qualquer das seguintes funções que os obriga a ser interrompida Dial-Manual, Discagem rápida, Pesquisa chumbo, Call Entrar View, Callbacks Verifique, insira o código de pausa. Padrão é n para inativos. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Auto Pausa Código Pré-Call -</B> Se o Auto Pause função trabalho de pré-Call acima é ativo, e Códigos Pause agente está ativo, essa configuração será o código de pausa que é usado quando o agente está em pausa para essas atividades. O padrão é PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -3896,6 +5399,11 @@ if ($ADD==99999) <BR> <B>Mostrar Contagem da Fila ao Agente - </B> Quando configurada como Y, quando um cliente está esperando um agente, será demonstrado na tela do agente a quantidade de clientes em espera. O padrão é Y. + <BR> + <A NAME="vicidial_campaigns-manual_dial_override"> + <BR> + <B>Manual de Dial Override -</B> A configuração pode substituir os Usuários definição para a capacidade de discagem manual para agentes quando eles são registrados nesta campanha. NONE seguirá a definição de Usuários, ALLOW_ALL permitirá que qualquer agente registrados nesta campanha para fazer chamadas de discagem manual, DISABLE_ALL não permitirá que ninguém registrados nesta campanha para fazer chamadas de discagem manual. O padrão é NONE. + <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> <BR> @@ -3904,7 +5412,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Filtro de Discagem Manual - </B> Permite que você filtre as chamadas que os agentes fazem no modo manual de discagem para esta campanha por uma combinação dos seguintes: DNC - para tirar, CAMPANHALISTAS - o número deve estar nas lístas para a campanha, NONE - sem filtros na discagem manual ou lista de discagem rápida . + <B>Filtro de Discagem Manual - </B> Permite que você filtre as chamadas que os agentes fazem no modo manual de discagem para esta campanha por uma combinação dos seguintes: DNC - para tirar, CAMPANHALISTS - o número deve estar nas lístas para a campanha, NONE - sem filtros na discagem manual ou lista de discagem rápida . CAMPLISTS_ALL - incluem listas de inativos na pesquisa para o número. + + <BR> + <A NAME="vicidial_campaigns-manual_preview_dial"> + <BR> + <B>Dial visualização manual -</B> Isso permite que o agente em modo de discagem manual para ver as informações de chumbo, quando clicar em Discar Número seguida antes que eles ativamente discar o telefonema. Há um link opcional para Ignorar a ligação e passar para a próxima, se selecionado. O padrão é PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Manual de Dial API -</B> Esta opção permite que você defina a API do agente para fazer qualquer chamada um a um, hora, ou a capacidade de fila chamadas de discagem manual e tê-los discar automaticamente uma vez que o agente entra em pausa ou está disponível para atender a sua chamada próxima com o opção de desativar a discagem automática dessas chamadas, QUEUE, ou QUEUE_AND_AUTOCALL que é a mesma fila, mas sem a opção de desativar a discagem automática das chamadas. Se um agente tem mais do que uma chamada na fila para eles vai ver a conta de quantas chamadas de discagem manual estão na fila logo abaixo do botão de pausa, ou Disque botão próximo número. Sugerimos que se QUEUE é usado que você envie ações API usando o preview = YES opção para que você não está repetidamente discagem de chamadas para o agente sem aviso prévio. Além disso, se estiver usando QUEUE e fortemente usando chamadas de discagem manual em um método não MANUAL marcação, recomendamos definir o Pause Agente Após Cada opção chamada para Y. O padrão é PADRÃO. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Call Time manual Confira -</B> Se esta opção estiver ativada, ele irá verificar todas as chamadas de discagem manual para se certificar que estão dentro das configurações de chamada de tempo definido para a campanha. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Marcação Manual CID -</B> Este define se um agente fazer chamadas discagem manual terá as configurações de campanha callerID usado, ou seus agentes as configurações do telefone callerID usado. O padrão é CAMPANHA. Se a opção Usar campanha personalizado CID está ativado ou a lista Campanha configuração Override CID é usada, esta configuração será ignorada. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Telefone Mensagem de Alerta Diferença de tempo -</B> Este recurso manual-dial-somente, se ativada, irá mostrar um alerta se o fuso horário para o código postal de chumbo, ou código postal, é diferente do fuso horário do código de área do número de telefone para a liderança. A opção OUTSIDE_CALLTIME_ONLY só irá mostrar a indicação se as duas zonas de tempo são diferentes e uma das zonas de tempo está fora do tempo de permanência seleccionado para a campanha. OUTSIDE_CALLTIME_PHONE só verificar o fuso horário do número de telefone do chumbo e alertar se estiver fora do tempo de chamada local. OUTSIDE_CALLTIME_POSTAL só verificar o fuso horário do código postal do chumbo e alertar se estiver fora do tempo de chamada local. OUTSIDE_CALLTIME_BOTH irá verificar o código postal e número de telefone para estar dentro do tempo de chamada local, mesmo se eles estão no mesmo fuso horário. Esses alertas irá mostrar na informação do registo de chamadas, informações callbacks lista, informações de resultados de pesquisa, quando uma ligação é marcado e quando uma ligação é visualizado. O padrão é DISABLED. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -3914,13 +5447,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>CallerID de Chamada a 3 - </B> Isso define o que é enviado como número do CallerID em chamadas a 3 realizadas pelo agente. CAMPANHA usa o CallerID customizado da campanha, CUSTOMER usa o número do cliente que está ativo na tela do agente e AGENT_PHONE usa o callerID do ramal que o agente está logado. AGENT_CHOOSE permite que o agente escolha qual CallerID usar em chamadas a 3 a partir de uma lista de opções + <B>CallerID de Chamada a 3 - </B> Isso define o que é enviado como número do CallerID em chamadas a 3 realizadas pelo agente. CAMPANHA usa o CallerID customizado da campanha, CUSTOMER usa o número do cliente que está ativo na tela do agente e AGENT_PHONE usa o callerID do ramal que o agente está logado. AGENT_CHOOSE permite que o agente escolha qual CallerID usar em chamadas a 3 a partir de uma lista de opções CUSTOM_CID irá usar o CID personalizada que é definido no campo security_phrase da tabela vicidial_list para o chumbo. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> <BR> <B>Prefixo para Chamadas a 3 - </B> Isso define o que será usado como prefixo de discagem nas chamadas a 3, o padrão é vazio, então o prefixo da campanha é usado, uma alternativa para se ouvir tocar é 88. + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> + <BR> + <B>Cliente 3-Way Logging Hangup -</B> Se esta opção estiver habilitada a user_call_log irá registrar quando um cliente hangup até se desligar durante uma chamada 3-way. Além disso, este pode permitir para o cliente 3-forma acção hangup se um é defineed abaixo. O padrão é ativado. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> + <BR> + <B>Cliente 3-Way Segundos hangup -</B> Se o registro do cliente 3-way é ativada, esta opção permite que você defina o número de segundos após o desligamento do cliente é detectado antes que ele está realmente conectado eo cliente opcional ação hangup de 3 vias é executado. O padrão é 5 segundos. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_action"> + <BR> + <B>Cliente 3-Way Ação Hangup -</B> Se o registro do cliente 3-way é ativada, esta opção permite-lhe ter a tela de agente automaticamente pendurar-se sobre a chamada e ir para a tela DISPO se esta opção estiver definida para DISPO. O padrão é NONE. + <?php if ($SSqc_features_active > 0) { @@ -3993,6 +5541,31 @@ if ($ADD==99999) <BR> <B>Status da Chamada no Vtiger -</B> Se a integração com o Vtiger estiver habilitada nas configurações do sistema então esta configuração irá definir se o status da conta no Vtiger irá ser atualizada com o status da chamada no VICIDIAL depois que ela foi finalizada. O padrão é N. + <BR> + <A NAME="vicidial_campaigns-queuemetrics_callstatus"> + <BR> + <B>QM CallStatus Override -</B> Se a integração QueueMetrics está ativado nas configurações do sistema, em seguida, essa configuração permite que o principal das configurações do sistema de definição para as entradas CallStatus queue_log. O padrão é DISABLED que irá utilizar a configuração do sistema. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>QM Ambiente Telefone -</B> Se a integração QueueMetrics está ativado nas configurações do sistema, em seguida, essa configuração permite a inserção de dados este valor no campo dados4 do queue_log para registros de atividade do agente. O padrão é vazio para deficientes físicos. + + <BR> + <A NAME="vicidial_campaigns-extension_appended_cidname"> + <BR> + <B>Extensão Anexar CID -</B> Se activado, as chamadas feitas a partir deste campanha terá um espaço e da extensão de telefone do agente acrescentado ao final do nome CallerID para a chamada antes de ser enviado para o agente. Padrão é n para deficientes físicos. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>Agrupamento PLLB -</B> Telefone Entrar Agrupamento de balanceamento de carga, só é permitido se houver vários agentes e servidores de aliases de telefone estão presentes no sistema. Se definido como ONE_SERVER_ONLY vai obrigar todos os agentes para essa campanha para entrar no mesmo servidor. Se definido como CASCATA ele vai agrupar logado agentes no mesmo servidor até PLLB Limitar número Agrupamento de agentes são atingidos, então o próximo agente entrará para o próximo servidor com o menor número de agentes. Se definido como Desativado o padrão de comportamento Telefone Aliases de cada agente encontrar o servidor com o menor número de não-remotos agentes conectados em que será utilizado. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>PLLB Limite Agrupamento -</B> Telefone Entrar Carga Limite Agrupamento de balanceamento. Se Agrupamento PLLB está definido para CASCATA essa configuração irá determinar o número de agentes aceitável em cada servidor para esta campanha. O padrão é 50. + <BR> <A NAME="vicidial_campaigns-crm_popup_login"> <BR> @@ -4013,6 +5586,11 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada es dispositioned por un agente, si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. dispo y talk_time son las variables que puede utilizar para recuperar el agente definido por la disposición de la llamada y el tiempo de conversación real en segundos de la llamada. Esta URL no puede ser una ruta relativa. Por defecto está en blanco. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>No URL chamada Agent -</B> Este endereço de URL da web não é visto pelo agente, mas se ela é preenchida é chamada cada vez que uma chamada que não é tratado por um agente é desligou ou transferidos. Usa as mesmas variáveis ​​que os campos de formulários da Web e scripts. dispo pode ser usado para recuperar o definido pelo sistema de disposição para a chamada. Esta URL não pode ser um caminho relativo. O padrão é em branco. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4048,13 +5626,28 @@ if ($ADD==99999) <BR> <B>Agente de pausa después de cada llamada -</B> Esta opción si se define como Y hará una pausa en el agente después de cada llamada automáticamente. Por defecto es n. + <BR> + <A NAME="vicidial_campaigns-blind_monitor_warning"> + <BR> + <B>Aviso Monitor de Cegos -</B> Esta opção, se habilitado deixará o agente sabe de várias formas opcionais, se eles estão sendo monitorados por alguém cego. DESATIVADO significa que este recurso não está ativo, o alerta só aparecerá um alerta na tela do agente, AVISO irá publicar uma nota que permanece na tela do agente, enquanto theyâ re sendo monitorado, AUDIO vai jogar o nome definido abaixo quando um agente está começando a ser monitorados e as outras opções são combibnations das opções acima. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_message"> + <BR> + <B>Aviso Monitor de Cegos -</B> Esta é a mensagem que irá mostrar na tela do agente, enquanto eles estão sendo monitorados se a opção AVISO é selecionado. O padrão é -Someone is blind monitoring your session-. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_filename"> + <BR> + <B>Nome do Monitor de Cegos -</B> Este é o arquivo de áudio que será reproduzido na sessão de agentes no início do monitoramento alguém cegá-los. Este aviso vai ser jogado para todos na sessão, incluindo o cliente se for o caso está presente. O padrão é vazio. + <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_LISTAS TABELA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTS TABELA</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>ID da Lista -</B> Este é o nome numérico da lista, não é editável após a confirmação do cadastro, deve conter somente numeros e deve ter entre 2 e 8 caracteres de comprimento. Must be a number greater than 100. @@ -4118,11 +5711,26 @@ if ($ADD==99999) <BR> <B>Drop de entrada Grupo de Override -</B> Si se establece este campo, en este grupo se utilizará para las llamadas salientes dentro de esta lista que la caída de la campaña de salida en lugar de la caída en grupo situado en la pantalla de detalle de la campaña. Por defecto no se establece. + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Override Formulário Web - </ B> Este é o endereço personalizado que clicar no botão Formulário Web em VICIDIAL irá levá-lo para as chamadas que entram em nesta lista. Se você quiser usar campos personalizados em um endereço de formulário web, você precisa adicionar &CF_uses_custom_fields=Y como parte de sua URL. + <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>Xfer-Conf Número Override -</B> Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Relatório de Inventário -</B> Se o relatório de inventário está habilitado em seu sistema, esta opção irá determinar se esta lista é incluída no relatório ou não. O padrão é Y para sim. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Definição de Fuso Horário -</B> Esta opção permite que você defina o método de manter a pesquisa de fuso horário atual para as ligações dentro desta lista. Este processo só é feito à noite para que todas as alterações feitas não serão imediatos. COUNTRY_AND_AREA_CODE é o padrão, e vai usar o código do país eo código de área do número de telefone para determinar o fuso horário do chumbo. Postal_code irá utilizar o código postal se disponível para determinar o fuso horário do chumbo. NANPA_PREFIX funciona apenas nos EUA e vai usar o código de área eo prefixo do número de telefone para determinar o fuso horário do chumbo, mas isso não é ativado por padrão no sistema, por isso, tenha certeza de ter os dados prefixo NANPA carregados seu sistema antes de selecionar esta opção. OWNER_TIME_ZONE_CODE usará o abbraviation zona padrão de tempo carregado no campo do proprietário do chumbo para determinar o fuso horário, nos EUA são exemplos AST, EST, CST, MST, PDT, AKST, HST. Este recurso deve ser ativado pelo administrador do sistema para entrar em vigor. + <BR> <A NAME="vicidial_list-dnc"> @@ -4133,7 +5741,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_ENTRANTE_GROUPS TABELA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_GROUPS TABELA</FONT></B><BR><BR> <A NAME="vicidial_inbound_groups-group_id"> <BR> <B>ID do Grupo -</B> Nome curto do grupo de entrada, não é editável após confirmação, não deve conter qualquer espaços e deve ter entre 2 e 20 caracteres de comprimento. @@ -4153,10 +5761,20 @@ if ($ADD==99999) <BR> <B>Ativo -</B> Indica se o grupo será mostrado na caixa de seleção quando o agente do VICIDIAL efetua logon . + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse grupo de entrada, o que permite a visualização de administrador isso no grupo restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador para visualizar esta em grupo. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>In-Grupo Calldate -</B> Esta é a última data e hora em que uma chamada foi direcionada para esse grupo de entrada. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Formulário Web -</B> Endereço customizado para o qual o botão WEB FORM no VICIDIAL leva quando clicado, nas chamadas que entram para este grupo. + <B>Formulário Web -</B> Endereço customizado para o qual o botão WEB FORM no VICIDIAL leva quando clicado, nas chamadas que entram para este grupo. Se você quiser usar campos personalizados em um endereço de formulário web, você precisa adicionar &CF_uses_custom_fields=Y como parte de sua URL. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4165,14 +5783,30 @@ if ($ADD==99999) <BR>   - random: ordena por um número randômico de atualizações na tabela vicidial_live_agents <BR>   - oldest_call_start: ordena pela última vez que um agente recebeu uma chamada. Resulta nos agentes recebendo uma média igual de chamadas. <BR>   - oldest_call_finish: ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada. + <BR>   - oldest_inbound_call_start: encomendas por a última vez que um agente foi enviado uma chamada de entrada. Resultados em agentes que recebem aproximadamente o mesmo número de chamadas global. + <BR>   - oldest_inbound_call_finish: encomendas por a última vez que um agente terminar uma chamada de entrada. AKA agente espera mais longa recebe primeira chamada. <BR>   - overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas. <BR>   - inbound_group_rank: ordena pelo ranking dado para um agente para um grupo de entrada. Do mais alto para o mais baixo. - <BR>   - fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro. <BR>   - campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo. + <BR>   - ingroup_grade_random: dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados por em grupo. + <BR>   - campaign_grade_random: dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados por campanha. + <BR>   - fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> NOTAS: Para ring_all, os agentes que estão usando telefones que têm Em habilitado agente Gancho terá seu anel de telefones e o primeiro a responder vai receber a chamada e as informações na tela do agente. Desde ring_all ignora tempo agente espera e classificação e vai chamar todos os agentes que está disponível para a fila, nós não recomendamos usar este método para as filas grandes. Ao utilizar ring_all, agentes conectados com telefones que têm o Agente Gancho Em desativado terá que usar as chamadas em painel de fila e clique no link CHAMADA TOMAR PARA receber chamadas em fila. A quantidade de tempo que o telefone vai tocar para os agentes ring_all está definido para a configuração de tempo no gancho do anel ou o menor tempo de anel dos telefones que serão chamados. Nós não recomendamos o uso ring_all em filas de chamadas em grande volume, ou filas com muitos agentes. O método ring_all se destina a ser usado com apenas alguns agentes e sobre o volume de chamadas em baixo-grupos. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>No gancho-Time Anel -</B> Esta opção só é usada para os agentes que são registrados com telefones que têm a função de agente no gancho habilitado. Este é o número de segundos que cada tentativa de chamada para o agente tocará para até que o sistema irá aguardar um segundo e começar a tocar os telefones agente disponível novamente. Este campo pode ser substituído se os telefones de agentes são definidos para um menor tempo de anel que pode ser necessário para evitar chamadas sejam enviados um correio de voz telefones. O padrão é 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>Em Hook-CID -</B> Esta opção só é usada para os agentes que são registrados com telefones que têm a função de agente no gancho habilitado. Este é o identificador de chamadas que aparecerá em seus telefones agente quando as chamadas são de toque. GENERIC é um tipo genérico RINGAGENT00000000001 da notificação. Ingroup vai mostrar apenas o grupo na chamada veio. CUSTOMER_PHONE irá mostrar apenas o número de telefone do cliente. CUSTOMER_PHONE_RINGAGENTE irá mostrar RINGAGENT_3125551212 com o RINGAGENTE como parte do CID com o número de telefone do cliente. CUSTOMER_PHONE_INGROUP irá mostrar os primeiros 10 caracteres do grupo em seguida o número do telefone do cliente. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4187,10 +5821,15 @@ if ($ADD==99999) <BR> <B>Script da Campanha -</B> Este menu permite que seja escolhido um script que irá aparecer na tela do agente para essa campanha. Selecione NONE para não mostrar scripts para esta campanha. + <BR> + <A NAME="vicidial_inbound_groups-ignore_list_script_override"> + <BR> + <B>Ignorar Override Script Lista-</B> Esta opção permite que você ignore a lista de ID opção Override Script para chamadas que entram esta no Grupo. Definindo-a para Y irá ignorar qualquer lista as configurações de script de identificação. O padrão é N. + <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Abrir com Chamada -</B> Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. + <B>Abrir com Chamada -</B> Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. Se os campos personalizados da lista estão habilitados em seu sistema, formulário será aberto no separador FORMULÁRIO na conexão de uma chamada para um agente. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4200,7 +5839,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. + <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. HANGUP irá desligar a chamada quando o cronômetro é disparado, CALLMENU enviará a chamada para o menu de chamada especificado no campo Destino Temporizador Ação, EXTENSÃO enviará a chamada para o ramal que está especificado no campo Destino Temporizador Ação, IN_GROUP enviará a chamada para o No Grupo-especificado no campo Destino Temporizador Ação. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4212,6 +5851,11 @@ if ($ADD==99999) <BR> <B>Temporizador Segundos Acción -</B> Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. + <BR> + <A NAME="vicidial_inbound_groups-timer_action_destination"> + <BR> + <B>Destino Ação temporizador -</B> Este campo é onde você especificar a chamada do menu de extensão, ou em grupo que você deseja a chamada enviada se o tempo de ação é definido como EXTENSÃO CALLMENU, ou IN_GROUP. O padrão é vazio. + <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> @@ -4225,18 +5869,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Extensão de Drop - </B> Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop. + <B>Extensão de Drop - </B> Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop. Para AGENTDIRECT em grupos de, se o usuário não estiver disponível, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>Correio de Voz -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + <B>Correio de Voz -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Grupo de Transferência de Drop - </B> Caso a Ação de Drop esteja configurada como IN_GROUP, a chamada será enviada para esse Grupo de Entrada após o tempo limite. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Largar menu de chamada -</B> Se a Ação Gota é definida como CALLMENU, a chamada será enviada para este menu chamada se atingir Segundos chamada gota. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Transferência de Ação CID -</B> Usado para soltar, após o expediente e nenhum agente-fila não-ações. Este é o número de identificação do chamador que a chamada usa antes de ser transferido para extensões, mensagens, correio de voz ou menus de atendimento. Você pode usar CLIENTE neste campo a ser usado o número de telefone do cliente, ou Campanha para usar a primeira campanha permitiu número identificador de chamadas. O padrão é CLIENTE. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4255,22 +5909,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Extensão Fora do Expediente -</B> Extensão a ser enviada a chamada que entrar se o campo Ação estiver como EXTENSION. O padrão é 8300. + <B>Extensão Fora do Expediente -</B> Extensão a ser enviada a chamada que entrar se o campo Ação estiver como EXTENSION. O padrão é 8300. Para AGENTDIRECT em-grupos, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Correio de Voz Fora do Expediente-</B> A caixa de VoiceMail a ser enviada a chamada, quando o campo Ação for VOICEMAIL. + <B>Correio de Voz Fora do Expediente-</B> A caixa de VoiceMail a ser enviada a chamada, quando o campo Ação for VOICEMAIL. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>Grupo de Transferência Fora do Expediente- </B> Se a Ação de Fora do Expediente estiver configurada para IN_GROUP, a chamada irá ser enviada para esse grupo de entrada se ela entrar neste grupo de entrada fora do horário configurado no Horário de Chamadas para este grupo de entrada. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>After Hours chamada do menu -</B> Se After Hours Ação é definida como CALLMENU, a chamada será enviada para este menu de chamada se ele entra no exterior no grupo do regime de tempo de chamada definido para o grupo em-. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>N de colas n Agentes -</B> Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. + <B>N de colas n Agentes -</B> Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz. Você também pode colocar AGENTEXT neste campo, se ele é definido como extensão eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -4282,6 +5941,21 @@ if ($ADD==99999) <BR> <B>No hay ninguna cola Acción Agente Valor -</B> Este es el valor de la acción anterior. El valor predeterminado es nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Max chama o método -</B> Esta opção pode permitir que o máximo recurso de chamadas simultâneas para esta no grupo. Se definido como TOTAL, então o número total de chamadas que estão sendo manipulados pelos agentes e em fila neste em grupo não será permitido exceder a Max Chama Contar o número de linhas como definido abaixo. Se definido como IN_QUEUE, então se o número de chamadas em fila de espera para os agentes não será permitido exceder a Max Chama Conte, não importa quantas chamadas são com agentes para isso no grupo. O padrão é DISABLED. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Max chama Conte -</B> Esta opção deve ser definida maior que 0 se você quiser usar o recurso do método Max Chama. O padrão é 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Max chama Ação -</B> Esta é a ação a ser tomada se o Max chama o método é habilitado eo número de chamadas exceder o que está definido acima, na Max Chama Conte configuração. As chamadas superiores a esse montante será enviado para tanto o GOTA ação, a ação ou a ação AfterHours NO_AGENT_NO_QUEUE e será registrado como um estado MAXCAL com uma razão hangup MAXCALLS. O padrão é NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -4307,6 +5981,16 @@ if ($ADD==99999) <BR> <B>Intervalo de Anúncio -</B> O tempo em segundos para esperar até tocar a mensagem de Espera. O padrão é 60. Para desabilitar a Mensagem em Espera, configuro o intervalo como 0. + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> + <BR> + <B>On Hold Prompt No Bloco -</B> Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada em espera, onde o aviso é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o On Hold mensagem Filename Prompt está jogando a um cliente que não pode ser enviada a um agente. O padrão é N. + + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> + <BR> + <B>On Hold Segundos Prompt -</B> Este campo precisa ser definido como o número de segundos que o Filename On Hold Prompt joga. O padrão é 10. + <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> <BR> @@ -4317,35 +6001,160 @@ if ($ADD==99999) <BR> <B>Tocar Tempo Estimado - </B> Isto define se o cliente irá ouvir o tempo estimado de espera antes de ser transferido para um agente. O padrão é N. Se o cliente está em espera e ouve o tempo estimado de atendimento, o tempo mínimo que será tocado é de 15 segundos. + <BR> + <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> + <BR> + <B>Calcule Segundos Retenção estimado -</B> Isso define o número de segundos na fila que o cliente irá esperar antes de o tempo de espera estimado será calculado e, opcionalmente, jogado. Mínima é de 3 segundos, mesmo se definida inferior a 3. O padrão é 0. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> + <BR> + <B>Estima Segure Filename tempo mínimo -</B> Se o tempo de retenção estimado é activo e é calculado para ser igual ou inferior ao mínimo de 15 segundos, então este ficheiro irá ser jogado em vez de o anúncio padrão. O padrão é vazio para inativos. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> + <BR> + <B>Mínimo Tempo estimado de espera Não Avisar Bloco -</B> Se Tempo de espera estimado é ativo eo estimado de espera Tempo campo Nome do arquivo mínimo acima é preenchido, então esta opção para permitir que as chamadas em fila atrás de uma chamada em que o prompt está jogando para ir a um agente se torna disponível quando a mensagem é jogar . Enquanto o tempo está a desempenhar a um cliente que não podem ser enviados para um agente. O padrão é N. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> + <BR> + <B>Estimado Hold Time Segundos mínimos Prompt -</B> Este campo precisa ser definido como o número de segundos que o estimado de espera Filename tempo mínimo prompt de joga. O padrão é 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option"> + <BR> + <B>Aguarde Opção Tempo -</B> Isto permite-lhe oferecer aos clientes opções para deixar a fila se o tempo de espera é sobre a quantidade de segundos especificados abaixo. O padrão é NONE. Se uma das opções de PRESS_ é selecionado, ele vai jogar o Filename Imprensa definido abaixo e dar ao cliente a opção de pressionar 1 em seu telefone para sair da fila e executar a opção selecionada. A opção PRESS_STAY enviará o cliente de volta para a fila sem perder seu lugar na fila. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_second_option"> + <BR> + <B>Aguarde Opção Segundo Tempo -</B> Mesmo que o primeiro campo Opção Wait Time acima, exceto este irá verificar para o cliente pressionando a tecla 2. O padrão é NONE. Se nenhuma opção de tempo de espera é primeiro selecionado, então esta opção não serão oferecidos. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_third_option"> + <BR> + <B>Aguarde Opção terceira vez -</B> Mesmo que o primeiro campo Opção Wait Time acima, exceto este irá verificar para o cliente pressionando a tecla 3. O padrão é NONE. Se nenhuma opção Second Time Wait for selecionado, então esta opção não serão oferecidos. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> + <BR> + <B>Aguarde alguns segundos opção de tempo -</B> Se a opção Tempo de espera é definida como qualquer coisa, mas NENHUM, este é o número de segundos que o cliente está esperando na fila que irá acionar as opções de tempo de espera. O padrão é 120 segundos. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_exten"> + <BR> + <B>Aguarde Opção Extensão Tempo -</B> Se a opção Tempo de espera é definido como PRESS_EXTEN, esta é a extensão dialplan que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção. Para AGENTDIRECT em-grupos, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> + <BR> + <B>Espere Callmenu opção de tempo -</B> Se a opção Tempo de espera é definido como PRESS_CALLMENU, este é o menu de chamada que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> + <BR> + <B>Espere Correio de Voz opção de tempo -</B> Se a opção Tempo de espera é definido como PRESS_VMAIL, esta é a caixa de correio de voz que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> + <BR> + <B>Espere Transferência Tempo Opção em grupo -</B> Se a opção Tempo de espera é definido como PRESS_INGROUP, este é o grupo de entrada que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> + <BR> + <B>Tempo de espera Filename Pressione Opção -</B> Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado, se o tempo de espera do cliente exceder os Aguarde alguns segundos opção de tempo para dar ao cliente a opção de pressionar 1, 2 ou 3 em seu telefone para executar os selecionados Wait Imprensa opções de tempo. É muito importante que você inclua opções no arquivo de áudio para todas as suas opções selecionadas Tempo de espera, e que o tamanho do arquivo de áudio em segundos está devidamente definido no campo Nome do arquivo Segundos abaixo ou haverá problemas. O padrão é a-ser-chamado-back. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> + <BR> + <B>Espere Pressione Opção No Time Bloco -</B> Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada onde o Tempo de Espera Pressione Opção Filename prompt é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o Tempo de Espera Opção mensagem Filename Imprensa está jogando a um cliente que não pode ser enviada a um agente. O padrão é N. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> + <BR> + <B>Aguarde tempo de opção Segundos Nome do ficheiro Imprensa -</B> Este campo precisa ser definido como o número de segundos que o Wait Time Filename Pressione Opção joga. O padrão é 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> + <BR> + <B>Aguarde Opção Time After Filename Imprensa -</B> Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado depois que o cliente tem pressionado 1, 2 ou 3. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> + <BR> + <B>Tempo de espera Opção ID Lista de chamada de retorno -</B> Se a opção Tempo de espera é definido como PRESS_CID_CALLBACK, este é o ID da chamada Lista é adicionado como uma nova pista, se o cliente pressiona a tecla opção quando apresentados com a opção. + + <BR> + <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> + <BR> + <B>Espere Segure Prioridade Opção -</B> Se ambas as opções Retenção estimado vez e aguarde opções de tempo são ativos, esta configuração irá definir se um, outro ou ambos os recursos são ativos. Por exemplo, se a opção de tempo estimado de espera é definida como 360, a opção Tempo de espera é definida para 120 eo cliente tem estado à espera de 120 segundos e ainda há 400 segundos estimados tempo de espera, então eles são ambos ativos ao mesmo tempo e esta definição será verificada para ver quais opções serão oferecidas. O padrão é esperar apenas. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Opção de Tempo de Espera - </B> Permite que você especifique uma rota para a chamada caso o tempo de espera esteja superior a quantidade de segundos configurada abaixo. O padrão é NONE. + <B>Estimated Opção de Tempo de Espera - </B> Permite que você especifique uma rota para a chamada caso o tempo de espera esteja superior a quantidade de segundos configurada abaixo. O padrão é NONE. Se uma das opções de PRESS_ é selecionado, ele vai jogar o Filename Imprensa definido abaixo e dar ao cliente a opção de pressionar 1 no seu telemóvel para deixar a fila e executar a opção selecionada. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_second_option"> + <BR> + <B>Segure Opção Segundo Tempo -</B> Mesmo que o primeiro campo Opção Tempo de espera acima, exceto este irá verificar para o cliente pressionando a tecla 2. O padrão é NONE. Se nenhuma opção de tempo de espera primeiro é selecionada a opção não será oferecido. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_third_option"> + <BR> + <B>Segure Opção terceira vez -</B> Mesmo que o primeiro campo Opção Tempo de espera acima, exceto este irá verificar para o cliente pressionando a tecla 3. O padrão é NONE. Se nenhuma opção Second Time espera for selecionado, então esta opção não serão oferecidos. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> <BR> <B>Tempo de Opção de Espera - </B> Se a opção de tempo de espera estiver configurado para um valor diferente de NONE, este número em segundos de tempo estimado de atendimento irá acionar esta opção de espera. O padrão é 360 segundos. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> + <BR> + <B>Segure mínimo opção de tempo -</B> Se a opção Tempo de espera ativado, este é o número mínimo de segundos que a chamada deve ser de espera antes de ser apresentado com a opção de tempo de espera. A opção de tempo de retenção será imediatamente apresentado neste momento, se o tempo de espera estimado é maior do que o valor de tempo de espera Opção Segundos. O padrão é 0 segundos. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Extensão de Opção de Tempo - </B> Se a Opção de Tempo de Espera estiver como EXTENSION, esta extensão do plano de discagem será usada para enviar a chamada quando o tempo de espera superar a configuração de tempo de espera. + <B>Extensão de Opção de Tempo - </B> Se a Opção de Tempo de Espera estiver como EXTENSION, esta extensão do plano de discagem será usada para enviar a chamada quando o tempo de espera superar a configuração de tempo de espera. Para AGENTDIRECT em-grupos, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> + <BR> + <B>Segure Callmenu opção de tempo -</B> Se a opção Hold Time está definido para CALL_MENU, este é o menu de chamada que a chamada será enviado para que o tempo de espera estimado ultrapassa os Segundos opção Tempo de Espera. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>VoiceMail da Opção de Espera - </B> Se a Opção de Espera estiver como VOICEMAIL, esta é a caixa de voicemail que a chamada será direcionada, caso o tempo de espera exceda o tempo configurado na opção de tempo. + <B>VoiceMail da Opção de Espera - </B> Se a Opção de Espera estiver como VOICEMAIL, esta é a caixa de voicemail que a chamada será direcionada, caso o tempo de espera exceda o tempo configurado na opção de tempo. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> <BR> <B>Gr. de Entr. da Opção de Espera - </B> Se a Opção de Espera for IN_GROUP, este grupo de entrada será usado para transferir a chamada que entrar e o tempo de espera estimado for maior que o tempo da opção.. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> + <BR> + <B>Hold Time Filename Pressione Opção -</B> Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado, se o tempo de espera estimado ultrapassa os Segundos Opção Hold Time para dar ao cliente a opção de pressionar 1 em seu telefone para executar o Hold Time selecionado Pressione Opção. É muito importante que este ficheiro de áudio é de 10 segundos ou menos, ou não haverá problemas. O padrão é a-ser-chamado-back. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> + <BR> + <B>Segure Pressione Opção No Time Bloco -</B> Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada onde o espera Tempo Pressione Opção Filename prompt é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o Tempo de espera Opção mensagem Filename Imprensa está jogando a um cliente que não pode ser enviada a um agente. O padrão é N. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> + <BR> + <B>Hold Time Opção Segundos Nome do ficheiro Imprensa -</B> Este campo precisa ser definido como o número de segundos que o tempo de espera Filename Pressione Opção joga. O padrão é 10. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Arquivo de Agendamento da Espera - </B> Se a configuração de Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esse arquivo será tocado e então a chamada será considerada com status de novo para a lista abaixo se o tempo estimado de espera exceder o tempo configurado. + <B>Segure Opção Time After Filename Imprensa -</B> Se a opção Tempo de espera é definida como uma das opções PRESS_ ou CALLERID_CALLBACK, este é o prompt de nome de arquivo que é jogado depois que o cliente tem pressionado 1 ou a chamada foi adicionado à lista de chamada de retorno. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -4375,7 +6184,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>Nome do Arquivo de Gravação de Entrada- </B> Este campo irá sobrepor o perfil de nome de arquivo de gravação da campanha, a não ser que esteja configurado como NONE. As variáveis permitidas são: CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENTE e irá ficar assim: 20051020-103108_6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que irá ficar assim: TESTCAMP_51020103108_3125551212. 50 caracteres no máximo. Padrão é NONE. + <B>In-Group Recording Filename -</B> This field will override the Gravação da Campanha Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. O padrão é FULLDATE_AGENTE e ficaria assim 20051020-103108_6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que ficaria assim TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -4444,18 +6253,42 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. + <BR> + <A NAME="vicidial_inbound_groups-add_lead_url"> + <BR> + <B>Adicionar Chumbo URL -</B> Este endereço de URL teia não é visto pelo agente, mas é chamado cada vez que um chumbo é adicionado ao sistema através do processo de entrada. O padrão é em branco. Você deve começar esta URL com VAR se você quiser usar variáveis ​​e, é claro - A - e - B - em torno da variável real na URL onde você quer usá-lo. Aqui está a lista de variáveis ​​que estão disponíveis para esta função. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>No URL chamada Agent -</B> Este endereço de URL da web não é visto pelo agente, mas se ela é preenchida é chamada cada vez que uma chamada que não é tratado por um agente é desligou ou transferidos. Usa as mesmas variáveis ​​que os campos de formulários da Web e scripts. dispo pode ser usado para recuperar o definido pelo sistema de disposição para a chamada. Esta URL não pode ser um caminho relativo. O padrão é em branco. + <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> <BR> <B>Alias de Grupo Padrão - </B> Se você permitium Alias de Grupo para a campanha que o agente está logado, então este é o alias de grupo que é selecionado como padrão em uma chamada vindo deste grupo de entrada quando o agente escolhe um alias de grupo para uma chamada manual. O padrão é NONE ou vazio. + <BR> + <A NAME="vicidial_inbound_groups-extension_appended_cidname"> + <BR> + <B>Extensão Anexar CID -</B> Se activado, as chamadas entrada, desde no grupo-terá um espaço ea extensão de telefone do agente acrescentado ao final do nome CallerID para a chamada antes de ser enviado para o agente. Padrão é n para deficientes físicos. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_display"> + <BR> + <B>Mostrar de Status uniqueid -</B> Se ativado, quando um agente recebe uma chamada através deste em grupo eles vão ver o uniqueid da chamada adicionada à linha de status em sua interface agente. O prefixo opção irá adicionar o prefixo definido golpe para o início da uniqueid no visor. O padrão é DISABLED. Se já havia uma uniqueid definido em uma chamada inserindo este no grupo-, então a uniqueid original será exibido. Se a opção de manter, seja utilizado ea chamada é enviada para um segundo agente, o prefixo uniqueid e exibida para o primeiro agente também será exibida para o segundo agente. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> + <BR> + <B>Prefixo Estado uniqueid -</B> Se a opção for selecionada PREFIX acima, então este é o valor do prefixo. O padrão é vazio. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_ENTRANTE_DIDS TABELA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_DIDS TABELA</FONT></B><BR><BR> <BR> <A NAME="vicidial_inbound_dids-did_pattern"> <BR> @@ -4471,11 +6304,21 @@ if ($ADD==99999) <BR> <B>DDR Ativo - </B> Este é o campo que você configura se o DDR está ativo ou não. O padrão é Y. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para este fez, isso permite a visualização de administração deste ter restringido por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador para visualizar este fez. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> <B>Rota DDR - </B> Este é o tipo de rota que seu DDR irá usar. EXTEN irá enviar as chamadas para a extensão abaixo, VOICEMAIL irá enviar as chamadas para uma caixa de voicemail digitada abaixo, AGENTE irá enviar as chamadas para um agente do VICIDIAL se ele estiver logado no sistema, PHONE irá enviar a chamada para um ramal configurado abaixo, IN_GROUP irá enviar as chamadas diretamente para um grupo de entrada especificado abaixo. O padrão é EXTEN. MENU irá enviar a chamada para o menu determinado. + <BR> + <A NAME="vicidial_inbound_dids-record_call"> + <BR> + <B>Registro de chamada -</B> Esta opção permite que você defina as chamadas que vem a este fez para ser gravado. Y vai gravar a chamada inteira, Y_QUEUESTOP irá gravar a chamada até que a chamada é hungup ou entra em uma fila em grupo, N não vai gravar a chamada. O padrão é N. + <BR> <A NAME="vicidial_inbound_dids-extension"> <BR> @@ -4529,7 +6372,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID. + <B>In-Group Call lidar com Método -</B> IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID. Se um método é usado com CIDLOOKUP ALT, ele irá procurar o campo alt_phone para o número de telefone, se nenhuma correspondência for encontrada para o número de telefone principal. Se um método é usado com CIDLOOKUP ADDR3, ele irá procurar o campo Endereço3 para o número de telefone, se nenhuma correspondência for encontrada para o número de telefone principal e, opcionalmente, o campo alt_phone. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -4551,6 +6394,44 @@ if ($ADD==99999) <BR> <B>Código do Tel. de Entrada -</B> Se IN_GROUP estiver selecionado como rota de DDR, então este é o código de telefone usado para um novo registro. + <BR> + <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> + <BR> + <B>Limpe Número CID -</B> Este campo permite que você especifique um número de dígitos para restringir o número de identificação de entrada chamador, colocando um R na frente do número de dígitos, por exemplo, para restringir o direito de 10 dígitos que gostariam de entrar no R10. Você também pode usar esse recurso para remover apenas um dígito ou dígitos colocando um L na frente dos dígitos específicos que você deseja remover, por exemplo, para remover a 1 como o primeiro dígito que você entraria em L1. O padrão é vazio. Se mais de uma regra é especificada certifique-se de separá-los com um espaço e do R será executado antes do L. + + <BR> + <A NAME="vicidial_inbound_dids-filter_inbound_number"> + <BR> + <B>Número de entrada do filtro -</B> Esta opção, se habilitada permite filtrar as chamadas que entram neste DID e enviá-los para uma ação alternativa se corresponderem a um número de telefone que está no grupo de telefone filtro ou uma resposta URL se você tiver configurado um. O padrão é DISABLED. GRUPO irá pesquisar em um grupo de Telefone Filter. URL irá enviar uma URL e irá corresponder a 1, se é enviado de volta. + + <BR> + <A NAME="vicidial_inbound_dids-filter_phone_group_id"> + <BR> + <B>ID Group Filter Telefone -</B> Se o campo Número de filtro de entrada é definida como grupo, então este é o ID do Grupo Telefone filtro que terão seus números pesquisados ​​à procura de um jogo para o número de identificação do autor da chamada. + + <BR> + <A NAME="vicidial_inbound_dids-filter_url"> + <BR> + <B>Filtro de URL -</B> Se o campo Número de filtro de entrada é definida como URL, então este é o endereço web de um script que irá procurar um sistema remoto e retornar um 1 por um jogo e um 0 para nenhuma correspondência. Apenas duas variáveis ​​estão disponíveis no endereço se você usar o prefixo VAR como com endereços webform em campanhas, - A - phone_number - B - e - A - did_pattern - B - pode ser usado na URL para indicar o identificador de chamadas do chamador e do DID que o cliente chamado em. + + <BR> + <A NAME="vicidial_inbound_dids-filter_action"> + <BR> + <B>Ação do Filtro -</B> Se Número de entrada do filtro é ativado e uma correspondência for encontrada, então esta é a ação que deve ser tomado. Este é o mesmo que a rota que você selecionar para um DID, e as configurações abaixo funcionar exatamente como eles fazem para um encaminhamento padrão. + + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>Personalizado DID Campos - </ B> Estes cinco campos podem ser usados ​​para diversos fins, principalmente relativas à programação personalizada e relatórios. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID substituições extensão remota do Agente -</B><BR>Esta seção permite que você ative DIDs ter substituições de extensão para agente remoto encaminhado chama através de in-grupos. O Início do usuário deve ser um usuário válido Iniciar Remote Agent ou se você quer a extensão Substituir entrada de trabalhar para todas as chamadas, então você pode usar --- todos --- no campo Iniciar do usuário. Se houver várias entradas para o mesmo usuário e DID Iniciar, em seguida, as entradas de ativos será usado em um método round robin. + @@ -4559,7 +6440,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENU TABELA</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>ID do Menu -</B> Este é o ID para este passo do menu de chamadas. Ele irá aparecer como o contexto que é usado no plano de discagem para este menu de chamadas. + <B>ID do Menu -</B> Este é o ID para este passo do menu de chamadas. Ele irá aparecer como o contexto que é usado no plano de discagem para este menu de chamadas. Aqui é uma lista de frases reservados que não pode ser usado como um menu de IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -4571,6 +6452,11 @@ if ($ADD==99999) <BR> <B>Audio do Menu -</B> Este campo contém o nome do arquivo para o audio que será tocado no inicio do menu. Puede introducir propmts múltiples en este campo y los demás ámbitos del sistema mediante la separación de ellos con un carácter de canalización. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -4611,10 +6497,20 @@ if ($ADD==99999) <BR> <B>Grupo de seguimiento de -</B> Esta es la identificación que se puede utilizar para rastrear las llamadas a este menú de llamada cuando se mira al Informe de IVR. La lista incluye CALLMENU como predeterminado, así como todos los Grupos de In -. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>Pressione a tecla Entrar -</B> Esta opção, se habilitado irá registrar a imprensa DTMF chave pelo chamador neste menu Chamadas. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Entrar Campo -</B> Se a opção Registrar Pressione a tecla estiver ativada, essa configuração opcional pode permitir que a resposta a ser armazenado neste campo lista. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. O padrão é NONE para deficientes físicos. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Valor da Opção -</B> Este campo é onde você define a opção de menu, as opções são: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. A opção especial TIMECHECK pode ser usada somente se você habilitou a verificação de horário e existe um horário de chamadas definido para o menu. Para remover uma opção, apenas selecione a rota como REMOVE e a opção será removida quando você clicar no botão enviar. + <B>Valor da Opção -</B> Este campo é onde você define a opção de menu, as opções são: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. A opção especial TIMECHECK pode ser usada somente se você habilitou a verificação de horário e existe um horário de chamadas definido para o menu. Para remover uma opção, apenas selecione a rota como REMOVE e a opção será removida quando você clicar no botão enviar. TIMEOUT irá permitir que você defina o que acontece com a chamada quando ele expira sem entrada a partir da chamada. INVALID irá permitir que você defina o que acontece quando o chamador entra uma opção inválida. INVALID_2ND e 3 º só pode estar ativo se inválido não for usado, ele vai esperar até a entrada segundo ou terceiro inválido pelo chamador antes de executar a opção. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -4637,15 +6533,45 @@ if ($ADD==99999) <BR> <B>Contexto do valor da rota da opção -</B> Este campo é opcional e somente é usado para Rotas do tipo EXTENSION. + <BR> + <A NAME="vicidial_call_menu-ingroup_settings"> + <BR> + <B>Chamada do menu Configurações em grupo -</B> Se a rota é definida como ingroup então há muitas opções que você pode definir para definir como a chamada é enviada para a fila. Em-Group é o grupo de entrada que você deseja que o convite para ir. Método Handle é o jeito que você quer que a chamada seja tratada, <a href="#vicidial_inbound_dids-call_handle_method">Clique aqui para ver uma lista dos métodos disponíveis punho</a>. Método de pesquisa define como a fila vai encontrar o próximo agente, recomendo deixar em LB. ID lista é a lista que o novo eletrodo é inserido, também se o método não é um método de pesquisa eo chumbo não é encontrado. ID da campanha é a campanha para procurar listas através se um dos métodos de RC é usado. Código de telefone é a entrada do campo phone_code para o chumbo que é inserido com. VID Enter Filename é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado de pedir ao cliente a entrar no seu ID. VID Filename número de identificação é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado após cliente entra em seu ID, algo como você digitou. VID Filename Confirmar é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado para confirmar sua identidade, algo como PRESS 1 para confirmar e entrar novamente 2. Dígitos VID é usado se o método é definido como um dos métodos VIDPROMPT, se ele é definido como um número é o número de dígitos que devem ser inseridos pelo cliente, quando solicitado pelo seu ID, se definido como vazio ou X, em seguida, o cliente terá que pressionar a libra ou de hash para terminar a sua entrada de sua ID. + <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dilplan entrada -</B> Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. + <B>Entrada Dialplan personalizado -</B> Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. + <BR><BR><BR><BR> + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> + <BR> + <B>ID Group Filter Telefone -</B> Este é o ID do Grupo Telefone filtro que é o recipiente para um grupo de números de telefone que você pode ter procurado automaticamente através quando receber uma chamada em um arquivo. DID e enviar para uma rota alternativa, se houver uma correspondência Este campo deve ser entre 2 e 20 caracteres e não têm pontuação, exceto para sublinhado. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> + <BR> + <B>Nome do grupo Filtro Telefone -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> + <BR> + <B>Descrição Group Filter Telefone -</B> Esta é a descrição do Grupo de telefone de filtro, é puramente para fins de notação apenas e não é um campo necessário. + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_REMOTE_AGENTS TABELA</FONT></B><BR><BR> @@ -4668,6 +6594,11 @@ if ($ADD==99999) <BR> <B>Extensão Externa -</B> Este é o número para o qual você quer que as chamadas sejam direcionadas. Tenha certeza que é um número completo do plano de discagem e que se você precisa de um 9 no começo, você o coloca aqui. Teste discando o número de um fone no sistema. + <BR> + <A NAME="vicidial_remote_agents-extension_group"> + <BR> + <B>Grupo de Extensão -</B> Se definido para algo diferente de NONE ou vazio este irá substituir o campo Extensão Externa e usar as entradas de extensão do Grupo que têm o mesmo ID de grupo de extensão. O padrão é NONE para desativado. + <BR> <A NAME="vicidial_remote_agents-status"> <BR> @@ -4678,6 +6609,16 @@ if ($ADD==99999) <BR> <B>Campanha -</B> Aqui é onde você escolhe a campanha que este agente remoto deve ser logado. Chamadas entrantes precisam usar uma campanha CLOSER e selecionar uma campanha entrante abaixo para que você receba chamadas. + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>Em Hook-agente -</B> Esta opção só é usada para chamadas de entrada que vão a este agente remoto. Este recurso irá chamar o agente remoto e não enviar o cliente para o agente remoto até que a linha é atendida. Padrão é n para deficientes físicos. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>No gancho-Time Anel -</B> Esta opção só é usada quando o campo agente no gancho acima é definido como Y e, em seguida, apenas para chamadas de entrada próximos a este agente remoto. Este é o número de segundos que cada tentativa de chamada irá tocar para tentar obter uma resposta. É recomendável que você defina isso para alguns segundos menos do que leva para uma chamada para ser enviado para a caixa postal. O padrão é 15. + <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> <BR> @@ -4686,7 +6627,30 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPANHA_LISTAS</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABELA</FONT></B><BR><BR> + <A NAME="vicidial_extension_groups-extension_group_id"> + <BR> + <B>Grupo de Extensão -</B> Este campo obrigatório é onde você entra o ID do grupo que você quer que essa extensão a ser colocada. Sem espaços ou caracteres especiais, exceto para destacar letras e números. + + <BR> + <A NAME="vicidial_extension_groups-extension"> + <BR> + <B>Extension -</B> Este campo obrigatório é o lugar onde você colocar a extensão dialplan que você deseja que o agente remoto chama para ser enviado para para esta entrada do grupo de extensão. + + <BR> + <A NAME="vicidial_extension_groups-rank"> + <BR> + <B>Rank -</B> Este campo permite-lhe classificar as entradas de extensão do grupo que compartilham o grupo de mesma extensão. O padrão é 0. + + <BR> + <A NAME="vicidial_extension_groups-campaign_groups"> + <BR> + <B>Grupos de Campanhas -</B> Neste campo você pode colocar uma lista de IDs de campanha e IDs de grupo ou de entrada que você deseja restringir o uso do grupo de extensão para. Lista deve ser separada por tubos e têm um tubo no início e no fim da cadeia. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_CAMPANHA_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>As listas dentro desta campanha são listadas aqui, estando ativas ou desativadas será demonstrado por Y ou N e você pode ir para a tela de cadastro de listas clicando no Id na primeira coluna.</B> @@ -4751,6 +6715,28 @@ if ($ADD==99999) + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPANHA PRESETS</FONT></B><BR><BR> + <A NAME="vicidial_xfer_presets"> + <BR> + <B>Se o cenário de campanha para pré-está definido como Habilitado, então você tem a capacidade de definir Transferência-Conferência presets que estarão disponíveis para o agente que lhes permite 3-way chamar esses presets ou transferir chamadas cegos a estes números predefinidos. Essas predefinições também tem a opção de ocultar o número associado a cada preset do agente.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPANHA CID CódigoDeÁreaS</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Se a configuração do sistema para CódigoDeÁrea CIDs é habilitado eo cenário de campanha para uso personalizado CallerID é definido como código de área, então você tem a capacidade de definir CIDs CódigoDeÁrea que serão usados ​​quando chamado de saída para ligações nesta campanha específica. Você pode adicionar múltiplas callerIDs por areacode e você pode ativar e desativar cada um deles de tempo real. Se mais do que um callerID é activo para um código de área específica, então o sistema irá usar o callerid que tem sido utilizado o menor número de vezes que hoje em dia. Se não callerIDs são ativos para a areacode então o CallerID campanha ou uma lista de substituição CallerID será usado.</B> + + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_USER_GROUPS TABELA</FONT></B><BR><BR> @@ -4786,14 +6772,66 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Estado del agente visible Grupos -</B> Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. + <B>Estado del agente visible Grupos -</B> Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. A opção NÃO-logged-in-Agentes permite que todos os usuários do sistema a ser exibido, mesmo que eles não são registrados em curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> <BR> <B>Ver estado del agente de turno -</B> Esta opción define si el agente va a ver la cantidad de tiempo que los usuarios en su barra lateral agente han sido en su estado actual. Por defecto es n sin o con discapacidad. + <BR> + <A NAME="vicidial_user_groups-agent_call_log_view"> + <BR> + <B>Agente Ver registro de chamadas -</B> Esta opção define se o agente será capaz de ver o seu registo de chamadas para chamadas tratadas através da tela de agente ViciDial. Padrão é n para não ou desativado. + + <BR> + <A NAME="vicidial_user_groups-agent_xfer_options"> + <BR> + <B>Transferência Opções do Agente -</B> Estas opções de permitir a desactivação de botões específicos na secção Conferência de transferência da interface do agente. O padrão é Y para sim ou habilitado. + + <BR> + <A NAME="vicidial_user_groups-agent_fullscreen"> + <BR> + <B>Agente Fullscreen -</B> Esta opção se definido como Y irá definir a altura ea largura da tela agente ViciDial ao tamanho da janela do navegador web, sem qualquer subsídio para o Vista agentes, chamadas em modo de fila ou chamadas em vista Session. Padrão é n para não ou desativado. + + <BR> + <A NAME="vicidial_user_groups-allowed_reports"> + <BR> + <B>Relatórios admitidos -</B> Se um usuário neste grupo é definido como nível de usuário 7 ou superior, então este recurso pode ser usado para restringir os relatórios que os usuários possam visualizar. O padrão é ALL. Se você quiser selecionar mais de um relatório, em seguida, pressione a tecla Ctrl no teclado enquanto seleciona os relatórios. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Admitidos Grupos de Usuários -</B> Esta é uma lista selecionável de Grupos de Usuários em que os membros deste grupo de usuário pode visualizar e possivelmente editar. Grupos de usuários podem restringir o acesso a quase todos os aspectos do sistema, a partir de um DID de entrada para caixas de correio de voz para telefones. A - ALL - opção permite que os usuários neste grupo para ver e efetuar login em qualquer registro no sistema se suas permissões de usuário permitem que. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Admitidos Tempos de Ligação -</B> Esta é uma lista selecionável de Times de chamada para que os membros deste grupo de usuários pode usar em campanhas, em grupos de chamada e menus. A - ALL - opção permite que os usuários neste grupo a usar todos os tempos de chamada no sistema. + + <?php + if (strlen($SSwebphone_url) > 5) + { + ?> + <BR> + <A NAME="vicidial_user_groups-webphone_url_override"> + <BR> + <B>Substituir URL Webphone -</B> Esta configuração permite que você defina uma URL webphone alternativa apenas para os membros de um grupo de usuários. O padrão é vazio. + + <BR> + <A NAME="vicidial_user_groups-webphone_systemkey_override"> + <BR> + <B>Sistema Webphone Tecla Anulação -</B> Esta configuração permite que você defina uma chave do sistema alternativo webphone apenas para os membros de um grupo de usuários. O padrão é vazio. + + <BR> + <A NAME="vicidial_user_groups-webphone_dialpad_override"> + <BR> + <B>Webphone Dialpad Override -</B> Esta configuração permite ativar ou desativar o teclado na webphone apenas para os membros de um grupo de usuários. O padrão é DISABLED. TOGGLE permitirá ao usuário visualizar e ocultar o teclado, clicando em um link. TOGGLE_OFF será o padrão para não mostrar o teclado na primeira carga, mas permitirá que o usuário para mostrar o teclado, clicando no link dialpad. + + <?php + } + if ($SSqc_features_active > 0) { ?> @@ -4828,14 +6866,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Comentários do Script -</B> Aqui é onde você pode colocar comentários para um Script Vicidial como: -alterado em 23 de Set.-. Máximo 255 caracteres, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Texto do Script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Texto do Script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + Você também pode usar um IGNORENOSCROLL variável especial para forçar as barras de rolagem na guia script mesmo se você estiver usando um iframe dentro dela. <BR> <A NAME="vicidial_scripts-active"> @@ -4865,6 +6910,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>Comentários do Filtro -</B> Aqui é onde são colocados comentários para um Filtro Vicidial como por exemplo -liga para todos os registros da California-. Máximo de 255 caracteres, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>Filtro SQL -</B> É onde colocamos o fragmento da consulta SQL que você deseja usar para filtrar. Não inicie nem termine com AND, isso será adicionado pelo script do hopper automaticamente. Um exemplo de consulta SQL que funcionaría é: called_count \> 4 and called_count \<8 . @@ -4890,14 +6940,23 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>Comentários do Horário de Chamada - Aqui devem ser colocados os comentários para a definição de Horários de chamada, por ex: "10:00 as 16:00 com chamadas restritas". Máximo de 255 caracteres</B> . + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_call_times-ct_default_start"> - <B>Horário de Início e Fim Padrão -</B> Este é o padrão de horário no qual chamadas são permitidas se o dia de início na semana não estiver definido. 0 é meia noite. Para evitar chamadas a qualquer horário, coloque 2400 no início e 2400 no fim. Para permitir chamadas nas 24 horas do dia, coloque 0 e 2400 nestes campos. + <B>Horário de Início e Fim Padrão -</B> Este é o padrão de horário no qual chamadas são permitidas se o dia de início na semana não estiver definido. 0 é meia noite. Para evitar chamadas a qualquer horário, coloque 2400 no início e 2400 no fim. Para permitir chamadas nas 24 horas do dia, coloque 0 e 2400 nestes campos. Para somente de entrada, você também pode definir o tempo de chamada de parada maior do que 2400 se quiser que o tempo de chamada para ir além da meia-noite. Então, se você quiser que o seu tempo de chamada para executar a partir de 6 da manhã até as 2 da manhã do dia seguinte, você colocaria 0600 como o horário de início e 2600 como o tempo de paragem. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> <B>Horários de Início e Fim em dias Úteis -</B> Estes são os horários por dia que podem ser configurados para chamada. As mesmas regras se aplicam conforme os horários de início e fim. + <BR> + <A NAME="vicidial_call_times-default_afterhours_filename_override"> + <B>After Hours Override Filename -</B> Estes campos permitem substituir a mensagem Horas depois para os grupos de entrada, se for configurado para algo. O padrão é vazio. + <BR> <A NAME="vicidial_call_times-ct_state_call_times"> <B>Definição de Horários por Estado -</B> Esta é a lista de horários específica por Estado que deve ser seguida por esta definição de horário. @@ -4920,6 +6979,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Nome do Turno - </B> Este é um nome mais descritivo da definição do turno. É um resumo da definição do turno. Máximo de 50 caracteres, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Início do Turno- </B> É o horário que o turno da campanha começa. Deve ter apenas números, 9:30 seria apenas 0930 e 17:00 seria 1700. @@ -4932,13 +6996,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Dias do Turno -</B> Nesta sessão você deve escolher os dias da semana em que este turno funciona. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Opção Relatório -</B> Esta opção permite que essa mudança específica para aparecer nos relatórios selecionados que suportam esta opção. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Relatório Ranking -</B> Esta opção permite que você classifique as mudanças nos relatórios selecionados que suportam esta opção. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio de la tienda -</B> Esta utilidad te permite subir archivos de audio para el servidor de forma que puedan ser distribuidos a todos los servidores de Vicidial en un multi-cluster de servidores. Una nota importante, sólo dos tipos de archivos de audio de trabajo,. Archivos WAV PCM de 16 bits que se 8k y los archivos. GSM que se 8bit 8k. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí. + <B>Audio de la tienda -</B> Este utilitário permite que você envie arquivos de áudio para o servidor web de modo que eles podem ser distribuídos para todos os servidores ViciDial em um cluster multi-servidor. Uma nota importante, apenas dois tipos de arquivos de áudio irá funcionar,. Wav que são PCM Mono 16bit e 8k. Arquivos GSM que são 8k 8bit. Por favor verifique se seus arquivos estão devidamente formatado antes de enviá-las aqui. @@ -4957,6 +7028,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Ativo -</B> Esta opción le permite definir la música en espera la entrada en activo o inactivo. Inactivo eliminará la entrada de los archivos de conf. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Orden aleatorio -</B> Esta opción le permite definir la reproducción de los archivos de audio en un orden aleatorio. Si se establece a N, entonces el orden definido se utilizará. @@ -4983,9 +7059,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Ativo -</B> Esta opción le permite establecer la entrada de TTS a activos o inactivos. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + + <BR> + <A NAME="vicidial_tts_prompts-tts_voice"> + <B>Voz -</B> Isto é, onde poderá definir a voz a ser usado na geração de TTS. O padrão é Allison-8kHz. + <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Texto -</B> Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Texto -</B> Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> para uma pausa de 1 segundo. Você também pode usar diversas variáveis, tais como nome, sobrenome e título como variáveis ​​ViciDial exatamente como você faz em um Script: - A - first_name - B -. Se você tiver estáticos arquivos de áudio que você deseja usar com base no valor de um dos campos que você pode usar as também com C e D etiquetas. Os nomes dos arquivos devem estar em letras minúsculas e devem ser 8k 16bit arquivos PCM WAV. O nome do campo deve ser o mesmo, mas sem o wav. No nome do arquivo. Por exemplo - C ---- A - Endereço3 - B ---- D - em primeiro lugar encontrar o valor para Endereço3, então seria tentar encontrar um arquivo de áudio que correspondem ao valor de colocá-lo no prompt. Aqui está uma lista das variáveis ​​disponíveis: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -5013,12 +7098,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <B>Email -</B> Este ajuste opcional le permite tener los mensajes de correo de voz enviado a una cuenta de correo electrónico, si su sistema está configurado para enviar correo electrónico. Si este campo está vacío, entonces no los correos electrónicos se envían. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Eliminar correo de voz después del email -</B> Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Zona Correio de Voz -</B> Esta configuração permite que você defina a zona que esta caixa de correio de voz será definido para quando o tempo é registrado para uma mensagem. O padrão é definido nas configurações do sistema. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Opções de correio de voz -</B> Esta configuração opcional lhe permite definir as configurações de correio de voz adicionais. É recomendável que você deixe este campo em branco se você não sabe o que está fazendo. <?php if ($SSoutbound_autodial_active > 0) @@ -5035,7 +7130,7 @@ if ($ADD==99999) <LI>Código do Vendedor no Registro - é mostrado no campo Vendor ID na tela do agente <LI>Código Fonte - uso interno, somente para admins e DBAs <LI>ID da Lista - número da lista em que esses registros vão ser carregados - <LI>Código do Telefone - prefixo do número do telefone - 1 para EUA, 01144 para Reino Unido, 01161 para Australia, 55 para Brasil, etc + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Número do telefone - deve ter pelo menos 8 digitos <LI>Título - título do cliente(Sr. Sra. Srta., etc...) <LI>Nome @@ -5059,6 +7154,15 @@ if ($ADD==99999) <BR>ATENÇÃO: A funcionalidade de carregar registros usando arquivos EXCEL é permitida por uma série de scripts e precisa estar devidamente configurada no arquivo /etc/astguiclient.conf no servidor web. Também, alguns módulos perl devem ser carregados para que funcione, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de tempo de execução neles olhando o arquivo de log do apache. Também, para verificação de duplicados na lista da campanha, a lista com os novos registros precisa existir no sistema antes de iniciar a carga. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Layout Customizado" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>ID do Template -</B> If the user has selected "Layout Customizado" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -5074,7 +7178,7 @@ if ($ADD==99999) <B><FONT SIZE=3>TABELA DE RAMAIS</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Número do Ramal -</B> Este campo é onde você coloca o número do ramal conforme aparece no Asterisk sem incluir o protocolo ou a barra no começo. Por exemplo: para o ramal SIP\/test101 o número do ramal seria test101. Também, para os ramais IAX2 tenha certeza de usar o nome completo: IAX2/IAXphone1@IAXphone1 seria IAXphone1@IAXphone1. Para Zap tenha certeza que você usa o canal completo: Zap/25-1 seria 25-1. Outro aviso, tenha certeza que você configura o protocolo abaixo corretamente para seu tipo de telefone. + <B>Extensão de telefone -</B> Este campo é onde você coloca o nome de telefones como ele aparece para o Asterisk não incluindo o protocolo ou barra no início. Por exemplo: para o telefone SIP SIP/test101 a extensão do telefone seria test101. Além disso, para IAX2 telefones: IAX2/IAXphone1 @ IAXphone1 seria IAXphone1. Para Zap e Dahdi channelbank anexado ou FXS telefones certifique-se de colocar o número do canal completo sem o prefixo: Zap/25-1 seria 25-1. Outra nota, certifique-se de definir o campo de protocolo abaixo corretamente para o seu tipo de telefone. <BR> <A NAME="phones-dialplan_number"> @@ -5086,11 +7190,24 @@ if ($ADD==99999) <BR> <B>Caixa Postal -</B> Este campo é para a caixa postal de voz para onde vao as menssagens para o usuário deste ramal. Utilizamos isto para verificar as mensagens e para o usuário utilizar o botão VOICEMAIL no aplicativo astGUIclient. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Zona Correio de Voz -</B> Esta configuração permite que você defina a zona que esta caixa de correio de voz será definido para quando o tempo é registrado para uma mensagem. O padrão é definido nas configurações do sistema. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Opções de correio de voz -</B> Esta configuração opcional lhe permite definir as configurações de correio de voz adicionais. É recomendável que você deixe este campo em branco se você não sabe o que está fazendo. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>Identificador de Saída -</B> Este campo é onde deve ser colocado o número que você quer que saia no identificador para as ligações de saída feitas pelo astguiclient. Isto não funciona em linhas RTB(non-PRI) T1/E1. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -5109,12 +7226,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>Login -</B> O login usado pelo usuário do ramal para logar no aplicativo client. + <B>Entrar Tela agente -</B> O login utilizado para o usuário do telefone para acessar os aplicativos do cliente, como a tela de agente ViciDial. <BR> <A NAME="phones-pass"> <BR> - <B>Senha -</B> A senha usada pelo usuário do ramal para entrar no aplicativo client. Importante, esta es la única contraseña para la red de interfaz de usuario del agente de teléfono, para cambiar el sip.conf iax.conf o contraseña, o en secreto, para este dispositivo de teléfono que tenga que modificar el campo Archivo Secreto Conf. más abajo en esta página. + <B>Login Senha -</B> A senha usada para o usuário do telefone para acessar as aplicações baseadas na web do cliente. IMPORTANTE, esta é a senha apenas para o agente de login do telefone interface web, para mudar o sip.conf ou senha iax.conf, ou secreta, para este dispositivo de telefone que você precisa para modificar a senha de inscrição no próximo campo. + + <BR> + <A NAME="phones-conf_secret"> + <BR> + <B>Registo Senha -</B> Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Anteriormente chamado Segredo arquivo conf. Uma palavra-passe registo forte deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número. + + <BR> + <A NAME="phones-is_webphone"> + <BR> + <B>Definir como Webphone -</B> Definir esta opção como Y tentará carregar um telefone baseado na web quando o agente registra em sua tela de agente. O padrão é N. + + <BR> + <A NAME="phones-webphone_dialpad"> + <BR> + <B>Webphone Dialpad -</B> Esta configuração permite ativar ou desativar o teclado para este webphone. O padrão é Y para habilitado. TOGGLE permitirá ao usuário visualizar e ocultar o teclado, clicando em um link. Este recurso não está disponível em todas as versões webphone. TOGGLE_OFF será o padrão para não mostrar o teclado na primeira carga, mas permitirá que o usuário para mostrar o teclado, clicando no link dialpad. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Webphone Auto-Resposta -</B> Esta configuração permite que o telefone web para ser configurado para atender automaticamente as chamadas que chegam por defini-la como Y, ou ter o toque de chamadas por defini-la como padrão é N. Y. + + <BR> + <A NAME="phones-use_external_server_ip"> + <BR> + <B>Use IP do servidor externo -</B> Se usar como um telefone web, você pode definir isso para Y para utilizar os servidores de IP externo para se registar em vez do IP do servidor. O padrão é vazio. <BR> <A NAME="phones-status"> @@ -5180,6 +7322,11 @@ if ($ADD==99999) <BR> <B>Teléfono Anillo de tiempo de espera -</B> Esta es la cantidad de tiempo, en segundos, que el teléfono sonará en el dialplan antes de enviar la llamada al buzón de voz. El valor predeterminado es 60 segundos. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>Em Hook-Agent Login -</B> Esta opção só é usada para chamadas de entrada que vão a um agente conectado com este telefone. Este recurso irá chamar o agente e não vai mandar o cliente para a sessão de agentes até a linha é atendida. Padrão é n para deficientes físicos. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -5256,9 +7403,14 @@ if ($ADD==99999) <B>Teléfono Contexto -</B> Este es el contexto del plan de marcado que este teléfono se utiliza para marcar. Si está ejecutando un centro de llamadas y usted no desea que sus agentes sean capaces de marcar fuera de la aplicación Vicidial por ejemplo, entonces puedes establecer este campo a un contexto dialplan que no existe, algo como agente nodial. por defecto es por defecto. <BR> - <A NAME="phones-conf_secret"> + <A NAME="phones-codecs_list"> <BR> - <B>Conf. Archivo Secreto -</B> Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + <B>Codecs admitidos -</B> Você pode definir uma lista delimitada por vírgula de codecs para ser definido como os codecs padrão para este telefone. Opções para incluir codecs ulaw, alaw, gsm, g729, Speex, G722, G723, G726, iLBC, ... Alguns desses codecs podem não estar disponíveis em seu sistema, como o G729 ou G726. Se o campo estiver vazio, então os codecs padrão do sistema ou a entrada de telefone acima este será utilizado para os codecs permitidas. O padrão é vazio. + + <BR> + <A NAME="phones-codecs_with_template"> + <BR> + <B>Codecs permitidos com Template-</B> Definir essa opção como 1 irá incluir os codecs definidos acima, mesmo se um modelo de arquivo conf é usado. O padrão é 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -5351,12 +7503,12 @@ if ($ADD==99999) <B>Botão do VMail -</B> Configurado como true irá mostrar o botao do VOICEMAIL (correio de voz) e o contador de mensagens no astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_refrescar"> <BR> <B>Atualização Rápida -</B> Configure como true para habilitar uma nova velocidade de atualização das informações sobre a chamada no astGUIclient. A velocidade padrão quando desabilitado é de 1000ms ou 1 segundo. Pode aumentar a carga no sistema se esse tempo for reduzido. <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_refrescar_rate"> <BR> <B>Tempo de Atualização Rápida -</B> em milisegundos. Só é usado se a opção "Atualização Rápida" estiver habilitada. O valor padrão desabilitado é 1000ms, 1 segundo. Pode aumentar a carga do sistema se esse valor for reduzido. @@ -5500,6 +7652,11 @@ if ($ADD==99999) <BR> <B>Ativo -</B> Configure se o servidor está ativo ou não. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="servers-sysload"> <BR> @@ -5568,7 +7725,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf. Archivo Secreto -</B> Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + <B>Conf. Archivo Secreto -</B> Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Um segredo arquivo forte conf deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número. <BR> <A NAME="servers-local_gmt"> @@ -5630,6 +7787,16 @@ if ($ADD==99999) <BR> <B>IP do Serv. Altern. de Gravação- </B> Esta configuração é onde você pode colocar um IP do servidor ou outro nome de máquina que pode ser usado para colocar no lugar do server_ip nos links de gravação nas páginas do site admin. O padrão é vazio. + <BR> + <A NAME="servers-external_server_ip"> + <BR> + <B>IP do servidor externo -</B> Esta configuração é onde você pode colocar um IP ou o nome outra máquina que pode ser usado no lugar do server_ip quando se utiliza um webphone na interface do agente. Para que isso funcione você também deve ter a entrada de telefones configurado para usar o IP do servidor externo. O padrão é vazio. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>IP Ativo Server Gêmea -</B> Alguns sistemas vicidial exigem a criação de servidores vicidial em pares. Esta configuração é onde você pode colocar o IP do servidor de um outro servidor vicidial que este servidor está geminada com. O padrão é vazio para deficientes físicos. + <BR> <A NAME="servers-active_asterisk_server"> <BR> @@ -5670,6 +7837,11 @@ if ($ADD==99999) <BR> <B>Portador de registro activo -</B> Esta configuración le permite registrar todos los códigos de retorno para colgar cualquier lista de marcación saliente llamadas que están haciendo. Por defecto es N. + <BR> + <A NAME="servers-custom_dialplan_entry"> + <BR> + <B>Entrada Dialplan personalizado -</B> Este campo permite-lhe entrar em quaisquer elementos dialplan que você deseja para o servidor, as linhas serão adicionadas para o contexto padrão. + @@ -5687,6 +7859,11 @@ if ($ADD==99999) <BR> <B>Nome da Template - </B> Este é o nome descritivo da configuração da template. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -5713,6 +7890,11 @@ if ($ADD==99999) <BR> <B>Descripción Carrier -</B> Éste se coloca en los comentarios de los archivos de conf asterisco encima del dialplan y anotaciones en cuenta. Máximo 255 caracteres. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -5821,16 +8003,46 @@ if ($ADD==99999) <BR> <B>URL Home do Admin -</B> É a URL do site que você irá se clicar no link HOME no topo da página admin.php. + <BR> + <A NAME="settings-admin_modify_refrescar"> + <BR> + <B>Administrador Modificar Auto-Refresh -</B> Este é o intervalo de atualização em segundos das telas de modificação neste interface de administração. Configurando isso para 0 irá desativá-lo, configurá-lo abaixo de 5, na sua maioria fazem as telas modificam inutilizável porque irá atualizar rápido demais para mudar de campo. Esta opção é útil em situações em que mais de um gerente é controlar configurações em uma campanha ativa ou em grupo, para que as configurações são atualizadas com freqüência. O padrão é 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Administrador No-Cache -</B> Definindo-a para um irá definir todas as páginas de administração para o navegador web no-cache, por isso cada tela tem que ser recarregado cada vez que é visto, mesmo se clicar de volta no navegador. O padrão é 0 para deficientes físicos. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> <B>Habilitar Log de Transf.-</B> Esta opção irá gravar um regsitro de ocorrências em um arquivo no servidor web cada vez que uma chamada for transferida para um agente. O padrão é 0, desabilitado. + <BR> + <A NAME="settings-enable_agc_dispo_log"> + <BR> + <B>Habilitar Logfile Disposição agente -</B> Esta opção irá registrar em um arquivo de log de texto no servidor cada vez que uma chamada é dispositioned por um agente. O padrão é 0, desativado. + <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Fim do dia - </B> Esta configuração define quando os usuários devem ser retirados do sistema de ponto automaticamente. Só roda uma vez por dia. Deve ter somente 4 caracteres, 2 para hora e 2 para os minutos no formato 24 horas. O padrão é 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Local padrão GMT -</B> Esta configuração define o que será usado por padrão quando novos telefones e servidores são adicionadas usando essa interface web de administração. Padrão é de -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Zona Correio de Voz padrão -</B> Esta configuração define o fuso será usado por padrão quando novos telefones e caixas de correio de voz são criados. A lista de zonas disponíveis é diretamente retirado do arquivo voicemail.conf. O padrão é oriental. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Agentes Chama Redefinir -</B> Esta configuração define se a agentes com sessão iniciada e registros telefonemas ativos devem ser zerados no final timeclock do dia. O padrão é 1 para habilitado. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -5899,6 +8111,11 @@ if ($ADD==99999) <BR> <B>Diretório Web de Sons -</B> Esta auto-generado nombre del directorio es creado al azar por el sistema como el lugar que la tienda de audio se mantendrá. Todos los archivos de audio residir en este directorio. + <BR> + <A NAME="settings-admin_web_directory"> + <BR> + <B>Diretório do Web Admin -</B> Este é o diretório que o seu conteúdo web administation, como admin.php, está dentro padrão é vicidial. Para descobrir o seu diretório web Admin, é tudo que está entre o nome do domínio eo admin.php na URL nesta página, sem as barras de início e término. + <BR> <A NAME="settings-active_voicemail_server"> <BR> @@ -5922,7 +8139,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Permitir Custom Dialplan entradas -</B> Esta opción le permite introducir líneas personalizadas dialplan en llamadas menús. El valor predeterminado es 0 para los inactivos. + <B>Permitir Custom Dialplan entradas -</B> Esta opção permite que você insira personalizados linhas dialplan em Menus de chamadas, servidores e configurações do sistema. O padrão é 0 para inativo. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>PLLB Limite Agrupamento -</B> Telefone Entrar Carga Limite Agrupamento de balanceamento. Se Agrupamento PLLB está definido para CASCATA no nível da campanha, em seguida, essa configuração vai determinar o número de agentes aceitável em cada servidor em todas as campanhas. O padrão é 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Gerar extensões entre servidores telefone -</B> Esta opção se definido como 1 irá gerar entradas dialplan para qualquer telefone em um sistema multi-servidor. O padrão é 0 para inativo. <BR> <A NAME="settings-user_territories_active"> @@ -5939,11 +8166,142 @@ if ($ADD==99999) <BR> <B>Habilitar TTS Integración -</B> Esta configuración le permite habilitar Texto a la integración de voz con Cepstral. Esto sólo está disponible actualmente para las campañas de tipo de encuesta de salida. Por defecto es 0 para discapacitados. + <BR> + <A NAME="settings-callcard_enabled"> + <BR> + <B>Habilitar CallCard -</B> Esta configuração permite que os recursos CallCard com ViciDial para permitir chamadores de usar números de pinos e card_ids que têm um saldo de minutos e os saldos pode ter tempo de conversação do agente em chamadas de clientes para em-grupos deduzidas. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="settings-custom_fields_enabled"> + <BR> + <B>Habilitar campos personalizados da lista -</B> Esta configuração permite que o costume lista de recursos que permite que os campos para os campos de dados personalizados a ser definido na interface web de administração em uma base per-lista e, então, os campos disponíveis em uma guia FORM para o agente na interface web do agente. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Habilitar chamadas de teste da campanha -</B> Esta configuração permite que a capacidade de introduzir um código de telefone e número de telefone em campos na parte inferior da tela Detalhes da campanha e colocar uma chamada telefónica para o número como se fosse uma vantagem de ser auto-marcado no sistema. O número de telefone será armazenado como uma nova pista no manual lista de identificação de discagem lista. A campanha deve estar ativo para que este recurso seja ativado, e recomenda-se que as listas atribuídas à campanha todos ser definido como inativo. O prefixo de discagem, tempo limite de ligação e todos os recursos de discagem outros produtos, exceto para DNC e opções de compra de tempo, vai afetar a discagem do número de teste. O telefonema vai ser colocado no servidor selecionado como o servidor de correio de voz nas configurações do sistema. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Habilitar Estatísticas lista extensa -</B> Esta configuração permite que duas colunas adicionais a serem exibidos em mais da lista de tabelas de estado de degradação sobre a modificação lista de páginas e de modificação de campanha. A penetração é definido como a percentagem de ligações que são iguais ou superiores ao limite de contagem campanha de chamadas e ou o estado é marcado como concluído. O padrão é 1 para habilitado. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Habilitar CódigoDeÁrea Campanha CID -</B> Esta configuração permite que a capacidade de definir números específicos de saída callerid para ser usado por campanha. O padrão é 1 para habilitado. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Ativar substituições extensão remota do Agente -</B> Esta configuração permite DIDs ter substituições de extensão para agente remoto encaminhado chama através de in-grupos. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Contactos Habilitado -</B> Esta configuração permite que os contatos sub-seção de administração que permite que um gerente para adicionar modificar ou excluir contatos no sistema que podem ser usados ​​como parte de uma transferência personalizado em uma campanha onde um agente pode procurar contactos por Nome Sobrenome ou escritório número e, em seguida, selecione um dos muitos números associados a esse contato. Este recurso é freqüentemente utilizado pelos operadores ou em funções de telefonistas, onde o usuário teria de transferir uma chamada para um telefone não-agente. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="settings-first_login_trigger"> + <BR> + <B>Gatilho primeiro Login -</B> Esta configuração permite a configuração inicial da tela do servidor para ser mostrado para o administrador quando pela primeira vez entrar no sistema. + + <BR> + <A NAME="settings-default_phone_registration_password"> + <BR> + <B>Senha padrão de Registro Telefone -</B> Esta é a senha registo padrão usado quando novos celulares são adicionados ao sistema. O padrão é teste. + + <BR> + <A NAME="settings-default_phone_login_password"> + <BR> + <B>Padrão Login Senha Telefone -</B> Este é o padrão de telefone senha de acesso web utilizado quando os telefones novos são adicionados ao sistema. O padrão é teste. + + <BR> + <A NAME="settings-default_server_password"> + <BR> + <B>Senha do Servidor Padrão -</B> Esta é a senha do servidor padrão usado quando novos servidores são adicionados ao sistema. O padrão é teste. + + <BR> + <A NAME="settings-slave_db_server"> + <BR> + <B>Database Server Escravo -</B> Se você tem um banco de dados MySQL escravo em seguida, digite o endereço IP local para o servidor aqui. Esta opção é atualmente usada apenas nos relatórios selecionados na próxima opção e não tem nada a ver com a configuração automática MySQL replicação mestre-escravo. O padrão é vazio para deficientes físicos. + + <BR> + <A NAME="settings-reports_use_slave_db"> + <BR> + <B>Relatórios para usar DB Escravo -</B> Esta opção permite que você selecione os relatórios que você deseja ter usar o banco de dados MySQL escravo, tal como definido na opção acima em vez do banco de dados mestre que o seu sistema ao vivo ViciDial está sendo executado. Você deve configurar a replicação escravo MySQL antes que você pode ativar esta opção. O padrão é vazio para deficientes físicos. + + <BR> + <A NAME="settings-default_field_labels"> + <BR> + <B>Os rótulos de campos padrão -</B> Esses 19 campos permitem que você defina o nome que aparecerá na interface do agente ViciDial, bem como a página principal modificação administrativa. O padrão é vazio, que usará os padrões codificados na interface do agente. Você também pode definir um rótulo para esconder --- --- para esconder tanto o rótulo eo campo. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Ocultar Label em registros de chamadas -</B> Se um rótulo é definida como --- OCULTAR --- então os registros de chamadas de agentes, se habilitado na campanha, ainda vai mostrar o campo e os dados a menos que esta opção é definida para Y. O padrão é N. + <BR> <A NAME="settings-qc_features_active"> <BR> <B>Recursos de CQ Ativos - </B> Esta opção permite habilitar ou desabilitar os recursos de CQ ou Controle de Qualidade. O padrão é 0 para Inativo. + <BR> + <A NAME="settings-default_webphone"> + <BR> + <B>Webphone padrão -</B> Se definido para 1, esta opção fará com que todos os novos telefones criados tiver definido como conjunto de Webphone padrão é 0 Y.. + + <BR> + <A NAME="settings-webphone_systemkey"> + <BR> + <B>Webphone chave do sistema -</B> Se o seu sistema ou o fornecedor de exigir, este é o lugar onde a chave do sistema para o webphone deve ser inserido dentro padrão é vazia. + + <BR> + <A NAME="settings-default_codecs"> + <BR> + <B>Codecs padrão -</B> Você pode definir uma lista delimitada por vírgula de codecs para ser definido como os codecs padrão para todos os sistemas. Opções para incluir codecs ulaw, alaw, gsm, g729, Speex, G722, G723, G726, iLBC, ... O padrão é vazio. + + <BR> + <A NAME="settings-custom_dialplan_entry"> + <BR> + <B>Entrada Dialplan personalizado -</B> Este campo permite-lhe entrar em quaisquer elementos dialplan que você deseja para todos os servidores Asterisk, as linhas serão adicionadas para o contexto padrão. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Atualizar Dialplan Em Servidores -</B> Esta opção permite que você force uma recarga do dialplan em todos os servidores Asterisk no cluster. Se você fez alterações na entrada personalizada Dialplan acima, você deve definir esta a 1 e se submeter a ter essas alterações entrem em vigor nos servidores. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Sem resposta-Log -</B> Esta opção irá registrar as chamadas auto-discagem que não foram respondidas para uma tabela separada. O padrão é N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>DID Log agente -</B> Esta opção irá registrar a entrada DID chamadas junto com um no grupo e de usuário de identificação, se aplicável, uma tabela separada. O padrão é N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt Log-DB Server -</B> Este é o servidor de banco de dados alternativo log. Isto é opcional, e permite que alguns logs para serem gravados em um banco de dados separado. O padrão é vazio. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Alt-Log Tabelas -</B> Estas são as tabelas que estão disponíveis para fazer logon no servidor alternativo log de banco de dados. O padrão é em branco. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>Padrão IP do servidor externo -</B> Se definido para 1, esta opção fará com que todos os novos telefones criados têm Use IP do servidor externo definido como Y. O padrão é 0. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>URL Webphone -</B> Esta é a URL do webphone que será usado com este sistema se ele estiver habilitado no registro de telefones que um agente está usando. O padrão é vazio. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -5984,6 +8342,31 @@ if ($ADD==99999) <BR> <B>Prefixo QueueMetrics EnterQueue -</B> Este campo é usado para permitir prefixar um dos campos da tabela vicidial_list na frente do número do telefone do cliente para relatórios customizados no QueueMetrics. O padrão é NONE para não colocar nada. + <BR> + <A NAME="settings-queuemetrics_loginout"> + <BR> + <B>QueueMetrics Login-Out -</B> Esta opção afeta a forma como vicidial irá registrar os logins e logouts de um agente no queue_log. Padrão é padrão para usar o padrão AGENTLOGIN AGENTLOGOFF, CALLBACK usará AGENTCALLBACKLOGIN e AGENTCALLBACKLOGOFF que QM irá analisar de forma diferente, NONE não registra nenhum logins e logouts dentro queue_log. + + <BR> + <A NAME="settings-queuemetrics_callstatus"> + <BR> + <B>QueueMetrics CallStatus -</B> Esta opção se definido a 0 não vai colocar na entrada CALLSTATUS em queue_log quando um agente disposições chamadas. O padrão é 1 para habilitado. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics AddMember Habilitado -</B> Esta opção se definido como 1 irá gerar ADDMEMBER2 e entradas REMOVEMEMBER em queue_log. O padrão é 0 para deficientes físicos. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>QueueMetrics Código Pause Dispo -</B> Esta opção, se preenchida, permite que você defina se um código de pausa dispo é celebrado queue_log quando um agente está em estado dispo. O padrão é vazio para deficientes físicos. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>QueueMetrics Telefone Ambiente Telefone Anexar -</B> Esta opção, se ativada, irá acrescentar o login telefone agente para o registro dados4 na tabela de log fila se a campanha de campo Ambiente Telefone é preenchida. O padrão é 0 para deficientes físicos. + <BR> <A NAME="settings-enable_vtiger_integration"> <BR> @@ -6020,7 +8403,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUS TABELA</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Com o uso do status do sistema, você pode ter status que existem para campanhas e grupos de entrada. O Status deve ter entre 1 e 6 caracteres de comprimento, a descrição deve ter entre 2 e 30 caracteres de comprimento e Selecionável define se será mostrado no VICIDIAL na finalização da chamada. O campo human_answered é usado para calcular o percentual de drop, ou índice de abandono. Configurando human_answered para Y irá usar este status quando contando as chamadas atendidas por humanos. A opção de Categoria permite agrupar vários status em uma categoria que pode ser usada para análise estatística. Existem também 5 configurações adicionais que irão definir o tipo do status: sale, dnc, customer contact, not interested, unworkable.</B> + <B>Com o uso do status do sistema, você pode ter status que existem para campanhas e grupos de entrada. O Status deve ter entre 1 e 6 caracteres de comprimento, a descrição deve ter entre 2 e 30 caracteres de comprimento e Selecionável define se será mostrado no VICIDIAL na finalização da chamada. O campo human_answered é usado para calcular o percentual de drop, ou índice de abandono. Configurando human_answered para Y irá usar este status quando contando as chamadas atendidas por humanos. A opção de Categoria permite agrupar vários status em uma categoria que pode ser usada para análise estatística. Existem também 5 configurações adicionais que irão definir o tipo do status: sale, dnc, customer contact, not interested, unworkable, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS TABELA</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a por campanha basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Label ID tela -</B> Este campo precisa ser pelo menos 2 caracteres de comprimento e um máximo de 20 caracteres de comprimento, sem espaços ou caracteres especiais. Esta é a identificação que irá ser utilizado para identificar o rótulo tela ao longo do sistema. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Nome do Rótulo tela -</B> Este é o nome descritivo da entrada rótulo tela. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Grupo de Usuários do Administrador -</B> Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Ocultar Label em registros de chamadas -</B> Se um rótulo é definida como --- OCULTAR --- então os registros de chamadas de agentes, se habilitado na campanha, ainda vai mostrar o campo e os dados a menos que esta opção é definida para Y. O padrão é N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Os rótulos de campos padrão -</B> Esses 19 campos permitem que você defina o nome que aparecerá na interface do agente ViciDial, bem como a página principal modificação administrativa. O padrão é vazio, que usará os padrões codificados na interface do agente. Você também pode definir um rótulo para esconder --- --- para esconder tanto o rótulo eo campo. @@ -6032,6 +8448,58 @@ if ($ADD==99999) <B>Através do uso de categoria de status de sistema, você pode agrupar status para permitir análise estatística em um grupo de status. O ID da categoria deve ter entre 2 e 20 caracteres sem espaços, o nome deve ter entre 2 e 50 caracteres, a descrição é opicional e o Mostrar TimeonVDAD define se o status deve ser um dos 4 status que podem ser calculados e mostrados no relatório em tempo real Time On VDAD .</B> A Categoria de Venda e a Categoria Registro Ruim são ambas usadas pelo sistema de Sugestão de Listas quando analisando as estatisticas da lista. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Criar um novo modelo - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Removertemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "Apagar Modelo". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>ID do Template -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Nome do Template -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>Descrição template -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>ID da Lista -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Colunas highlighted in blue are standard columns from the vicidial_list table. Colunas highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "Enviar modelo" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Máxima do sistema Relatórios Estatísticas</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Estas estatísticas são totais que são armazenados em cache ao longo de cada dia em tempo real através de processos de back-end. Para chamadas de entrada, as chamadas totais por in-grupo são calculadas para cada chamada que entra no processo que calcula. Para a contagem de todo o sistema, os totais são gerados a partir de entradas de registro, bem como outros totais em grupo e da campanha. Esses totais podem não somar devido às configurações que você tem em seu sistema, bem como quando a chamada é desligada. + + <?php if ($SSqc_features_active > 0) { @@ -6041,7 +8509,7 @@ if ($ADD==99999) <B><FONT SIZE=3>CÓDIGOS DE STATUS DE CONTROLE DE QUALIDADE</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>O sistema de Controle de Qualidade do VICIDIAL tem seu conjunto de status separados daqueles usados na finalização de chamadas do VICIDIAL. Os códigos de CQ devem ter entre 2 e 8 caracteres de comprimento e não podem conter caracteres especiais como espaços ou virgulas. A descrição do código de status de CQ deve ter entre 2 e 30 caracteres</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -6081,12 +8549,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -6096,7 +8565,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -6121,13 +8590,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Mostrar Quantidade de Registros Discáveis</B> -<BR><BR>\n"; echo "<B>CAMPANHA:</B> $campaign_id<BR>\n"; - echo "<B>LISTAS:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>STATUS:</B> $dial_statuses<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -6151,6 +8622,8 @@ 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'; @@ -6209,13 +8682,22 @@ if ($ADD==7111111) $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'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -6225,6 +8707,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6283,10 +8767,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6346,6 +8833,15 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
",$script_text); @@ -6366,8 +8862,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
"; + } ###################################################################################################### @@ -6411,32 +8909,23 @@ if ($ADD=="1") { echo "Número do usuário: $NWB#vicidial_users-user$NWE\n"; } - echo "Senha: $NWB#vicidial_users-pass$NWE\n"; + + echo "Senha: $NWB#vicidial_users-pass$NWE     Força: \n"; + echo "Nome Completo: $NWB#vicidial_users-full_name$NWE\n"; echo "Nível do Usuário: $NWB#vicidial_users-user_level$NWE\n"; echo "Grupo do Usuário: $NWB#vicidial_users-phone_login$NWE\n"; echo "Senha do Ramal: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -6485,7 +8974,9 @@ if ($ADD=="1A") { echo "Número do usuário: $NWB#vicidial_users-user$NWE\n"; } - echo "Senha: $NWB#vicidial_users-pass$NWE\n"; + + echo "Senha: $NWB#vicidial_users-pass$NWE     Força: \n"; + echo "Nome Completo: $NWB#vicidial_users-full_name$NWE\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6493,7 +8984,7 @@ if ($ADD=="1A") echo "Source Usuário: \n"; + echo "\n"; echo "
\n"; if ($voi_count > 0) { @@ -6553,15 +9045,18 @@ if ($ADD==11) } 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"; @@ -6630,10 +9125,12 @@ if ($ADD==11) echo "$scripts_list"; echo "$NWB#vicidial_campaigns-campaign_script$NWE\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $NWB#vicidial_campaigns-campaign_description$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_campaigns-user_group$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: $NWB#vicidial_campaigns-park_ext$NWE
Nome do arquivo de Estacionamento: $NWB#vicidial_campaigns-park_file_name$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Finalizadores (Closers): $NWB#vicidial_campaigns-allow_closers$NWE
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nível de Discagem Automática:
Nível Hopper mínimo: $NWB#vicidial_campaigns-hopper_level$NWE
Nível de Discagem Automática: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Horário Local da Chamada: $NWB#vicidial_campaigns-local_call_time$NWE
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; } @@ -6682,7 +9179,7 @@ if ($ADD==12) echo "Campanha Origem:$NWB#vicidial_lists-list_description$NWE\n"; echo "Campanha: \n"; } echo "\n"; - echo "\n"; + echo "\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) + { + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; 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_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_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 ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
NÚMERO DO GRUPO FILTRO TELEFONE NÃO DELETED - Este número de telefone não está na lista de filtros Telefone Grupo: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
NÚMERO DO GRUPO FILTRO TELEFONE DELETED: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
NÚMERO DO GRUPO FILTRO TELEFONE NÃO ADICIONADO - Este número de telefone já está na lista de filtros Telefone Grupo: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
NÚMERO DO GRUPO FILTRO TELEFONE ADICIONADO: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
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 Grupo:
Números de Telefone:

(somente um telefone por linha)
$NWB#vicidial_list-dnc$NWE
Incluir ou Remover:
\n"; + + if ($LOGuser_level >= 9) + { + echo "
Download numbers in this list to a file:
\n"; + echo "\n"; + echo "
\n"; + } + } @@ -6964,17 +9577,23 @@ if ($ADD==1111) echo "
Nome do Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Cor do Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Ativo: $NWB#vicidial_inbound_groups-active$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_inbound_groups-user_group$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Correio de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; } @@ -7023,7 +9642,7 @@ if ($ADD==1211) echo "Source ID do Grupo: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; echo "Descrição DDR:$NWB#vicidial_inbound_dids-did_description$NWE\n"; + echo "Grupo de Usuários do Administrador: $NWB#vicidial_inbound_dids-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7095,7 +9718,7 @@ if ($ADD==1411) echo "DDR Origem: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Nome do Menu: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Grupo de Usuários do Administrador: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7203,7 +9830,7 @@ if ($ADD==1611) echo "Menu Origem: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Group Filter Telefone: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
Nome do grupo Filtro Telefone: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
Descrição Group Filter Telefone: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_filter_phone_groups-user_group$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7243,7 +9902,7 @@ if ($ADD==11111) echo "
NOVO AGENTE REMOTO
\n"; echo "\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7523,6 +10246,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7542,7 +10269,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
Início do ID do Usuário: (somente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Início do ID do Usuário: (somente números, incremented, deve ser um usuário existente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
Número de linhas: (somente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP do Servidor: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
\n"; + echo ""; + + echo "
Adicionar Entrada do Grupo de Ramais\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Grupo de Extensão: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
Extensão: (somente números)$NWB#vicidial_extension_groups-extension$NWE
Rango: $NWB#vicidial_extension_groups-rank$NWE
Grupos de Campanhas: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -7350,12 +10049,19 @@ if ($ADD==1111111) echo "
Nome do Script: (título do script)$NWB#vicidial_scripts-script_name$NWE
Comentários do Script: $NWB#vicidial_scripts-script_comments$NWE
Ativo: $NWB#vicidial_scripts-active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_scripts-user_group$NWE
Texto do Script: "; # BEGIN Insert Field echo ""; echo "
"; # END Insert Field @@ -7463,6 +10178,10 @@ if ($ADD==11111111) } echo "
Nome do Filtro: (descrição simples do filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentários do filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_lead_filters-user_group$NWE
Filtro SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; @@ -7492,6 +10211,10 @@ if ($ADD==111111111) echo "
ID do Horário de Cham.: (sem espaços ou pontos)$NWB#vicidial_call_times-call_time_id$NWE
Nome do Horário de Cham.: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do Horário de cham.: $NWB#vicidial_call_times-call_time_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_call_times-user_group$NWE
Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada
State Call Time State: (sem espaços ou pontos)$NWB#vicidial_call_times-state_call_time_state$NWE
Nome do horário de chamada por estado: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do horário de chamada por estado: $NWB#vicidial_call_times-call_time_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_call_times-user_group$NWE
Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada
\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo ""; @@ -7552,6 +10279,10 @@ if ($ADD==131111111) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -7565,6 +10296,7 @@ if ($ADD==131111111) echo "Sexta
\n"; echo "Sábado
\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
ID do Turno: (sem espaços ou pontos)$NWB#vicidial_shifts-shift_id$NWE
Nome do Turno: (descrição curta do turno)$NWB#vicidial_shifts-shift_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_shifts-user_group$NWE
Início do Turno:\n"; echo "   Final do Turno:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
Opção Relatório: $NWB#vicidial_shifts-report_option$NWE
\n"; } @@ -7582,7 +10314,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -7605,32 +10337,36 @@ if ($ADD==11111111111) echo "
\n"; if ($voi_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"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
Extensão do Ramal: Auto-Generated $NWB#phones-extension$NWE
Extensão do Ramal:Auto-Generated $NWB#phones-extension$NWE
Extensão do Ramal: $NWB#phones-extension$NWE
Extensão do Ramal:$NWB#phones-extension$NWE
Número no Plano de Discagem: (somente dígitos)$NWB#phones-dialplan_number$NWE
Caixa do Correio de Voz: (somente dígitos)$NWB#phones-voicemail_id$NWE
CallerID de Saída: (somente dígitos)$NWB#phones-outbound_cid$NWE
Endereço IP do Ramal: (optional)$NWB#phones-phone_ip$NWE
Endereço IP do Computador: (optional)$NWB#phones-computer_ip$NWE
IP do Servidor:
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
IP do Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Senha: $NWB#phones-pass$NWE
Entrar Tela agente: $NWB#phones-login$NWE
Login Senha: $NWB#phones-pass$NWE
Registo Senha: $NWB#phones-conf_secret$NWE     Força:
Status: $NWB#phones-status$NWE
Conta Ativa: $NWB#phones-active$NWE
Tipo de Ramal: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Empresa: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Protocolo do Cliente: $NWB#phones-protocol$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#phones-local_gmt$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#phones-local_gmt$NWE
\n"; } @@ -7648,7 +10384,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; @@ -7660,6 +10396,10 @@ if ($ADD==12111111111) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7679,7 +10419,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
ID do Alias:$NWB#phones-alias_id$NWE
Nome do Alias: $NWB#phones-alias_name$NWE
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
Lista de Logins de Ramal: (comma separated)$NWB#phones-logins_list$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; @@ -7694,6 +10434,10 @@ if ($ADD==13111111111) echo "
Número CallerID: $NWB#phones-caller_id_number$NWE
Nome CallerID: $NWB#phones-caller_id_name$NWE
Ativo:
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
\n"; @@ -7725,6 +10469,10 @@ if ($ADD==111111111111) echo "
Endereço IP do Servidor: $NWB#servers-server_ip$NWE
Ativo: $NWB#servers-active$NWE
Versão do Asterisk: $NWB#servers-asterisk_version$NWE
Grupo de Usuários do Administrador: $NWB#servers-user_group$NWE
\n"; } @@ -7753,6 +10501,10 @@ if ($ADD==131111111111) echo "
ID do Template: $NWB#vicidial_conf_templates-template_id$NWE
Nome do Template: $NWB#vicidial_conf_templates-template_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_conf_templates-user_group$NWE
Conteúdo do Template: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; @@ -7771,7 +10523,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -7835,13 +10577,63 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) + { + echo "
\n"; echo ""; @@ -7783,10 +10535,14 @@ if ($ADD==141111111111) echo "
ID da Operadora: $NWB#vicidial_server_carriers-carrier_id$NWE
Nome da Operadora: $NWB#vicidial_server_carriers-carrier_name$NWE
Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_server_carriers-user_group$NWE
String de Registro: $NWB#vicidial_server_carriers-registration_string$NWE
ID do Template:
Plano de Discagem: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP do Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + echo ""; + + echo "
ADD CARRIER COPIADO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
ID da Operadora: $NWB#vicidial_server_carriers-carrier_id$NWE
Nome da Operadora: $NWB#vicidial_server_carriers-carrier_name$NWE
IP do Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
Transportadora Fonte: $NWB#vicidial_server_carriers-carrier_id$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### if ($ADD==151111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; @@ -7853,6 +10645,10 @@ if ($ADD==151111111111) echo "
TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
Ativo:
Grupo de Usuários do Administrador: $NWB#vicidial_tts_prompts-user_group$NWE
\n"; @@ -7871,7 +10667,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; @@ -7883,6 +10679,10 @@ if ($ADD==161111111111) echo "
Música en espera de identificación: $NWB#vicidial_music_on_hold-moh_id$NWE
Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
Orden aleatorio:
Grupo de Usuários do Administrador: $NWB#vicidial_music_on_hold-user_group$NWE
\n"; @@ -7901,7 +10701,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; echo ""; @@ -7915,6 +10715,81 @@ if ($ADD==171111111111) echo "
Name: $NWB#vicidial_voicemail-fullname$NWE
Ativo:
Email:$NWB#vicidial_voicemail-email$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_voicemail-user_group$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\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 LABEL TELA\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Label ID tela: $NWB#vicidial_screen_labels-label_id$NWE
Nome do Rótulo tela: $NWB#vicidial_screen_labels-label_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_screen_labels-user_group$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=191111111111 display the ADD NEW CONTACT SCREEN +###################### + +if ($ADD==191111111111) + { + if ( ($LOGmodify_servers==1) or ($LOGmodify_contacts==1) ) + { + echo ""; + $SYSTEMRELEASE_graph.=" "; + $AGENTRELEASE_graph.=" "; + $SALES_graph.=" "; + $DNCS_graph.=" "; + $NAS_graph.=" "; + $DROPS_graph.=" "; + $LOGINTIME_graph.=" "; + $PAUSETIME_graph.=" "; + } + $CALLS_graph.="
\n"; + echo ""; + + echo "
ADD NEW LABEL TELA\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Nome: $NWB#contact_information$NWE
Sobrenome: $NWB#contact_information$NWE
Número de escritório: $NWB#contact_information$NWE
O número de células: $NWB#contact_information$NWE
Outro número 1: $NWB#contact_information$NWE
Outro número 2: $NWB#contact_information$NWE
BU Name: $NWB#contact_information$NWE
Department: $NWB#contact_information$NWE
Grupo: $NWB#contact_information$NWE
Job Title: $NWB#contact_information$NWE
Location: $NWB#contact_information$NWE
\n"; @@ -7943,9 +10818,7 @@ if ($ADD==1111111111111) echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Número da Conferência: (somente dígitos)$NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
\n"; @@ -7974,9 +10847,7 @@ if ($ADD==11111111111111) echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Número da Conferência: (somente dígitos)$NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
\n"; @@ -8129,6 +11000,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8216,7 +11097,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8353,7 +11234,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8411,6 +11292,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8498,7 +11389,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8611,12 +11502,30 @@ if ($ADD==21) { echo "
CAMPANHA ADICIONADA: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPANHAS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8675,13 +11584,31 @@ if ($ADD==20) { echo "
CAMPANHA COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPANHAS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_refrescar,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) 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_refrescar,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -8693,6 +11620,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8737,7 +11670,7 @@ if ($ADD==22) { echo "
STATUS DE CAMPANHA ADICIONADO: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -8978,6 +11911,176 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PRESET NÃO ADICIONADO - já existe uma entrada para esta campanha com esta predefinição\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
PRESET NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CódigoDeÁrea NÃO CID ADICIONADO - já existe uma entrada para esta campanha com este CID
\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
CódigoDeÁrea NÃO CID ADICIONADO - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "
CódigoDeÁrea CID ADICIONADO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
CódigoDeÁrea CID não excluído - esta entrada não existir
\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
CódigoDeÁrea CID não excluído - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "
CódigoDeÁrea 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_AC-CID', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 "
CódigoDeÁrea CID NOT MODIFIED - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "CódigoDeÁrea CID MODIFICADO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_AC-CID', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $Xareacode[$o] - $Xoutbound_cid[$o]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9024,7 +12127,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9077,19 +12180,22 @@ if ($ADD==2111) } 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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
GRUPO ADICIONADO: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD ENTRANTE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9142,9 +12248,15 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
GRUPO ADICIONADO: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -9189,7 +12301,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9234,7 +12346,7 @@ if ($ADD==2411) } 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) 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 from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9282,31 +12394,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n";} + { + echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + 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 "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; - echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\n"; + echo "
Identificação de chamada Menu não pode usar palavras reservadas: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\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_query($stmt, $link); - echo "
MENU INCLUÍDO: $menu_id $menu_name\n"; + echo "
MENU INCLUÍDO: $menu_id $menu_name\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9335,34 +12461,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n";} + { + echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + 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 "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; - echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\n"; + echo "
Identificação de chamada Menu não pode usar palavras reservadas: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
MENU INCLUÍDO: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GRUPO DE FILTRO TELEFONE NÃO ADICIONADO - já existe um Grupo Telefone FILTER no sistema com este ID\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
PHONE FILTER GRUPO NÃO ADICIONADO - por favor volte e verifique os dados digitados\n"; + echo "
Telefone ID Group Filter deve ter entre 2 e 20 caracteres e não contêm ' '.\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_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
MENU INCLUÍDO: $menu_id - $menu_name\n"; + echo "
GRUPO DE TELEFONE filtro adicionado: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + $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 INCLUIR FILTRO PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9380,30 +12559,94 @@ if ($ADD==21111) {echo "
AGENTES REMOTOS NÃO ADICIONADOS - já existe um usuário remoto com esse ID no sistema\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
AGENTES REMOTOS NOT ADDED - você deve usar um usuário válido como o user_start para agentes remotos\n";} + else { - echo "
AGENTES REMOTOS NÃO ADICIONADOS - Por favor volte e verifique os dados digitados\n"; - echo "
Início da ID e extensão externa devem ter no mínimo 2 caracteres de comprimento\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AGENTES REMOTOS NOT ADDED - seu número de sobreposições de linhas com um outro agente remoto\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES REMOTOS NÃO ADICIONADOS - Por favor volte e verifique os dados digitados\n"; + echo "
Início da ID e extensão externa devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
AGENTES REMOTOS ADICIONADOS: $user_start\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
ENTRADA DO GRUPO DE EXTENSÃO NÃO ADICIONADO - já existe uma entrada de grupo de extensão com estes valores\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
ENTRADA DO GRUPO DE EXTENSÃO NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\n"; + echo "
extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
AGENTES REMOTOS ADICIONADOS: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
ENTRADA GROUP extensão adicionada: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9439,9 +12682,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPANHAS-');"; + $allowed_user_group_insert_SQL = '---ALL---'; + $allowed_campaign_insert_SQL = '-ALL-CAMPANHAS-'; + # 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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
GRUPO DE USUÁRIOS ADICIONADOS: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -9567,7 +12835,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
SCRIPT ADICIONADO: $script_id\n"; @@ -9620,7 +12888,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9660,7 +12928,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9700,7 +12968,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9764,7 +13032,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9841,7 +13109,7 @@ if ($ADD==21111111111) { echo "
RAMAL ADICIONADO\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9890,7 +13158,7 @@ if ($ADD==22111111111) { echo "
ALIAS DE RAMAL INCLUÍDO\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9931,7 +13199,7 @@ if ($ADD==23111111111) { echo "
ALIAS DE GRUPO INCLUÍDO\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9968,7 +13236,7 @@ if ($ADD==211111111111) { echo "
SERVIDOR ADICIONADO\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10065,7 +13333,7 @@ if ($ADD==231111111111) { echo "
TEMPLATE DE CONF INCLUÍDO\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10101,7 +13369,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10120,6 +13388,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
OPERADORA NÃO INCLUÍDA - já existe uma operadora no sistema com este ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
OPERADORA NÃO INCLUÍDA - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
CARRIER COPIADO ADICIONADO\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_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10140,7 +13447,7 @@ if ($ADD==251111111111) { echo "
TTS añadido la entrada de\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10176,7 +13483,7 @@ if ($ADD==261111111111) { echo "
MÚSICA EN ESPERA añadido la entrada de\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10219,7 +13526,7 @@ if ($ADD==271111111111) { echo "
Contestador AGREGADOS\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -10244,6 +13551,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
LABEL TELA NÃO ADICIONADO - já existe uma etiqueta no sistema com este ID\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
LABEL TELA NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
LABEL TELA ADICIONADO\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONTATO NÃO ADICIONADO - já existe um contato no sistema com este nome e número\n";} + else + { + if (strlen($last_name) < 2) + {echo "
CONTATO NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
Contato adicionado\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -10307,7 +13694,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -10331,7 +13718,7 @@ if ($ADD==221111111111111) { echo "
STATUS DE SISTEMA INCLUÍDO: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10472,7 +13859,7 @@ if ($ADD=="4A") } echo "
USUÁRIO ALTERADO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10524,6 +13911,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10611,7 +14008,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10705,7 +14102,7 @@ if ($ADD=="4B") } echo "
USUÁRIO ALTERADO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10757,6 +14154,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10844,7 +14251,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10932,7 +14339,7 @@ if ($ADD==4) { echo "
USUÁRIO ALTERADO: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10984,6 +14391,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11071,7 +14488,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -11152,6 +14569,7 @@ if ($ADD==41) 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'; @@ -11180,6 +14598,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -11194,32 +14614,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
LISTAS ATIVAS ALTERADAS"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Teste de chamadas de saída';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPANHA TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
"; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
LISTAS ATIVAS ALTERADAS"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -11231,77 +14740,124 @@ if ($ADD==41) } else { - echo "
CAMPANHA ALTERADA: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'ENTRANTE_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
CAMPANHA NOT MODIFIED - Por favor, espere a página inteira para carregar antes de enviar o formulário\n"; } else { - if ($dial_level_override > 0) + echo "
CAMPANHA ALTERADA: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
- Aguarde 1 minuto antes de discar o próximo número\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refrescar='$campaign_stats_refrescar',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; + echo "
- Aguarde 1 minuto antes de discar o próximo número\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPANHA LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPANHA LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -11354,7 +14910,7 @@ if ($ADD==42) { echo "
STATUS CUSTOMIZADO ALTERADO: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11461,6 +15017,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -11483,7 +15041,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11532,7 +15090,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11723,7 +15281,7 @@ if ($ADD=='40A') { echo "
CONFIGURAÇÃO DE PESQUISA ALTERADA: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11809,7 +15367,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -11843,7 +15401,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -11917,7 +15475,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -12010,56 +15568,128 @@ if ($ADD==49) ###################### -# ADD=411 submit list modifications to the system +# ADD=401 modify campaign preset in the system ###################### -if ($ADD==411) +if ($ADD==401) { - if ($LOGmodify_lists==1) + if ($LOGmodify_campaigns==1) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
LISTA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n"; - echo "
o nome da lista precisa ter no mínimo 2 caracteres de comprimento\n"; + echo "
PRESET NÃO MODIFICADA - Por favor, volte e verifique os dados digitados\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 { - if (strlen($reset_time) < 4) {$reset_time='';} + echo "
PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; - echo "
LISTA ALTERADA: $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' where list_id='$list_id';"; + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } - if ($reset_list == 'Y') + +###################### +# 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) { - echo "
ZERANDO O STATUS DE CHAMADA DA LISTA\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
LISTA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n"; + echo "
o nome da lista precisa ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
LISTA ALTERADA: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
ZERANDO O STATUS DE CHAMADA DA LISTA\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -12078,84 +15708,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; - echo "
a cor e o nome do grupo deve ter pelo menos 2 carcteres\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
USUÁRIOS NOT MODIFIED - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', 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_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
GRUPO ALTERADO: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Você não tem permissão para ver esta página\n"; + exit; } } else { - echo "Você não tem permissão para ver esta página\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
a cor e o nome do grupo deve ter pelo menos 2 carcteres\n"; + } + else + { + if ($form_end != 'END') + { + echo "
GROUP NOT MODIFIED - Por favor, espere a página inteira para carregar antes de enviar o formulário\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
GRUPO ALTERADO: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -12180,7 +15910,7 @@ if ($ADD==4311) { echo "
DDR ALTERADO: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12220,12 +15950,12 @@ if ($ADD==4511) { echo "
MENU ALTERADO: $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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -12242,27 +15972,35 @@ if ($ADD==4511) 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["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"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -12303,7 +16041,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -12345,32 +16083,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados\n"; - echo "
O início do ID e a Extensão Externa deve ter pelo menos 2 caracteres de comprimento\n"; + echo "
FILTER PHONE GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
Nome do grupo Filtro Telefone and ID 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' where remote_agent_id='$remote_agent_id';"; + $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_query($stmt, $link); - echo "
AGENTES REMOTOS ALTERADOS\n"; + echo "
GRUPO DE TELEFONE filtro Modificado\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12380,10 +16118,108 @@ if ($ADD==41111) echo "Você não tem permissão para ver esta página\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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
AGENTES REMOTOS NOT MODIFIED - você deve usar um usuário válido como o user_start para agentes remotos\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AGENTES REMOTOS NOT MODIFIED - seu número de sobreposições de linhas com um outro agente remoto\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados\n"; + echo "
O início do ID e a Extensão Externa deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
AGENTES REMOTOS ALTERADOS\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Você não tem permissão para ver esta página\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 "
ENTRADA DO GRUPO DE EXTENSÃO NÃO MODIFICADA - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + echo "
ENTRADA DO GRUPO DE EXTENSÃO MODIFICADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12401,117 +16237,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Você não tem permissão para editar o seu próprio grupo de usuários\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - - $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' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - echo "
GRUPO DE USUÁRIOS ALTERADO\n"; + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "
GRUPO DE USUÁRIOS ALTERADO\n"; - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -12543,7 +16414,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
SCRIPT ALTERADO\n"; @@ -12585,7 +16456,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
FILTRO ALTERADO\n"; @@ -12641,7 +16512,7 @@ if ($ADD==411111111) $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' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
HORÁRIO DE CHAMADA ALTERADO\n"; @@ -12697,7 +16568,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
HORÁRIO DE CHAMADA POR ESTADO ALTERADO\n"; @@ -12726,7 +16597,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -12748,7 +16619,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
TURNOS ALTERADOS\n"; @@ -12777,14 +16648,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
RAMAL NÃO MODIFICADO - já existe no sistema um ramal com esta extensão e servidor\n";} else { @@ -12794,7 +16665,7 @@ if ($ADD==41111111111) { echo "
RAMAL ALTERADO: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refrescar='$enable_fast_refrescar', fast_refrescar_rate='$fast_refrescar_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12825,7 +16696,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12838,7 +16709,7 @@ if ($ADD==42111111111) { echo "
ALIAS DE RAMAL ALTERADO: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12865,7 +16736,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12878,7 +16749,7 @@ if ($ADD==43111111111) { echo "
ALIAS DE GRUPO ALTERADO: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12912,14 +16783,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
SERVIDOR NOT MODIFIED - there is already a server in the system with this server_id\n";} else { $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
SERVIDOR NÃO ALTERADO - já existe no sistema um servidor com este IP\n";} else { @@ -12927,7 +16798,7 @@ if ($ADD==411111111111) {echo "
SERVIDOR NÃO ALTERADO - Por favor volte e verifique os dados digitados\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13030,7 +16901,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
CONF TEMPLATE MODIFIED: $template_id\n"; @@ -13059,7 +16930,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -13067,7 +16938,7 @@ if ($ADD==441111111111) {echo "
OPERADORA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -13099,7 +16970,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -13107,7 +16978,7 @@ if ($ADD==451111111111) {echo "
TTS ENTRADA SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
TTS entrada modificada: $tts_id\n"; @@ -13136,7 +17007,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -13169,7 +17040,7 @@ if ($ADD==461111111111) {echo "
MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -13237,7 +17108,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -13245,7 +17116,7 @@ if ($ADD==471111111111) {echo "
Contestador SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -13276,6 +17147,87 @@ if ($ADD==471111111111) } +###################### +# 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 "
LABEL TELA NÃO MODIFICADA - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + echo "
LABEL TELA MODIFICADO: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\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 "
CONTATO NÃO MODIFICADA - Por favor, volte e verifique os dados digitados\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_query($stmt, $linkALT); + + echo "
CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN MODIFICAR CONTATO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -13289,7 +17241,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor\n";} else { @@ -13299,7 +17251,7 @@ if ($ADD==4111111111111) { echo "
CONFERÊNCIA ALTERADA: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13326,7 +17278,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
VICIDIAL CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor\n";} else { @@ -13336,7 +17288,7 @@ if ($ADD==41111111111111) { echo "
VICIDIAL CONFERÊNCIA ALTERADA: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13363,11 +17315,37 @@ if ($ADD==411111111111111) echo "
CONFIGURAÇÕES DE SISTEMA ALTERADAS\n"; - $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';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refrescar='$admin_modify_refrescar',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -13389,7 +17367,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13432,7 +17410,7 @@ if ($ADD==421111111111111) { echo "
STATUS DO SISTEMA ALTERADO: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13460,7 +17438,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13683,7 +17661,7 @@ if ($ADD==53) else { echo "
CONFIRMAR LIMPEZA DO VDAC: $campaign_id\n"; - echo "

Clique aqui para apagar o registro mais velho do VDAC para $campaign_id


\n"; + echo "

Clique aqui para apagar o registro mais velho do VDAC para $campaign_id


\n"; } # go to campaign modification below @@ -13781,6 +17759,28 @@ if ($ADD==5511) $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 "
GRUPO DE FILTRO TELEFONE NÃO DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
FILTRO TELEFONE CONFIRMAÇÃO EXCLUSÃO DO GRUPO: $filter_phone_group_id\n"; + echo "

Clique aqui para apagar GROUP TELEFONE FILTER $filter_phone_group_id


\n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13803,6 +17803,28 @@ if ($ADD==51111) $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 "
ENTRADA DO GRUPO DE EXTENSÃO não excluído - Por favor, volte e verifique os dados digitados\n"; + echo "
extension_id be at least 1 characters in length\n"; + } + else + { + echo "
EXTENSÃO GRUPO DE CONFIRMAÇÃO DE INSCRIÇÃO ELIMINAÇÃO: $extension_id\n"; + echo "

Clique aqui para excluir a entrada grupo de ramal $extension_id


\n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14135,6 +18157,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
LABEL TELA NÃO DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
Label ID be at least 2 characters in length\n"; + } + else + { + echo "
TELA CONFIRMAÇÃO EXCLUSÃO LABEL: $label_id - $label_name\n"; + echo "

Clique aqui para apagar rótulo tela $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 "
CONTATO não excluído - Por favor, volte e verifique os dados digitados\n"; + echo "
Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
CONTATO CONFIRMAÇÃO ELIMINAÇÃO: $contact_id - $first_name - $last_name\n"; + echo "

Clique aqui para removercontact $contact_id - $first_name - $last_name


\n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -14204,27 +18270,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Você não tem permissão para editar seu próprio usuário\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
REMOÇÃO DO USUÁRIO CONCLUÍDA: $user\n"; - echo "

\n"; + echo "
REMOÇÃO DO USUÁRIO CONCLUÍDA: $user\n"; + echo "

\n"; + } } - $ADD='0'; # go to user list } @@ -14243,44 +18316,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14318,7 +18400,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
$stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -14329,6 +18411,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -14368,7 +18451,7 @@ if ($ADD==62) if ($DB) {echo "\n
VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -14418,7 +18501,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
$stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -14429,55 +18512,139 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; - if ($DB) {echo "
$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
$stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -14525,7 +18692,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14574,7 +18741,7 @@ if ($ADD==65) { echo "
RECICLAGEM DE REGISTROS DA CAMPANHA REMOVIDO: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14605,7 +18772,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14621,12 +18788,12 @@ if ($ADD==66) { echo "
STATUS DE DISC. PARA NÚMERO ALT. REMOVIDO: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14668,7 +18835,7 @@ if ($ADD==67) { echo "
CAMPANHA PAUSE CODE DELETED: $campaign_id - $pause_code\n"; - $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14699,7 +18866,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14715,12 +18882,12 @@ if ($ADD==68) { echo "
STATUS DE DISCAGEM REMOVIDO: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14742,6 +18909,51 @@ if ($ADD==68) $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 "
PRESET CAMPANHA NÃO DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
preset name must be between 1 and 40 characters in length\n"; + } + else + { + echo "
CAMPANHA 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_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHA_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14757,11 +18969,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
REMOVENDO REGISTROS DA LISTA DA TABELA VICIDIAL_LIST\n"; @@ -14772,7 +18984,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -14798,7 +19010,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -14810,6 +19022,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -14841,7 +19056,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14874,7 +19089,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -14895,6 +19110,42 @@ if ($ADD==6511) $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 "
GRUPO DE FILTRO TELEFONE NÃO DELETED - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EXCLUSÃO DO GRUPO FILTRO TELEFONE COMPLETO: $filter_phone_group_id\n"; + echo "

\n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14928,6 +19179,41 @@ if ($ADD==61111) $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 "
ENTRADA DO GRUPO DE EXTENSÃO não excluído - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EXTENSÃO EXCLUSÃO DE ENTRADA grupo completou: $extension_id\n"; + echo "

\n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -14943,21 +19229,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Você não tem permissão para editar o seu próprio grupo de usuários\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
REMOÇÃO DE GRUPO DE USUÁRIOS CONCLUÍDA: $user_group\n"; - echo "

\n"; + echo "
REMOÇÃO DE GRUPO DE USUÁRIOS CONCLUÍDA: $user_group\n"; + echo "

\n"; + } } - $ADD='100000'; # go to user group list } @@ -14976,7 +19269,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15010,7 +19303,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15044,7 +19337,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15078,7 +19371,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -15136,7 +19429,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15171,7 +19464,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -15207,7 +19500,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15240,7 +19533,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15274,7 +19567,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15357,7 +19650,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15395,7 +19688,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -15431,7 +19724,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15467,7 +19760,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -15500,7 +19793,7 @@ if ($ADD==671111111111) } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15526,6 +19819,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
LABEL TELA NÃO DELETED - Por favor, volte e verifique os dados digitados\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EXCLUSÃO LABEL TELA CONCLUÍDO: $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 "
CONTATO não excluído - Por favor, volte e verifique os dados digitados\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Excluir contato', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

\n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -15614,10 +19980,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_refrescar=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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15694,8 +20066,30 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
Você não tem permissão de alterar este usuário: $user\n"; } @@ -15711,14 +20105,25 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 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"; @@ -15767,6 +20173,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15786,18 +20193,22 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -15819,6 +20230,12 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; #9BB9FB @@ -15841,6 +20258,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15866,6 +20288,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -15873,8 +20308,17 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } - echo "\n"; + echo "\n"; echo "
Número do usuário: $user$NWB#vicidial_users-user$NWE
Senha: $NWB#vicidial_users-pass$NWE
Senha: $NWB#vicidial_users-pass$NWE     Força:
Forçar alteração de senha: $NWB#vicidial_users-force_change_password$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Nível do Usuário: $NWB#vicidial_users-user_level$NWE
Grupo do Usuário:
Login do Ramal: $NWB#vicidial_users-phone_login$NWE
Senha do Ramal: $NWB#vicidial_users-phone_pass$NWE
Ativo: $NWB#vicidial_users-active$NWE
ID de correo de voz: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
Email:$NWB#vicidial_users-optional$NWE
Usuário Code: $NWB#vicidial_users-optional$NWE
Main Territorio: $NWB#vicidial_users-optional$NWE
OPÇÕES DA INTERFACE DO AGENTE:
Agente pode escolher Grupos de Entrada: $NWB#vicidial_users-agent_choose_ingroups$NWE
Agente Escolha Blended: $NWB#vicidial_users-agent_choose_blended$NWE
Agente Elija territorios: $NWB#vicidial_users-agent_choose_territories$NWE
Sobrepor Permissão de Alter. de Telefone:$NWB#vicidial_users-alter_custphone_override$NWE
Sobrepor Controle de Turno do Agente: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Call Agent View Log Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
Agente Override Pesquisa chumbo: $NWB#vicidial_users-agent_lead_search_override$NWE
Alerta Ativo: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Permitir Alertas: $NWB#vicidial_users-allow_alerts$NWE
Contato Busca predefinido: $NWB#vicidial_users-preset_contact_search$NWE
Rankings da Campanha:$NWB#vicidial_users-campaign_ranks$NWE
\n"; - echo "\n"; + echo "
\n"; echo "$RANKcampaigns_list"; echo "
\n"; echo "
Grupos de Entrada: $NWB#vicidial_users-closer_campaigns$NWE
\n"; - echo "\n"; + echo "
\n"; echo "$RANKgroups_list"; echo "
\n"; echo "
ADMIN Opções de relatório:
Informações do usuário em tempo real Bloco: $NWB#vicidial_users-realtime_block_user_info$NWE
Administrador Ocultar dados levam: $NWB#vicidial_users-admin_hide_lead_data$NWE
Administrador Ocultar dados do telefone: $NWB#vicidial_users-admin_hide_phone_data$NWE
OPÇÕES DA INTERFACE ADMIN:
Exportar Relatórios: $NWB#vicidial_users-export_reports$NWE
Remover da Lista de Bloqueio: $NWB#vicidial_users-delete_from_dnc$NWE
Campos Personalizados Modificar: $NWB#vicidial_users-custom_fields_modify$NWE
Alterar Campanhas: $NWB#vicidial_users-modify_sections$NWE
Detalhes da Campanha: $NWB#vicidial_users-campaign_detail$NWE
Apagar Campanhas: $NWB#vicidial_users-delete_campaigns$NWE
Alterar um Hor. de Cham.s: $NWB#vicidial_users-modify_call_times$NWE
RemoverHorários de Cham.: $NWB#vicidial_users-delete_call_times$NWE
Alterar Servidor: $NWB#vicidial_users-modify_sections$NWE
Alterar Turnos: $NWB#vicidial_users-modify_sections$NWE
AlterarCelular: $NWB#vicidial_users-modify_sections$NWE
AlterarOperadoras: $NWB#vicidial_users-modify_sections$NWE
AlterarLabels: $NWB#vicidial_users-modify_sections$NWE
AlterarStatus: $NWB#vicidial_users-modify_sections$NWE
AlterarCorreio de Voz: $NWB#vicidial_users-modify_sections$NWE
AlterarAudio de la tienda: $NWB#vicidial_users-modify_sections$NWE
AlterarMúsica en espera: $NWB#vicidial_users-modify_sections$NWE
AlterarTTS: $NWB#vicidial_users-modify_sections$NWE
AlterarContacts: $NWB#vicidial_users-modify_sections$NWE
CallCard Acesso: $NWB#vicidial_users-modify_sections$NWE
Agente para Acesso ao API:$NWB#vicidial_users-vdc_agent_api_access$NWE
Incluir Registro de Ponto: $NWB#vicidial_users-add_timeclock_log$NWE
Remover Registro de Log do Ponto: $NWB#vicidial_users-delete_timeclock_log$NWE
Sobrepor Controle de Turno do Gerente: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
Modificar o nível mesmo usuário: $NWB#vicidial_users-modify_same_user_level$NWE
\n"; if ($LOGdelete_users > 0) @@ -15888,7 +20332,7 @@ if ($ADD==3) echo "

Clique aqui para os registros de Chamada Agendada do usuário\n"; if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver alterações Admin para este registro
\n"; + echo "

Clique aqui para ver as mudanças de administrador para este registro\n"; } } } @@ -15913,6 +20357,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_refrescar=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -15923,6 +20372,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -15930,16 +20389,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -15989,7 +20451,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_refrescar = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -16071,13 +20533,82 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Definições";} + else + {$ALTmultiDISABLE=0; $ALTmultiLINK='';} + + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -16088,7 +20619,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -16116,7 +20647,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -16160,7 +20691,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -16191,7 +20722,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -16215,9 +20746,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -16240,6 +20773,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -16259,9 +20817,13 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -16274,6 +20836,14 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16282,7 +20852,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
$row[0]: Básico   Básico Detalhes StatusAtalhosPesquisaCódigos de Pausa Presets AC-CIDQC Tempo Real Tempo Real
\n"; echo "
\n"; @@ -16295,19 +20865,31 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; @@ -16336,139 +20918,200 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + 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"; @@ -16676,24 +21329,32 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + 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"; if ($SSoutbound_autodial_active > 0) { @@ -16738,37 +21411,65 @@ if ($ADD==31) } 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"; @@ -16787,6 +21488,11 @@ if ($ADD==31) } 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"; @@ -16800,9 +21506,21 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -16810,16 +21528,22 @@ if ($ADD==31) { echo "\n"; } - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -16868,13 +21592,46 @@ if ($ADD==31) 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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { @@ -16896,6 +21653,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
ID da Campanha: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
ID da Campanha: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $NWB#vicidial_campaigns-campaign_description$NWE
Campanha Data da Alter.: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campanha Data do Login: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campanha Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
\n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
Ativo: $NWB#vicidial_campaigns-active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_campaigns-user_group$NWE
Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
Target do Form. Web: $NWB#vicidial_campaigns-web_form_target$NWE
Permitir Finalizadores (Closers): $NWB#vicidial_campaigns-allow_closers$NWE
Add A Dial Status:
Adicionar um status de marcação para chamadas:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordem da Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mesclagem de Lista:
Ordem da Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
Filtro de registros: $NWB#vicidial_campaigns-lead_filter_id$NWE
Ordem Randomize Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
Ordem lista secundária: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
Mesclagem de Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
Filtro de registros: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
Tiempo de caída de bloqueo: $NWB#vicidial_campaigns-drop_lockout_time$NWE
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Contagem contas Limite: $NWB#vicidial_campaigns-call_count_limit$NWE
Forçar Reset do Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Contagem contas Alvo: $NWB#vicidial_campaigns-call_count_target$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Nível Hopper mínimo: $NWB#vicidial_campaigns-hopper_level$NWE
Nível Hopper automática: $NWB#vicidial_campaigns-use_auto_hopper$NWE
Multiplicador Hopper automática: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
Hopper VLC Dup Confira: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
Forçar Reset do Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Nível de Discagem Automática: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       SOBREPOR ADAPT
Somente Lista Autom.: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Auto Threshold Nível Dial: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
Somente Lista Autom.: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Threshold Tally disponível somente: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
Limite de Derrubadas (drop): $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferências Simultâneas: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Disque nível do método alvo Diferença: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
Transferências Simultâneas: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Prioridade da Fila:$NWB#vicidial_campaigns-drop_rate_group$NWE
Fila de entrada no Disque: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
Auto Discar Alternativo: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Auto Discar Alternativo: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Horário Local da Chamada:
Prefixo de Discagem: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Prefixo de discagem manual: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
Omitir Código de Telefone: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID da Campanha: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Personalizado CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
Extensão VDAD da Campanha: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Roteamento de Extensão: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extensão de Gravação da Campanha: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Atraso de Gravação: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Chame Notes por chamada: $NWB#vicidial_campaigns-per_call_notes$NWE
Pesquisa de chumbo agente: $NWB#vicidial_campaigns-agent_lead_search$NWE
Agente Método de Pesquisa de chumbo: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Mensagem na Secretária Eletrônica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
Mensagem na Secretária Eletrônica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -16722,15 +21383,27 @@ if ($ADD==31) echo "
Número Transfer-Conf 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
Habilitar Presets de transferência: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
Esconder número de transferência para discar: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
Personalizado Transferência Botão 3-Way: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
Transferencia de rellenar previamente Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
Estacionamento de chamadas IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
Estacionamento de chamadas IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
Destino Ação temporizador: $NWB#vicidial_campaigns-timer_action_destination$NWE
Agendamento de Chamadas: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Callbacks alerta agendadas: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
Callbacks agendadas Contagem: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
Programado Callbacks Limite Dias: $NWB#vicidial_campaigns-callback_days_limit$NWE
Programado Callbacks Bloco Horas: $NWB#vicidial_campaigns-callback_hours_block$NWE
Callbacks agendadas Bloco Calltime: $NWB#vicidial_campaigns-callback_list_calltime$NWE
Meu padrão Checkbox Callbacks: $NWB#vicidial_campaigns-my_callback_option$NWE
Tempo até derrubar(DROP): $NWB#vicidial_campaigns-drop_call_seconds$NWE
Ação de Drop:$NWB#vicidial_campaigns-drop_action$NWE
Ação de Drop:$NWB#vicidial_campaigns-drop_action$NWE
Extensão do Porto Seguro: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
Áudio Safe Harbor: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
Grupo de Transferência de Drop:
Menu de chamada Safe Harbor: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
Grupo de Transferência de Drop: $NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Desativar Tela Dispo: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
Desativar Status Dispo: $NWB#vicidial_campaigns-disable_dispo_status$NWE
Tempo de pós atendimento: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Mensagem de pós atendimento: $NWB#vicidial_campaigns-wrapup_message$NWE
Usar lista de bloqueio interna: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Usar lista de bloqueio interna: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Usar Lista de Bloqueio: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
Usar Lista de Bloqueio: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentCódigos de PausaAtivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campanha Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Auto Pausa trabalho de pré-Call: $NWB#vicidial_campaigns-auto_pause_precall$NWE
Auto Resume Pré-Call Work: $NWB#vicidial_campaigns-auto_resume_precall$NWE
Auto Pausa Código Pré-Call: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
Campanha Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refrescar$NWE
Tempo Real Tempo Estatísticas do Agente: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
Desabilitar Alteração de Dados do Cliente:$NWB#vicidial_campaigns-disable_alter_custdata$NWE
Desab. Alterar Telefone do Cliente :$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Agente de pantalla Dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
Tela Etiquetas Agente: $NWB#vicidial_campaigns-screen_labels$NWE
Mostrar campos de status: $NWB#vicidial_campaigns-status_display_fields$NWE
Mostrar Clientes em Espera ao Agente:$NWB#vicidial_campaigns-display_queue_count$NWE
Agente de pausa después de cada llamada: $NWB#vicidial_campaigns-pause_after_each_call$NWE
Manual de Dial Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
ID da Lista Manual :$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Filtro de Discagem Manual:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Filtro de Discagem Manual:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Dial visualização manual: $NWB#vicidial_campaigns-manual_preview_dial$NWE
Call Time manual Confira: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
Manual de Dial API: $NWB#vicidial_campaigns-api_manual_dial$NWE
Marcação Manual CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
Telefone Mensagem de Alerta Diferença de tempo: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
Cópia p/ Área de Transf. do Agente: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Discagem Extendida na tela do Agente : $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
CallerID de Chamada a 3: $NWB#vicidial_campaigns-three_way_call_cid$NWE
CallerID de Chamada a 3: $NWB#vicidial_campaigns-three_way_call_cid$NWE
Prefixo para chamadas a 3: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Cliente 3-Way Logging Hangup: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
Cliente 3-Way Segundos hangup: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
Cliente 3-Way Ação Hangup: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
Alias de Grupo Permitido: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
QM Ambiente Telefone: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
Agrupamento PLLB: $NWB#vicidial_campaigns-pllb_grouping$NWE
PLLB Limite Agrupamento: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
Iniciar llamada URL: $NWB#vicidial_campaigns-start_call_url$NWE
Iniciar llamada URL: $NWB#vicidial_campaigns-start_call_url$NWE
Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
No URL chamada Agent: $NWB#vicidial_campaigns-na_call_url$NWE
Extensão Anexar CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
Aviso Monitor de Cegos: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
Aviso Monitor de Cegos: $NWB#vicidial_campaigns-blind_monitor_message$NWE
Nome do Monitor de Cegos: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
\n"; @@ -16915,6 +21674,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPANHAlink='stage=CAMPANHADOWN'; @@ -16922,6 +21682,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -16930,14 +21692,14 @@ if ($ADD==31) if (eregi("CAMPANHADOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPANHAlink='stage=CAMPANHAUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
\n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -16982,8 +21744,6 @@ if ($ADD==31) echo "\n"; echo "
ID DA LISTANOME DA LISTANOME DA LISTADESCRIÇÃOTOTAL DE REG.ATIVO

\n"; - echo "
\n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -16992,13 +21752,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
STATUS dentro das listas ativo para esta CAMPANHA:\n"; + echo " - ESCONDER
"; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
STATUSNOME DO STATUSCHAMADONÃO CHAMADODIALABLEPENETRATION
\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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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 "
STATUSNOME DO STATUSCHAMADONÃO CHAMADO
$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]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]    
TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + } + else + { + echo "MOSTRAR STATUS DE CHUMBO Nesta campanha

"; + } + + + + echo "
\n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - ESCONDER

"; } else @@ -17007,7 +21949,7 @@ if ($ADD==31) echo " - MOSTRAR

"; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -17018,9 +21960,36 @@ if ($ADD==31) echo "Clique aqui para ver um relatório VDAD para esta campanha

\n"; } echo "Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha

\n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Teste de chamadas de saída: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


\n"; + } + else + { + echo "Teste chamando desativada

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

Clique aqui para ver alterações Admin para esta campanha
\n"; + echo "

Clique aqui para ver as mudanças de administrador para esta campanha\n"; } echo "
\n"; } @@ -17031,7 +22000,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -17048,17 +22017,45 @@ if ($ADD==31) echo "
\n"; echo "
STATUS CUSTOMIZADOS PARA ESSA CAMPANHA:   $NWB#vicidial_campaign_statuses$NWE
\n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + echo "
STATUSDESCRIÇÃOSELECIONÁVELRESPOSTA HUMANOACATEGORIAMODIFY-DELETE
\n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -17073,42 +22070,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
S
T
A
T
U
S
DESCRIÇÃOCATEGORIA
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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "APAGAR\n"; - echo "
\n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "APAGAR\n"; + } + else + { + echo "APAGAR\n"; + } echo "
\n"; + echo "
INCLUIR NOVO STATUS DE CAMPANHA
\n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Descrição:   \n"; - echo "Selecionável:  
\n"; - echo "Resposta Humana:   \n"; + echo "Selecionável:   \n"; + echo "Resposta Humana:  
\n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
\n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
\n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoria:\n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17174,7 +22181,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -17187,7 +22194,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -17313,7 +22320,7 @@ if ($ADD==31) echo "
ATALHOSTATUSDESCRIÇÃOAPAGAR
\n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -17353,7 +22360,7 @@ if ($ADD==31) ##### CAMPANHA 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -17378,7 +22385,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -17391,7 +22398,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -17445,7 +22452,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -17464,17 +22471,155 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
CÓDIGOS DE PAUSACOBRÁVELALTERARAPAGAR
Dígito p/ Não Interessado: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Arquivo de Audio para Interessado: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Arquivo de Audio para não Interessado: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Método de Pesquisa: $NWB#vicidial_campaigns-survey_method$NWE
Método de Pesquisa: $NWB#vicidial_campaigns-survey_method$NWE
Ação p/ sem Resposta: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Status p/ Não Interessado: $NWB#vicidial_campaigns-survey_ni_status$NWE
Diretório de Gravações da Pesquisa: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Correio de Voz: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
Menu de chamada pesquisa: $NWB#vicidial_campaigns-survey_menu_id$NWE
Gravação de pesquisa: $NWB#vicidial_campaigns-survey_recording$NWE
\n"; echo "

\n"; } + ##### CAMPANHA 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_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + + echo "

$presets_to_print PRESETS para esta campanha:   $NWB#vicidial_xfer_presets$NWE
\n"; + + echo "
ADD NEW PRESET -
\n"; + echo "\n"; + echo "\n"; + echo "Nome da predefinição: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Ocultar número:  \n"; + echo "
\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
# PRESET NAMENÚMERODTMFESCONDERALTERARAPAGAR
$o $rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  APAGAR
\n"; + } + + + ##### CAMPANHA CódigoDeÁrea CID ##### + if ($SUB==202) + { + echo "

CIDS CódigoDeÁrea para esta campanha:   $NWB#vicidial_campaign_cid_areacodes$NWE
\n"; + if ($use_custom_cid != 'CódigoDeÁrea') + {echo "
The campaign setting Personalizado CallerID is not set to CódigoDeÁrea!
";} + 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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 "
#CódigoDeÁreaNÚMERO CIDDESCRIÇÃOATIVOCALLSAPAGAR
  $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   APAGAR
\n"; + echo "

\n"; + + echo "
ADD CódigoDeÁrea NOVA CID
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Areacode: \n"; + echo "Outbound CID:
\n"; + echo "Descrição: \n"; + echo "
\n"; + + echo "

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

\n"; echo "DESCONECTAR TODOS OS AGENTES DESTA CAMPANHA

\n"; - echo "EMERGENCY VDAC CLEAR FOR THIS CAMPANHA

\n"; + # echo "EMERGENCY VDAC CLEAR FOR THIS CAMPANHA

\n"; if ($LOGdelete_campaigns > 0) { @@ -17501,6 +22646,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_refrescar=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17511,8 +22661,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -17537,9 +22697,10 @@ if ($ADD==34) $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_stats_refrescar = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -17547,13 +22708,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Definições";} + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -17571,7 +22739,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -17592,7 +22760,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -17603,7 +22771,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -17633,14 +22801,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -17655,15 +22823,18 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
$row[0]: $campaign_id: Visão Básica Visão Detalhada Mesclagem de Lista Tela de Tempo Real Tela de Tempo Real  
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -17690,137 +22861,164 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
ID da Campanha: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
ID da Campanha: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campanha Data da Alter.: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campanha Data do Login: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Grupo de Usuários do Administrador: $user_group $NWB#vicidial_campaigns-user_group$NWE
Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Finalizadores (Closers): $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Grupo de Transferência Padrão:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Add A Dial Status:
Adicionar um status de marcação para chamadas:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordem da Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mesclagem de Lista:
Ordem da Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
Filtro de registros: $NWB#vicidial_campaigns-lead_filter_id$NWE
Mesclagem de Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Filtro de registros: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
Nível Hopper mínimo: $NWB#vicidial_campaigns-hopper_level$NWE
Forçar Reset do Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Nível de Discagem Automática: \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
ID DA LISTANOME DA LISTADESCRIÇÃOTOTAL DE REG.ATIVOÚLTIMA CHAMADAALTERAR
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
ID DA LISTANOME DA LISTADESCRIÇÃOTOTAL DE REG.ATIVOÚLTIMA CHAMADAALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]ALTERAR

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\n"; + + + if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) ) + { + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]ALTERAR

\n"; - echo "
\n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - ESCONDER

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

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Esta campanha tem$hopper_leads registros no hopper

\n"; - echo "Clique aqui para ver quais registros estão no hopper agora

\n"; - echo "Clique aqui para ver um relatório VDAD para esta campanha

\n"; + echo "
STATUS dentro das listas ativo para esta CAMPANHA:\n"; + echo " - ESCONDER
"; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
STATUSNOME DO STATUSCHAMADONÃO CHAMADO
$CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + } + else + { + echo "MOSTRAR STATUS DE CHUMBO Nesta campanha

"; + } + + + 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 " - ESCONDER

"; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - MOSTRAR

"; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Esta campanha tem$hopper_leads registros no hopper

\n"; + echo "Clique aqui para ver quais registros estão no hopper agora

\n"; + echo "Clique aqui para ver um relatório VDAD para esta campanha

\n"; } echo "Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha

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

Clique aqui para ver alterações Admin para esta campanha
\n"; + echo "

Clique aqui para ver as mudanças de administrador para esta campanha\n"; } echo "
\n"; @@ -18033,24 +23343,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
\n"; echo "
RANKING DO AGENTE NA CAMPANHA:
\n"; - echo "\n"; - echo "\n"; + echo "
USER     RANK     CALLS TODAY
\n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
USER     RANK     GRADE     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[2]
$rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

\n"; @@ -18087,7 +23398,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -18106,7 +23417,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
ATENÇÃO, só recomendamos Mesclagem de Listas para usuários avançados, Por favor leia o Manual de Gerente do Vicidial
\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -18115,7 +23426,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -18314,341 +23625,403 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
\n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + 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 ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTA DE STATUS CUSTOMIZADOS:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTA DE STATUS CUSTOMIZADOS:\n"; + echo "
CAMPANHANOMESTATUSALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPANHANOMESTATUSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY STATUS
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUS
\n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTA DE ATALHOS DA CAMPANHA:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTA DE ATALHOS DA CAMPANHA:\n"; + echo "
CAMPANHANOMEHOTKEYSALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPANHANOMEHOTKEYSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY HOTKEYS
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
\n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTA DE RECICLAGEM DE REGISTROS:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTA DE RECICLAGEM DE REGISTROS:\n"; + echo "
CAMPANHANOMERECICLAGEM DE REGISTROSALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPANHANOMERECICLAGEM DE REGISTROSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY RECICLAGEM DE REGISTROS
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY RECICLAGEM DE REGISTROS
\n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTA DE DISC. ALTERN. DE REG.:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTA DE DISC. ALTERN. DE REG.:\n"; + echo "
CAMPANHANOMEAUTO-ALT DIALALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPANHANOMEAUTO-ALT DIALALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NONE";} - echo "MODIFY AUTO-ALT DIAL
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
\n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTA DE CÓDIGOS DE PAUSA DE AGENTE:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTA DE CÓDIGOS DE PAUSA DE AGENTE:\n"; + echo "
CAMPANHANOMECÓDIGOS DE PAUSAALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPANHANOMECÓDIGOS DE PAUSAALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY CÓDIGOS DE PAUSA
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY CÓDIGOS DE PAUSA
\n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
\n"; + { + echo "
\n"; + echo ""; + + echo "
LISTA DE MESCLAGEM DE LISTA DE REGISTROS:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
CAMPANHANOMELIST MIXALTERAR
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
\n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; + + echo "
\n"; echo ""; -echo "
LISTA DE MESCLAGEM DE LISTA DE REGISTROS:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTAS DE CAMPANHA PRESET:\n"; + echo "
CAMPANHANOMELIST MIXALTERAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -18656,23 +24029,97 @@ echo "\n"; while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; + $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 (eregi("1$|3$|5$|7$|9$", $o)) + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
CAMPANHANOMEPRESETSALTERAR
$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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PRESETS
\n"; + } + + + +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
\n"; + echo ""; + + echo "
CAMPANHA LISTAS CódigoDeÁrea CID:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "$row[0] "; $p++; } - if ($p<1) - {echo "NONE";} echo ""; - echo "\n"; + echo "\n"; + + $k++; $o++; } -echo "
CAMPANHANOMECUSTOM CIDAC-CIDSALTERAR
$campaigns_id_list[$o]
$campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -18682,17 +24129,15 @@ echo "
MODIFY LIST MIX
MODIFY AC-CIDS
\n"; -} - - + echo "
\n"; + } @@ -18704,10 +24149,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -18845,19 +24307,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
\n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -18726,9 +24176,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18737,10 +24191,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18749,13 +24204,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -18768,7 +24224,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -18802,7 +24258,7 @@ if ($ADD==311) echo "
Descrição da Lista: $NWB#vicidial_lists-list_description$NWE
Campanha: $NWB#vicidial_lists-drop_inbound_group_override$NWE
Formulário Web: $NWB#vicidial_lists-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_lists-web_form_address$NWE
Número Transfer-Conf 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Relatório de Inventário: $NWB#vicidial_lists-inventory_report$NWE
Definição de Fuso Horário: $NWB#vicidial_lists-time_zone_setting$NWE
\n"; echo "
\n"; echo "
STATUS DESTA LISTA:
\n"; - echo "\n"; - echo "\n"; + + if ($SSexpanded_list_stats > 0) + { + echo "
STATUSNOME DO STATUSCHAMADONÃO CHAMADO
\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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
STATUSNOME DO STATUSCHAMADONÃO CHAMADODIALABLEPENETRATION
\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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18911,15 +24412,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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 "
STATUSNOME DO STATUSCHAMADONÃO CHAMADO
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
$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]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]    
TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); @@ -18929,7 +24468,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18968,7 +24507,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -18990,67 +24529,142 @@ if ($ADD==311) echo "
\n"; echo "
PROPIETARIOS dentro de esta lista:
\n"; - echo "
DIFERENÇA PARA GMT AGORA (horário local)CHAMADONÃO CHAMADO
\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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
OWNERCHAMADONÃO CHAMADO
\n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
OWNERCHAMADONÃO CHAMADORESET
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]
\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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
OWNERCHAMADONÃO CHAMADO
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); @@ -19063,7 +24677,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -19125,7 +24739,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -19242,7 +24856,16 @@ if ($ADD==311) echo "
\n"; - echo "

Clique aqui para ver todos os registros de Callback para esta lista

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

Os campos personalizados definidos para esta lista: $rowx[0]
\n"; + } + + echo "

Clique aqui para ver todos os registros de Callback para esta lista
\n"; echo "

Clique aqui para fazer download desta lista

\n"; if ($LOGdelete_lists > 0) @@ -19251,7 +24874,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver alterações Admin para esta lista
\n"; + echo "

Clique aqui para ver as mudanças de administração a esta lista\n"; } } else @@ -19271,10 +24894,16 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_refrescar=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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19344,9 +24973,85 @@ if ($ADD==3111) $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]; + + ##### 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_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + $Wmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -19357,6 +25062,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -19367,6 +25074,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -19419,6 +25133,10 @@ if ($ADD==3111) {$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 @@ -19428,17 +25146,29 @@ if ($ADD==3111) echo "
ALTERAR REGISTRO DE GRUPOS: $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"; if ($SSenable_second_webform > 0) { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19480,41 +25219,49 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19628,7 +25441,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -19666,11 +25479,21 @@ if ($ADD==3111) 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) @@ -19682,7 +25505,7 @@ if ($ADD==3111) $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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -19706,7 +25529,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19732,7 +25555,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19745,7 +25568,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19778,16 +25601,16 @@ if ($ADD==3111) } echo "
ID do Grupo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nome do Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Cor do Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Ativo: $NWB#vicidial_inbound_groups-active$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
In-Grupo Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
\n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
Grupo de Usuários do Administrador: $NWB#vicidial_inbound_groups-user_group$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Prioridade da Fila: $NWB#vicidial_inbound_groups-queue_priority$NWE
No gancho-Time Anel: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
Em Hook-CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Ignorar Override Script Lista: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_inbound_groups-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
Destino Ação temporizador: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
Tempo até derrubar(DROP): $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Ação de Drop:$NWB#vicidial_inbound_groups-drop_action$NWE
Ação de Drop:$NWB#vicidial_inbound_groups-drop_action$NWE
Exten de Drop: $NWB#vicidial_inbound_groups-drop_exten$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
Grupo de Transferência de Drop:
Grupo de Transferência de Drop: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Largar menu de chamada:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
Horário de Chamada:$NWB#vicidial_inbound_groups-call_time_id$NWE
Ação Fora do Expediente:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Transferência de Ação CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
Arquivo Fora do Expediente: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Ação Fora do Expediente:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Arquivo Fora do Expediente: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Extensão Fora do Expediente:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Correio de Voz Fora do Expediente: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Correio de Voz Fora do Expediente: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Grupo de Transferência Fora do Exped.:
Grupo de Transferência Fora do Exped.: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
After Hours chamada do menu:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
N de colas n Agentes: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
No No Acción cola de agente: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -19545,9 +25292,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID da Lista: "; echo "
ID da Campanha: audio chooser\n"; + echo "arquivo de áudio: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -19589,37 +25336,103 @@ if ($ADD==3111) echo "
 
Arquivo de Boas Vindas: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Max chama o método: $NWB#vicidial_inbound_groups-max_calls_method$NWE
Max chama Conte: $NWB#vicidial_inbound_groups-max_calls_count$NWE
Max chama Ação: $NWB#vicidial_inbound_groups-max_calls_action$NWE
Arquivo de Boas Vindas: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Tocar Mens. de Boas Vindas:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Contexto da Música de Espera: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
Contexto da Música de Espera: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
Arquivo de Aviso de Espera audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Arquivo de Aviso de Espera audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Intervalo de Aviso de Espera:$NWB#vicidial_inbound_groups-prompt_interval$NWE
On Hold Prompt No Bloco: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
On Hold Segundos Prompt: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
Tocar Lugar na Fila:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Tocar Tempo Estimado:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Calcule Segundos Retenção estimado: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
Estima Segure Filename tempo mínimo: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
Mínimo Tempo estimado de espera Não Avisar Bloco: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
Estimado Hold Time Segundos mínimos Prompt: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
Aguarde Opção Tempo: $NWB#vicidial_inbound_groups-wait_time_option$NWE
Aguarde Opção Segundo Tempo: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
Aguarde Opção terceira vez: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
Aguarde alguns segundos opção de tempo: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
Aguarde Opção Extensão Tempo: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
Espere Callmenu opção de tempo: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
Espere Correio de Voz opção de tempo: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
Espere Transferência Tempo Opção em grupo: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
Tempo de espera Filename Pressione Opção: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
Espere Pressione Opção No Time Bloco: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
Aguarde tempo de opção Segundos Nome do ficheiro Imprensa: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
Aguarde Opção Time After Filename Imprensa: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
Tempo de espera Opção ID Lista de chamada de retorno: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
Espere Segure Prioridade Opção: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
Opção Tempo estimado de espera: $NWB#vicidial_inbound_groups-hold_time_option$NWE
Segure Opção Segundo Tempo: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
Segure Opção terceira vez: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
Tempo de Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Segure mínimo opção de tempo: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
Extensão de Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Correio de Voz da Opção de Espera: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Segure Callmenu opção de tempo: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
Correio de Voz da Opção de Espera: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Grupo de Entrada da Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Arq. de Agend. da Opção de Espera: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Filename Pressione Opção: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
Segure Pressione Opção No Time Bloco: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
Hold Time Opção Segundos Nome do ficheiro Imprensa: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
Segure Opção Time After Filename Imprensa: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Lista de Agend. da Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Agente de Alerta Nombre de archivo: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Agente de Alerta Nombre de archivo: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Atraso de Alerta ao Agente:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Percentual Estatístico de Chamadas Atendidas em X seg 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Iniciar llamada URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
Iniciar llamada URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
Adicionar Chumbo URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
No URL chamada Agent: $NWB#vicidial_inbound_groups-na_call_url$NWE
Extensão Anexar CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
Mostrar de Status uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
Prefixo Estado uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
\n"; - echo "

\n"; + echo "


\n"; ### list of agent rank or skill-level for this inbound group - echo "
\n"; - echo "
AGENTE RANKS FOR THIS ENTRANTE GROUP:
\n"; - echo "\n"; - echo "\n"; + echo "
\n"; + echo "
AGENTE RANKS FOR THIS INBOUND GROUP:
\n"; + echo "
USER     RANK     CALLS TODAY
\n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19797,26 +25620,215 @@ if ($ADD==3111) $rowx=mysql_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_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + $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_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='ENVIAR') + { + $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 = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_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_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ( ($ARIG_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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_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 (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + $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 "
USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[2]
$ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

\n"; + echo "$users_output"; - echo "

\n"; + echo "

\n"; echo "Clique aqui para ver um relatório deste grupo de entrada

\n"; + echo "Clique aqui para ver os agentes conectados a este grupo de entrada

\n"; + echo "
\n"; - echo "DIDS USING THIS IN-GROUP:
\n"; + echo "DIDS USAR ESTE GRUPO IN:
\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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -19828,10 +25840,10 @@ if ($ADD==3111) } echo "

\n"; - echo "CALL MENUS USING THIS IN-GROUP:
\n"; + echo "CALL MENUS USAR ESTE GRUPO IN:
\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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -19846,7 +25858,7 @@ if ($ADD==3111) echo "CAMPAÑAS QUE PERMITA EN ESTE GRUPO:
\n"; echo "
\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19861,12 +25873,12 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; + # echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

APAGAR ESTE GRUPO DE ENTRADA\n"; } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver alterações Admin para este grupo de entrada\n"; + echo "

Clique aqui para ver as mudanças de administração para esta No Grupo In\n"; } } else @@ -19874,6 +25886,7 @@ if ($ADD==3111) echo "Você não tem permissão para ver esta página\n"; exit; } + } @@ -19886,13 +25899,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19997,7 +26073,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20019,7 +26095,7 @@ if ($ADD==3311) 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_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $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 "
\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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19916,9 +25934,36 @@ if ($ADD==3311) $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 order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19931,53 +25976,79 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\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') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\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 "
ALTERAR UM REGISTRO DDR:$row[0]
\n"; @@ -19987,7 +26058,12 @@ if ($ADD==3311) echo "
Extensão DDR:$NWB#vicidial_inbound_dids-did_pattern$NWE
Descrição DDR:$NWB#vicidial_inbound_dids-did_description$NWE
Ativo: $NWB#vicidial_inbound_dids-did_active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_inbound_dids-user_group$NWE
Rota DDR:$NWB#vicidial_inbound_dids-did_route$NWE
Registro de chamada: $NWB#vicidial_inbound_dids-record_call$NWE
Extensão:$NWB#vicidial_inbound_dids-extension$NWE
Contexto da Extensão:$NWB#vicidial_inbound_dids-exten_context$NWE
Caixa do Correio de Voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
In-ID do Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
Método de Manuseio de Chamada Entrante:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Método de Manuseio de Chamada Entrante:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Método de Busca de Agente p/ Ch. Entr.:$NWB#vicidial_inbound_dids-agent_search_method$NWE
ID da Lista de Entrada:$NWB#vicidial_inbound_dids-list_id$NWE
ID da Campanha de Entrada:$NWB#vicidial_inbound_dids-campaign_id$NWE
Código do Ramal de Entrada:$NWB#vicidial_inbound_dids-phone_code$NWE
Limpe Número CID: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
Número de entrada do filtro: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
ID Group Filter Telefone: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
Filtro de URL: $NWB#vicidial_inbound_dids-filter_url$NWE
Ação do Filtro: $NWB#vicidial_inbound_dids-filter_action$NWE
Filter Extensão:$NWB#vicidial_inbound_dids-extension$NWE
Filter Contexto da Extensão:$NWB#vicidial_inbound_dids-exten_context$NWE
Filter Caixa do Correio de Voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Filter Extensão do Ramal:$NWB#vicidial_inbound_dids-phone$NWE
Filter IP do Servidor: $NWB#vicidial_inbound_dids-server_ip$NWE
Filter Menu: $NWB#vicidial_inbound_dids-menu_id$NWE
Filter Agente:$NWB#vicidial_inbound_dids-user$NWE
Filter Ação p/ Agente não Disponível:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Filter Config. de Rota de Entrada do Agente:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
Filter In-ID do Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
Filter Método de Manuseio de Chamada Entrante:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Filter Método de Busca de Agente p/ Ch. Entr.:$NWB#vicidial_inbound_dids-agent_search_method$NWE
Filter ID da Lista de Entrada:$NWB#vicidial_inbound_dids-list_id$NWE
Filter ID da Campanha de Entrada:$NWB#vicidial_inbound_dids-campaign_id$NWE
Filter Código do Ramal de Entrada:$NWB#vicidial_inbound_dids-phone_code$NWE
Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
\n"; echo "

\n"; echo "
Haga clic aquí para ver un informe de tráfico para este DID

\n"; + echo "
Clique aqui para ver uma lista de gravações e chamadas para este DID
\n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

VER QUE AGENTE substituições REMOTO extensão para esse DID\n"; + } if ($LOGdelete_dids > 0) { echo "

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

Clique aqui para ver alterações Admin para este DDR\n"; + echo "

Clique aqui para ver as mudanças de administrador para este DID\n"; } } else @@ -20052,6 +26189,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
\n"; + echo ""; + + echo "
Remote Agent Substituir LISTAS DE EXTENSÃO:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
DIDNOMERA-EXTENSALTERAR
$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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/AlterarDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
NAO OVERRIDE ramal remoto agente adicionado - já existe uma entrada para esta DID com esta extensão RA
\n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
NAO OVERRIDE ramal remoto agente adicionado - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "
DID OVERRIDE ramal remoto agente adicionado: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
EXTENSÃO QUE AGENTE REMOTO OVERRIDE não excluído - esta entrada não existir
\n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
EXTENSÃO QUE AGENTE REMOTO OVERRIDE não excluído - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "
DID REMOTE AGENTE 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 AGENTE EXTENSION OVERRIDE NOT MODIFIED - Por favor, volte e verifique os dados digitados
\n"; + } + else + { + echo "EXTENSÃO QUE AGENTE REMOTO OVERRIDE MODIFICADO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/AlterarDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_refrescar=1; + } + echo "
\n"; + echo ""; + echo "

Substituições AGENTE REMOTO extensão para esse DID:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTEXTENSÃODESCRIÇÃOATIVOCALLSAPAGAR
  $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   APAGAR
\n"; + echo "

\n"; + + echo "
ADD NEW REMOTE AGENTE EXTENSION OVERRIDE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Usuário Start: \n"; + echo "Extensão:
\n"; + echo "Descrição: \n"; + echo "
\n"; + + echo "

\n"; + + echo "

MODIFICAR ESTE DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as mudanças de administrador para este DID
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -20060,10 +26497,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_refrescar=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -20077,6 +26519,9 @@ if ($ADD==3511) $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]; echo "
ALTERAR O REGISTRO DE MENU: $menu_id
\n"; @@ -20085,6 +26530,10 @@ if ($ADD==3511) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20121,6 +26570,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -20152,7 +26613,7 @@ if ($ADD==3511) $dtmf_list = ""; echo " "; - echo "   Handle Method: \n"; - echo "
Search Method: "; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; + echo "
Método de Pesquisa: \n"; echo "   ID da Lista: "; echo "
ID da Campanha: \n"; echo "   Phone Code: "; + echo "
  VID Enter Filename: audio chooser"; + echo "
  VID Filename Número de Identificação: audio chooser"; + echo "
  VID Confirmar Nome: audio chooser"; + echo "   Dígitos VID: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -20231,7 +26701,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "arquivo de áudio: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -20255,12 +26725,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
ID do Menu: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
Nome do Menu: $NWB#vicidial_call_menu-menu_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_call_menu-user_group$NWE
Audio do Menu: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
Tempo max do menu: $NWB#vicidial_call_menu-menu_timeout$NWE
Audio de tempo excedido do menu: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
Pressione a tecla Entrar: $NWB#vicidial_call_menu-dtmf_log$NWE     Entrar Campo: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
Opções do Menu:
Custom Plano de Discagem:
$NWB#vicidial_call_menu-custom_dialplan_entry$NWE
Entrada Dialplan personalizado:
$NWB#vicidial_call_menu-custom_dialplan_entry$NWE
Custom Plano de Discagem: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
Entrada Dialplan personalizado: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
\n"; echo "

\n"; - echo "DIDS USING THIS CALL MENU:
\n"; + echo "DIDS Usando este menu CHAMADA:
\n"; echo "\n"; - $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -20323,7 +26793,7 @@ if ($ADD==3511) echo "

\n"; - echo "CALL MENUS USING THIS CALL MENU:
\n"; + echo "CALL MENUS Usando este menu CHAMADA:
\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';"; @@ -20346,7 +26816,7 @@ if ($ADD==3511) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações deste MENU\n"; + echo "

Clique aqui para ver as mudanças de administrador para este menu de chamada\n"; } } else @@ -20366,10 +26836,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20379,38 +26854,232 @@ if ($ADD==31111) $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]; - echo "
ALTERAR AGENTES REMOTOS: $row[0]
\n"; - echo "\n"; - echo "\n"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; + $rsltx=mysql_query($stmt, $link); + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
ALTERAR AGENTES REMOTOS: $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 "
Início do ID do Usuário: (somente números, incremented, deve ser um usuário existente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
Número de linhas: (somente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP do Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensão Externa: (número do plano de discagem para ligar para agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Grupo de Extensão: $NWB#vicidial_remote_agents-extension_group$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campanha: $NWB#vicidial_remote_agents-campaign_id$NWE
Em Hook-agente: $NWB#vicidial_remote_agents-on_hook_agent$NWE
No gancho-Time Anel: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE
\n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "
Grupos de Entrada: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

HÁ $didraext_count DID substituições AGENTE ramal remoto para este agente REMOTO\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

APAGAR ESTE USUÁRIO REMOTO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as mudanças de administração a este agente remoto
\n"; + } + } + else + { + echo "Iniciar usuário para este agente remoto não existe: $user_start\n"; + exit; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=3711 modify filter phone group info in the system +###################### + +if ($ADD==3711) + { + if ($LOGmodify_dids==1) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_refrescar=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + $user_group = $row[3]; + + echo "
Modificar Grupo Telefone Filtro: $filter_phone_group_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 "
Início do ID do Usuário: (somente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de linhas: (somente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP do Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensão Externa: (número do plano de discagem para ligar para agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campanha: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos de Entrada: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
ID Group Filter Telefone: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
Nome do grupo Filtro Telefone: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
Descrição Group Filter Telefone: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_filter_phone_groups-user_group$NWE
\n"; - echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

Números deste grupo Telefone Filtro: $row[0]"; - if ($LOGdelete_remote_agents > 0) + if ($LOGdelete_dids > 0) { - echo "

APAGAR ESTE USUÁRIO REMOTO\n"; + echo "

Excluir este grupo TELEFONE FILTER\n"; } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver alterações Admin para este Agente Remoto
\n"; + echo "

Clique aqui para baixar os números neste grupo telefone filtro\n"; + + echo "

Clique aqui para ver as mudanças de administração para este grupo de telefone filtro\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_refrescar=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
Modificar uma entrada GRUPO DE EXTENSÃO: $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 "
Grupo de Extensão: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
Extensão: (somente números)$NWB#vicidial_extension_groups-extension$NWE
Rango: $NWB#vicidial_extension_groups-rank$NWE
Grupos de Campanhas: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
Contagem contas hoje: $call_count_today
Última chamada: $last_call_time
ID Last Call: $last_callerid
\n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

Apagar este registo GRUPO DE EXTENSÃO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as mudanças de administrador to this extension group entry
\n"; } } else @@ -20429,158 +27098,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

Clique aqui para ver todos os registros de CallBack para este grupo de usuários

\n"; - echo "

Clique aqui para ver o Status de Relógio de ponto para este usuário

\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - - echo ""; - - echo "
ALTERAR O REGISTRO DE GRUPO DE USUÁRIOS\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - echo "\n"; + echo "
Grupo: (sem espaços ou pontos)$NWB#vicidial_user_groups-user_group$NWE
Descrição: (descrição do grupo)$NWB#vicidial_user_groups-group_name$NWE
Forçar Login no Ponto: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Controle de Turno: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campanhas Permitidas:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; - echo "$campaigns_list
 "; - echo "
Turnos do Grupo:
$NWB#vicidial_user_groups-group_shifts$NWE
\n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " 1) and ($modify_refrescar_set < 1) ) { - if (ereg(" $shift_id_value ", $GROUP_shifts)) - { - echo " CHECKED"; - } - $p++; + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_refrescar=1; } - echo "> $shift_id_value - $shift_name_value
\n"; - $o++; - } - echo "
 
\n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
\n"; - echo "
USUÁRIOS DESTE GRUPO: $users_to_print
\n"; - 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + echo "
ALTERAR O REGISTRO DE GRUPO DE USUÁRIOS\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 "
Grupo: (sem espaços ou pontos)$NWB#vicidial_user_groups-user_group$NWE
Descrição: (descrição do grupo)$NWB#vicidial_user_groups-group_name$NWE
Forçar Login no Ponto: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Controle de Turno: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campanhas Permitidas:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Estado del agente visible Grupos:
$NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
\n"; - echo "ALL-GROUPS - All user groups in the system
\n"; - echo "CAMPANHA-AGENTS - All users logged into the same campaign as the agent
\n"; - - $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo "
Turnos do Grupo:
$NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) { - if (ereg(" $vgroups_id_value ", $VGROUP_vgroups)) + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
\n"; + $o++; } - echo "> $vgroups_id_value - $vgroups_name_value
\n"; - $o++; - } - echo "
 
Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
Campanhas Permitidas no CQ:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; - echo "$qc_campaigns_list"; echo "
 
Grupos de Entrada para CQ:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; - echo "$qc_groups_list"; + + + echo "
Estado del agente visible Grupos:
$NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
\n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
\n"; + } + echo "CAMPANHA-AGENTS - All users logged into the same campaign as the agent
\n"; + if ($admin_viewable_groupsALL > 0) + { + echo "NOT-LOGGED-IN-AGENTS - Todos os usuários do sistema, nem mesmo usuários registrados
\n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
\n"; + $o++; + } echo "
 
\n"; + echo "
Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
Agente Ver registro de chamadas: $NWB#vicidial_user_groups-agent_call_log_view$NWE
Agente Permitir Xfer Consultivo: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agente Permitir Xfer Override Dial: $NWB#vicidial_user_groups-agent_xfer_options$NWE
\n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
USERNOME COMPLETONÍVELATIVO
Agente Permitir Xfer mensagem de voz: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agente Permitir Xfer Cegos: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agente Permitir Dial Com Xfer Cliente: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agente Permitir Parque Xfer Dial Cliente: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agente Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
Relatórios admitidos: $NWB#vicidial_user_groups-allowed_reports$NWE
Substituir URL Webphone: $NWB#vicidial_user_groups-webphone_url_override$NWE
Sistema Webphone Tecla Anulação: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + if ($SSqc_features_active > 0) + { + echo "
Campanhas Permitidas no CQ:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
Grupos de Entrada para CQ:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
Admitidos Grupos de Usuários:
$NWB#vicidial_user_groups-admin_viewable_groups$NWE
\n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
\n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

APAGAR ESTE GRUPO DE USUÁRIOS\n"; - } - if ($LOGuser_level >= 9) - { - echo "

Clique aqui para ver as alterações Admin para este Grupo de usuários\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
\n"; + $o++; + } + echo "
 
Admitidos Tempos de Ligação:
$NWB#vicidial_user_groups-admin_viewable_call_times$NWE
\n"; + echo "ALL-CALLTIMES - Todos os tempos de chamada do sistema
\n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
\n"; + echo "
USUÁRIOS DESTE GRUPO: $users_to_print
\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
USERNOME COMPLETONÍVELATIVO
$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 "
Adicionar ou Remover No Grupo-selecionado para usuários ativos no Este Grupo de Usuários
\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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Grupo:
\n"; + echo "
\n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

Clique aqui para ver todos os registros de CallBack para este grupo de usuários

\n"; + echo "

Clique aqui para ver o Status de Relógio de ponto para este usuário

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

APAGAR ESTE GRUPO DE USUÁRIOS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as mudanças de administração a este grupo de usuários\n"; + } } } else @@ -20599,32 +27440,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
ALTERAR SCRIPT
\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
ID do Script: $script_id$NWB#vicidial_scripts-script_name$NWE
Nome do Script: (título do script)$NWB#vicidial_scripts-script_name$NWE
Comentários do Script: $NWB#vicidial_scripts-script_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_scripts-user_group$NWE
Ativo: $NWB#vicidial_scripts-active$NWE
Texto do Script:

Pré-Visualizar Script
"; # BEGIN Insert Field echo ""; echo "
"; # END Insert Field @@ -20692,10 +27557,10 @@ if ($ADD==3111111) echo "


\n"; - echo " CAMPANHAS USING THIS SCRIPT:
\n"; + echo " CAMPANHAS usando este script:
\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20707,10 +27572,10 @@ if ($ADD==3111111) } echo "


\n"; - echo " GRUPOS DE ENTR. USING THIS SCRIPT:
\n"; + echo " EM GRUPOS usando este script:
\n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20722,10 +27587,10 @@ if ($ADD==3111111) } echo "


\n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
\n"; + echo " Substituições lista usando este script:
\n"; echo "\n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20736,17 +27601,15 @@ if ($ADD==3111111) $o++; } - echo "
\n"; - - if ($LOGdelete_scripts > 0) { echo "

APAGAR ESTE SCRIPT\n"; } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este script
\n"; + echo "

Clique aqui para ver as mudanças de administração para este script
\n"; } + } else { @@ -20764,30 +27627,42 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
ALTERAR FILTRO\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
ID do Filtro:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nome do Filtro: (descrição simples do filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentários do filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_lead_filters-user_group$NWE
Filtro SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20816,7 +27691,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Filtro
\n"; + echo "

Clique aqui para ver as mudanças de administrador para este filtro
\n"; } } else @@ -20828,13 +27703,18 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -20880,10 +27760,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20905,6 +27790,15 @@ if ($ADD==311111111) $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]; echo ""; @@ -20912,17 +27806,22 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - 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; @@ -20942,7 +27841,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20952,10 +27851,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -20981,7 +27880,7 @@ if ($ADD==311111111) echo "CAMPANHAS QUE USAM ESTE HORÁRIO DE CHAMADA:
\n"; echo "
ID do Horário de Cham.: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Nome do Horário de Cham.: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do Horário de cham.: $NWB#vicidial_call_times-call_time_comments$NWE
Padrão de Início: Padrão de Fim: $NWB#vicidial_call_times-ct_default_start$NWE
Início no Domingo: Fim no Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Segunda: Fim na Segunda: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Terça: Fim na Terça: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quarta: Fim na Quarta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quinta: Fim na Quinta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Sexta: Fim na Sexta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início no Sábado: Fim no Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_call_times-user_group$NWE
Padrão de Início: Padrão de Fim: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início no Domingo: Fim no Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início na Segunda: Fim na Segunda: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início na Terça: Fim na Terça: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início na Quarta: Fim na Quarta: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início na Quinta: Fim na Quinta: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início na Sexta: Fim na Sexta: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Início no Sábado: Fim no Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
$state_rules[$b] - REMOVE $row[0] - $row[1]
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20993,10 +27892,10 @@ if ($ADD==311111111) } echo "
\n"; - echo "ENTRANTE GROUPS USING THIS CALL TIME:
\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';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21016,7 +27915,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Horário de Chamada\n"; + echo "

Clique aqui para ver as mudanças de administrador to this call time\n"; } } else @@ -21035,10 +27934,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -21060,6 +27964,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -21067,10 +27972,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21085,7 +27995,7 @@ if ($ADD==3111111111) echo "TEMPOS DE CHAMADA USANDO HORÁRIOS DE CHAMADA POR ESTADO:
\n"; echo "
ID do Horário de Cham.: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
Nome do horário de chamada por estado: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do horário de chamada por estado: $NWB#vicidial_call_times-call_time_comments$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_call_times-user_group$NWE
Padrão de Início: Padrão de Fim: $NWB#vicidial_call_times-ct_default_start$NWE
Início no Domingo: Fim no Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Segunda: Fim na Segunda: $NWB#vicidial_call_times-ct_sunday_start$NWE
\n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21117,18 +28027,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -21158,6 +28076,10 @@ if ($ADD==331111111) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -21185,6 +28107,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Sábado
\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
ID do Turno:$shift_id
Nome do Turno: (descrição curta do turno)$NWB#vicidial_shifts-shift_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_shifts-user_group$NWE
Início do Turno:\n"; echo "   Final do Turno:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
Opção Relatório: $NWB#vicidial_shifts-report_option$NWE
Relatório Ranking: $NWB#vicidial_shifts-report_rank$NWE
\n"; @@ -21192,7 +28125,7 @@ if ($ADD==331111111) echo "GRUPOS DE USUÁRIO USANDO ESTE TURNO:
\n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21212,7 +28145,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Turno\n"; + echo "

Clique aqui para ver as mudanças de administrador to this shift\n"; } } else @@ -21229,12 +28162,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_refrescar=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21242,11 +28180,18 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21269,6 +28237,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21284,11 +28253,12 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21303,8 +28273,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21321,7 +28291,7 @@ if ($ADD==31111111111) echo "\n"; echo "
Extensão do Ramal: $NWB#phones-extension$NWE (Agent Screen Login do Ramal)
Extensão do Ramal:$NWB#phones-extension$NWE
Número no Plano de Discagem: (somente dígitos)$NWB#phones-dialplan_number$NWE
Caixa do Correio de Voz: (somente dígitos)$NWB#phones-voicemail_id$NWE
CallerID de Saída: (somente dígitos)$NWB#phones-outbound_cid$NWE
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
Endereço IP do Ramal: (optional)$NWB#phones-phone_ip$NWE
Endereço IP do Computador: (optional)$NWB#phones-computer_ip$NWE
IP do Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Senha: $NWB#phones-pass$NWE
Entrar Tela agente: $NWB#phones-login$NWE
Login Senha: $NWB#phones-pass$NWE
Registo Senha: $NWB#phones-conf_secret$NWE     Força:
Definir como Webphone: $NWB#phones-is_webphone$NWE
Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
Webphone Auto-Resposta: $NWB#phones-webphone_auto_answer$NWE
Use IP do servidor externo: $NWB#phones-use_external_server_ip$NWE
Status: $NWB#phones-status$NWE
Conta Ativa: $NWB#phones-active$NWE
Tipo de Ramal: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Eliminar correo de voz después del email: $NWB#phones-delete_vm_after_email$NWE
Zona Correio de Voz: $NWB#phones-voicemail_timezone$NWE
Opções de correio de voz: $NWB#phones-voicemail_options$NWE
Empresa: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Mensagens Novas: $row[14]$NWB#phones-messages$NWE
Protocolo do Cliente: $NWB#phones-protocol$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#phones-local_gmt$NWE
Teléfono Anillo de tiempo de espera: $NWB#phones-phone_ring_timeout$NWE
Em Hook-agente: $NWB#phones-on_hook_agent$NWE
Login do Gerente: $NWB#phones-ASTmgrUSERNAME$NWE
Senha do Gerente: $NWB#phones-ASTmgrSECRET$NWE
Usuário padrão do VICIDIAL: $NWB#phones-login_user$NWE
Exten de Correio de Voz: $NWB#phones-voicemail_dump_exten$NWE
Contexto do Exten: $NWB#phones-ext_context$NWE
Teléfono Contexto: $NWB#phones-phone_context$NWE
Conf. Archivo Secreto: $NWB#phones-conf_secret$NWE
Codecs admitidos: $NWB#phones-codecs_list$NWE
Codecs permitidos com Template: $NWB#phones-codecs_with_template$NWE
Canal de envio do DTMF: $NWB#phones-dtmf_send_extension$NWE
Grupo de Saída de Chamadas: $NWB#phones-call_out_number_group$NWE
Localização do Navegador: $NWB#phones-client_browser$NWE
Caminho de Instalação: $NWB#phones-install_directory$NWE
URL do CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL Padrão do VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
Permitir Filas: $NWB#phones-QUEUE_ACTION_enabled$NWE
Popup do CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Botão CxPostal : $NWB#phones-voicemail_button_enabled$NWE
Atualizar Rápido: $NWB#phones-enable_fast_refresh$NWE
Taxa da Atualização Rápida: (in ms)$NWB#phones-fast_refresh_rate$NWE
Atualizar Rápido: $NWB#phones-enable_fast_refrescar$NWE
Taxa da Atualização Rápida: (in ms)$NWB#phones-fast_refrescar_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Discar próximo número: $NWB#phones-auto_dial_next_number$NWE
Parar de gravar após cada chamada: $NWB#phones-VDstop_rec_after_each_call$NWE
Porta do DBY: (Secundário DB Port)$NWB#phones-DBY_port$NWE
ID do Template: \n"; echo "
\n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21377,7 +28358,11 @@ if ($ADD==32111111111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
ID do Alias:$row[0] $NWB#phones-alias_id$NWE
Nome do Alias: $NWB#phones-alias_name$NWE
Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
Celular Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; @@ -21390,15 +28375,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -21416,7 +28402,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Alias de Ramal\n"; + echo "

Clique aqui para ver as mudanças de administrador to this phone alias\n"; } } else @@ -21433,12 +28419,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_refrescar=1; + } echo "
LOGINEXTENSÃOSERVERPROTOCOLIP
\n"; echo "\n"; +echo "
\n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21448,6 +28439,10 @@ if ($ADD==33111111111) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21461,7 +28456,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Alias de Grupo\n"; + echo "

Clique aqui para ver as mudanças de administrador to this group alias\n"; } } else @@ -21480,10 +28475,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "
ID do Alias: $row[0] $NWB#phones-group_alias_id$NWE
Nome do Alias: $NWB#phones-group_alias_name$NWE
Grupo de Usuários do Administrador: $NWB#phones-user_group$NWE
Número CallerID: $NWB#phones-caller_id_number$NWE
Nome CallerID: $NWB#phones-caller_id_name$NWE
Ativo:
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -21557,7 +28565,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21566,8 +28574,10 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21576,6 +28586,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21525,6 +28525,10 @@ if ($ADD==311111111111) $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]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21543,6 +28547,10 @@ if ($ADD==311111111111) echo "
Carga do Sistema: $sysload - $cpu%   $NWB#servers-sysload$NWE
Canais Falando: $channels_total   $NWB#servers-channels_total$NWE
Uso do HD: $disk_usage   $NWB#servers-disk_usage$NWE
Grupo de Usuários do Administrador: $NWB#servers-user_group$NWE
Versão do Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks no VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Usuário do Atualizador do Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuário de Listen do Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuário de Send do Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE
Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE     Força:
GMT Local: (NÃO ajuste para o horário de verão)$NWB#servers-local_gmt$NWE
Extensão para descarregar Correio de Voz : $NWB#servers-voicemail_dump_exten$NWE
Extensão do AD do VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Logs do Servidor: $NWB#servers-vd_server_logs$NWE
Saída do AGI: $NWB#servers-agi_output$NWE
Portador de registro activo: $NWB#servers-carrier_logging_active$NWE
Link Web de Gravação: $NWB#servers-recording_web_link$NWE
Link Web de Gravação: $NWB#servers-recording_web_link$NWE
Alternate Recording IP do Servidor: $NWB#servers-alt_server_ip$NWE
IP do servidor externo: $NWB#servers-external_server_ip$NWE
IP Ativo Server Gêmea: $NWB#servers-active_twin_server_ip$NWE
Servidor Asterisk Ativo: $NWB#servers-active_asterisk_server$NWE
Ativo Server Agent: $NWB#servers-active_agent_login_server$NWE
Gerar Arquivos Conf: $NWB#servers-generate_vicidial_conf$NWE
Actualización de los sonidos: $NWB#servers-sounds_update$NWE
Grabación Vicidial Límite: $NWB#servers-vicidial_recording_limit$NWE
Entrada Dialplan personalizado: $NWB#servers-custom_dialplan_entry$NWE
Entrada Dialplan personalizado: Disabled $NWB#servers-custom_dialplan_entry$NWE
\n"; @@ -21586,7 +28606,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -21633,7 +28653,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21665,7 +28685,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21763,7 +28783,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este Servidor\n"; + echo "

Clique aqui para ver as mudanças de administrador to this server\n"; } } else @@ -21782,15 +28802,21 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_refrescar=1; + } echo "
CAMPANHA TRUNKS RESTRIÇÃO DELETE
\n"; echo "\n"; +echo "\n"; +echo "
\n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; + $user_group = $row[3]; echo "
ALTERAR UM REGISTRO DE TEMPLATE DE CONF: $row[0]
\n"; echo "\n"; @@ -21799,6 +28825,10 @@ if ($ADD==331111111111) echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
ID do Template: $template_id
Nome do Template: $NWB#vicidial_conf_templates-template_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_conf_templates-user_group$NWE
Conteúdo do Template: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; @@ -21813,7 +28843,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21844,7 +28874,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21875,7 +28905,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para este template de conf
\n"; + echo "

Clique aqui para ver as mudanças de administrador to this conf template\n"; } } else @@ -21892,12 +28922,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21973,7 +28999,7 @@ if ($ADD==341111111111) } if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para esta Operadora\n"; + echo "

Clique aqui para ver as mudanças de administrador to this carrier\n"; } } else @@ -21990,18 +29016,25 @@ if ($ADD==341111111111) if ($ADD==351111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_tts==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=351111111111&tts_id=$tts_id"; + $modify_footer_refrescar=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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -21911,6 +28946,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
ALTERAR OPERADORA: $row[0]\n"; echo "\n"; @@ -21920,10 +28956,14 @@ if ($ADD==341111111111) echo "
ID da Operadora: $carrier_id
Nome da Operadora: $NWB#vicidial_server_carriers-carrier_name$NWE
Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_server_carriers-user_group$NWE
String de Registro: $NWB#vicidial_server_carriers-registration_string$NWE
ID do Template:
Plano de Discagem: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP do Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -22024,7 +29063,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

Haga clic aquí para ver chages Admin a esta entrada a TTS\n"; + echo "

Clique aqui para ver as mudanças de administrador to this TTS entry\n"; } } else @@ -22041,18 +29080,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; + $user_group = $row[5]; echo "
TTS MODIFICAR UN RECORD: $tts_id\n"; echo "\n"; @@ -22011,6 +29044,12 @@ if ($ADD==351111111111) echo "
TTS ID: $tts_id
Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
Ativo: $NWB#vicidial_tts_prompts-active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_tts_prompts-user_group$NWE
Voz: $NWB#vicidial_tts_prompts-tts_voice$NWE
TTS Texto: $NWB#vicidial_tts_prompts-tts_text$NWE
\n"; echo "
\n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -22061,6 +29106,12 @@ if ($ADD==361111111111) echo "
\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -22102,7 +29153,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

Haga clic aquí para ver chages de administración para esta música en espera de entrada\n"; + echo "

Clique aqui para ver as mudanças de administrador to this Música en espera entry\n"; } } else @@ -22119,12 +29170,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_refrescar=1; + } echo "
Música en espera de identificación: $moh_id
Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_music_on_hold-user_group$NWE
Ativo: $NWB#vicidial_music_on_hold-active$NWE
Orden aleatorio: $NWB#vicidial_music_on_hold-random$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22160,7 +29241,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

Haga clic aquí para ver chages de administración para esta casilla de correo de voz\n"; + echo "

Clique aqui para ver as mudanças de administrador to this voicemail box\n"; } } else @@ -22171,6 +29252,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_refrescar=1; + } + echo "
\n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -22135,6 +29191,9 @@ if ($ADD==371111111111) $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]; echo "
MODIFICAR UN contestador: $tts_id\n"; echo "\n"; @@ -22146,7 +29205,29 @@ if ($ADD==371111111111) echo "
Name: $NWB#vicidial_voicemail-fullname$NWE
Email:$NWB#vicidial_voicemail-email$NWE
Ativo: $NWB#vicidial_voicemail-active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_voicemail-user_group$NWE
Eliminar correo de voz después del email: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
Zona Correio de Voz: $NWB#vicidial_voicemail-voicemail_timezone$NWE
Opções de correio de voz: $NWB#vicidial_voicemail-voicemail_options$NWE
Mensagens Novas: $messages
Mensagens Antigas: $old_messages
\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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $user_group = $row[23]; + + echo "
MODIFICAR LABEL TELA: $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#vicidial_screen_labels-label_name$NWE
Ativo: $NWB#vicidial_screen_labels-active$NWE
Grupo de Usuários do Administrador: $NWB#vicidial_screen_labels-user_group$NWE
Ocultar Label em registros de chamadas: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
Título Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Nome primeira etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Médio rótulo inicial: $NWB#vicidial_screen_labels-default_field_labels$NWE
Nome última etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Etiqueta Address1: $NWB#vicidial_screen_labels-default_field_labels$NWE
Etiqueta Endereço2: $NWB#vicidial_screen_labels-default_field_labels$NWE
Etiqueta Endereço3: $NWB#vicidial_screen_labels-default_field_labels$NWE
Cidade Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Estado Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Província Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Código Postal Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Etiqueta de código de chumbo Vendedor: $NWB#vicidial_screen_labels-default_field_labels$NWE
Sexo rótulo: $NWB#vicidial_screen_labels-default_field_labels$NWE
Telefone Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Telefone Código de etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Telefone Alt Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
Frase Label Security: $NWB#vicidial_screen_labels-default_field_labels$NWE
E-mail rótulo: $NWB#vicidial_screen_labels-default_field_labels$NWE
Comentários Etiqueta: $NWB#vicidial_screen_labels-default_field_labels$NWE
\n"; + + echo "
\n"; + + + echo "


\n"; + echo " Campanhas que usam Esta etiqueta TELA:
\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]


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

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

Clique aqui para ver as mudanças de administrador para essa etiqueta tela
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=391111111111 modify contact in the system +###################### +if ($ADD==391111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_refrescar=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_query($stmt, $linkALT); + $row=mysql_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 "
MODIFICAR CONTATO: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
Nome: $NWB#contact_information$NWE
Sobrenome: $NWB#contact_information$NWE
Número de escritório: $NWB#contact_information$NWE
O número de células: $NWB#contact_information$NWE
Outro número 1: $NWB#contact_information$NWE
Outro número 2: $NWB#contact_information$NWE
BU Name: $NWB#contact_information$NWE
Department: $NWB#contact_information$NWE
Grupo: $NWB#contact_information$NWE
Job Title: $NWB#contact_information$NWE
Location: $NWB#contact_information$NWE
\n"; + + echo "
\n"; + + if ($LOGast_delete_phones > 0) + { + echo "

Excluir este contato\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as mudanças de administração para este contato\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -22179,6 +29477,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; +echo "
\n"; echo ""; @@ -22225,6 +29528,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "\n"; + + } -echo "\n"; - - -} - echo "
\n"; echo ""; @@ -22272,10 +29580,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_refrescar=1; + } 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"; @@ -22463,15 +29905,138 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + 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"; @@ -22489,6 +30054,16 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
\n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22323,6 +29689,66 @@ if ($ADD==311111111111111) $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_refrescar = $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]; echo "
ALTERAR CONFIG. DE SISTEMA DO VICIDIAL\n"; echo "\n"; @@ -22333,6 +29759,10 @@ if ($ADD==311111111111111) echo "
DB Schema Update Date: $db_schema_update_date
Auto Usuário-add Value: $auto_user_add_value
Data da Instalação: $install_date
Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
Uso Não-Latino: $NWB#settings-use_non_latin$NWE
Raiz Web Gravável: $NWB#settings-webroot_writable$NWE
Mostrar Bloqueio ao Agente VICIDIAL:$NWB#settings-vicidial_agent_disable$NWE
Permitir Mensagens SIPSAK$NWB#settings-allow_sipsak_messages$NWE
URL Home do Admin: $NWB#settings-admin_home_url$NWE
Administrador Modificar Auto-Refresh: $NWB#settings-admin_modify_refrescar$NWE
Administrador No-Cache: $NWB#settings-nocache_admin$NWE
Habilitar Log de Transferências: $NWB#settings-enable_agc_xfer_log$NWE
Habilitar Logfile Disposição agente: $NWB#settings-enable_agc_dispo_log$NWE
Relógio Ponto Final do Dia:$NWB#settings-timeclock_end_of_day$NWE
Local padrão GMT: (NÃO ajuste para o horário de verão)$NWB#settings-default_local_gmt$NWE
Zona Correio de Voz padrão: $NWB#settings-default_voicemail_timezone$NWE
Agentes Chama Redefinir: $NWB#settings-agents_calls_reset$NWE
Último Sair Automático do Ponto: $timeclock_last_reset_date
Formato da Data no Cabeçalho da tela do Agente:
Controle Central de Audio Ativado: $NWB#settings-sounds_central_control_active$NWE
Servidor Web de Sons: $NWB#settings-sounds_web_server$NWE
Diretório Web de Sons: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
Diretório do Web Admin: $NWB#settings-admin_web_directory$NWE
Servidor de correo de voz activo: $NWB#settings-active_voicemail_server$NWE
Permitir Custom Dialplan entradas: $NWB#settings-allow_custom_dialplan$NWE
PLLB Limite Agrupamento: $NWB#settings-pllb_grouping_limit$NWE
Gerar extensões entre servidores telefone: $NWB#settings-generate_cross_server_exten$NWE
Territorios de usuario de Ativo: $NWB#settings-user_territories_active$NWE
Formulario de Asistencia Segunda Habilitar: $NWB#settings-enable_second_webform$NWE
Habilitar TTS Integración: $NWB#settings-enable_tts_integration$NWE
Habilitar CallCard: $NWB#settings-callcard_enabled$NWE
Habilitar campos personalizados da lista: $NWB#settings-custom_fields_enabled$NWE
Habilitar chamadas de teste da campanha: $NWB#settings-test_campaign_calls$NWE
Habilitar Estatísticas lista extensa: $NWB#settings-expanded_list_stats$NWE
Habilitar CódigoDeÁrea Campanha CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
Ativar substituições extensão remota do Agente: $NWB#settings-did_ra_extensions_enabled$NWE
Enable Contacts: $NWB#settings-contacts_enabled$NWE
Gatilho primeiro Login: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
Senha padrão de Registro Telefone: $NWB#settings-default_phone_registration_password$NWE     Força:
Padrão Login Senha Telefone: $NWB#settings-default_phone_login_password$NWE     Força:
Senha do Servidor Padrão: $NWB#settings-default_server_password$NWE     Força:
Database Server Escravo: $NWB#settings-slave_db_server$NWE
Relatórios para usar DB Escravo: $NWB#settings-reports_use_slave_db$NWE
Entrada Dialplan personalizado: $NWB#settings-custom_dialplan_entry$NWE
Atualizar Dialplan Em Servidores: $NWB#settings-reload_dialplan_on_servers$NWE
Entrada Dialplan personalizado: Disabled $NWB#settings-custom_dialplan_entry$NWE
Ocultar Label em registros de chamadas: $NWB#settings-label_hide_field_logs$NWE
Título Etiqueta: $NWB#settings-default_field_labels$NWE
Nome primeira etiqueta: $NWB#settings-default_field_labels$NWE
Médio rótulo inicial: $NWB#settings-default_field_labels$NWE
Nome última etiqueta: $NWB#settings-default_field_labels$NWE
Etiqueta Address1: $NWB#settings-default_field_labels$NWE
Etiqueta Endereço2: $NWB#settings-default_field_labels$NWE
Etiqueta Endereço3: $NWB#settings-default_field_labels$NWE
Cidade Etiqueta: $NWB#settings-default_field_labels$NWE
Estado Etiqueta: $NWB#settings-default_field_labels$NWE
Província Etiqueta: $NWB#settings-default_field_labels$NWE
Código Postal Etiqueta: $NWB#settings-default_field_labels$NWE
Etiqueta de código de chumbo Vendedor: $NWB#settings-default_field_labels$NWE
Sexo rótulo: $NWB#settings-default_field_labels$NWE
Telefone Etiqueta: $NWB#settings-default_field_labels$NWE
Telefone Código de etiqueta: $NWB#settings-default_field_labels$NWE
Telefone Alt Etiqueta: $NWB#settings-default_field_labels$NWE
Frase Label Security: $NWB#settings-default_field_labels$NWE
E-mail rótulo: $NWB#settings-default_field_labels$NWE
Comentários Etiqueta: $NWB#settings-default_field_labels$NWE
Recursos de CQ Ativos: $NWB#settings-qc_features_active$NWE
Última Hora de Retirada do CQ: $qc_last_pull_time
Codecs padrão: $NWB#settings-default_codecs$NWE
Webphone padrão: $NWB#settings-default_webphone$NWE
Padrão IP do servidor externo: $NWB#settings-default_external_server_ip$NWE
URL Webphone: $NWB#settings-webphone_url$NWE
Webphone chave do sistema: $NWB#settings-webphone_systemkey$NWE
Sem resposta-Log: $NWB#settings-noanswer_log$NWE
DID Log agente: $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 Senha: $NWB#settings-alt_log_server_ip$NWE
Alt-Log Tabelas: $NWB#settings-tables_use_alt_log_db$NWE
Habilitar Log para o QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP do Servidor QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nome do BD do QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
QueueMetrics CallStatus: $NWB#settings-queuemetrics_callstatus$NWE
QueueMetrics AddMember Habilitado: $NWB#settings-queuemetrics_addmember_enabled$NWE
QueueMetrics Código Pause Dispo: $NWB#settings-queuemetrics_dispo_pause$NWE
QueueMetrics Telefone Ambiente Telefone Anexar: $NWB#settings-queuemetrics_pe_phone_append$NWE
Habilitar Integração com Vtiger: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Clique aqui para sincronizar usuários com o Vtiger\n"; @@ -22505,7 +30080,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Clique aqui para ver as alterações Admin para esta Configuração de sistema\n"; + echo "

Clique aqui para ver as mudanças de administrador to the system settings\n"; } } else @@ -22526,15 +30101,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_refrescar=1; + } echo "
\n"; echo ""; echo "
\n"; echo "ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:  $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -22551,8 +30143,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -22573,15 +30164,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -22609,14 +30198,16 @@ if ($ADD==321111111111111) echo "
INCLUIR STATUS DE SISTEMA
\n"; echo "\n"; echo "Status:   \n"; - echo "Descrição:
\n"; + echo "Descrição:   \n"; echo "Selecionável:   \n"; - echo "Resposta Humana:   \n"; + echo "Resposta Humana:
\n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
\n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
\n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoria:\n"; echo "
STATUSDESCRIÇÃOSELECT-
ABLE
HUMANO
RESPOSTA
CATEGORIAMODIFY/DELETE
S
T
A
T
U
S
DESCRIÇÃOCATEGORIA
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 "\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])) @@ -22592,15 +30190,6 @@ if ($ADD==321111111111111) { echo "APAGAR\n"; } - - echo "
\n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
\n"; echo ""; @@ -22688,7 +30284,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -22752,6 +30348,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_refrescar=1; + } echo "\n"; echo "
\n"; echo ""; @@ -22840,7 +30441,7 @@ if ($ADD==550) echo "
Nível do Usuário:
Grupo do Usuário: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23197,6 +30802,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23221,6 +30827,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPANHAlink='stage=CAMPANHADOWN'; @@ -23228,6 +30835,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -23236,7 +30845,7 @@ if ($ADD==100) if (eregi("CAMPANHADOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPANHAlink='stage=CAMPANHAUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23244,7 +30853,7 @@ if ($ADD==100) echo "
\n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23177,6 +30781,7 @@ if ($ADD==10) echo "ID
NOME
ACTIVE   GROUP   MÉTODO DE DISC.  
$row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
\n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -23276,7 +30885,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23303,7 +30912,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23312,7 +30920,7 @@ if ($ADD==1000) echo "
ID DA LISTANOME DA LISTANOME DA LISTADESCRIÇÃORTIMETOTAL DE REG.
"; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -23340,6 +30949,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23358,18 +30968,20 @@ if ($ADD==1300) echo "
\n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -23323,6 +30931,7 @@ if ($ADD==1000) echo "NOMEPRIORIDADEATIVOGRUPO ADMINTIMECOLORALTERAR $row[1] $row[2] $row[3] $row[6] $row[4]  ALTERAR
\n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); - echo "
ENTRANTE DID LISTINGS:\n"; + echo "
INBOUND DID LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23385,7 +30997,9 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23402,7 +31016,7 @@ if ($ADD==1500) echo "
#DIDDESCRIÇÃOATIVOGRUPO ADMINROUTERECALTERAR
$row[1] $row[2] $row[3] $row[6] $row[4] $row[5]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -23427,6 +31042,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -23442,6 +31058,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -23453,6 +31070,72 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
\n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -23411,6 +31025,7 @@ if ($ADD==1500) echo "
MENU IDNOMEGROUPPROMPTTIMEOUTOPTIONS
$menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
\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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
LISTAS DE GRUPO DE FILTRO TELEFONE:\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=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
FPG IDFPG NAMEDESCRIÇÃOGRUPO ADMINPHONES COUNTALTERAR
$row[0] $row[1] $row[2] $row[4] $row[3]ALTERAR
$row[0] $row[1] $row[2] $row[4] $row[3]ALTERAR
\n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23461,7 +31144,28 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23490,6 +31195,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23498,6 +31204,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
\n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23472,6 +31176,7 @@ if ($ADD==10000) echo "LINESSERVIDOR   CONF-EXTEN   GROUP   STATUS   CAMPANHA   ALTERAR
$row[4] $row[5] $row[6] $row[7]ALTERAR
\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_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
GRUPO LISTAS DE EXTENSÃO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
GROUPEXTENSÃORANK   RESTRICT   COUNT   LAST CALL   LAST ID   ALTERAR
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]ALTERAR
\n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -23506,7 +31259,7 @@ if ($ADD==100000) echo "
\n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -23545,7 +31298,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23568,6 +31322,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23584,7 +31339,7 @@ if ($ADD==10000000) echo "
\n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -23555,6 +31308,7 @@ if ($ADD==1000000) echo "ID DO SCRIPTNOME DO SCRIPTACTIVE   GRUPO ADMIN   ALTERAR
$row[0] $row[1] $row[2] $row[3]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23605,6 +31361,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23621,7 +31378,10 @@ if ($ADD==100000000) echo "
\n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -23593,6 +31348,7 @@ if ($ADD==10000000) echo "
FILTER IDFILTER NAMEGRUPO ADMINALTERAR
$row[0] $row[1] $row[2]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23646,6 +31407,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23661,7 +31423,7 @@ if ($ADD==1000000000) echo "
\n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -23632,6 +31392,7 @@ if ($ADD==100000000) echo "NOME DO HORÁRIOINÍCIO PADRÃOFIM PADRÃOGRUPO ADMINALTERAR
$row[1] $row[2] $row[3] $row[4] ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23688,6 +31451,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23703,7 +31467,7 @@ if ($ADD==130000000) echo "
\n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -23673,6 +31435,7 @@ if ($ADD==1000000000) echo "NOME DO HORÁRIOINÍCIO PADRÃOFIM PADRÃOGRUPO ADMINALTERAR
$row[2] $row[3] $row[4] $row[5] ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23730,6 +31495,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23758,7 +31524,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -23772,6 +31538,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23790,7 +31557,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -23806,7 +31574,7 @@ if ($ADD==12000000000) echo "
\n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -23715,6 +31479,7 @@ if ($ADD==130000000) echo "INÍCIO DO TURNOFIM DO TURNOSEMANALGRUPO ADMINALTERAR
$row[2] $row[3] $row[4] $row[5] ALTERAR
STATUSNOMEVMAILGROUPLINKS
$row[5] $row[6] $row[7]$row[8]$row[8]$row[9]ALTERAR | ESTATÍSTICAS
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23829,6 +31598,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23844,7 +31614,7 @@ if ($ADD==13000000000) echo "
\n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23816,6 +31584,7 @@ if ($ADD==12000000000) echo "ID DO ALIASNOME DO ALIASLISTA DE LOGINS DE RAMALGROUPALTERAR
$row[0]$row[1]$row[2]$row[3]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23871,6 +31642,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23886,7 +31658,7 @@ if ($ADD==100000000000) echo "
\n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23856,6 +31626,7 @@ if ($ADD==13000000000) echo "NÚMERO CIDNOME CIDATIVOGRUPO ADMINALTERAR
$row[2]$row[3]$row[4]$row[5]ALTERAR
\n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -23932,7 +31704,7 @@ if ($ADD==130000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23953,6 +31726,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23968,7 +31742,7 @@ if ($ADD==140000000000) echo "
\n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); @@ -23941,6 +31713,7 @@ if ($ADD==130000000000) echo "
ID do TemplateNome do TemplateGRUPO ADMINALTERAR
$row[0]$row[1]$row[2]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23997,6 +31772,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24013,7 +31789,7 @@ if ($ADD==150000000000) echo "
\n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -23981,6 +31755,7 @@ if ($ADD==140000000000) echo "ProtocolRegistroAtivoGRUPO ADMINALTERAR
$row[3]$row[4]$row[5]$row[6]ALTERAR
"; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24041,7 +31819,9 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24058,7 +31838,7 @@ if ($ADD==160000000000) echo "
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24023,7 +31799,9 @@ if ($ADD==150000000000) echo "TTS IDNombre TTSAtivoVozTTS TextoGRUPO ADMINALTERAR
$row[0]$row[1]$row[2]$row[4]$row[3]$row[5]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24087,6 +31868,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24103,7 +31885,7 @@ if ($ADD==170000000000) echo "
\n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -24069,6 +31849,7 @@ if ($ADD==160000000000) echo "MOH NameAtivoOrden aleatorioGRUPO ADMINALTERAR
$row[1]$row[2]$row[3]$row[4]ALTERAR
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24133,6 +31916,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24141,6 +31925,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
\n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -24116,6 +31898,7 @@ if ($ADD==170000000000) echo "Mensagens NovasMensagens AntigasDeleteGRUPO ADMINALTERAR
$row[3]$row[4]$row[5]$row[6]ALTERAR
\n"; + echo ""; + + $stmt="SELECT label_id,label_name,active,user_group from vicidial_screen_labels $whereLOGadmin_viewable_groupsSQL order by label_id"; + $rslt=mysql_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
Tela Etiquetas Agente:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
LABEL IDNameAtivoGRUPO ADMINALTERAR
$row[0]$row[1]$row[2]$row[3]ALTERAR
\n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24295,6 +32182,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24316,7 +32204,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
NOMENúmero de escritórioBU NameDepartmentGroupJob TitleLocationALTERAR
$row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ALTERAR
\n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -24241,7 +32127,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24255,6 +32141,7 @@ if ($ADD==700000000000000) echo "
SECTIONTYPERECORD IDGROUPDESCRIÇÃOGOTO
$row[4] $row[5] $row[6] $row[8] $row[7] GOTO
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24380,6 +32269,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24403,7 +32293,13 @@ if ($ADD==720000000000000) echo "
\n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -24325,7 +32213,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24339,6 +32227,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGROUPDESCRIÇÃOGOTO
$row[4] $row[5] $row[6] $row[8] $row[7] GOTO
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24427,25 +32324,26 @@ if ($ADD==720000000000000) { $row=mysql_fetch_row($rslt); - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPANHA',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPANHA',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -24458,8 +32356,9 @@ if ($ADD==720000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; - echo ""; + echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; @@ -24487,7 +32386,8 @@ if ($ADD==730000000000000) echo "
\n"; echo ""; - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $sectionSQL = "event_section='$category'"; + if (preg_match("/CAMPANHAS/",$category)) + {$sectionSQL = "event_section IN('CAMPANHAS','CAMPANHA_SURVEY','CAMPANHA_LISTMIX','CAMPANHA_PRESET','CAMPANHA_QC','CAMPANHA_PAUSECODE','CAMPANHA_RECYCLE','CAMPANHA_HOTKEY','CAMPANHA_STATUS','CAMPANHA_DIALSTATUS','CAMPANHA_DIALSTATUS','CAMPANHA_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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24417,6 +32313,7 @@ if ($ADD==720000000000000) echo "SECTIONTYPERECORD IDGROUPDESCRIÇÃOGOTO
$row[4] $row[5] $row[6] $row[8] $row[7] GOTO GOTO
"; echo ""; echo "\n"; + echo ""; + echo ""; + echo "\n"; echo ""; echo ""; echo "\n"; @@ -24552,7 +32455,7 @@ if ($ADD==999999) 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24521,6 +32421,9 @@ if ($ADD==730000000000000) echo "DESCRIPTION: $row[7]
GRUPO ADMIN: $row[11]
NOTES: $row[8]
\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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -24574,13 +32477,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -24592,54 +32501,104 @@ if ($ADD==999999)
      - Tempo Real Relatórios
-
- Inbound and Outbound Calling Relatórios
-
    -
  • Inbound Report -
  • Inbound Service Level Report -
  • Resumen horario de entrada Informe -
  • Inbound DID Report -
  • Inbound IVR Report -
  • Outbound Calling Report -
  • Outbound Summary Interval Report -
  • Fronter - Closer Report - - Tempo Real Relatórios
    \n"; + echo "
      \n"; + if ( (preg_match("/Tempo Real Main Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Tempo Real Main Report\n";} + # echo "
        Tempo Real SIP: Listen - Barge\n"; + # echo "
        Tempo Real IAX: Listen - Barge

      \n"; + if ( (preg_match("/Tempo Real Campanha Summary/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Tempo Real Campanha Summary\n";} + echo "

    \n"; + echo "Inbound and Outbound Calling Relatórios
    \n"; + echo "
      \n"; + if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$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 RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Relatório de entrada por DID\n";} + if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Inbound Service Level Report\n";} + if ( (preg_match("/Resumen horario de entrada Informe/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Resumen horario de entrada Informe\n";} + if ( (preg_match("/Inbound Daily Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Inbound Daily Report\n";} + if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Inbound DID Report\n";} + if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Inbound IVR Report\n";} + if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Outbound Calling Report\n";} + if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Outbound Summary Interval Report\n";} + if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + echo "
    • Outbound IVR Report"; + if ($LOGexport_reports >= 1) + { + if ( (preg_match("/Exportar Relatórios de Chamadas/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo " - Export";} + } + echo "\n"; + } + if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Fronter - Closer Report\n";} + if ( (preg_match("/Listas Status da Campanha Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Listas Status da Campanha Report\n";} + if ( (preg_match("/Campanha Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Campanha Status List Report\n";} + # echo "
    • AGENTE SPREADSHEET PERFORMANCE\n"; + if ( ( (preg_match("/Dialer Relatório de Inventário/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) and ($inventory_report_count > 0) ) + {echo "
    • Dialer Relatório de Inventário\n";} + if ($LOGexport_reports >= 1) { - echo "
    • Exportar Relatórios de Chamadas\n"; + if ( (preg_match("/Exportar Relatórios de Chamadas/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Exportar Relatórios de Chamadas\n";} + if ( (preg_match("/Exportação lidera Relatório/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
    • Exportação lidera Relatório\n";} } - ?> -
    + echo "
\n"; + echo "
\n"; + echo "      \n"; + echo "\n"; + echo "Agent Relatórios
\n"; + echo "
    \n"; + if ( (preg_match("/Agente Tiempo Detalle/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Agente Tiempo Detalle\n";} + if ( (preg_match("/Agent Status Detalhes/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Agent Status Detalhes\n";} + if ( (preg_match("/Agent Performance Detalhes/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Agent Performance Detalhes\n";} + if ( (preg_match("/Team Performance Detalhes/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Team Performance Detalhes\n";} + if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Single Agent Daily\n";} + if ( (preg_match("/Estatísticas de Usuário/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Estatísticas de Usuário\n";} + if ( (preg_match("/Usuário Planilha de Tempo/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Usuário Planilha de Tempo\n";} + echo "

\n"; + echo "Time Clock Relatórios
\n"; + echo "
    \n"; + if ( (preg_match("/UsuárioRelógio Ponto Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • UsuárioRelógio Ponto Report\n";} + if ( (preg_match("/Grupo do UsuárioRelógio Ponto Status Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Grupo do UsuárioRelógio Ponto Status Report\n";} + if ( (preg_match("/UsuarioRelógio Ponto Detalle Informe/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • UsuarioRelógio Ponto Detalle Informe\n";} + echo "

\n"; + echo "Other Relatórios and Links
\n"; + echo "
    \n"; + if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Server Performance Report\n";} -
-       - - Agent Relatórios
-
- Time Clock Relatórios
-
- Other Relatórios and Links
-
    -
  • Server Perforrmance Report - = 9) + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + {echo "
  • Maximum System Stats\n";} + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) ) { echo "
  • Administration Change Log\n"; } @@ -24651,58 +32610,117 @@ if ($ADD==999999) { echo "
  • VtigerCRM Home\n"; } - if ($list_update_count > 0) + if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) ) { echo "
  • List Update Stats\n"; } - ?> -
-
- - -

-		
-		 $o)
+		if ($SScallcard_enabled > 0)
 			{
-			$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";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			$o++;
+			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) )
+				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERDESCRIÇÃOIPACTLOADCHANDISKSAINTEENTRANTE
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Relatórios Links/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$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;
    +			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";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				else
    +					{
    +					if ( (preg_match("/Tempo Real Main Report/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) )
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					else
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					}
    +				echo "\n";
    +				$o++;
    +				}
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +
    +				$stmt="SELECT NOW();";
    +				$rslt=mysql_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    SERVIDOR -DESCRIÇÃOIPACTLOADCHANDISKTIME
    SERVIDOR +DESCRIÇÃOIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      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 RELATÓRIOS/",$LOGallowed_reports)) ) ) + { + echo "

      Utilitários de administração\n"; + } + } } else { @@ -24710,6 +32728,463 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    + "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -192,10 +309,10 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; @@ -212,7 +329,7 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -232,27 +349,36 @@ else { if (strlen($log_lead_id)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; } if (strlen($log_phone)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; } - + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $rslt=mysql_query("$stmtA", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no outbound calls matching your search criteria

    \n"; + echo "Existem no outbound calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    SAINTE LOG RESULTS: $results_to_print
    \n"; + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \n"; echo "
    + \n"; + echo "   \n"; + } +##### END admin links ##### + + +###################### +# ADD=999997 - user force change password page +###################### +if ($ADD==999997) + { + $show_form=1; + if ($stage=='ENVIAR') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "A senha não foi alterada, por favor tente novamente |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "A senha não foi alterada, por favor tente novamente |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "A senha não foi alterada, por favor tente novamente |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', event_type='MODIFY', record_id='$user', event_code='USER FORCE MUDAR SENHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "A senha foi atualizada, você pode agora continuar\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    MUDAR SENHA\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Nova Senha:     Força:
    Você é obrigado a alterar sua senha antes que você possa continuar a Administração. Uma senha forte tem tanto letras minúsculas e maiúsculas, assim como pelo menos um número. Sua senha deve ter de 2 a 20 caracteres e não pode conter quaisquer caracteres que não são letras ou números. Certifique-se que esta senha é algo que você pode lembrar, porque assim que você fizer essa alteração, você será solicitado a digitar a nova senha para login em Administração
    \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=='ENVIAR') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "A senha não foi alterada, por favor tente novamente |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "A senha não foi alterada, por favor tente novamente |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "A senha não foi alterada, por favor tente novamente |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUÁRIOS', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Senhas foram atualizadas, agora você pode continuar em Administração.

    Você pode querer começar por ler o Manual Gestor ViciDial disponível em vicidial.org (existe uma versão gratuita disponível)\n"; + } + } + } + } + if ($show_form > 0) + { + echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "CHAMADAS PARA ESSE REGISTRO:\n"; + echo "
    \n"; + echo ""; + + echo "
    Bem-vindo ao ViciDial, tela de configuração inicial

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Você é obrigado a alterar sua senha antes que você possa continuar a Administração. Uma senha forte tem tanto letras minúsculas e maiúsculas, assim como pelo menos um número. Sua senha deve ter de 2 a 20 caracteres e não pode conter quaisquer caracteres que não são letras ou números. Certifique-se que esta senha é algo que você pode lembrar, porque assim que você completar esta tela de configuração inicial, você será solicitado a digitar a nova senha novamente para voltar a entrar para a Administração
    Nova Senha:     Força:
     
    Os próximos três senhas padrão são definidas na seção Configurações do Sistema, e você pode alterá-los depois de defini-los aqui. É uma idéia boa para fazer essas senhas tão forte que ninguém pode invadir suas contas de telefone e telefonemas lugar sem você saber. A senha de registro padrão usado quando os telefones novos são adicionados ao sistema como o SIP ou IAX senha do telefone VOIP. O padrão de telefone senha de acesso web utilizado quando os telefones novos são adicionados ao sistema, como a senha do telefone que um agente iria usar na interface do Agente ViciDial. A senha do servidor padrão usado quando os novos servidores são adicionados ao sistema para os servidores para comunicar uns com os outros.
    Senha padrão de Registro Telefone:     Força:
    Padrão Login Senha Telefone:     Força:
    Senha do Servidor Padrão:     Força:
     
    As próximas duas configurações também são definidos na seção Configurações do Sistema, e você pode alterá-los depois de defini-los aqui. Você deve definir o local padrão para o fuso horário GMT que seus agentes querem estar dentro A zona de Correio de Voz é a lista de fusos horários de correio de voz que as mensagens de correio de voz será o tempo registrado com quando novas mensagens são deixadas.
    Local padrão GMT: (NÃO ajuste para o horário de verão)$NWB#settings-default_local_gmt$NWE
    Zona Correio de Voz padrão: $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 "
    Bem-vindo ao ViciDial: página direitos autorais, marcas e licenças

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   O ViciDial Call Center Suite é mantido pelo ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" é uma marca registrada do ViciDial Group. Aqui é o nosso política de uso de marca
    License:   O ViciDial Call Center Suite é lançado sob a AGPLv2 licença de código aberto
    Source Code:   O ViciDial Call Center Suite está disponível para download, e para o uso, livre de custos. Você pode baixar o fácil de instalar ViciBox CD ISO versão, ou apenas o código-fonte
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Continue até a configuração inicial

      \n"; + } + } +##### END copyright trademark license page ##### + + +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: página utilitários escondidos - Se você não sabe o que esses utilitários fazer, provavelmente você não deve usá-los

    \n"; + echo "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$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 Detalhes/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $campaign_name = $rowx[0]; + } + else + {echo "Not found"; exit;} + } + + echo "
    Administration: Maximum Stats Detalhes for $stage $modify_link$campaign_id
    - $campaign_name   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Você não tem permissão para ver esta página";} + + 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Você não tem permissão para ver esta página";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + echo "
    \n"; @@ -24723,24 +33198,127 @@ echo "
    \n"; echo "

    "; echo "VERSÃO: $admin_version
    "; -echo "BUILD: $build
    \n"; - +echo "BUILD: $build\n"; +if (!preg_match("/_BUILD_/",$SShosted_settings)) + {echo "
    © 2012 ViciDial Group
    ";} +echo "\n"; ?>
    - - 1) and ($modify_footer_refrescar > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_refrescar > 1) and ($modify_footer_refrescar > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Existem $complete_leads ligações concluídas nessas listas\n";} + } + else + { + echo "nenhum status de discagem selecionado para essa campanha\n"; + } + } + else + { + echo "nenhuma lista ativa para esta campanha\n"; + } + } +else + { + echo "nenhuma lista ativa para esta campanha\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -25063,7 +33641,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -25075,8 +33659,11 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; - echo "Esta campanha tem$active_leads registros para serem discados nessas listas\n"; + if ($DB > 0) {echo "|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {echo "Esta campanha tem$active_leads registros para serem discados nessas listas\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_campaign_multi_alt.php new file mode 100644 index 00000000..d60a9cce --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRAÇÃO: campanha multi-Alt-Leads +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Esta campanha não está definido para Auto-Alt-Dial MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_ENVIAR") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPANHA MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-chumbo Auto definições de marcação Alt Formulário<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_ENVIAR>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS CAMPANHA: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>CHAMADO</td><td>NÃO CHAMADO</td><td>SELECTED</td><td>OLD RANK</td><td>NEW RANK</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>SUBTOTAIS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Ordem Randomize Lista: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Ordem lista secundária: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Versão: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_header.php index 72403543..0bf50e3c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,25 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -27,15 +46,23 @@ if($short_header) ?> <TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR> <TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22>   </TD> + <?php if ($reports_only_user < 1) { + ?> <TD>   <A HREF="admin.php" ALT="Usuários"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Usuários</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10" ALT="Campanhas"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Campanhas</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100" ALT="Listas"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Listas</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=1000000" ALT="Scripts"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Scripts</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000000" ALT="Filtros"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Filtros</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=1000" ALT="Groupos de Entrada"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Groupos de Entrada</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=1000" ALT="Inbound"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Inbound</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100000" ALT="Grupos de Usuário"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Grupos de Usuário</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000" ALT="Agentes Remotos"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Agentes Remotos</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=10000000000" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=999998" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <?php + } + else + { ?> + <TD width=600>     </TD> + <?php } ?> <TD>   <A HREF="admin.php?ADD=999999" ALT="Relatórios"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Relatórios</B></A>   </TD> </TR> </TABLE> @@ -319,41 +346,99 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_refrescar;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("refrescar_countdown").innerHTML = "<font color=black> screen refrescar in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_refrescar_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -519,22 +604,47 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) ) } + + +### Javascript for shift end-time calculation and display +if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) + { + ?> + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + <?php + } + + +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -546,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -558,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -570,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -622,13 +732,17 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 if (selected_route=='INGROUP') { if (value_context.length < 10) - {value_context = 'CID,LB,998,TESTCAMP,1';} - var value_context_split = value_context.split(","); - var IGhandle_method = value_context_split[0]; - var IGsearch_method = value_context_split[1]; - var IGlist_id = value_context_split[2]; - var IGcampaign_id = value_context_split[3]; - var IGphone_code = value_context_split[4]; + {value_context = 'CID,LB,998,TESTCAMP,1,,,,';} + var value_context_split = value_context.split(","); + var IGhandle_method = value_context_split[0]; + var IGsearch_method = value_context_split[1]; + var IGlist_id = value_context_split[2]; + var IGcampaign_id = value_context_split[3]; + var IGphone_code = value_context_split[4]; + var IGvid_enter_filename = value_context_split[5]; + var IGvid_id_number_filename = value_context_split[6]; + var IGvid_confirm_filename = value_context_split[7]; + var IGvid_validate_digits = value_context_split[8]; if (route == selected_route) { @@ -640,14 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   lidar com Método: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 Border=0 ALT="AJUDA" ALIGN=TOP></a>'; + new_content = new_content + '<BR>Método de Pesquisa: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID da Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID da Campanha: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID Filename Número de Identificação: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID Confirmar Nome: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   Dígitos VID: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -667,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "arquivo de áudio: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -782,14 +901,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -799,14 +922,19 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   lidar com Método: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Método de Pesquisa: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID da Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID da Campanha: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + // new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID Filename Número de Identificação: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID Confirmar Nome: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   Dígitos VID: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + } if (selected_route=='DID') { @@ -826,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "arquivo de áudio: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,15 +1020,46 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_refrescar_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_br/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Brazilian <img src=\"../agc/images/br.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?> <CENTER> @@ -911,6 +1070,8 @@ $SSenable_tts_integration = $row[1]; <IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="VICIDIAL logo"> <B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR> <TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160> + <?php if ($reports_only_user < 1) { + ?> <!-- USUÁRIOS NAVIGATION --> <TR WIDTH=160><TD <?php echo $users_hh ?> WIDTH=160> <a href="<?php echo $ADMIN ?>?ADD=0"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $users_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $users_bold ?>Usuários</a> @@ -966,6 +1127,10 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -989,31 +1154,56 @@ $SSenable_tts_integration = $row[1]; ?> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Códigos de Pausa</a></TD> - <?php } + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>> Presets </a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- LISTAS NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { ?> <TR><TD ALIGN=LEFT <?php echo $lists_hh ?>><a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $lists_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $lists_bold ?>Listas</a></TD></TR> <?php - if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Incluir-Remover Número do Bloqueio';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Adicione-RemoverNúmero DNC';} + else {$DNClink = 'Adicionar número de DNC';} ?> - <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar Listas </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir Lista </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Pesquisar Registro </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./new_listloader_superL.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Carregar Registros </a> - </TD></TR> - <?php } + <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar Listas </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir Lista </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Pesquisar Registro </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Adicionar uma nova pista </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Carregar Registros </a> + <?php + if ($SScustom_fields_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Listar Campos Personalizados </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiar campos personalizados </a> + <?php + } + ?> + </TD></TR> + <?php + } } ?> <!-- SCRIPTS NAVIGATION --> @@ -1051,30 +1241,50 @@ $SSenable_tts_integration = $row[1]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Grupos Entr. </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Entrada </a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Adicione-RemoverNúmero FPG';} + else {$FPGlink = 'Adicionar número FPG';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar Grupos Entr. </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir Grupo Entr. </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiar Grupo de Entrada </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiar Grupo de Entrada </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar DDRs </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir DDR </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar Menus </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir um Menu </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiar Menu de Chamada </a> + <HR> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filtro de Grupos de telefone </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Adicionar Grupo de telefone Filtro </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> <?php } ?> @@ -1109,12 +1319,16 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar Ag. Remotos </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Incluir Ag. Remoto </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Grupos de Extensão </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Adicionar Grupo de Extensão </a> </TD></TR> <?php } ?> <!-- ADMIN NAVIGATION --> <TR><TD <?php echo $admin_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> + <a href="<?php echo $ADMIN ?>?ADD=999998"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> </TD></TR> <?php if (strlen($admin_hh) > 1) @@ -1135,6 +1349,8 @@ $SSenable_tts_integration = $row[1]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1145,6 +1361,10 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1164,6 +1384,8 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Conferências </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> Config. de Sistema </a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Etiquetas Tela </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>>Status do Sistema</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1186,7 +1408,23 @@ $SSenable_tts_integration = $row[1]; </TR> <?php } + if ($SScallcard_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cc_sh ?>>   + <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cc_fc ?> SIZE=<?php echo $header_font_size ?>> CallCard Admin </a></TD> + </TR> + + <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } + } ?> <!-- RELATÓRIOS NAVIGATION --> <TR><TD <?php echo $reports_hh ?>> @@ -1202,7 +1440,7 @@ $SSenable_tts_integration = $row[1]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HOME</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Relógio Ponto</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Sair</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HOME</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Relógio Ponto</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Sair</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1245,12 +1483,16 @@ $SSenable_tts_integration = $row[1]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Operadoras </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Operadoras </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiar Um transportador </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar las entradas TTS </a>   |   <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregar una nueva entrada TTS </a></TD></TR> <?php } + if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { + ?> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Gerar Novos números </a></TD></TR> + <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar las entradas del Ministerio de Salud </a>   |   <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregar una nueva entrada del Ministerio de Salud </a></TD></TR> @@ -1263,6 +1505,14 @@ $SSenable_tts_integration = $row[1]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Config. de Sistema </a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Etiquetas Tela </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Adicione um rótulo Tela </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Adicionar um contato </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Status do Sistema</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Categoria de Status</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Cód. de Status CQ</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..35931278 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AJUDA\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- VERSÃO: $version BUILD: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL DIFERENÇA PARA GMT AGORA: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Status do arquivo atual:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Carregar registros do arquivo:
    ID da Lista Override: + +
    Sobrepor Código do Telefone: + +
    Layout do arquivo a usar:Standard Format    Layout Customizado    Custom Template
    Template personalizado para usar: construtor modelo
    Verificação de Duplicidade de Registro:
    USA-Canada Check:
    Pesquisa do Fuso Horário do Registro:
            
            VOLTAR PARA ADMIN         Old Lead Loader     LIST LOADER 4th Gen-     VERSÃO:     BUILD:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID da Lista Override:
    Sobrepor Código do Telefone:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSÃO:     BUILD: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesandofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoDeÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoDeÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoDeÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoDeÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoDeÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoDeÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesando$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColunaDados do arquivo
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domingo March to First Domingo November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domingo March to First Domingo November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domingo April to Last Domingo October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in April and last Domingo in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domingo March to Last Domingo October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in March and last Domingo in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domingo October to Last Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domingo October to Last Domingo March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domingo in October to First Domingo in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and first Domingo in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domingo October to Third Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and third Domingo in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domingo in September to First Domingo in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in September and first Domingo in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domingo October to Last Domingo February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domingo October to Last Domingo February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_third_gen.php new file mode 100644 index 00000000..61ec5a64 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"AJUDA\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Carregar registros do arquivo:
    ID da Lista Override: + +
    Sobrepor Código do Telefone: + +
    Layout do arquivo a usar:Standard Format    Layout Customizado
    Verificação de Duplicidade de Registro:
    USA-Canada Check:
    Pesquisa do Fuso Horário do Registro:
            
            VOLTAR PARA ADMIN         Old Lead Loader     LIST LOADER 3rd Gen-     VERSÃO:     BUILD:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID da Lista Override:
    Sobrepor Código do Telefone:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSÃO:     BUILD: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesandofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoDeÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoDeÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoDeÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoDeÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesando$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColunaDados do arquivo
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domingo March to First Domingo November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domingo March to First Domingo November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domingo April to Last Domingo October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in April and last Domingo in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domingo March to Last Domingo October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in March and last Domingo in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domingo October to Last Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domingo October to Last Domingo March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domingo in October to First Domingo in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and first Domingo in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domingo October to Third Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and third Domingo in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domingo in September to First Domingo in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in September and first Domingo in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domingo October to Last Domingo February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domingo October to Last Domingo February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_lists_custom.php new file mode 100644 index 00000000..6ec1a6fd --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Lista de campo personalizados +<?php + +################################################################################ +##### BEGIN help section +if ($action == "AJUDA") + { + ?> + + + +
    +
    +
    + ViciDial Lista de campo personalizados Help +

    + + +
    + Rótulo de campo - Este é o identificador de campo de dados para este campo. Isso precisa ser um identificador único dentro dos campos personalizados para esta lista. Não use espaços ou pontuação para este campo. max 50 caracteres, mínimo de 2 caracteres. Você também pode incluir os campos padrão ViciDial em uma configuração de campo personalizado, e você vai vê-los em vermelho na lista. Estes campos não será adicionado à tabela de costume lista banco de dados, o agente de interface, em vez disso referência à tabela vicidial_list directamente. As etiquetas que você pode usar para incluir os fieds padrão são - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Nome do Campo - Este é o nome do campo como irá aparecer a um agente através da sua interface. Você pode usar espaços neste campo, mas sem pontuação caracteres, máximo de 50 caracteres e mínima de 2 caracteres. +

    + +
    +
    + Campo Descrição - A descrição do campo como ele aparecerá na interface de administração. Este é um campo opcional com um máximo de 100 caracteres. +

    + +
    +
    + Posição Campo - A ordem em que estes campos é exibido ao agente do menor no topo mais alto que no fundo. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Ajuda Campo - Campo opcional, se você preenchê-lo, o agente será capaz de ver este texto quando clicar em um link de ajuda ao lado do campo em sua interface agente. +

    + +
    +
    + Tipo de Campo - Esta opção define o tipo de campo que irá ser apresentada. TEXTO é um formulário de entrada padrão de linha única, AREA é uma caixa de texto multi-linha, SELECT é uma seleção única pull-down menu, MULTI é uma caixa de seleção múltipla, o rádio é uma lista de botões de rádio, onde somente uma opção pode ser selecionado, CHECKBOX é uma lista de caixas de seleção onde várias opções podem ser selecionadas, DATA é um dia do calendário pop-up ano, mês em que o agente pode escolher a data ea hora é uma caixa de seleção tempo. O padrão é texto. Para as opções SELECT, RÁDIO, MULTI ea caixa de seleção é necessário definir os valores de opção abaixo na caixa Opções de Campo. VISOR irá exibir somente e não permitir a modificação introduzida pelo agente. SCRIPT também irá exibir apenas, mas você é capaz de usar variáveis ​​de script como no recurso de Scripts. Campos script também irá apenas exibir o conteúdo em Opções, e não o nome do campo como o tipo de exibição faz. HIDDEN não vai mostrar o agente de campo, mas vai permitir que o campo ter dados importados para ele e exportado a partir dele, assim como tê-lo disponível para a aba script e endereço de forma web. READONLY irá exibir o valor dos dados no campo, mas não irá permitir que o agente para alterar os dados. ESCONDERBLOB é semelhante ao HIDDEN exceto o tipo de armazenamento de dados no banco de dados é um tipo BLOB, adequada para dados binários ou de dados que precisa ser protegido. +

    + +
    +
    + Opções de Campo - Para o SELECT, RADIO, MULTI e tipos de campo opção, você deve definir os valores de opção nesta caixa. Você deve colocar uma lista de vírgula rótulo opção separada e texto opção aqui com cada opção de uma linha própria. O primeiro valor não deve ter espaços, e nem os valores devem ter qualquer pontuação. Por exemplo - electric_meter Meter, Elétrica +

    + +
    +
    + Posição opção - Para os tipos de campos checkbox e radio apenas, se definido como HORIZONTAL as opções aparecerão na mesma linha, possivelmente envolvendo a linha abaixo se há muitas opções. Se definido para VERTICAL haverá apenas uma opção por linha. O padrão é HORIZONTAL. +

    + +
    +
    + Tamanho do Campo - Essa configuração vai significar coisas diferentes dependendo do que o tipo de campo é. Para campos de texto, o tamanho é o número de caracteres que irá mostrar no campo. Para os campos de área, o tamanho é a largura da caixa de texto em caracteres. Para campos MULTI, esta configuração define o número de opções para ser mostrado na lista de vários select. Para SELECT, rádio, checkbox DATA, HORA e essa configuração é ignorada. +

    + +
    +
    + Campo Max - Essa configuração vai significar coisas diferentes dependendo do que o tipo de campo é. Para obter texto, campos escondidos e READONLY, o tamanho é o número máximo de caracteres que são permitidos no campo. Para os campos da área, este campo define o número de linhas de texto visível na caixa de texto. Para MULTI, SELECT, rádio, checkbox DATA, HORA e esta definição é ignorada. +

    + +
    +
    + Padrão Campo - Este campo opcional permite que você defina o valor a atribuir a um campo, se nada for carregado para esse campo. O padrão é NULL que desativa a função padrão. Para os tipos de campo DATA, o padrão é sempre definido como hoje, a menos que um número é colocado no caso em que a data será que hoje muitos dias mais ou menos. Para os tipos de campo de tempo, o padrão é sempre definido como a hora atual do servidor, a menos que um número é colocado no caso em que o tempo será que muitos minutos mais ou menos tempo atual. +

    + +
    +
    + Custo Campo - Este campo somente leitura diz-lhe que o custo deste campo é na tabela de campo personalizado para esta lista. Não há limite rígido para o número de campos personalizados que você pode ter em uma lista, mas o total do custo de todos os campos para a lista deve ser inferior a 65000. Isso geralmente permite que centenas de campos, mas se você especificar vários campos de texto que são centenas ou milhares de caracteres de comprimento, então você pode atingir esse limite rapidamente. Se você precisa que o texto muito em um campo, você deve escolher um tipo de zona, que são armazenados de forma diferente e não use espaço de tabela tanto. +

    + +
    +
    + Campo Obrigatório - Se definido como Y, este campo irá forçar o agente a inserção de texto ou selecione uma opção para este campo. O padrão é N. +

    + +
    +
    + Posição Nome do Campo - Se definido como LEFT, este nome de campo aparecerá à esquerda do campo, se definido como TOP o nome do campo vai ocupar toda a linha e aparecem acima do campo. Padrão é da Esquerda. +

    + +
    +
    + Opção Copiar - Ao copiar definições de campo de uma lista para outra, você tem algumas opções para como funciona o processo de cópia. APPEND será adicionar os campos que não estão presentes na lista de destino, se houver correspondência rótulos de campo aqueles vontade permaneceram intocados, não existem dados de campo personalizado serão apagados ou modificados por esta opção. UPDATE atualiza os campos comuns field_label na lista de destinos para as definições de campo a partir da lista de origem. dados de campo personalizadas podem ser modificados ou perdidos usando esta opção. REPLACE irá remover todos os campos existentes personalizados na lista de destino e substituí-los com os campos personalizados a partir da lista de origem, todos os dados de campo personalizado serão apagados através desta opção. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "ERROR: campos personalizados não estiver ativo no sistema\n"; + exit; + } + + +$NWB = "   \"AJUDA\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Copiar Campos para outra lista
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Listar ID para copiar campos de:
    Lista de ID para copiar campos para:
    Opção Copiar: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_ENVIAR") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "ERRO: Você não pode copiar os campos para a mesma lista: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "ERRO: Lista de Fonte não tem campos personalizados\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCESSO: Campo personalizado Excluídos - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCESSO: Campo personalizado Adicionado - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "ERROR: Tabela não existe custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCESSO: Campo personalizado Modificado - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRO: Campo não existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: Tabela não existe custom_$list_id\n
    ";} + else + { + echo "

    CLIQUE AQUI para confirmar a exclusão este campo personalizado: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRO: Campo não existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: Tabela não existe custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCESSO: Campo personalizado Excluídos - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "ERRO: Você não pode usar palavras reservadas para rótulos de campo - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Você deve digitar opções de campo ao adicionar um SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "ERRO: Campo já existe para esta lista - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCESSO: Campo personalizado Adicionado - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_ENVIAR") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRO: Campo não existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: Tabela não existe\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Você deve digitar opções de campo ao atualizar um SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCESSO: Campo personalizado Modificado - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    Alterarcampo Personalizados: ID da Lista $list_id         "; + echo "Registros nesta tabela personalizado: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### SÍNTESE DOS CAMPOS ### + echo "
    SÍNTESE DOS CAMPOS:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Existem no custom fields for this list
    TOTALS: $o             $total_cost    


    \n"; + + + ### EXEMPLO DE FORMA PERSONALIZADA ### + echo "\n"; + echo "
    EXEMPLO DE FORMA PERSONALIZADA:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Existem no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='ESCONDERBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### Modificar os campos ### + echo "
    Modificar campos existentes:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Rótulo de campo $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Posição Campo $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Nome do Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Posição Nome do Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descrição $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Ajuda Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo de Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Opções de Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Posição opção $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Tamanho do Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Padrão Campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Campo Obrigatório $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Adicionar um novo campo CUSTOM para esta lista:
    New Posição Campo:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Rótulo de campo: $NWB#vicidial_lists_fields-field_label$NWE
    Nome do Campo: $NWB#vicidial_lists_fields-field_name$NWE
    Posição Nome do Campo: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descrição: $NWB#vicidial_lists_fields-field_description$NWE
    Ajuda Campo: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo de Campo: $NWB#vicidial_lists_fields-field_type$NWE
    Opções de Campo: $NWB#vicidial_lists_fields-field_options$NWE
    Posição opção: $NWB#vicidial_lists_fields-multi_position$NWE
    Tamanho do Campo: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max: $NWB#vicidial_lists_fields-field_max$NWE
    Padrão Campo: $NWB#vicidial_lists_fields-field_default$NWE
    Campo Obrigatório: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Vá para a página modificação lista para esta lista

    \n"; + + echo "  Clique aqui para ver as mudanças de administração a esta listas custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    LISTAS LISTA com campos personalizados COUNT:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    ID DA LISTANOME DA LISTAATIVOCAMPANHACUSTOM FIELDSALTERAR
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]Modificar os campos
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; $call_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + $campaign_id = $row[3]; } @@ -471,14 +640,83 @@ else $closer_log .= "\n"; $closer_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + $campaign_id = $row[3]; } ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "ESCONDERLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + if (strlen($row[0]) > 0) {$lead_id = $row[0];} $dispo = $row[3]; @@ -510,15 +748,42 @@ else $last_local_call_time = $row[31]; $rank = $row[32]; $owner = $row[33]; + $entry_list_id = $row[34]; - echo "
    Informações da Chamada: $first_name $last_name - $phone_number

    \n"; + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Adicionar uma nova pista\n";} + else + {echo "
    Informações da Chamada: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -526,237 +791,568 @@ else echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    LOG DE ALT. ADMIN: Registros de Seção - $category - $stage\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + 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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPANHA',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIÇÃOGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Versão: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATE TABELA custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTER TABELA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='ESCONDERBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="MOSTRAR COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTER TABELA custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTER TABELA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='ESCONDERBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTER TABELA custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_modify_lead.php index 889d638f..60d37709 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -34,6 +34,18 @@ # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries # 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -49,8 +61,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -119,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -131,9 +149,15 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -141,26 +165,35 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -170,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -186,50 +219,137 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Cidade'; +$label_state = 'State'; +$label_province = 'Província'; +$label_postal_code = 'CEP'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexo'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Comentários'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Registro Alterado + +
    ADMINISTRATION: Registro Alterado
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "O chumbo foi adicionado: $lead_id

    \n"; + $end_call=0; + } + else + {echo "ERROR: Chumbo não adicionou, por favor, vá para trás e olhar para o que você entrou

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Informação Alterada

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -249,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -259,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -307,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -316,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -325,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -333,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -404,6 +558,21 @@ else $call_log .= "
    $row[15]   $row[10]
    NOTES:   $rowA[0]
      $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + 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"; + 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 status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status"; - $rslt=mysql_query($stmt, $link); - $CAMPstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($CAMPstatuses_to_print > $o) + if ($lead_id != 'NEW') { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "\n"; } - - if ($DS < 1) {$statuses_list .= "\n";} - echo "$statuses_list"; - echo "(with $log_campaign statuses)\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) + { + echo "\n"; + } echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID da Lista: $list_id
    Nome:   \n"; - echo " Sobrenome:
    Endereço 1 :
    Endereço 2 :
    Endereço 3 :
    Cidade :
    Estado:   \n"; - echo " CEP:
    Lead ID: $lead_id     ID da Lista: $list_id
    Fronter: $tsr     Called Count: $called_count
    Província:
    País :
    Main Phone :
    Tel. Alt. :
    Email :
    Segurança:
    Rank :
    Owner :
    Comentários :
    Finalização:
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    País : $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    País :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    $label_comments :
    Finalização: (with $list_campaign statuses)
    Alterarvicidial log
    Alteraragent log
    Alterarcloser log
    Add closer log record
    Alterarvicidial log
    Alteraragent log
    Alterarcloser log
    Add closer log record
    \n"; echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') { - ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) + echo "
    \n"; + echo "Callback Detalhess:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { - if ($rowx[9] == 'USERONLY') - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    \n"; + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuárioID: \n"; - echo "

    \n"; + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuárioID: \n"; + echo "

    \n"; + } + else + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuárioID: \n"; + echo "

    \n"; + } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Comentários: + + +
    + + + + +
    + +
    + +
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuárioID: \n"; - echo "

    \n"; + echo "
    No Callback records found
    \n"; } + } else { - echo "
    No Callback records found
    \n"; + echo "
    Se você quiser mudar isso leva a um retorno programado, primeiro mude a disposição para CBHOLD, em seguida, submeter-se e você será capaz de definir a data de retorno e tempo.
    \n"; } - } + echo "
    \n"; + echo "

    \n"; - echo "

    \n"; + echo "
    \n"; - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - echo "CHAMADAS PARA ESSE REGISTRO:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "AGENTE LOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPANHA TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - if ($DB) {echo "$logs_to_print|$stmt|\n";} - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) + if ($c > 0) { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) + echo "EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO:\n"; + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    \n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="MOSTRAR TABELAS LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "Campos personalizados para ESTE LEAD:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if (eregi("http",$location)) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo "
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "AGENTE LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPANHA TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # CAMPANHADATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Alterarchanges to this lead\n"; + } + + echo "\n"; } - - - echo "
    \n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_br/admin_search_lead.php index 1bdc0cbc..e8c1491b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -23,6 +23,12 @@ # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page # 100405-1331 - Added log search ability +# 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -59,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -76,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -96,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -146,6 +219,50 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Cidade'; +$label_state = 'State'; +$label_province = 'Província'; +$label_postal_code = 'CEP'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexo'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Comentários'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); @@ -162,16 +279,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo "
    Pesquisar Registro Opçãos:
    Vendor ID(código do fornecedor):   $label_vendor_lead_code(código do fornecedor):  
     
    Home Número do Telefone:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Nome:   $label_first_name:  
    Sobrenome:   $label_last_name:  
     
    Número do Telefone Dialed:   $label_phone_number Dialed:  
     
    \n"; echo "\n"; echo "\n"; @@ -270,6 +396,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -297,12 +439,12 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound calls matching your search criteria

    \n"; + echo "Existem no inbound calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    ENTRANTE LOG RESULTS: $results_to_print
    \n"; + echo "
    INBOUND LOG RESULTS: $results_to_print
    \n"; echo "
    #
    \n"; echo "\n"; echo "\n"; @@ -319,6 +461,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -347,12 +505,12 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound did calls matching your search criteria

    \n"; + echo "Existem no inbound did calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    ENTRANTE DID LOG RESULTS: $results_to_print
    \n"; + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; echo "
    #
    \n"; echo "\n"; echo "\n"; @@ -365,6 +523,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -412,7 +586,7 @@ else ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -420,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -454,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -471,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -487,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -511,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -544,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "ESCONDERLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -574,6 +811,13 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_br/audio_store.php index f3e0624e..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/audio_store.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # @@ -9,10 +9,12 @@ # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel # 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-3'; -$build = '100401-1037'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -126,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -196,8 +198,24 @@ if ($action == "AUTOUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,8 +302,24 @@ if ($action == "MANUALUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -326,7 +360,7 @@ if ($action == "MANUALUPLOAD")
    #
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav)

    All spaces will be stripped from uploaded audio file names

    audio file list
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_br/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_br/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_br/call_report_export.php index f4599238..a19a1e87 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,22 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -42,45 +58,132 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Exportar Relatórios de Chamadas'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Nome ou Senha inválidos or no export report permission: |$PHP_AUTH_USER|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +213,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -197,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -218,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Existem no outbound calls during this time period for these parameters\n"; exit; } else @@ -236,9 +354,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -248,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Existem no inbound calls during this time period for these parameters\n"; exit; } else @@ -266,9 +403,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -282,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORTAR RELAT. DE CHAMADAS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -299,9 +455,50 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,13 +535,243 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="MOSTRAR TABELAS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Existem no calls during this time period for these parameters\n"; exit; } } @@ -360,7 +787,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -375,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -390,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -405,7 +832,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +862,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +882,9 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -480,13 +909,17 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Exportar Relatórios de Chamadas"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; - echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<font class=\"select_bold\"><B>Período:</B></font><BR><CENTER>\n"; echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; ?> @@ -498,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Segunda week start </script> <?php @@ -514,13 +947,49 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Segunda week start </script> <?php + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>campo Personalizados:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Campanhas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -532,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos de Entrada:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Listas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -559,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Status:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -571,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos de Usuário:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_br/callcard_admin.php new file mode 100644 index 00000000..8d0a8294 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSÃO: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AJUDA\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Detalhes<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Grupo: </td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comentários: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create Usuário/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate Usuário/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used Usuário/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void Usuário/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE DATA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>QUANTIDADE</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Existem $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE DATA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>QUANTIDADE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>QUANTIDADE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Grupo: </td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     VERSÃO: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_br/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
    "; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_br/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_br/dbconnect.php index ca505cc0..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/dbconnect.php @@ -1,11 +1,15 @@ LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) { $DBCagc = file("/etc/astguiclient.conf"); @@ -26,6 +30,10 @@ if ( file_exists("/etc/astguiclient.conf") ) {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} if (ereg("^VARDB_pass", $DBCline)) {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} if (ereg("^VARDB_port", $DBCline)) {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} } @@ -37,10 +45,14 @@ else $VARDB_port = '3306'; $VARDB_user = 'cron'; $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; $VARDB_database = '1234'; $WeBServeRRooT = '/usr/local/apache2/htdocs'; } +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} $link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); if (!$link) { @@ -51,9 +63,9 @@ mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_br/fcstats.php index 555f3a40..6351f072 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,18 +39,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "In-Group Fronter-Closer Stats Report\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ALTERAR | RELATÓRIOS \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           DOWNLOAD | ALTERAR | RELATÓRIOS
    Mostrar as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ENVIAR\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ENVIAR\n";
     }
     
     else
    @@ -167,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -185,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -216,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| AGENTE                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALS FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| AGENTE                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -246,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -270,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -309,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -324,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -354,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -369,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -397,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| AGENTE | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| AGENTE | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -425,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -449,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -532,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -546,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -591,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -613,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/functions.php b/agc_2-X/trunk/LANG_www/vicidial_br/functions.php index f3a6e7b7..1b4f1a5e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "   \"AJUDA\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_br/group_hourly_stats.php index ee678b65..e2031691 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTAL $status $hour_calls $total_calls $day_calls
    TOTAL $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Por favor entre com o grupo que deseja visualizar estatísticas horárias:
    \n"; - echo "\n"; - echo "group: \n"; +echo "group:
    \n"; - echo "status:   (example: XFER)
    \n"; - echo "date with hour:   (example: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "status:   (example: XFER)
    \n"; +echo "date with hour:   (example: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \nScript runtime: $RUNtime seconds
    "; exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_br/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_br/lead_report_export.php new file mode 100644 index 00000000..9bffd422 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Exportação lidera Relatório'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Existem no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Existem no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="MOSTRAR TABELAS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Existem no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Exportação lidera Relatório</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Este relatório extrai informações da ligação para números discados no período selecionado. A liderança só é exportada uma vez, não importa quantas chamadas foram manipulados. O estado actual liderança é usado.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Período:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Segunda week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Segunda week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>campo Personalizados:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campanhas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos de Entrada:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Listas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Status:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos de Usuário:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_br/leadloader_template_display.php new file mode 100644 index 00000000..10382b5d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/line.js b/agc_2-X/trunk/LANG_www/vicidial_br/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_br/list_download.php index 3ecaca97..bca60e8e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Não há números de telefone na lista: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Campanha DNC list validation ##### + $event_code_type='CAMPANHA DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Não há derivações em DNC lista Campanha: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Não existem ligações neste grupo de telefone filtro: $group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Existem no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTS') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTS') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTS') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_br/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_br/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_br/listloaderMAIN.php index 209c109f..3183ed2d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_br/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_br/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_br/new_listloader_superL.php index 2fb94bef..f029f677 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -30,11 +30,16 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -127,22 +132,29 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -171,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -203,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -348,6 +360,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <form action=<?php echo $PHP_SELF ?> method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> <input type=hidden name='leadfile_name' value="<?php echo $leadfile_name ?>"> +<input type=hidden name='DB' value="<?php echo $DB ?>"> <?php if ($file_layout!="custom") { ?> <table align=center width="700" border=0 cellpadding=5 cellspacing=0 bgcolor=#D9E6FE> <tr> @@ -384,7 +397,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <tr> <td align=center colspan=2><input type=submit value="ENVIAR" name='submit_file'>        <input type=button onClick="javascript:document.location='new_listloader_superL.php'" value="REINICIAR" name='reload_page'></td> </tr> - <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">VOLTAR PARA ADMIN</a></font></td><td align=right><font size=1>LIST LOADER-     VERSÃO: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> + <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">VOLTAR PARA ADMIN</a>         <a href="./admin_listloader_third_gen.php">3rd Gen Lead Loader</a>     </font></td><td align=right><font size=1>LIST LOADER-     VERSÃO: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> </table> <?php } ?> @@ -398,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -409,7 +422,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Procesando$delim_name-delimited file...\n"; @@ -445,7 +458,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +478,36 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +519,69 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +708,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +719,54 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -642,9 +778,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -666,7 +802,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; { print "<BR><BR>SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override<BR><BR>\n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +810,13 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +844,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +864,112 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1094,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1107,53 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -905,9 +1164,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -919,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -930,9 +1189,9 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -941,8 +1200,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1210,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1244,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1264,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1428,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,21 +1443,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1181,9 +1479,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1194,10 +1492,10 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1504,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1512,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1230,8 +1528,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; @@ -1258,7 +1556,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1576,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1740,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,21 +1754,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DA LISTA</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1452,9 +1789,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1464,6 +1801,7 @@ if ($leadfile) { print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; } else { + ##### BEGIN field chooser ##### print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>"; flush(); print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n"; @@ -1472,15 +1810,67 @@ if ($leadfile) { print " <th><font class='standard' color='white'>Dados do arquivo</font></th>\r\n"; print " </tr>\r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRAR TABELAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1488,8 +1878,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1536,10 +1926,10 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1937,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1945,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1571,8 +1961,8 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; @@ -1617,6 +2007,8 @@ if ($leadfile) { print "</table>\r\n"; # } print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_br/non_agent_api.php index faecfc20..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -31,10 +38,40 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -129,6 +166,139 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +306,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -186,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -201,13 +372,76 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -216,23 +450,22 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -260,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -280,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -515,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Tempo Real Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Escolher Opções do Relat."; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "RELOAD AGORA"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       ALTERAR | \n";} +else + {echo "       ALTERAR | \n";} + +echo "SUMMARY \n"; + + +echo "       refrescar: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       ESCONDER GRUPO DE USUÁRIOS";} +else + {echo "       VIEW GRUPO DE USUÁRIOS";} +if ($SERVdisplay>0) + {echo "       ESCONDER SERVIDOR INFO";} +else + {echo "       MOSTRAR SERVIDOR INFO";} +if ($CALLSdisplay>0) + {echo "       ESCONDER WAITING CALLS";} +else + {echo "       MOSTRAR WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       ESCONDER IN-GROUP STATS";} +else + {echo "       MOSTRAR IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       ESCONDER PHONES";} +else + {echo "       MOSTRAR PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       ESCONDER CUSTPHONES";} +else + {echo "       MOSTRAR CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_br/remote_dispo.php index dd8a67cd..210b2348 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_br/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_br/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_edit.php index d938594f..4d3ff410 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_report.php index 4aca8d6f..d128c43d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,36 +44,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'UsuárioRelógio Ponto Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +106,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -83,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -99,49 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE>UsuárioRelógio Ponto Report - -<?php +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -161,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -187,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Período:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Período:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Segunda week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Segunda week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Grupos de Usuário:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Grupos de Usuário:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Usuário:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">RELATÓRIOS</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Mostrar as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "UsuárioRelógio Ponto Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Usuário:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Time range: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&ENVIAR=$ENVIAR&file_download=1\">DOWNLOAD</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">RELATÓRIOS</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="UsuárioRelógio Ponto Report $NOW_TIME\n"; + +$CSV_text.="\"UsuárioRelógio Ponto Report - $NOW_TIME\"\n"; +$CSV_text.="\"Time range: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -301,92 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Time range: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} - -$TOThours = $TOTdbHOURS; -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; - -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_status.php index 1932961f..1e645d43 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -10,9 +10,14 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -33,25 +38,41 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +$report_name = 'Grupo do UsuárioRelógio Ponto Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,13 +89,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -86,35 +112,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else - { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -131,18 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Relógio Ponto Status -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -162,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Relógio Ponto Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GRUPO DE USUÁRIOS</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Relógio Ponto Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GRUPO DE USUÁRIOS</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -228,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -247,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -291,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -311,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR GRUPO DE USUÁRIOS: $user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPANHA</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR GRUPO DE USUÁRIOS: $user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPANHA</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR GRUPO DE USUÁRIOS: $user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPANHA\"\n"; $o=0; $s=0; @@ -338,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -380,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALS</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -429,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; +$MAIN.="<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -459,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -478,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -501,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -520,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_br/user_group_bulk_change.php index 22dce925..54eb7c9e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Grupo do Usuário $old_group Usuários changed to the $group Grupo do Usuário<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Usuários changed to the $group Grupo do Usuário<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_br/user_stats.php index 5c28f03f..5607c5b0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -20,34 +20,65 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'Estatísticas de Usuário'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -62,6 +93,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -72,12 +105,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,28 +129,83 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RELATÓRIOS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Você não tem permissão para ver este relatório: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -119,17 +213,17 @@ else +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -?> -<html> -<head> +if ($did > 0) + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} +else + {$HEADER.="<title>ADMINISTRATION: $report_name";} -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: Estatísticas de Usuário -<?php ##### BEGIN Set variables to make header show properly ##### @@ -148,402 +242,472 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Estatísticas de Usuário for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; +if ($did > 0) + {$MAIN.="<B>   DID Call Stats for $user";} +else + {$MAIN.="<B>   Estatísticas de Usuário for $user";} +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -<?php +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="</script>\n"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Segunda week start -</script> -<?php - -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Segunda week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Segunda week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Planilha de Tempo</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">Status do Usuário</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Alterar Usuário</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuário multiple day status detail report</a>"; -echo "</center>\n"; - - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; - -echo "<br><center>\n"; - -##### vicidial agent talk time and status ##### - -echo "<B>AGENTE TEMPO E STATUS DA CHAMADA:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>QUANTIDADE</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +$MAIN.="<center>\n"; +if ($did > 0) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">AlterarDID</a>\n"; } - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) +else { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Planilha de Tempo</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">Status do Usuário</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Alterar Usuário</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuário multiple day status detail report</a>"; + } +$MAIN.="</center>\n"; + + +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +$MAIN.="<br><center>\n"; + + +if ($did < 1) + { + ##### vicidial agent talk time and status ##### + $MAIN.="<B>AGENTE TEMPO E STATUS DA CHAMADA:     <a href='$download_link&file_download=1'>[DOWNLOAD]</a></B>\n"; + + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>STATUS</td><td align=right><font size=2>QUANTIDADE</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"AGENTE TEMPO E STATUS DA CHAMADA\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>TOTAL DE CHAMADAS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>AGENTE HORÁRIO DE LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - } - - $total_calls = ($total_calls + $row[0]); + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; $o++; - } + } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + $call_hours_minutes = sec_convert($total_sec,'H'); -echo "<tr><td><font size=2>TOTAL</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>TOTAL DE CHAMADAS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"TOTAL DE CHAMADAS\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; -echo "</TABLE></center>\n"; + + ##### Login and Sair time from vicidial agent interface ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>AGENTE HORÁRIO DE LOGIN/LOGOUT:     <a href='$download_link&file_download=2'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $CSV_text2.="\"AGENTE HORÁRIO DE LOGIN/LOGOUT\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPANHA\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) + { + $event_start_seconds = $row[1]; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; + } + else + { + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + $MAIN.="<tr><td><font size=2>TOTAL</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; + + $MAIN.="</TABLE></center>\n"; -##### vicidial_timeclock log records for user ##### + ##### vicidial_timeclock log records for user ##### -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; + $MAIN.="<br><br>\n"; -echo "<center>\n"; + $MAIN.="<center>\n"; -echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:     <a href='$download_link&file_download=3'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK HORÁRIO DE LOGIN/LOGOUT\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {$MAIN.="|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; + + + + ##### closer in-group selection logs ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPANHA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPANHA\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; + + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) + $MAIN.="</TABLE><BR><BR>\n"; + + + ##### vicidial agent outbound calls for this time period ##### + + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPANHA\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + + if ($LOGadmin_hide_phone_data != '0') { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; + } - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + $MAIN.="</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPANHA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>SAINTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### -echo "<B>ENTRANTE/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPANHA\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +722,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -565,130 +739,181 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALS</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALS\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>AGENTE ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + $MAIN.="<B>Atividade do agente para esse período: (10000 record limit)     <a href='$download_link&file_download=7'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>estes campos estão em segundos </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"Atividade do agente para esse período: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPANHA\",\"PAUSE CODE\"\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; + } + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALS</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALS\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; + + $MAIN.="</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -704,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -717,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -725,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -732,84 +962,234 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; - + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } - -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL SAINTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ESCONDERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### -echo "</TABLE><BR><BR>\n"; + $MAIN.="<B>LEAD procura por este período de tempo: (10000 record limit)     <a href='$download_link&file_download=10'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"LEAD procura por este período de tempo: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2> CAMPANHA</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPANHA\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_br/user_status.php index aea5732d..4819dd94 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -98,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -106,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -132,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -154,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -270,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -338,48 +370,114 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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_pe_phone_append = $row[8]; } ##### 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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_br/user_territories.php index 92006655..3e4163d7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/user_territories.php @@ -40,8 +40,8 @@ if (isset($_GET["batch"])) {$batch=$_GET["batch"];} elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: Territorios de usuario no están activos en este sistema\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Nome ou Senha inválidos: |$USER|$PASS|\n"; exit; } } @@ -138,8 +138,8 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> -<title>ADMINISTRATION: User Territories +<!-- VERSÃO: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: Territorios de usuario <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambio Territorio Propietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,12 +175,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; exit; } @@ -194,7 +194,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i if ( (strlen($accountid)<1) or (strlen($user)<1) ) { - echo "ERROR: Account ID and User must be filled in<BR>\n"; + echo "ERROR: Account ID and Usuário must be filled in<BR>\n"; } else { @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Tuvo que añadir el territorio de usuario: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Territorio Propietario cambiado: $user $territory<BR>\n"; + echo "Registros modificados: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,13 +299,13 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">Lista de territorios</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Añadir Territorio</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Añadir usuario Territorio</a></TD> <? if ($enable_vtiger_integration > 0) { ?> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territorio Owner</a></TD> <? $colspan='4'; } ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AJUDA\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,10 +350,10 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambio Territorio Propietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,12 +387,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END change territory owner in the system @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio y el usuario deberá ser llenado en<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Tuvo que añadir el territorio de usuario: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Territorio Propietario cambiado: $user $territory       Registros modificados: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Añadir usuario Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -550,7 +550,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -567,7 +567,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$territories_list"; echo "</select></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Level: </td><td align=left><select size=1 name=level><option>TOP_AGENT</option><option>STANDARD_AGENT</option><option>BOTTOM_AGENT</option></select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add user territory page @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, y de nivel de usuario debe ser llenado en<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: este usuario territorio ya está en el sistema de<BR>\n"; } else { @@ -600,7 +600,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Added: $user $territory<BR>\n"; + echo "Usuario Territorio Añadido: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, y de nivel de usuario debe ser llenado en<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: este usuario territorio no está en el sistema<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "Usuario Territorio Modificado: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio y el usuario deberá ser llenado en<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: este usuario territorio no está en el sistema<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "Usuario Territorio eliminados: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -706,12 +706,12 @@ if ($action == "ADD_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Añadir Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio Descripción: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add territory page @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio y Territorio Descripción deben ser rellenados<BR>\n"; } else { @@ -731,14 +731,14 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: ya existe un territorio en el sistema con ese nombre<BR>\n"; } else { $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; $rslt=mysql_query($stmt, $link); - echo "Territory Added: $territory<BR>\n"; + echo "Territorio en que se agregó: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Territorio debe ser llenado en<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Este territorio no está en el sistema con ese nombre<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Territorio eliminados: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio y Territorio Descripción deben ser rellenados<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Este territorio no está en el sistema con ese nombre<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Territorio Modificado: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Modificar Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio Descripción: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -857,7 +857,7 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); $user_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Agents: </td><td align=left><B>$user_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Agentes: </td><td align=left><B>$user_count</B></td></tr>"; $owner_count=0; $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; @@ -882,13 +882,13 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rsltV); $vtiger_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Cuentas Vtiger: </td><td align=left><B>$vtiger_count</B></td></tr>"; } - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Usuários in this Territorio:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">APAGAR</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Suprimir este territorio</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Territorio que no se encuentra: $territory<BR>\n"; } } ### END modify territory page @@ -986,13 +986,13 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Lista de todos los territorios:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TERRITORY</B></TD>"; - echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIÇÃO</B></TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>AGENTS</TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACCOUNTS</TD>\n"; if ($enable_vtiger_integration > 0) @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>Territorios de usuario     VERSÃO: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_br/vdremote.php index 21bbc65d..826bccbf 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_br/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/vicidial_sales_viewer.php b/agc_2-X/trunk/LANG_www/vicidial_br/vicidial_sales_viewer.php index 2ffcb03b..69c4ba41 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/vicidial_sales_viewer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/vicidial_sales_viewer.php @@ -88,7 +88,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <input type="hidden" name="list_ids"> <table border=0 cellpadding=5 cellspacing=0 align=center width=600> <tr> - <th colspan=3><font class="standard_bold">Vicidial SAINTE recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> + <th colspan=3><font class="standard_bold">Vicidial OUTBOUND recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> <BR></th> </tr> <tr bgcolor='#CCCCCC'> diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_br/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_br/welcome.php index 5eeba0ad..a3dad3cc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Bem vindo\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_br/welcome_demo.php index 238cf5cf..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "   \n"; echo "\n"; +echo "\n"; +echo "
    Bemvindo
     
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_br/welcome_languages.php index d53707a9..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_br/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_br/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "  
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_br/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_br/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_br/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSER_service_level.php index d0b906a6..ffc52d14 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90801-0923 - Added in-group name to pulldown # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,33 +39,57 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Service Level Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -69,6 +99,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -76,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Service Level Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; -echo "
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "
    \n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ÄNDERN Sie | REPORTS"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if (!$group)
     	{
    -	echo "\n\n";
    -	echo "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
     	}
     
     else
    @@ -261,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
     	$DURATIONday++;
     	}
     
    -echo "Inbound Service Level Report                      $NOW_TIME\n";
    -echo "\n";
    -echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
    +$MAIN.="\n";
    +$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
     #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
    +$CSV_text.="\n";
    +$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
     
     $d=0;
     while ($d < $DURATIONday)
    @@ -370,7 +457,7 @@ $TOTintervals = $j;
     ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
     $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$MAIN.="$stmt\n";}
     $records_to_grab = mysql_num_rows($rslt);
     $i=0;
     while ($i < $records_to_grab)
    @@ -489,12 +576,40 @@ while ($j < $TOTintervals)
     
     ###################################################
     ### TOTALS SUMMARY SECTION ###
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    -echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    -echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    -echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    +$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    +$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
     
    +
    +$graph_stats=array();
    +$max_drops=1;
    +$max_droppct=1;
    +$max_avgdrops=1;
    +$max_hold=1;
    +$max_holdpct=1;
    +$max_avgholds=1;
    +$max_avgholdstotal=1;
    +$max_calls=1;
    +$max_totalcalltime=1;
    +$max_avgcalltime=1;
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTIME MIN:SECAVG CALLTIME SECONDS

     


    "; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -538,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -551,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -605,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
    INBOUND SERVICE LEVEL REPORT
    STATUSDROPS
    DROP %
    AVG DROP(s)
    HOLD
    HOLD %
    AVG HOLD(s) HOLD
    AVG HOLD(s) TOTAL
    CALLS
    TOTAL CALLTIME MIN:SEC
    AVG CALLTIME SECONDS
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    TOTAL:".trim($FtotDROPS)."
    "; + $DROPPCT_graph.="
    TOTAL:".trim($FtotDROPSpct)."%
    "; + $AVGDROPS_graph.="
    TOTAL:".trim($FtotDROPSavg)."
    "; + $HOLD_graph.="
    TOTAL:".trim($FtotQUEUE)."
    "; + $HOLDPCT_graph.="
    TOTAL:".trim($FtotQUEUEpct)."%
    "; + $AVGHOLDS_graph.="
    TOTAL:".trim($FtotQUEUEavg)."
    "; + $AVGHOLDSTOTAL_graph.="
    TOTAL:".trim($FtotQUEUEtot)."
    "; + $CALLS_graph.="
    TOTAL:".trim($FtotCALLS)."
    "; + $TOTALCALLTIME_graph.="
    TOTAL:".trim($totTIME_MS)."
    "; + $AVGCALLTIME_graph.="
    TOTAL:".trim($FtotCALLSavg)."
    "; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -860,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE ANTWORT (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE ANTWORT (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE ANTWORT(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -947,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -973,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERstats.php index 6e9eceee..59be0895 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -27,6 +27,14 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -47,8 +55,14 @@ 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["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -56,23 +70,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -82,13 +114,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +135,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,19 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -126,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -141,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -156,128 +245,138 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Inbound Stats\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Zeitraum:
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Zeitraum:
    \n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo "
    \n"; -echo "Inbound Gruppen: \n"; -echo "\n"; -echo "\n"; +if ($DID=='Y') + {$MAIN.="Inbound DIDs: \n";} +else + {$MAIN.="Inbound Gruppen: \n";} +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; -echo "ÄNDERN Sie | "; -echo "REPORTS | "; -echo "IVR REPORT \n"; -echo "\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; +if ($DID!='Y') + { + $MAIN.="ÄNDERN Sie | "; + $MAIN.="IVR REPORT | \n"; + } +$MAIN.="REPORTS | "; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +#$MAIN.="\n";
    +$MAIN.="Shift: \n";
    +$MAIN.="
    Anzeige as:  "; +$MAIN.="\n
    "; +$MAIN.="   \n"; +$MAIN.="
    \n"; +$MAIN.="\n\n"; +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
    -{
    -echo "\n\n";
    -echo "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
    -}
    +	{
    +	$MAIN.="\n\n";
    +	if ($DID=='Y')
    +		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK SUBMIT\n";}
    +	else
    +		{$MAIN.="Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";}
    +	}
     
     else
     {
    @@ -305,38 +404,125 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
    +$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        DOWNLOAD\n";
    +
    +$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
     
     
    +if ($DID=='Y')
    +	{
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$dids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $dids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$did_id[$i] = $row[0];
    +		$did_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$did_SQL = eregi_replace(",$",'',$did_SQL);
    +	if (strlen($did_SQL)<3) {$did_SQL="''";}
     
    +	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$unids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $unids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$unid_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
    +	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
     
    +	if ($DB > 0)
    +		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
     
    +	}
     
     if ($group_ct > 1)
     	{
    -	echo "\n";
    -	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    -	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
    +
    +	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
    +
    +	if ($DID=='Y')
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
    +	else
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
     
     	$i=0;
     	while($i < $group_ct)
     		{
    -		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		$did_id[$i]='0';
    +		$DIDunid_SQL='';
    +		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$Sdids_to_print = mysql_num_rows($rslt);
    +		if ($Sdids_to_print > 0)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$did_id[$i] = $row[0];
    +			}
    +
    +		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$DIDunids_to_print = mysql_num_rows($rslt);
    +		$k=0;
    +		while ($k < $DIDunids_to_print)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$DIDunid_SQL .= "'$row[0]',";
    +			$k++;
    +			}
    +		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
    +		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
    +
    +		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    +		if ($row[0]>$max_value) {$max_value=$row[0];}
     
     		$groupDISPLAY =	sprintf("%20s", $group[$i]);
     		$gTOTALcalls =	sprintf("%7s", $row[0]);
    @@ -351,32 +537,94 @@ if ($group_ct > 1)
     			}
     		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
     
    -		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
    +		$graph_data_ary[$i][0]=$groupDISPLAY;
    +		$graph_data_ary[$i][1]=$gTOTALcalls;
    +		$graph_data_ary[$i][2]=$gDROPcalls;
    +		$graph_data_ary[$i][3]=$gDROPpercent;
    +		$graph_data_ary[$i][4]=$gIVRcalls;
    +
     		$i++;
     		}
     
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
     
     	}
     
    +	if ($report_display_type=="HTML") {
    +		$max_value=1;
    +		$graph_height=240;
    +		$scale = 1;
    +		$w=0;
    +		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
    +			if ($graph_data_ary[$i][1]>0) {$w++;}
    +		}
    +		$scale = $graph_height / $max_value;
     
    -echo "\n";
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- TOTALS\n";
    +
    +		$GRAPH_text.="";
    +		for ($d=0; $d0) {
    +				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
    +				$GRAPH_text.="  \n";
    +			}
    +		}
    +		$GRAPH_text.="
    MULTI-GROUP BREAKDOWN
    GROUPIVRS / DROPS / CALLS
    ".$graph_data_ary[$d][0]."
    ".$graph_data_ary[$d][3]."% drops
     
    \n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][1]."
    • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][2]."
    • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][4]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALS\n"; + +$CSV_text1.="\n\"Time range:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; +if ($DID=='Y') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -408,19 +656,30 @@ else } -echo "Insgesamt fordert die in dieser In-Gruppe: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $ANTWORTEDcalls $ANTWORTEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Gruppe: $IVRcalls\n"; +$MAIN.="Insgesamt fordert die in dieser In-Gruppe: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $ANTWORTEDcalls $ANTWORTEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Gruppe: $IVRcalls\n"; +$CSV_text1.="\"Insgesamt fordert die in dieser In-Group:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$ANTWORTEDcalls\",\"$ANTWORTEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- DROPS\n"; +$MAIN.="\n"; +$MAIN.="---------- DROPS\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -450,56 +709,70 @@ else $DROP_ANTWORTEDpercent = round($DROP_ANTWORTEDpercent, 0); } -echo "Gesamt-TROPFEN Anrufe: $DROPcalls $DROPpercent% drop/answered: $DROP_ANTWORTEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Gesamt-TROPFEN Anrufe: $DROPcalls $DROPpercent% drop/answered: $DROP_ANTWORTEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_ANTWORTEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) { - $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $Sanswer_sec_pct_rt_stat_one = $row[0]; - $Sanswer_sec_pct_rt_stat_two = $row[1]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_one = $row[0]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_two = $row[0]; - - if ( ($ANTWORTEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + if ($DID!='Y') { - $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $ANTWORTEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); - #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); - $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $ANTWORTEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); - #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $Sanswer_sec_pct_rt_stat_one = $row[0]; + $Sanswer_sec_pct_rt_stat_two = $row[1]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_one = $row[0]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_two = $row[0]; + + if ( ($ANTWORTEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + { + $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $ANTWORTEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); + #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); + $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $ANTWORTEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); + #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Gesamtanrufe genommenin to this In-Group): $ANTWORTEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_ANTWORTEDpercent%\n"; -echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; -echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Gesamtanrufe genommenin to this In-Group): $ANTWORTEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_ANTWORTEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Gesamtanrufe genommenin to this In-Group):\",\"$ANTWORTEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_ANTWORTEDpercent%\"\n"; + +if ($DID!='Y') + { + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; + } # GET LIST OF ALL STATUSES and create SQL from human_answered statuses $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -516,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -534,12 +807,18 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -569,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -580,17 +863,27 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN DOWNLOAD\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -633,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -643,17 +1008,26 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -696,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -707,15 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL ANTWORTED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL ANTWORTED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL ANTWORTED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -899,31 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- CALL HANGUP GRUND STATS\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL HANGUP GRUND STATS DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"CALL HANGUP GRUND STATS\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; +if ($DID=='Y') + { + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -932,42 +1465,105 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
    \n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CALL HANGUP GRUND STATS
    REASON CALLS
    \"\"".$ct_ary[$i][0]."
    GESAMTANRUFE:".trim($TOTALcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     ##############################
     #########  CALL STATUS STATS
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL STATUS STATS\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    -echo "| STATUS | DESCRIPTION          | KATEGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL STATUS STATS       DOWNLOAD\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text.="| STATUS | DESCRIPTION          | KATEGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTOTAL TIMEAVG TIMECALLS/HR

     


    "; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"KATEGORIE\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;"; +if ($DID=='Y') + { + $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -995,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1015,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1045,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
    CALL STATUS STATS
    STATUSCALLS
    TOTAL TIME
    AVG TIME
    CALLS/HR
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    TOTAL:".trim($TOTALcalls)."
    "; + $TOTALTIME_graph.="
    TOTAL:".trim($TOTALhours)."
    "; + $AVGTIME_graph.="
    TOTAL:".trim($TOTALavg)."
    "; + $CALLSHOUR_graph.="
    TOTAL:".trim($TOTALrate)."
    "; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS KATEGORIE STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| KATEGORIE | CALLS | DESCRIPTION |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS KATEGORIE STATS DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| KATEGORIE | CALLS | DESCRIPTION |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS KATEGORIE STATS\"\n"; +$CSV_text5.="\"KATEGORIE\",\"CALLS\",\"DESCRIPTION\"\n"; $TOTCATcalls=0; $r=0; @@ -1070,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1078,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
    ".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CUSTOM STATUS KATEGORIE STATS
    KATEGORIE CALLS
    ".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
    TOTAL:".trim($TOTCATcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else 
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     
     ##############################
    @@ -1088,15 +1793,23 @@ echo "+----------------------+------------+\n";
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    -echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       DOWNLOAD\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +
    +$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
    +$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
    +
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
    +	}
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$ASCII_text.="$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
     $i=0;
     while ($i < $positions_to_print)
    @@ -1139,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
     
     $TOTALcalls =		sprintf("%10s", $TOTALcalls);
     
    -echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
     
    +$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
     
    +if ($report_display_type=="HTML") 
    +	{
    +	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
    +	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
    +	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
    +	if ($DID=='Y')
    +		{
    +		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
    +		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
    +		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
    +		}
    +	if ($DB) {$GRAPH_text.=$stmt."\n";}
    +	$ms_rslt=mysql_query($ms_stmt, $link);
    +	$ms_row=mysql_fetch_row($ms_rslt);
    +	$max_position=$ms_row[0];
    +	if ($max_position>25) {$max_position=26;}
    +	for ($i=1; $i<=$max_position; $i++) {
    +		$sec_ary[$i]=0;
    +	}
    +
    +	$mc_rslt=mysql_query($mc_stmt, $link);
    +	$mc_row=mysql_fetch_row($mc_rslt);
    +	$max_calls=$ms_row[0];
    +	if ($max_calls<=10) {
    +		while ($maxcalls%5!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=100) {
    +		while ($maxcalls%10!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=1000) {
    +		while ($maxcalls%50!=0) {
    +			$maxcalls++;
    +		}
    +	} else {
    +		while ($maxcalls%500!=0) {
    +			$maxcalls++;
    +		}
    +	}
    +	$rslt=mysql_query($stmt, $link);
    +	
    +	$GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1152,15 +1935,35 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- MITTELSTATS\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| MITTEL | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- MITTELSTATS DOWNLOAD\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| MITTEL | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"MITTELSTATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTIME H:M:SAVERAGE

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +if ($DID=='Y') + { + $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1183,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1210,26 +2022,73 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTAL Bevollmächtigte: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTAL Bevollmächtigte: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
    MITTELSTATS
    AGENTCALLS
    TIME H:M:S
    AVERAGE
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    TOTAL:".trim($TOTALcalls)."
    "; +$TIMEHMS_graph.="
    TOTAL:".trim($TOTtime)."
    "; +$AVERAGE_graph.="
    TOTAL:".trim($TOTavg)."
    "; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTAL Bevollmächtigte: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- TIME STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- TIME STATS DOWNLOAD\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## ######### 15-minute increment breakdowns of total calls and drops, then answered table $BDansweredCALLS = 0; $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1240,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1255,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1313,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1343,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1364,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1378,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1394,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1410,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
    GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
    HOURDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL ANTWORTED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL ANTWORTED TIME BREAKDOWN IN SECONDS DOWNLOAD\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL ANTWORTED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1508,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1516,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALS| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALS| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALS\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.=""; +$MAIN.="
    "; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERsummary_hourly.php index 2c5f60dc..66470cad 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 90809-0216 - Added Exclude Outbound Drop Group option # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -44,6 +50,10 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -52,23 +62,38 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} +$report_name = 'Inbound Zusammenfassung Stunden-Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -78,21 +103,70 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -100,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -116,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -124,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -139,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -155,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -168,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Summary Hourly Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Zeitraum:
    \n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Montag week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Montag week start\n"; + $MAIN.=" \n"; - echo "
      \n"; - echo "\n"; - echo "Inbound Groups:
    \n"; - echo "
      \n"; + $MAIN.="\n"; + $MAIN.="Inbound Gruppen:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "   Exclude Outbound Drop Groups:
    "; - echo "   \n"; - echo "
                          "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ÄNDERN Sie | "; + $MAIN.="REPORTS"; + $MAIN.="\n"; + $MAIN.="
      Anzeige as: "; + $MAIN.="\n
    "; + $MAIN.="   Exclude Outbound Drop Groups:
    "; + $MAIN.="   \n"; + $MAIN.="
                          "; + $MAIN.="\n"; - echo "
    \n"; + $MAIN.="
    \n"; - echo "Call Time:
    \n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
     	}
     
     else
    @@ -309,7 +389,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -352,18 +432,48 @@ else
     	$query_date_END = "$end_date 23:59:59";
     
     
    -	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
    +	$MAIN .= "Inbound Zusammenfassung Stunden-Report: $group_string          $NOW_TIME\n";
    +	$CSV_main.="Inbound Zusammenfassung Stunden-Report:,$NOW_TIME\n";
     
     
    +	$JS_text.="\n";
    +
     	if ($costformat > 0)
     		{
    -		echo "
    \n"; + $ASCII_text.="
    \n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
    "; + + echo ""; + + } + } - - ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_DIDstats.php new file mode 100644 index 00000000..97600480 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +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["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; + } + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
    to
    "; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

    "; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ÄNDERN Sie | REPORTS \n"; +$MAIN.="
    \n"; +$MAIN.="
    \n"; + +$MAIN.="
    ";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +	#	$time_BEGIN=$AM_shift_BEGIN;
    +	#	$time_END=$AM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +	#	$time_BEGIN=$PM_shift_BEGIN;
    +	#	$time_END=$PM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
    +	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
    +	$MAIN.="\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +
    +	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
    +	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
    +
    +	$d=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) );
    +		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
    +
    +		if ($EQsec < $SQsec)
    +			{
    +			$dEQepoch = ($dEQepoch + 86400);
    +			}
    +
    +		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +		$d++;
    +		}
    +
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### BAU HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $j;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	$extension[0]='';
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$dt[$i] =			0;
    +		$ut[$i] =			($row[0] - $SQepochDAY);
    +		$extension[$i] =	$row[1];
    +		while($ut[$i] >= 86400) 
    +			{
    +			$ut[$i] = ($ut[$i] - 86400);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +
    +		$i++;
    +		}
    +
    +	### Find default route
    +	$default_route='';
    +	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$Drecords_to_grab = mysql_num_rows($rslt);
    +	if ($Drecords_to_grab > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$default_route =	$row[0];
    +		}
    +
    +	###################################################
    +	### TOTALS DID SUMMARY SECTION ###
    +	if (strlen($extension[0]) > 0)
    +		{
    +		$ASCII_text.="DID Summary:\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="| DID                | DESCRIPTION                    | ROUTE      | CALLS      |\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +
    +		$CSV_text1.="\"DID Summary:\"\n";
    +		$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
    +
    +		$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    DID Summary:
    DIDCALLS
    \"\"".$graph_stats[$d][0]."
    GESAMTANRUFE:".trim($totCALLS)."
    \n";
    +
    +			$FtotCALLS =	sprintf("%10s", $totCALLS);
    +
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="|                                                           TOTALS | $FtotCALLS |\n";
    +		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
    +		$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
    +		#$MAIN.=$GRAPH;
    +
    +		}
    +
    +
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totCALLSmax=0;
    +	$totCALLSdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
    +				{
    +				$totCALLS++;
    +				$qrtCALLS[$j]++;
    +				$dtt = $dt[$i];
    +				$totCALLSdate[$dtt]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +
    +
    +	###################################################
    +	### TOTALS DATE SUMMARY SECTION ###
    +	$ASCII_text.="\nDate Summary:\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="| SHIFT                                     |        |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +
    +	$CSV_text1.="\n\"Date Summary:\"\n";
    +	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
    +
    +	$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    Date Summary:
    SHIFT DATE-TIME RANGECALLS
    \"\"".$graph_stats[$d][0]."
    GESAMTANRUFE:".trim($totCALLS)."
    \n";
    +
    +
    +	$FtotCALLS =	sprintf("%6s", $totCALLS);
    +
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="|                                    TOTALS | $FtotCALLS |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
    +	#$MAIN.=$GRAPH;
    +
    +	if ($report_display_type=="HTML")
    +		{
    +		$MAIN.=$GRAPH_text;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +
    +	## FORMAT OUTPUT ##
    +	$i=0;
    +	$hi_hour_count=0;
    +	$hi_hold_count=0;
    +
    +	while ($i < $TOTintervals)
    +		{
    +		if ($qrtCALLS[$i] > 0)
    +			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
    +
    +		if ($qrtCALLS[$i] > $hi_hour_count) 
    +			{$hi_hour_count = $qrtCALLS[$i];}
    +
    +		$i++;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (70 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (70 / $hi_hold_count);}
    +
    +
    +
    +
    +	###################################################################
    +	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
    +
    +	$MAIN.="\n";
    +	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
    +
    +	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
    +
    +	$ASCII_text.="";
    +
    +	$ASCII_text.="";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
    +
    +	$k=1;
    +	$Mk=0;
    +	$call_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hour_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hour_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hour_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$call_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$call_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$call_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +	$k=1;
    +	$Mk=0;
    +	$hold_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hold_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hold_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hold_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$hold_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$hold_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$hold_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
    +	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
    +
    +
    +
    +	$max_calls=1;
    +	$graph_stats=array();
    +	$GRAPH_text="";
    +
    +
    +	$i=0;
    +	while ($i < $TOTintervals)
    +		{
    +		$char_counter=0;
    +		### BEGIN HOLD TIME TOTALS GRAPH ###
    +			$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count > 0) {$no_lines_yet=0;}
    +
    +		$Gavg_hold = $qrtQUEUEavg[$i];
    +		if ($Gavg_hold < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				$TOT_lines++;
    +				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +				$ASCII_text.="|$HMdisplay[$i]|";
    +				$CSV_text1.="\"$HMdisplay[$i]\",";
    +			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
    +			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +				}
    +			}
    +		else
    +			{
    +			$TOT_lines++;
    +			$no_lines_yet=0;
    +			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
    +			$Yavg_hold = (19 - $Xavg_hold);
    +
    +			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +
    +		#	$ASCII_text.="|$HMdisplay[$i]|";
    +			$ASCII_text.="|$HMdisplay[$i]|";
    +			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
    +		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
    +		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
    +		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
    +		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +			}
    +		### END HOLD TIME TOTALS GRAPH ###
    +
    +		$char_counter=0;
    +		### BEGIN CALLS TOTALS GRAPH ###
    +		$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +			#	$ASCII_text.="  |";
    +				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"0\"\n";
    +				}
    +			}
    +		else
    +			{
    +			$no_lines_yet=0;
    +			$Xhour_count = ($Ghour_count * $hour_multiplier);
    +			$Yhour_count = (69 - $Xhour_count);
    +
    +			$Gdrop_count = $qrtDROPS[$i];
    +			if ($Gdrop_count < 1) 
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
    +				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			else
    +				{
    +				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
    +
    +			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
    +
    +				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
    +
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
    +				$ASCII_text.="D";   $char_counter++;
    +				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				$ASCII_text.="C";   $char_counter++;
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			}
    +		### END CALLS TOTALS GRAPH ###
    +		$graph_stats[$i][0]=$HMdisplay[$i];
    +		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
    +		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
    +		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
    +		$i++;
    +		}
    +
    +
    +	if ($totQUEUEsec > 0)
    +		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
    +	else
    +		{$totQUEUEavgRAW = 0;}
    +	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
    +	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
    +	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
    +	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
    +	$totDROPS =	sprintf("%5s", $totDROPS);
    +	$totCALLS =	sprintf("%5s", $totCALLS);
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +
    +	for ($d=0; $d\n";
    +	}
    +	$GRAPH_text.="
    HOLD TIME, CALL AND DROP STATS
    TIME 15-MIN INTDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
    TOTALS:".trim($totCALLS)."
    "; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRfilter.php index 2acddc97..d7ab492a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} 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["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "\n"; +$HTML_text.="
    \n"; -echo "\n"; -echo "Zeitraum:
    \n"; -echo "\n"; -echo " to \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "REPORTS\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; +$HTML_text.="Zeitraum:
    \n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
    \n\n";
    +$HTML_text.="\n";
    +
    +$HTML_text.="
    Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="REPORTS\n"; +$HTML_text.="\n"; + +$HTML_text.="
    \n"; + +$HTML_text.="   \n"; +$HTML_text.="
    \n"; +$HTML_text.="\n\n"; + +$HTML_text.="
    \n\n";
     
     $shift = 'ALL';
     
    @@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
    +$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [DOWNLOAD]\n";
    +
    +$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
    +
    +$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
    +$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
    +
    +$i=0;
    +while($start_date<$end_date) {
    +	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
    +	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
    +	for ($j=0; $j<16; $j++) {
    +		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
    +	}
    +	
    +	$i++;
    +	$start_date+=$date_int;
    +}
    +
    +$total=0;
    +$Utotal=0;
    +$totalstq=0;
    +$Utotalstq=0;
    +$totalnocid=0;
    +$Utotalnocid=0;
    +$totaldnc=0;
    +$Utotaldnc=0;
    +$totalsale=0;
    +$Utotalsale=0;
    +$totalarch=0;
    +$Utotalarch=0;
    +$totaltiq=0;
    +$Utotaltiq=0;
    +$totalsta=0;
    +$Utotalsta=0;
    +
    +	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
    +	$rsltA=mysql_query($stmtA, $link);
    +	if ($DB) {$HTML_text.="$stmtA\n";}
    +	while ($rowA=mysql_fetch_row($rsltA)) {
    +		$count_ary[$rowA[2]][0]+=$rowA[0];
    +		$count_ary[$rowA[2]][1]+=$rowA[1];
    +		$count_ary[$rowA[2]][14]+=$rowA[0];
    +		$count_ary[$rowA[2]][15]+=$rowA[1];
    +		$total+=$rowA[0];
    +		$Utotal+=$rowA[1];
    +		$totalstq+=$rowA[0];
    +		$Utotalstq+=$rowA[1];
    +	}
    +
    +	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
    +	$rsltB=mysql_query($stmtB, $link);
    +	if ($DB) {$HTML_text.="$stmtB\n";}
    +	while ($rowB=mysql_fetch_row($rsltB)) {
    +		$count_ary[$rowB[2]][2]+=$rowB[0];
    +		$count_ary[$rowB[2]][3]+=$rowB[1];
    +		$total+=$rowB[0];
    +		$Utotal+=$rowB[1];
    +		$count_ary[$rowB[2]][14]+=$rowB[0];
    +		$count_ary[$rowB[2]][15]+=$rowB[1];
    +		$totalnocid+=$rowB[0];
    +		$Utotalnocid+=$rowB[1];
    +	}
    +
    +	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
    +	$rsltC=mysql_query($stmtC, $link);
    +	if ($DB) {$HTML_text.="$stmtC\n";}
    +	while ($rowC=mysql_fetch_row($rsltC)) {
    +		$count_ary[$rowC[2]][4]+=$rowC[0];
    +		$count_ary[$rowC[2]][5]+=$rowC[1];
    +		$total+=$rowC[0];
    +		$Utotal+=$rowC[1];
    +		$count_ary[$rowC[2]][14]+=$rowC[0];
    +		$count_ary[$rowC[2]][15]+=$rowC[1];
    +		$totaldnc+=$rowC[0];
    +		$Utotaldnc+=$rowC[1];
    +	}
    +
    +	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
    +	$rsltD=mysql_query($stmtD, $link);
    +	if ($DB) {$HTML_text.="$stmtD\n";}
    +	while ($rowD=mysql_fetch_row($rsltD)) {
    +		$count_ary[$rowD[2]][6]+=$rowD[0];
    +		$count_ary[$rowD[2]][7]+=$rowD[1];
    +		$total+=$rowD[0];
    +		$Utotal+=$rowD[1];
    +		$count_ary[$rowD[2]][14]+=$rowD[0];
    +		$count_ary[$rowD[2]][15]+=$rowD[1];
    +		$totalsale+=$rowD[0];
    +		$Utotalsale+=$rowD[1];
    +	}
    +
    +	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
    +	$rsltE=mysql_query($stmtE, $link);
    +	if ($DB) {$HTML_text.="$stmtE\n";}
    +	while ($rowE=mysql_fetch_row($rsltE)) {
    +		$count_ary[$rowE[2]][8]+=$rowE[0];
    +		$count_ary[$rowE[2]][9]+=$rowE[1];
    +		$total+=$rowE[0];
    +		$Utotal+=$rowE[1];
    +		$count_ary[$rowE[2]][14]+=$rowE[0];
    +		$count_ary[$rowE[2]][15]+=$rowE[1];
    +		$totalarch+=$rowE[0];
    +		$Utotalarch+=$rowE[1];
    +	}
    +
    +	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
    +	$rsltF=mysql_query($stmtF, $link);
    +	if ($DB) {$HTML_text.="$stmtF\n";}
    +	while ($rowF=mysql_fetch_row($rsltF)) {
    +		$count_ary[$rowF[2]][10]+=$rowF[0];
    +		$count_ary[$rowF[2]][11]+=$rowF[1];
    +		$totaltiq+=$rowF[0];
    +		$Utotaltiq+=$rowF[1];
    +	}
    +
    +	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
    +	$rsltG=mysql_query($stmtG, $link);
    +	if ($DB) {$HTML_text.="$stmtG\n";}
    +	while ($rowG=mysql_fetch_row($rsltG)) {
    +		$count_ary[$rowG[2]][12]+=$rowG[0];
    +		$count_ary[$rowG[2]][13]+=$rowG[1];
    +		$totalsta+=$rowG[0];
    +		$Utotalsta+=$rowG[1];
    +	}
     
     
    -echo "\n";
    -echo "+----------------------+---------+---------+---------+\n";
    -echo "| KATEGORIE             | CALLS   | UNIQUE  |      %  |\n";
    -echo "+----------------------+---------+---------+---------+\n";
    +	$HTML_text.="\n";
    +	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
    +	$HTML_text.="|                              |          TOTALS         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
    +	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
    +	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	
    +	$CSV_text.="\n";
    +	$CSV_text.="\"\",\"\",\"TOTALS\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
    +	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
    +
    +	for($i=0; $i
    -
    -
    + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRstats.php index f3564aeb..5998515d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -13,6 +13,13 @@ # 91112-0719 - Added in-group names to select list # 100214-1421 - Sort menu alphabetically # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -28,39 +35,71 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} 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["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} + +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} +$db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "IVR Stats Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Zeitraum:
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Zeitraum:
    \n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    to
    "; +$MAIN.="
    to
    "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    \n"; -echo "Inbound Gruppen: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Inbound Gruppen: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ÄNDERN Sie | "; + $MAIN.="REPORTS | "; + $MAIN.="GENAUERER REPORT \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Kampagnen: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ÄNDERN Sie | "; + $MAIN.="REPORTS | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "ÄNDERN Sie | "; -echo "REPORTS | "; -echo "GENAUERER REPORT \n"; -echo "\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
    Anzeige as:  "; +$MAIN.="\n
    "; +$MAIN.="    \n"; -   -
    \n"; +$MAIN.="\n\n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
     	}
     
     else
     	{
    -	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    -	echo "                  $group_string\n";
    +	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    +	$MAIN.="                  $group_string\n";
    +
    +	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
     
     	$TOTALcalls=0;
     	$NOCALLERIDcalls=0;
    @@ -338,9 +463,16 @@ else
     	$totFLOWtotal_time=0;
     
     	##### Grab all records for the IVR for the specified time period
    -	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +	if ($type == 'inbound')
    +		{
    +		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +		}
    +	else
    +		{
    +		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
    +		}
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$logs_to_print = mysql_num_rows($rslt);
     	$p=0;
     	while ($p < $logs_to_print)
    @@ -365,11 +497,11 @@ else
     	$r=-1;
     	while ($p < $logs_to_print)
     		{
    -		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
    +		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
     		if ($last_uniqueid === "$uniqueid[$p]")
     			{
     			$unique_calls[$r] .= "----------$comment_b[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			$last_epoch[$r]=$epoch[$p];
     			}
     		else
    @@ -391,7 +523,7 @@ else
     			$unique_calls[$r] = $comment_b[$p];
     			$FLOWuniqueid[$r] = "$uniqueid[$p]";
     			$last_uniqueid = "$uniqueid[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			}
     		$p++;
     		}
    @@ -408,7 +540,7 @@ else
     	$s=0;
     	while ($s <= $r)
     		{
    -		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
    +		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
     		if ($last_Suniqueid === "$unique_calls[$s]")
     			{
     			$STunique_calls_count[$p]++;
    @@ -436,11 +568,15 @@ else
     		}
     
     	#### PRINT GESAMTANRUFEINTO THIS IVR
    -	echo "\n";
    -	echo "Calls taken into this IVR:   $TOTALcalls\n";
    -	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
    -	echo "Unique Callers:              $UNIQUEcallers\n";
    -	echo "\n";
    +	$MAIN.="\n";
    +	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
    +	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
    +	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
    +	$MAIN.="\n";
    +
    +	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
    +	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
    +	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
     
     	### sort call flows for counting
     	if ($p > 0)
    @@ -475,11 +611,32 @@ else
     	### put call flows and counts together for sorting again
     	$s=0;
     
    -	echo "+--------+--------+--------+--------+------+------+\n";
    -	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    -	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    -	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    -	echo "+--------+--------+--------+--------+------+------+------------\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
    +	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    +	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    +	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
    +
    +	######## GRAPHING #########
    +	$graph_stats=array();
    +	$max_ivr_calls=1;
    +	$max_queue_calls=1;
    +	$max_queue_drops=1;
    +	$max_queue_drops_percent=1;
    +	$max_ivr_avg=1;
    +	$max_total_avg=1;
    +	$GRAPH="";
    +	$GRAPH.="";
    +	$GRAPH.="
    IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

     


    "; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
    IVR STATS
    IVR CALLSCALL PATH
    "; + $QUEUEDROPCALLS_graph="
    IVR STATS
    QUEUE CALLSCALL PATH
    "; + $QUEUEDROPPERCENT_graph="
    IVR STATS
    QUEUE DROP CALLSCALL PATH
    "; + $IVRAVGTIME_graph="
    IVR STATS
    QUEUE DROP PERCENTCALL PATH
    "; + $TOTALAVGTIME_graph="
    IVR STATS
    IVR AVG TIMECALL PATH
    "; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -493,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -528,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -557,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
    IVR STATS
    TOTAL AVG TIMECALL PATH
    ".$graph_stats[$d][0]."
    ".$graph_stats[$d][2]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][3]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
    ".$graph_stats[$d][5]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][6]."".$graph_stats[$d][0]."
    ".trim($TOTALcalls)."GESAMTMENGE
    "; + $QUEUECALLS_graph.="
    ".trim($totFLOWtotal)."GESAMTMENGE
    "; + $QUEUEDROPCALLS_graph.="
    ".trim($totFLOWdrop)."GESAMTMENGE
    "; + $QUEUEDROPPERCENT_graph.="
    ".trim($totFLOWdropPCT)."%GESAMTMENGE
    "; + $IVRAVGTIME_graph.="
    ".trim($TavgFLOWivr_time)."GESAMTMENGE
    "; + $TOTALAVGTIME_graph.="
    ".trim($TavgFLOWtotal_time)."GESAMTMENGE
    "; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- TIME STATS\n"; + $MAIN.="\n"; + $MAIN.="---------- TIME STATS\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -576,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -586,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -623,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -653,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -688,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -701,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -715,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..ba4cdf1a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Listen Kampagne Status Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..a040eac5 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["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["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
    \n"; + echo "$query_date|$end_date\n"; + echo "
    \n"; + } + +echo "
    "; + +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    to
    \n"; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "
    \n"; +echo "
    \n"; + +echo "
    ";
    +
    +
    +if (!$query_date)
    +{
    +echo "\n\n";
    +echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +}
    +
    +else
    +{
    +echo "List Update Process Report                      $NOW_TIME\n";
    +echo "\n";
    +echo "Time range $query_date to $end_date\n\n";
    +
    +
    +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +echo "List Update Summary:\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +
    +$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$records_to_grab = mysql_num_rows($rslt);
    +$i=0;
    +while ($i < $records_to_grab)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$TOTcount = ($TOTcount + $row[0]);
    +	$TOTupdated = ($TOTupdated + $row[3]);
    +	$count =	sprintf("%-8s", $row[0]);
    +	$filename =	sprintf("%-50s", trim($row[1]));
    +	$result =	sprintf("%-10s", $row[2]);
    +	$updated =	sprintf("%-8s", $row[3]);
    +	echo "| $filename | $result | $count | $updated |\n";
    +
    +	$i++;
    +	}
    +$TOTcount =	sprintf("%-8s", $TOTcount);
    +$TOTupdated =	sprintf("%-8s", $TOTupdated);
    +
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "                                                                  | $TOTcount | $TOTupdated |\n";
    +echo "                                                                  +----------+----------+\n";
    +echo "\n
    \n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Detail:
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
    DATE/TIMELEAD_IDVENDOR_IDPHONESTATUSOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
    $row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

    \nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_OUTBOUNDsummary_interval.php index 4ce1906b..6e12c1b2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 091129-0017 - Added Sales-type and DNC-type tallies # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -42,6 +48,10 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -50,23 +60,40 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Summary Interval Report'; +$db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Outbound Summary Interval Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Zeitraum:
    \n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
    Campaigns:
    "; - echo "
    Kampagnen:
    "; + $MAIN.="\n"; - echo "
    "; - echo "Include Drop  
    Rollover:
    "; - echo "
    \n"; - echo "Time Interval:
    "; - echo "\n"; + $MAIN.="
    "; + $MAIN.="Include Drop  
    Rollover:
    "; + $MAIN.="
    \n"; + $MAIN.="Time Interval:
    "; + $MAIN.="\n"; - echo "
    \n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "
            "; - echo "\n"; + {$MAIN.="\n";} - echo "
    \n"; - echo "Call Time:
    \n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="         "; + $MAIN.="DOWNLOAD | "; + $MAIN.="ÄNDERN Sie | "; + $MAIN.="REPORTS"; + $MAIN.="

    \n"; + $MAIN.="Anzeige as:
    "; + $MAIN.="\n
    "; + $MAIN.="
            "; + $MAIN.="\n"; + + $MAIN.="
    \n"; + + $MAIN.="Call Time:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($group_ct < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
     	}
     
     else
    @@ -483,7 +526,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -553,7 +596,7 @@ else
     			$Hcalltime_HHMM[$h] = "$H_test";
     			}
     		if ($DB)
    -			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
    +			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
     		$h++;
     		}
     
    @@ -563,19 +606,49 @@ else
     
     	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
     
    -
    +	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
     
     
     	##### Loop through each campaign and gether stats
     	if ($group_ct > 0)
     		{
    -		$MAIN .= "\n";
    -		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    -		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    -		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
    -		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "\n";
    +		$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "|                                          |        | SYSTEM | MITTEL |        |        | NO     |        | MITTEL     | MITTEL     |\n";
    +		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANTWORT | DROP   | LOGIN      | PAUSE      |\n";
    +		$ASCII_text .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +
    +		$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
    +		$CSV_main.="\"CAMPAIGN\",\"GESAMTANRUFE\",\"SYSTEM RELEASE CALLS\",\"MITTELRELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ANTWORT PERCENT\",\"DROP PERCENT\",\"MITTELLOGIN TIME(H:M:S)\",\"MITTELPAUSE TIME(H:M:S)\"\n";
    +		$CSV_subreports="";
    +		
    +		######## GRAPHING #########
    +		$max_calls=1;
    +		$max_system_release=1;
    +		$max_agent_release=1;
    +		$max_sales=1;
    +		$max_dncs=1;
    +		$max_nas=1;
    +		$max_drops=1;
    +		$max_login_time=1;
    +		$max_pause_time=1;
    +
    +		$GRAPH="

    "; + $GRAPH.=""; + $GRAPH.="
    CALLSSYSTEM RELEASE CALLSMITTELRELEASE CALLSSALE CALLSDNC CALLSNO ANTWORT PERCENTDROP PERCENTMITTELLOGIN TIMEMITTELPAUSE TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -596,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -614,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -641,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -655,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -732,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hANTWORTcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -815,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -823,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -953,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -961,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -978,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1004,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1025,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gANTWORTcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1040,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | MITTEL | | | NO | | MITTEL | MITTEL |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANTWORT | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"GESAMTANRUFE\",\"SYSTEM RELEASE CALLS\",\"MITTELRELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ANTWORT PERCENT\",\"DROP PERCENT\",\"MITTELLOGIN TIME (H:M:S)\",\"MITTELPAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

    MULTI-CAMPAIGN BREAKDOWN
    CAMPAIGNSGESAMTANRUFE
    SYSTEM RELEASE CALLS
    MITTELRELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO ANTWORT PERCENT
    DROP PERCENT
    MITTELLOGIN TIME (H:M:S)
    MITTELPAUSE TIME (H:M:S)
    "; + $SUBGRAPH.=""; + $SUBGRAPH.="
    CALLSSYSTEM RELEASE CALLSMITTELRELEASE CALLSSALE CALLSDNC CALLSNO ANTWORT PERCENTDROP PERCENTMITTELLOGIN TIMEMITTELPAUSE TIME

     


    "; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1105,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1124,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hANTWORTcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1140,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1167,8 +1317,8 @@ else $hTOTcalls_count = sprintf("%6s", $hTOTcalls_count); $hTOTsystem_count = sprintf("%6s", $hTOTsystem_count); $hTOTagent_count = sprintf("%6s", $hTOTagent_count); - $hTOTptp_count = sprintf("%6s", $hTOTrtp_count); - $hTOTrtp_count = sprintf("%6s", $hTOTptp_count); + $hTOTptp_count = sprintf("%6s", $hTOTptp_count); + $hTOTrtp_count = sprintf("%6s", $hTOTrtp_count); if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) ) {$hTOTna_percent=0;} else @@ -1190,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
    $SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
    INTERVALGESAMTANRUFE
    SYSTEM RELEASE CALLS
    MITTELRELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO ANTWORT PERCENT
    DROP PERCENT
    MITTELLOGIN TIME (H:M:S)
    MITTELPAUSE TIME (H:M:S)
    ".$SUBgraph_stats[$d][1]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
    TOTAL:".trim($hTOTcalls_count)."
    "; + $SUBSYSTEMRELEASE_graph.="
    TOTAL:".trim($hTOTsystem_count)."
    "; + $SUBAGENTRELEASE_graph.="
    TOTAL:".trim($hTOTagent_count)."
    "; + $SUBSALES_graph.="
    TOTAL:".trim($hTOTptp_count)."
    "; + $SUBDNCS_graph.="
    TOTAL:".trim($hTOTrtp_count)."
    "; + $SUBNAS_graph.="
    TOTAL:".trim($hTOTna_percent)."%
    "; + $SUBDROPS_graph.="
    TOTAL:".trim($hTOTdrop_percent)."%
    "; + $SUBLOGINTIME_graph.="
    TOTAL:".trim($hTOTagent_sec)."
    "; + $SUBPAUSETIME_graph.="
    TOTAL:".trim($hTOTpause_sec)."
    "; + $JS_onload.="\tDraw".$SUBrpt_campaign."KampagneGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."KampagneGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1244,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALS Kampagnen: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALS Kampagnen: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H')."
    TOTAL:".trim($TOTcalls_count)."
    "; + $SYSTEMRELEASE_graph.="
    TOTAL:".trim($TOTsystem_count)."
    "; + $AGENTRELEASE_graph.="
    TOTAL:".trim($TOTagent_count)."
    "; + $SALES_graph.="TOTAL:".trim($TOTptp_count).""; + $DNCS_graph.="TOTAL:".trim($TOTrtp_count).""; + $NAS_graph.="TOTAL:".trim($TOTna_percent)."%"; + $DROPS_graph.="TOTAL:".trim($TOTdrop_percent)."%"; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiKampagneGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiKampagneGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo "
    "; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; } ?> -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_VDADstats.php index 1fb00136..3a710443 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -26,6 +26,12 @@ # 100202-1034 - Added statuses to no-answer section # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100814-2307 - Added display of preset dials if presets are enabled in the campaign +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -73,10 +81,14 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';} if (strlen($carrier_stats)<2) {$carrier_stats='NO';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Calling Report'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; -echo "Outbound Stats\n"; +echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -333,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

    Anzeige as:
    "; +echo "\n
    "; echo "Shift:  
    "; echo "\n"; -#echo "\n"; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           ÄNDERN Sie \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +	echo "Live Current Bevollmächtigte logged in to take calls from $group - $selected_name         $NOW_TIME\n";
    +
    +	echo "\n";
    +
    +	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +
    +	$TOTALagents =	sprintf("%10s", $row[0]);
    +
    +	echo "Total agents:       $TOTALagents\n";
    +
    +
    +	##############################
    +	#########  LIVE MITTELSTATS
    +	$user_list='|';
    +	echo "\n";
    +	echo "---------- LIVE AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +	echo "| #    | BENUTZER       | CAMPAIGN             | STATUS | LAST ACTIVITY       |\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$users_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $users_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		$campaign_id =	sprintf("%-8s", $row[2]);
    +		$status =		sprintf("%-6s", $row[3]);
    +		$time =			sprintf("%-19s", $row[4]);
    +		$user_list .=	"$row[0]---$row[3]|";
    +
    +		echo "| $FMT_i | $user | $campaign_id   Real-Time | $status | $time |\n";
    +		}
    +
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	
    +	if ($DB) {echo "\n$user_list\n";}
    +
    +	##############################
    +	#########  ALL MITTELSTATS
    +
    +	echo "\n";
    +	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +	echo "| #    | BENUTZER       | LOGGED IN |\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +
    +	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$Xusers_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $Xusers_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		if (preg_match("/\|$row[0]---/",$user_list))
    +			{
    +			$userstatusARY =	explode("|$row[0]---",$user_list);
    +			$userstatus =		explode('|',$userstatusARY[1]);
    +			$status_line =		sprintf("%-9s", $userstatus[0]);
    +
    +			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
    +			}
    +		else
    +			{$status_line = '         ';}
    +
    +		echo "| $FMT_i | $user | $status_line |\n";
    +		}
    +
    +	echo "+------+--------------------------------+-----------+\n";
    +	
    +	}
    +
    +
    +?>
    +
    + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_log_display.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_log_display.php deleted file mode 100644 index 176a50b9..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: AGPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -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"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "
    \n\n"; - -echo "
    \n\n";
    -
    -
    -echo "VICIDIAL Änderung der Registrierung ADMIN                             $NOW_TIME\n";
    -
    -#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
    -passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
    -
    -
    -?>
    -
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_template_maker.php new file mode 100644 index 00000000..753415ed --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="SUBMIT TEMPLATE" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
    **NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="Vorlage löschen" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
    **$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
    ##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"HILFE\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
    + + +
    Listloader Custom Template Maker
    + +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
    $error_msg
    $success_msg
    Erstellen Sie eine neue VorlageLöschen Sie eine vorhandene Vorlage
    +
    + Beispiel-Datei passende Vorlage:
    ()


    +
    +
    Wählen Sie Vorlage löschen:


    +
            ZURÜCK ZU ADMIN         Go to Lead Loader    
    + +
    + + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_days_detail.php index 86fad8b2..7b3d068c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,6 +11,11 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -39,12 +44,19 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Tage Status Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -172,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="
    \n";
    +	$GRAPH_text.="
    \n";
     	}
     
     if (strlen($group[0]) < 1)
    @@ -212,10 +314,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Tage Status Report: $user                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- MITTELDetails -------------\n\n";
    +		$ASCII_text.="Agent Tage Status Report: $user                     $NOW_TIME\n";
    +		$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$ASCII_text.="---------- MITTELDetails -------------\n\n";
    +		$GRAPH_text.="Agent Tage Status Report: $user                     $NOW_TIME\n";
    +		$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$GRAPH_text.="---------- MITTELDetails -------------\n";
     		}
     	else
     		{
    @@ -235,7 +339,7 @@ else
     	$date_namesARY[0]='';
     	$k=0;
     
    -	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
    +	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$rows_to_print = mysql_num_rows($rslt);
    @@ -271,20 +375,39 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "LEAD STATS BREAKDOWN:\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    -		echo "| DATE       | LEADS  | CIcalls| DNC/CI%|$statusesHTML\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		for ($i=0; $i$SstatusTXT";
    +		}
    +
     		}
     	else
     		{
    -		$file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n";
    +		$file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
     		}
     
     	### BEGIN loop through each user ###
     	$m=0;
     	$CIScountTOT=0;
     	$DNCcountTOT=0;
    +
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_cicalls=1;
    +	$max_dncci=1;
    +	$GRAPH="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -300,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -318,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -357,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -397,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -426,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -445,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -460,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -487,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
    LEAD STATS BREAKDOWN
    STATUSCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="
    TOTAL:".trim($CIScountTOT)."
    "; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n
    "; } else { @@ -522,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
    \n"; echo "
    Termine:
    "; @@ -572,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
    "; +echo "Anzeige as:   
    "; +echo "\n

    "; echo "
    User:
    "; echo "\n"; echo "
    Shift:
    "; @@ -596,38 +814,41 @@ else echo "REPORTS \n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if ($report_display_type=="TEXT" || !$report_display_type) 
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_performance_detail.php
    index ab6e20ad..2f8bec03 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_performance_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_performance_detail.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     #
    @@ -23,6 +23,13 @@
     # 100203-1131 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 110703-1739 - Added file download option
    +# 111007-0709 - Changed user and fullname to use non-truncated for output file
    +# 111104-1249 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -49,36 +56,61 @@ 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["file_download"]))				{$file_download=$_GET["file_download"];}
    +	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    -$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
    +$report_name = 'Agent Performance Detail';
    +$db_source = 'M';
    +$JS_text="\n";
    -echo "\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
     
    -echo "\n";
    -echo "Agent Performance Detail\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="$report_name\n";
     
     	$short_header=1;
     
    -	require("admin_header.php");
    +#	require("admin_header.php");
     
    -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "
    Termine:
    "; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
    Termine:
    "; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$HTML_text.="\n"; -echo "
    to
    "; +$HTML_text.="
    to
    "; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$HTML_text.="\n"; -echo "
    Kampagnen:
    "; -echo "
    Kampagnen:
    "; +$HTML_text.="\n"; -echo "
    Benutzer-Gruppen:
    "; -echo "\n"; +$HTML_text.="
    Benutzer-Gruppen:
    "; +$HTML_text.="\n"; -echo "
    Shift:
    "; -echo "

    \n"; -echo "\n"; -echo "
            "; +$HTML_text.="\n"; +$HTML_text.="Shift:
    "; +$HTML_text.="

    \n"; +$HTML_text.="Anzeige as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; -echo "          \n"; -echo " REPORTS \n"; -echo "\n"; -echo "
    "; +$HTML_text.="          \n"; +$HTML_text.=" REPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; -echo "
    \n\n"; +$HTML_text.="\n\n"; -echo "
    \n";
    +$HTML_text.="
    \n";
     
     
     if (!$group)
     {
    -echo "\n";
    -echo "Bitte wählen Sie eine Kampagne und Datum-Zeit oben ein und klicken dann SUBMIT\n";
    -echo " NOTE: stats taken from shift specified\n";
    +$HTML_text.="\n";
    +$HTML_text.="Bitte wählen Sie eine Kampagne und Datum-Zeit oben ein und klicken dann SUBMIT\n";
    +$HTML_text.=" NOTE: stats taken from shift specified\n";
     }
     
     else
    @@ -300,10 +403,10 @@ $query_date_END = "$end_date $time_END";
     if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
     else {$ugSQL='';}
     
    -echo "Agent Performance Detail                        $NOW_TIME\n";
    +$HTML_text.="Agent Performance Detail                        $NOW_TIME\n";
     
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- AGENTS Details -------------\n\n";
    +$HTML_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +$HTML_text.="---------- AGENTS Details -------------\n\n";
     
     
     
    @@ -312,6 +415,12 @@ echo "---------- AGENTS Details -------------\n\n";
     $statuses='-';
     $statusesTXT='';
     $statusesHEAD='';
    +
    +$CSV_header="\"Agent Performance Detail                        $NOW_TIME\"\n";
    +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
    +$CSV_header.="\"---------- AGENTS Details -------------\"\n";
    +$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
    +
     $statusesHTML='';
     $statusesARY[0]='';
     $j=0;
    @@ -320,10 +429,44 @@ $usersARY[0]='';
     $user_namesARY[0]='';
     $k=0;
     
    -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
    +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $rows_to_print = mysql_num_rows($rslt);
    +
    +$graph_stats=array();
    +$max_calls=1;
    +$max_time=1;
    +$max_pause=1;
    +$max_pauseavg=1;
    +$max_wait=1;
    +$max_waitavg=1;
    +$max_talk=1;
    +$max_talkavg=1;
    +$max_dispo=1;
    +$max_dispoavg=1;
    +$max_dead=1;
    +$max_deadavg=1;
    +$max_customer=1;
    +$max_customeravg=1;
    +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
    "; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -340,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -347,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -362,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [DOWNLOAD]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -383,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -390,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -405,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -412,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -443,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -459,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -490,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -499,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -521,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -532,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -553,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -622,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
    CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
    USERCALLS
    TIME
    PAUSE
    PAUSE AVG
    WAIT
    WAIT AVG
    TALK
    TALK AVG
    DISPO
    DISPO AVG
    DEAD
    DEAD AVG
    CUST
    CUST AVG
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
    TOTAL:".trim($TOTcalls)."
    "; +$TIME_graph.="
    TOTAL:".trim($TOTtime_MS)."
    "; +$PAUSE_graph.="
    TOTAL:".trim($TOTtotPAUSE_MS)."
    "; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -646,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    GESAMTMENGENONPAUSEPAUSE
    "; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -665,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -675,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -688,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [DOWNLOAD]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Detail $NOW_TIME\"\n"; +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -715,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -722,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -737,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -744,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -769,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -781,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -807,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -814,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -829,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -859,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
    PAUSE CODE BREAKDOWN
    STATUSTOTAL
    NONPAUSE
    PAUSE
    $Sstatus
    ".sec_convert($graph_stats[$d][1], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".sec_convert($graph_stats[$d][($e+4)], 'H')."
    TOTAL:".trim($TOTtotTOTAL_MS)."
    "; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
    $db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_status_detail.php index 3883ee2c..466a9ce2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,11 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -40,12 +45,19 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Detail'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Status Detail Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -218,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="\n\n\n
    \n";
    +	$GRAPH.="
    \n";
     	}
     
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
    -	echo "\n";
    +	echo "
    \n\n\n";
     	echo "Bitte wählen Sie eine Kampagne oder Benutzergruppe und Datum-Zeit oben ein und klicken dann SUBMIT\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
    @@ -258,10 +359,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Status Detail Report                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- MITTELDetails -------------\n\n";
    +		$ASCII_text.="

    Agent Status Detail Report $NOW_TIME\n"; + $ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- MITTELDetails -------------\n\n"; + $GRAPH.="

    Agent Status Detail Report $NOW_TIME\n"; + $GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- MITTELDetails -------------"; } else { @@ -285,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -304,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -319,14 +428,22 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } @@ -334,11 +451,23 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; $Sfull_name=$user_namesARY[$m]; - $Scalls=$calls[$m]; + $Scalls=0; $SstatusesHTML=''; $SstatusesFILE=''; $CIScount=0; @@ -350,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -367,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -376,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -420,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -459,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -487,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -506,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -521,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -550,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    CALL STATS BREAKDOWN
    STATUSCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -583,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Termine:
    "; @@ -654,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

    \n"; +echo "Anzeige as:
    "; +echo "\n

    "; echo "\n"; echo "
            "; @@ -663,38 +888,41 @@ echo " REPORTS \n"; echo "\n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if (!$report_display_type || $report_display_type=="TEXT")
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "                              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "                              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "                              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "                              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    \ No newline at end of file
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_detail.php
    index 3f3edb50..eaa0fedc 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_detail.php
    @@ -4,7 +4,7 @@
     # Pulls time stats per agent selectable by campaign or user group
     # should be most accurate agent stats of all of the reports
     #
    -# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     # 90522-0723 - First build
    @@ -12,6 +12,17 @@
     # 100203-1147 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
    +# 101207-1719 - Fixed download file formatting bugs(issue 394)
    +# 101208-0320 - Fixed issue 404
    +# 110307-1057 - Added user_case setting in options.php
    +# 110623-0728 - Fixed user group selection bug
    +# 110708-1727 - Added options.php setting for time precision
    +# 111104-1248 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -40,13 +51,35 @@ 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["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($stage)<2) {$stage='NAME';}
     
    +$report_name = 'Agent Time Detail';
    +$db_source = 'M';
    +$JS_text="\n";
     	echo "\n";
    +	echo "\n";
     
     	echo "\n";
    -	echo "Agent Time Detail\n";
    +	echo "$report_name\n";
     	echo "";
     
     	$short_header=1;
    @@ -198,7 +321,7 @@ if ($file_download < 1)
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
     	echo "\n";
    -	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
    +	echo "Bitte wählen Sie eine Kampagne oder Benutzergruppe und Datum-Zeit oben ein und klicken dann SUBMIT\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
     
    @@ -253,11 +376,34 @@ else
     	############################################################################
     
     	### BEGIN gather user IDs and names for matching up later
    -	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
    +	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$users_to_print = mysql_num_rows($rslt);
     	$i=0;
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_timeclock=1;
    +	$max_agenttime=1;
    +	$max_wait=1;
    +	$max_talk=1;
    +	$max_dispo=1;
    +	$max_pause=1;
    +	$max_dead=1;
    +	$max_customer=1;
    +	$GRAPH="";
    +	$GRAPH2="";
    +	$graph_header="
    CALLSTIME CLOCKMITTELTIMEWAITTALKDISPOPAUSEDEADCUSTOMER
    "; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -269,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -296,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -317,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -331,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -350,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -419,14 +568,16 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="MITTELTIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | MITTELTIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,MITTELTIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -450,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -493,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -502,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -529,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -582,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -618,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -630,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -653,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -680,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -695,53 +899,132 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
    MITTELTIME BREAKDOWN
    STATUSCALLS
    TIME CLOCK
    MITTELTIME
    WAIT
    TALK
    DISPO
    PAUSE
    DEAD
    CUSTOMER
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
    TOTAL:".trim($hTOTcalls)."
    "; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -782,8 +1065,22 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Termine:
    "; echo "\n"; echo ""; @@ -796,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Montag week start
    Campaigns:
    "; +echo "
    Kampagnen:
    "; echo "\n"; -echo "
    User Groups:
    "; +echo "
    Benutzer-Gruppen:
    "; echo "

    \n"; -echo "\n"; +echo "Anzeige as:
    "; +echo "\n

    "; +echo "\n"; echo "
            "; echo "          \n"; @@ -861,7 +1162,7 @@ echo " REPORTS \n"; echo "\n"; echo "
    "; -echo "\n\n"; +echo "\n\n
    $db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_sheet.php index da1bdc80..18a18c94 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,46 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); require("functions.php"); +$report_name = 'User Time Sheet'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -45,20 +64,28 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,27 +93,70 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "Agent Time Sheet"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -107,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentTime Sheetfor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentTime Sheetfor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN MITTELID AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN MITTELID AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -136,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentTime Sheet $NOW_TIME\n"; +$MAIN.="AgentTime Sheet $NOW_TIME\n"; + +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- MITTELTIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentTime Sheet- $NOW_TIME\"\n"; +$CSV_text_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"MITTELTIME SHEET: $agent - $full_name\"\n\n"; -echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- MITTELTIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -176,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "GESAMTANRUFETAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE MITTELTIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="GESAMTANRUFETAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[DOWNLOAD]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE MITTELTIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"GESAMTANRUFETAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE MITTELTIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -227,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK LOGIN/LOGOUT ZEIT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; +$MAIN.="<B>TIMECLOCK LOGIN/LOGOUT ZEIT: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK LOGIN/LOGOUT ZEIT:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"HOURS:MINUTES\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -255,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -269,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -285,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE>\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_timeclock_detail.php index e8d0b8b8..7dbd5115 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_agent_timeclock_detail.php @@ -3,11 +3,16 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -37,13 +42,17 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'UserTimeclock Detail Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,28 +60,100 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -90,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -101,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -145,6 +226,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -185,10 +267,11 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -203,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "Bitte wählen Sie eine Kampagne oder Benutzergruppe und Datum-Zeit oben ein und klicken dann SUBMIT\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -258,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -300,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| USER NAME | ID | USER GROUP | TIME CLOCK | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="MITTELTIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| USER NAME | ID | User Group | TIME CLOCK | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } else { @@ -322,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -359,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -375,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -428,7 +524,12 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -460,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -470,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i".$graph_stats[$i][0]."\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### @@ -497,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -526,12 +636,22 @@ else if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.="
    MITTELTIME-CLOCK DETAIL
    USER/User GroupTIME CLOCK TIME CLOCK PUNCHES
    \"\"".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."".$graph_stats[$i][3]."
    TOTALSAGENTS: $TOT_AGENTS$TOTtimeTC
    \n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.=""; + $GRAPH.=""; } else { @@ -568,12 +688,20 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section ############################################################################ echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Termine:
    "; echo "\n"; echo "\n"; echo "\n"; @@ -588,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Montag week start \n"; -echo "
    User Groups:
    "; +echo "
    Benutzer-Gruppen:
    "; echo "\n"; +echo "
    "; +echo "Anzeige as:   
    "; +echo "\n

    "; echo "
    Shift:
    "; echo "
    "; + +$HTML_text.="\n"; +$HTML_text.="
    Termine:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Kampagnen:
    "; +$HTML_text.="\n"; + +$HTML_text.="
     \n"; +$HTML_text.="\n"; +$HTML_text.="Anzeige as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" REPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="\n\n"; + +$HTML_text.="
    ";
    +$i=0;
    +$group_string='|';
    +$group_ct = count($group);
    +$JS_text.="\n";
    +
    +if ($report_display_type=="HTML")
    +	{
    +	$HTML_text.=$JS_text.$GRAPH;
    +	}
    +else
    +	{
    +	$HTML_text.=$ASCII_text;
    +	}
    +
    +$HTML_text.="
    "; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_carrier_log_report.php new file mode 100644 index 00000000..3fb86604 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    Bediener IP:
    \n"; +$MAIN.="
    \n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($SUBMIT && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | BEDIENERIP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ANTWORTED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"BEDIENERIP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANTWORTED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="
    \n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_dialer_inventory_report.php new file mode 100644 index 00000000..30e3aaf7 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Inventory Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Kampagnen:
    "; +$campaign_span_txt.=""; + +$list_span_txt="Listen:
    "; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
    "; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
    \n";
    +
    +$rpt_header="";
    +####### STAT GENERATION #######
    +require("count_functions.inc");
    +function GetListCount($list_id, $inventory_ptnstr) 
    +	{
    +	global $list_start_inv;
    +	global $new_count;
    +	global $link;
    +	global $total_calls;
    +	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
    +	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
    +	$ct_rslt=mysql_query($ct_stmt, $link);
    +	$new_count=0; $total_calls=0;
    +	while ($ct_row=mysql_fetch_row($ct_rslt)) 
    +		{
    +		$list_start_inv+=$ct_row[2];
    +		$total_calls+=($ct_row[1]*$ct_row[2]);
    +		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
    +		}
    +	}
    +
    +if ($SUBMIT) 
    +	{
    +
    +	$total_list_start_inv=0;
    +	$total_dialable_count=0;
    +	$total_dialable_count_nofilter=0;
    +	$total_dialable_count_oneoff=0;
    +	$total_dialable_count_inactive=0;
    +	$total_total_calls=0;
    +	$total_average_call_count=0;
    +	$total_penetration=0;
    +
    +	if ($snapshot_time && $report_source=="SNAPSHOT") 
    +		{
    +		$rpt_header="SNAPSHOT from $snapshot_time\n";
    +		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
    +		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
    +		$rslt=mysql_query($stmt, $link);
    +		$shift_SQL_str="";
    +		while ($shift_row=mysql_fetch_array($rslt)) 
    +			{
    +			$shift_data1=explode("|", $shift_row["shift_data"]);
    +			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
    +		$shift_rslt=mysql_query($shift_stmt, $link);
    +		$c=0;
    +		while($shift_row=mysql_fetch_array($shift_rslt)) 
    +			{
    +			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
    +			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
    +			$rpt_header_SHIFTS_lower.="          |";
    +			$rpt_header_Border.="----------+";
    +			$shift_ary[$c]=$shift_row["shift_id"];
    +			$total_varname="total_".$shift_row["shift_id"];
    +			$$total_varname=0;
    +			if ($DB > 0) {echo "
    -$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
    -$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
    \n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_Border.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPAIGNS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL Status:|$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL Status:|$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " DIAL Status:|$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + $rpt_header.="| Call list | List description | Kampagne | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Kampagne\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + #### PRINT TOTALS #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + } +$HTML_header.="
    \n"; +############################### + +$HTML_text="
    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Report type:
    Kampagnen
    List
    \n"; +$HTML_text.="
     \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Time setting:
    Server
    Local
    Ignore local campaign call time
    (default to 24 hours)
    \n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
    Report source:
    Snapshot
    Real-time
     
    $snapshot_span_txt\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n"; +$HTML_text.="           DOWNLOAD | REPORTS

    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n\n";
    +
    +$HTML_text.="$rpt_header";
    +$HTML_text.="$rpt_body";
    +$HTML_text.="$rpt_footer";
    +
    +$time_end = microtime(true);
    +$ENDtime = date("U");
    +$time = $ENDtime - $STARTtime;
    +
    +$HTML_text.="Executed in $time seconds\n";
    +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_hangup_cause_report.php new file mode 100644 index 00000000..0174f659 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    Bediener IP:
    \n"; +$MAIN.="
    Hangup Cause/Dial Status:
    "; +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($SUBMIT && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | BEDIENERIP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ANTWORTED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"BEDIENERIP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANTWORTED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_inboundEXTstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_inboundEXTstats.php index 550b42a7..a623ecc6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_inboundEXTstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_inboundEXTstats.php @@ -79,7 +79,7 @@ while ($i < $inbound_to_print) \n"; #echo"\n"; -echo "ASTERISK: Inbound Anruf-Notfall\n"; +echo "ASTERISK: Inbound Anruf-Notfall\n"; echo "
    \n"; echo "\n"; echo "\n"; @@ -108,7 +108,7 @@ else { -echo "ASTERISK: Inbound Anruf-Notfall $NOW_TIME\n"; +echo "ASTERISK: Inbound Anruf-Notfall $NOW_TIME\n"; echo "\n"; echo "---------- TOTALS\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_inbound_daily_report.php new file mode 100644 index 00000000..b416427d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +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["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | ÄNDERN Sie | REPORTS
    Show hourly results
    \n"; +$MAIN.="\n\n"; + +$MAIN.="
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$time1 = strtotime($time_BEGIN);
    +	$time2 = strtotime($time_END)+1;
    +
    +	$hpd = ceil(($time2 - $time1) / 3600);
    +	if ($hpd<0) {$hpd+=24;}
    +
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
    +	$MAIN.="Selected in-group: $group\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
    +	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
    +	$CSV_text.="Selected in-group: $group\n";
    +	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
    +
    +	$d=0; $q=0; $hr=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
    +
    +		if ($hourly_breakdown) 
    +			{
    +			$dEQepoch = $dSQepoch+3599;
    +			}
    +			else
    +			{
    +			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
    +			if ($EQsec < $SQsec)
    +				{
    +				$dEQepoch = ($dEQepoch + 86400);
    +				}
    +			}
    +
    +		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +	#  || $time_END<=date("H:i:s", $dEQepoch)
    +		if ($hr>=($hpd-1) || !$hourly_breakdown) 
    +			{
    +			$d++;
    +			$hr=0;
    +			if (date("H:i:s", $dEQepoch)>$time_END) 
    +				{
    +				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
    +				}
    +			}
    +			else
    +			{
    +			$hr++;
    +			}
    +		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
    +		$q++;
    +
    +		}
    +	$prev_week=$daySTART[0];
    +	$prev_month=$daySTART[0];
    +	$prev_qtr=$daySTART[0];
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### BAU HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $q;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$ASCII_text.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$qs[$i] = $row[0];
    +		$dt[$i] = 0;
    +		$ut[$i] = ($row[1] - $SQepochDAY);
    +		while($ut[$i] >= $epoch_interval) 
    +			{
    +			$ut[$i] = ($ut[$i] - $epoch_interval);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +		$ls[$i] = $row[2];
    +		$st[$i] = $row[3];
    +		$tr[$i] = $row[4];
    +		$at[$i] = $row[5]; # Actual time
    +
    +		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
    +
    +		$i++;
    +		}
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totDROPS=0;
    +	$totQUEUE=0;
    +	$totCALLSsec=0;
    +	$totDROPSsec=0;
    +	$totQUEUEsec=0;
    +	$totCALLSmax=0;
    +	$totDROPSmax=0;
    +	$totQUEUEmax=0;
    +	$totCALLSdate=$MT;
    +	$totDROPSdate=$MT;
    +	$totQUEUEdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtDROPS=$MT;
    +	$qrtQUEUE=$MT;
    +	$qrtCALLSsec=$MT;
    +	$qrtDROPSsec=$MT;
    +	$qrtQUEUEsec=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtDROPSavg=$MT;
    +	$qrtQUEUEavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$qrtDROPSmax=$MT;
    +	$qrtQUEUEmax=$MT;
    +
    +	$totABANDONSdate=$MT;
    +	$totANTWORTSdate=$MT;
    +
    +	$totANTWORTS=0;
    +	$totABANDONS=0;
    +	$totANTWORTSsec=0;
    +	$totABANDONSsec=0;
    +	$totANTWORTSspeed=0;
    +
    +	$FtotANTWORTS=0;
    +	$FtotABANDONS=0;
    +	$FtotANTWORTSsec=0;
    +	$FtotABANDONSsec=0;
    +	$FtotANTWORTSspeed=0;
    +
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
    +	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
    +	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
    +		$totABANDONSdate[$j]=0;
    +		$totABANDONSsecdate[$j]=0;
    +		$totANTWORTSdate[$j]=0;
    +		$totANTWORTSsecdate[$j]=0;
    +		$totANTWORTSspeeddate[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
    +				{
    +				$totCALLS++;
    +				$totCALLSsec = ($totCALLSsec + $ls[$i]);
    +				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
    +	#			$qrtCALLS[$j]++;
    +	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
    +	#			$dtt = $dt[$i];
    +				$totCALLSdate[$j]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
    +					{
    +					$totABANDONSdate[$j]++;
    +					$totABANDONSsecdate[$j]+=$ls[$i];
    +					$FtotABANDONS++;
    +					$FtotABANDONSsec+=$ls[$i];
    +					}
    +					else 
    +					{
    +					$totANTWORTSdate[$j]++;
    +					$totANTWORTSsecdate[$j]+=($ls[$i]-$qs[$i]-15);
    +					$totANTWORTSspeeddate[$j]+=$qs[$i];
    +					$FtotANTWORTS++;
    +					$FtotANTWORTSsec+=($ls[$i]-$qs[$i]-15);
    +					$FtotANTWORTSspeeddate+=$qs[$i];
    +					}
    +				if (ereg('DROP',$st[$i])) 
    +					{
    +					$totDROPS++;
    +					$totDROPSsec = ($totDROPSsec + $ls[$i]);
    +					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
    +	#				$qrtDROPS[$j]++;
    +	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
    +					$totDROPSdate[$j]++;
    +	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
    +	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
    +					}
    +				if ($qs[$i] > 0) 
    +					{
    +					$totQUEUE++;
    +					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
    +					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
    +	#				$qrtQUEUE[$j]++;
    +	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
    +					$totQUEUEdate[$j]++;
    +	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
    +	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
    +					}
    +	/*
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +	*/
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +	###################################################
    +	### TOTALS SUMMARY SECTION ###
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
    +	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | ANTWORT | TALK   | TALK       | WRAP       | CALL       |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | ANTWORTED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
    +	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"ANTWORT\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
    +	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"ANTWORTED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
    +
    +	##########################
    +	$JS_text="\n";
    +
    +	if ($report_display_type=="HTML") 
    +		{
    +		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (20 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (20 / $hi_hold_count);}
    +
    +
    +	$ENDtime = date("U");
    +	$RUNtime = ($ENDtime - $STARTtime);
    +	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
    +	$MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_server_performance.php index 4c50d326..01865e4b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?>
    - +
    + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_team_performance_detail.php new file mode 100644 index 00000000..1104d44c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Detail'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
    Termine:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Zeitraum:
    \n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Kampagnen:
    "; +$HTML_text.="\n"; + +$HTML_text.="
    Teams/Benutzer-Gruppen:
    "; +$HTML_text.="\n"; +$HTML_text.="
    Show additional statuses:
    "; +$HTML_text.="
    \n"; +$HTML_text.="Anzeige as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" REPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +if ($SUBMIT=="SUBMIT") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
    ";
    +	$total_average_sale_time=0;
    +	$total_average_contact_time=0;
    +	$total_talk_time=0; 
    +	$total_system_time=0; 
    +	$total_calls=0;	
    +	$total_leads=0;
    +	$total_contacts=0;
    +	$total_sales=0;
    +	$total_inc_sales=0;
    +	$total_cnc_sales=0;
    +	$total_callbacks=0;
    +	$total_stcall=0;
    +	for ($q=0; $q".$call_status[$q]."";
    +	}
    +	$total_graph_stats[]="";
    +	$max_totalcalls=1;
    +	$max_totalleads=1;
    +	$max_totalcontacts=1;
    +	$max_totalcontactratio=1;
    +	$max_totalsystemtime=1;
    +	$max_totaltalktime=1;
    +	$max_totalsales=1;
    +	$max_totalsalesleadsratio=1;
    +	$max_totalsalescontactsratio=1;
    +	$max_totalsalesperhour=1;
    +	$max_totalincsales=1;
    +	$max_totalcancelledsales=1;
    +	$max_totalcallbacks=1;
    +	$max_totalfirstcall=1;
    +	$max_totalavgsaletime=1;
    +	$max_totalavgcontacttime=1;
    +	$TOTALGRAPH="

    "; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALSALES_graph=$TOTALGRAPH_header.""; + $TOTALSALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

    CALL CENTER TOTAL
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    "; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALS ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    TEAM: $user_group[$i] - $group_name
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    ".$graph_stats[$d][0]."".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][12]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][13]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][14]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
    TOTAL:".trim($group_calls)."
    "; + $LEADS_graph.="
    TOTAL:".trim($group_leads)."
    "; + $CONTACTS_graph.="
    TOTAL:".trim($group_contacts)."
    "; + $CONTACTRATIO_graph.="
    TOTAL:".trim($group_contact_ratio)."%
    "; + $SYSTEMTIME_graph.="
    TOTAL:".sec_convert($group_system_time,'H')."
    "; + $TALKTIME_graph.="
    TOTAL:".sec_convert($group_talk_time,'H')."
    "; + $SALES_graph.="
    TOTAL:".trim($group_sales)."
    "; + $SALESLEADSRATIO_graph.="
    TOTAL:".trim($group_sales_ratio)."%
    "; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALSYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALSALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALSALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALSALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALSYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALSALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALSALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALSALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALSALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALSYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALSALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALSALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALSALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALSALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php index ce013332..432adc22 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -60,10 +60,26 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -123,11 +139,28 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} +$report_name = 'Real-Time Main Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -136,13 +169,25 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -155,13 +200,13 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -216,9 +261,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -230,13 +284,99 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -247,7 +387,43 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -260,29 +436,58 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -294,9 +499,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -304,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -325,7 +556,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "
    Select Kampagnen:
    "; +$select_list = "
    Select Kampagnen:
    "; $select_list .= ""; $select_list .= "
    (Um mehr als 1 Kampagne, halten Sie die Strg-Taste gedrückt und klicken Sie auf)"; + +$select_list .= "

    Select Benutzer-Gruppen:
    "; +$select_list .= ""; + $select_list .= "
    "; $select_list .= "Fenster schließen

    "; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select Benutzer-Gruppe:
    "; - $select_list .= "

    "; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
    "; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
    "; +$select_list .= "Inbound:
     
    "; + $select_list .= "Select Benutzer-Gruppe: "; + $select_list .= "
    "; +$select_list .= "Dialable Leads Alert:
    "; + $select_list .= "Zeige Presets Stats:
    "; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSION: $version   BAU: $build"; $select_list .= "
    "; @@ -422,283 +719,303 @@ $open_list = "< - - -\n"; + // function to display in-groups selected for a specific agent + function ingroup_info(agent_user,count) + { + var cursorheight = (document.REALTIMEform.cursorY.value - 0); + var newheight = (cursorheight + 10); + document.getElementById("agent_ingroup_display").style.top = newheight; + // alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user); + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + var monitorQuery = "source=realtime&function=agent_ingroup_info&stage=change&user=" + user + "&pass=" + pass + "&agent_user=" + agent_user; + xmlhttp.open('POST', 'non_agent_api.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(monitorQuery); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var Xoutput = null; + Xoutput = xmlhttp.responseText; + var regXFerr = new RegExp("ERROR","g"); + if (Xoutput.match(regXFerr)) + {alert(xmlhttp.responseText);} + else + { + document.getElementById("agent_ingroup_display").visibility = "visible"; + document.getElementById("agent_ingroup_display").innerHTML = Xoutput; + } + } + } + delete xmlhttp; + } + } + + // function to display in-groups selected for a specific agent + function hide_ingroup_info() + { + document.getElementById("agent_ingroup_display").visibility = "hidden"; + document.getElementById("agent_ingroup_display").innerHTML = ''; + } + + + + + + \n"; + + echo "\n"; + echo"\n"; + echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + + } $stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; $rslt=mysql_query($stmt, $link); @@ -706,57 +1023,55 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; -echo "\n"; -echo"\n"; -echo "Real-Time Report: $group\n"; - $short_header=1; - - require("admin_header.php"); - -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"; -echo "\n"; -echo "\n"; -echo "Real-Time Report                                                                               \n"; -echo "\n"; -echo "
    \n"; -echo "Wählen Sie Report anzeigen Optionen"; -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       ÄNDERN Sie | \n"; - } -else - { - echo "       ÄNDERN Sie | \n"; - } -echo "SUMMARY \n"; -echo "\n\n"; + echo ""; + } + + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -974,10 +1483,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1100,11 +1607,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1115,15 +1624,15 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1151,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1187,6 +1697,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1207,7 +1722,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1217,6 +1732,10 @@ else $DIALorder = "US-Mix: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Real-Time Report                                                                               \n"; + echo "\n"; + echo "
    \n"; + echo "Wählen Sie Report anzeigen Optionen"; + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "SLOW | "; + echo "GO"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ÄNDERN Sie | \n"; + } + else + { + echo "       ÄNDERN Sie | \n"; + } + echo "SUMMARY \n"; + echo "\n\n"; + } if (!$group) {echo "

    please select a campaign from the pulldown above\n"; exit;} @@ -798,10 +1113,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -936,6 +1250,7 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) $dtp++; } $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; if ($DB > 0) {echo "\n|$stmtB|\n";} @@ -963,6 +1278,200 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
    "; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
    CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
         $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
    no log entries
    "; + $CARRIERstatsHTML .= "
    "; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
      MITTELDIAL PRESETS:     PRESET NAMES                 CALLS  
                $row[0]     $row[1]  
    no log entries
    "; + $PRESETstatsHTML .= "
    "; echo ""; @@ -1228,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1251,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1271,7 +1794,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1290,63 +1861,67 @@ echo ""; echo ""; echo "
    DIAL LEVEL:  $DIALlev   
    - min   MAX LEVEL:  $maxDIALlev   $min_link  MAX LEVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    HOPPER LEVEL:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     DROPPED / ANTWORTED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses     ORDER:  $DIALorder    
    MITTELAVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       Verberge User Group"; - } -else - { - echo "       VIEW User Group"; - } -if ($SERVdisplay>0) - { - echo "       Verberge BEDIENERINFO"; - } -else - { - echo "       Zeige BEDIENERINFO"; - } -if ($CALLSdisplay>0) - { - echo "       Verberge WAITING CALLS"; - } -else - { - echo "       Zeige WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       Verberge User Group"; + } + else + { + echo "       VIEW User Group"; + } + if ($SERVdisplay>0) + { + echo "       Verberge BEDIENERINFO"; + } + else + { + echo "       Zeige BEDIENERINFO"; + } + if ($CALLSdisplay>0) + { + echo "       Verberge WAITING CALLS"; + } + else + { + echo "       Zeige WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       Verberge IN-GROUP STATS"; + } + else + { + echo "       Zeige IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       Verberge PHONES"; + } + else + { + echo "       Zeige PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       Verberge CUSTPHONES"; + } + else + { + echo "       Zeige CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       Verberge IN-GROUP STATS"; - } -else - { - echo "       Zeige IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       Verberge PHONES"; - } -else - { - echo "       Zeige PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       Verberge CUSTPHONES"; - } -else - { - echo "       Zeige CUSTPHONES"; - } echo "
    "; @@ -1390,6 +1965,20 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) ################################################################################### if ($campaign_allow_inbound > 0) { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1422,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "VerbergePHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1515,15 +2120,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1548,7 +2153,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -1560,6 +2165,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1589,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; +if ($RTajax > 0) + {$HTuser = " USER ";} if ($UidORname>0) { - $HTuser .= "Zeige ID "; + if ($RTajax > 0) + {$HTuser .= "Zeige ID ";} + else + { + $HTuser .= "Zeige ID "; + } } else { - $HTuser .= "Zeige NAME"; + if ($RTajax > 0) + {$HTuser .= "Zeige NAME";} + else + { + $HTuser .= "Zeige NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " User Group |"; +$HTusergroup = " User Group |"; +if ($RTajax > 0) + {$HTusergroup = " User Group |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1621,9 +2243,13 @@ $HTserver_ip = " BEDIENERIP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL BEDIENERIP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPAIGN |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1672,9 +2298,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1698,12 +2331,16 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -1730,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -1748,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -1971,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2000,7 +2667,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2011,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2043,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2060,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2088,14 +2763,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load Average: $load_ave\n\n"; + $Aecho .= " System Load Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2110,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2123,6 +2810,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE Agenten in fordert Toten      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
    ";
     		echo "";
    @@ -2135,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt);
     	echo "
    $Cecho";
     	}
     
    +echo "
    "; + +if ($RTajax < 1) + { + echo "
    "; + } ?> - -
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php index 20136589..55fc5150 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -16,10 +16,15 @@ # 80525-1040 - Added IVR status summary display for inbound calls # 90310-2119 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100709-1806 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -31,24 +36,64 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='Zeige ALL KAMPAGNEN';} + +$report_name = 'Real-Time Kampagne Summary'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -56,13 +101,49 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -74,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "Real-Time All Kampagnen Summary\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; +$MAIN.=""; +$MAIN.="
    "; -echo "Real-Time All Kampagnen Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; +$MAIN.="Real-Time All Kampagnen Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="SLOW | "; +$MAIN.="GO "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + $MAIN.="+ VIEW MORE SETTINGS"; } else { - echo "- VIEW LESS SETTINGS"; + $MAIN.="- VIEW LESS SETTINGS"; } -echo "       REPORTS"; -echo "

    \n\n"; +$MAIN.="      DOWNLOAD | REPORTS"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
    DIAL LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"DIAL LEVEL:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTER:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX LEVEL:\",\"$maxDIALlev\",\"DROPPED MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"DIAL TIMEOUT:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"DIALABLE LEADS:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"AVG AGENTS:\",\"$agentsONEMIN\",\"DIAL METHOD:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"HOPPER LEVEL:\",\"$HOPlev\",\"DROPPED / ANTWORTED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"STATUSES:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDER:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MITTELAVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
    DIAL LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
      MAX LEVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
      MAX LEVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL METHOD:  $DIALmethod    
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL METHOD:  $DIALmethod    
    HOPPER LEVEL:  $HOPlev     DROPPED / ANTWORTED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    HOPPER LEVEL:  $HOPlev     DROPPED / ANTWORTED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +$MAIN.="
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    "; +$MAIN.="
    "; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
    "; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
    MITTELAVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; ### Header finish @@ -307,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -341,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo "KEIN PHASENCANKLOPFEN\n"; + $MAIN.="KEIN PHASENCANKLOPFEN\n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -366,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -419,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
    \n"; + $MAIN.="\n
    \n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
    ";
    -		echo "";
    +		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
    +		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
    +		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
    +		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
    +		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
    +				
    +		$MAIN.="
    ";
    +		$MAIN.="";
     	}
     	else
     	{
    -	echo " NO AGENTS ON CALLS
    \n"; + $MAIN.=" NO AGENTS ON CALLS
    \n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -442,16 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
    "; +$MAIN.="
    \n\n
    "; -echo "
    \n\n"; $k++; } +$MAIN.="\n\n
    "; +$MAIN.="\n"; +$MAIN.="
    \n"; + +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } ?> - -
    - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonpark.php index 7a049e62..debf1eaa 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Bevollmächtigte Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Bevollmächtigte Time On Inbound Calls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin.php index 2c1bc590..170e5671 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,6 +103,13 @@ $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 Kampagne Summary , Inbound Report, Inbound Service Level Report, Inbound Zusammenfassung Stunden-Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listen Kampagne Status Report, Kampagne Status List Report, Export fordert Bericht, Export Leads Bericht , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily , UserTimeclock Report, Benutzer-GruppeTimeclock Status Report, UserTimeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User-Statistiken, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs'; + +$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Kampagne Summary , Inbound Report, Inbound Service Level Report, Inbound Zusammenfassung Stunden-Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listen Kampagne Status Report, Kampagne Status List Report, Export fordert Bericht , Export Leads Bericht , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily , UserTimeclock Report, Benutzer-GruppeTimeclock Status Report, UserTimeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User-Statistiken, User Time Sheet, Download List, Dialer Inventory Report, Custom Berichte Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs'; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -321,16 +338,16 @@ 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_fast_erfrischen"])) {$enable_fast_erfrischen=$_GET["enable_fast_erfrischen"];} + elseif (isset($_POST["enable_fast_erfrischen"])) {$enable_fast_erfrischen=$_POST["enable_fast_erfrischen"];} 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["fast_erfrischen_rate"])) {$fast_erfrischen_rate=$_GET["fast_erfrischen_rate"];} + elseif (isset($_POST["fast_erfrischen_rate"])) {$fast_erfrischen_rate=$_POST["fast_erfrischen_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"];} @@ -595,8 +612,8 @@ 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["campaign_stats_erfrischen"])) {$campaign_stats_erfrischen=$_GET["campaign_stats_erfrischen"];} + elseif (isset($_POST["campaign_stats_erfrischen"])){$campaign_stats_erfrischen=$_POST["campaign_stats_erfrischen"];} 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"];} @@ -687,6 +704,8 @@ 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"];} @@ -1167,9 +1186,553 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n 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_erfrischen"])) {$admin_modify_erfrischen=$_GET["admin_modify_erfrischen"];} + elseif (isset($_POST["admin_modify_erfrischen"])) {$admin_modify_erfrischen=$_POST["admin_modify_erfrischen"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + + +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) { @@ -1179,25 +1742,49 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1265,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_erfrischen = ereg_replace("[^0-9]","",$enable_fast_erfrischen); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_erfrischen_rate = ereg_replace("[^0-9]","",$fast_erfrischen_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1299,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1307,7 +1893,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1951,70 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_erfrischen = ereg_replace("[^0-9]","",$admin_modify_erfrischen); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1397,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_erfrischen = ereg_replace("[^NY]","",$campaign_stats_erfrischen); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1433,6 +2083,37 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +2161,24 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +2193,8 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +2206,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1582,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1610,11 +2310,10 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -1632,6 +2331,78 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2416,47 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,53 +2465,96 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -1716,7 +2562,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,8 +2578,19 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); + ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -1761,7 +2617,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,8 +2627,14 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -1783,6 +2645,11 @@ if ($non_latin < 1) # $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 @@ -2046,44 +2913,187 @@ else # 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 # + # 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.2.0-234'; -$build = '100116-0718'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_erfrischen_set=0; +$modify_footer_erfrischen=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2098,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_erfrischen,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2109,6 +3119,10 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; + $SSadmin_modify_erfrischen = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2120,84 +3134,189 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_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 ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($SSwebroot_writable > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2206,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_erfrischen > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_erfrischen_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2219,13 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Addieren Sie Neue Kampagne" if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "KopierenKampagne";} if ($ADD==111) {$hh='lists'; echo "Addieren Sie Neue Liste";} if ($ADD==121) {$hh='lists'; echo "Addieren Sie Neues DNC";} +if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";} if ($ADD==1111) {$hh='ingroups'; echo "Addieren Sie Neue In-Gruppe";} if ($ADD==1211) {$hh='ingroups'; echo "KopierenIn-Gruppe";} if ($ADD==1311) {$hh='ingroups'; echo "Add NewDID";} if ($ADD==1411) {$hh='ingroups'; echo "KopierenDID";} if ($ADD==1511) {$hh='ingroups'; echo "Add-Ruf-Menü";} if ($ADD==1611) {$hh='ingroups'; echo "Copy-Ruf-Menü";} +if ($ADD==1711) {$hh='ingroups'; echo "Filter hinzufügen Phone Group";} if ($ADD==11111) {$hh='remoteagent'; echo "Addieren Sie Neue Remotemittel";} +if ($ADD==12111) {$hh='remoteagent'; echo "Erweiterung hinzufügen Gruppe";} if ($ADD==111111) {$hh='usergroups'; echo "Addieren Sie Neue Benutzer-Gruppe";} if ($ADD==1111111) {$hh='scripts'; echo "Addieren Sie Neuen Index";} if ($ADD==11111111) {$hh='filters'; echo "Addieren Sie Neuen Filter";} @@ -2238,9 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN SIE NEUEN BEDIENER";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Neue CONF TEMPLATE";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "ADD NEW CARRIER";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD KOPIERT 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 "Neuen Kontakt hinzufügen";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN SIE NEUE KONFERENZ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Neue Benutzer-Hinzufügung";} @@ -2254,6 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Neuer Vorwahlknopf-Status if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Neuer Mittel-Pause Code";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status Addiert";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung Fügte Hinzu";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Kampagne Preset hinzugefügt";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Kampagne Vorwahl CID ändern";} if ($ADD==211) {$hh='lists'; echo "Neue Liste Hinzufügung";} if ($ADD==2111) {$hh='ingroups'; echo "Neue In-Gruppe Hinzufügung";} if ($ADD==2011) {$hh='ingroups'; echo "Neue Kopierte In-Gruppe Hinzufügung";} @@ -2261,7 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Neue DID-Zusatz";} if ($ADD==2411) {$hh='ingroups'; echo "Neue Copied DID-Zusatz";} if ($ADD==2511) {$hh='ingroups'; echo "Neue Call-Menü";} if ($ADD==2611) {$hh='ingroups'; echo "Neue Call-Menü";} +if ($ADD==2711) {$hh='ingroups'; echo "Neuer Filter Phone Group";} if ($ADD==21111) {$hh='remoteagent'; echo "Neue Remotemittel-Hinzufügung";} +if ($ADD==22111) {$hh='remoteagent'; echo "Neue Gruppe Erweiterung Zusatz";} if ($ADD==211111) {$hh='usergroups'; echo "Neue Benutzer-Gruppe Hinzufügung";} if ($ADD==2111111) {$hh='scripts'; echo "Neue Index-Hinzufügung";} if ($ADD==21111111) {$hh='filters'; echo "Neue Filter-Hinzufügung";} @@ -2275,9 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN BED if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN STAMM-SATZES DES BEDIENER-VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Neue CONF TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Neue CARRIER";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "HINZUFÜGEN KOPIERT CARRIER";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "Hinzufügen neuer TTS ENTRY";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "Hinzufügen neuer MUSIC ON HOLD ENTRY";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "Hinzufügen neuer Voicemail-Box";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "HINZUFÜGEN VON NEUEN SCREEN LABEL";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "HINZUFÜGEN VON NEUEN KONTAKT";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN DER NEUEN KONFERENZ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDIEREN VON VON VICIDIAL SYSTEMSTATUS";} @@ -2296,6 +3448,8 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - US-Mixes";} if ($SUB=='20A') {echo " - Umfrage";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2308,6 +3462,8 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - US-Mixes";} if ($SUB=='20A') {echo " - Umfrage";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Kampagne Status";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Kampagne HotKeys";} @@ -2316,11 +3472,16 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Kampagne Selbstalt Vorwah if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Kampagne Mittel-Pause Codes";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischungen";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Kampagne Presets";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Kampagne Vorwahl CID";} if ($ADD==311) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==3111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} if ($ADD==3311) {$hh='ingroups'; echo "ÄndernDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Ändern DID RA Erweiterung Überschreibt";} if ($ADD==3511) {$hh='ingroups'; echo "Ändern Call-Menü";} +if ($ADD==3711) {$hh='ingroups'; echo "Ändern Filter Phone Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} +if ($ADD==32111) {$hh='remoteagent'; echo "Ändern Verlängerung Gruppe";} if ($ADD==311111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} if ($ADD==3111111) {$hh='scripts'; echo "Ändern Sie Index";} if ($ADD==31111111) {$hh='filters'; echo "Ändern Sie Filter";} @@ -2337,6 +3498,8 @@ 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 "KONTAKT ZU ÄNDERN";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} @@ -2354,12 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Ändern Sie Kampagne Leit if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Ändern Sie Mittel-Pause Code";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Ändern Kampagne QC Einstellungen";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Ändern Sie Kampagne Liste Mischung";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Ändern Kampagne Preset";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Ändern Sie den Kampagnen";} if ($ADD==411) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==4111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} if ($ADD==4311) {$hh='ingroups'; echo "ÄndernDID";} if ($ADD==4511) {$hh='ingroups'; echo "Ändern Call-Menü";} +if ($ADD==4711) {$hh='ingroups'; echo "Ändern Filter Phone Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} +if ($ADD==42111) {$hh='remoteagent'; echo "Ändern Verlängerung Gruppe";} if ($ADD==411111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} if ($ADD==4111111) {$hh='scripts'; echo "Ändern Sie Index";} if ($ADD==41111111) {$hh='filters'; echo "Ändern Sie Filter";} @@ -2376,6 +3542,8 @@ 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 "KONTAKT ZU ÄNDERN";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} @@ -2390,7 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "LöschenList";} if ($ADD==5111) {$hh='ingroups'; echo "LöschenIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "LöschenDID";} if ($ADD==5511) {$hh='ingroups'; echo "Löschen-Ruf-Menü";} +if ($ADD==5711) {$hh='ingroups'; echo "Löschen Phone Filter Gruppe";} if ($ADD==51111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} +if ($ADD==52111) {$hh='remoteagent'; echo "Löschen Verlängerung Gruppe";} if ($ADD==511111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} if ($ADD==5111111) {$hh='scripts'; echo "Löschung-Index";} if ($ADD==51111111) {$hh='filters'; echo "Löschung-Filter";} @@ -2406,6 +3576,8 @@ if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";} if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "TTS DELETE 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 "Kontakt löschen";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "LöschenUser";} @@ -2417,11 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Selbstalt Vorwahlknopf-St if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Löschung-Mittel-Pause Code";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status Entfernt";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung Entfernte";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Kampagne Preset entfernt";} if ($ADD==611) {$hh='lists'; echo "LöschenList";} if ($ADD==6111) {$hh='ingroups'; echo "LöschenIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "LöschenDID";} if ($ADD==6511) {$hh='ingroups'; echo "Löschen-Ruf-Menü";} +if ($ADD==6711) {$hh='ingroups'; echo "Löschen Phone Filter Gruppe";} if ($ADD==61111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} +if ($ADD==62111) {$hh='remoteagent'; echo "Löschen Verlängerung Gruppe";} if ($ADD==611111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} if ($ADD==6111111) {$hh='scripts'; echo "Löschung-Index";} if ($ADD==61111111) {$hh='filters'; echo "Löschung-Filter";} @@ -2438,6 +3613,8 @@ if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";} if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "TTS DELETE 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 "Kontakt löschen";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Anzahl anrufbarer Anschlüsse";} @@ -2455,8 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Kampagnen";} if ($ADD==100) {$hh='lists'; echo "Listen";} if ($ADD==1000) {$hh='ingroups'; echo "In-Gruppen";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Ändern DID RA Erweiterung Überschreibt";} if ($ADD==1500) {$hh='ingroups'; echo "Call-Menüs";} +if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Gruppen";} if ($ADD==10000) {$hh='remoteagent'; echo "Remotemittel";} +if ($ADD==12000) {$hh='remoteagent'; echo "Erweiterung Gruppen";} if ($ADD==100000) {$hh='usergroups'; echo "Benutzer-Gruppen";} if ($ADD==1000000) {$hh='scripts'; echo "Indexe";} if ($ADD==10000000) {$hh='filters'; echo "Filter";} @@ -2472,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "CARRIER LISTE";} if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS TEILNEHMERLISTE";} if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "MUSIC ON HOLD TEILNEHMERLISTE";} if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "Voicemailboxen LISTE";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "SCREEN Label Liste";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "Liste KONTAKTE";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "KONFERENZ-LISTE";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL KONFERENZ-LISTE";} if ($ADD==550) {$hh='users'; echo "Suchform";} @@ -2480,11 +3662,19 @@ if ($ADD==660) {$hh='users'; echo "Suchresultate";} if ($ADD==661) {$hh='users'; echo "SUCHE RUFT RESULTATE AN";} if ($ADD==99999) {$hh='users'; echo "HILFE";} if ($ADD==999999) {$hh='reports'; echo "REPORTS";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "PASSWORT ÄNDERN";} +if ($ADD==999996) {$hh='reports'; echo "Erstinstallation WILLKOMMEN";} +if ($ADD==999995) {$hh='reports'; echo "Urheberrechtshinweis Markenlizenz";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "Zusammenfassung ";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM Zusammenfassung ";} -if ( ($ADD>9) && ($ADD < 99998) ) + +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; @@ -2499,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; @@ -2515,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -2529,30 +3719,17 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2569,45 +3746,57 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; } - else {$campaign_rank = $SELECT_campaign_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2615,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -2645,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -2658,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2669,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2708,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2716,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2739,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -2748,37 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; } - else {$group_rank = $SELECT_group_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2811,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -2819,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -2832,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2847,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -2862,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; + if ( (eregi("-ALL",$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=''; @@ -2872,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPAIGNS-"; + } } if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) { @@ -2887,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPAIGNS - BENUTZER KÖNNEN JEDE MÖGLICHE KAMPAGNE ANSEHEN</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPAIGNS - BENUTZER KÖNNEN JEDE MÖGLICHE KAMPAGNE ANSEHEN</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPAIGNS - Benutzer können alle Kampagnen, QC</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - Benutzer können QC JEDENFALLS INBOUND GROUP</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2925,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -2957,10 +4188,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +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 from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2969,7 +4200,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n"; $o++; } } @@ -3008,7 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Kennwort -</B> Dieses fangen ist auf, wohin Sie das VICIDIALBenutzerkennwort setzen. Sein mindestens müssen 2 Buchstaben lang. + <B>Kennwort -</B> Dieses fangen ist auf, wohin Sie das VICIDIALBenutzerkennwort setzen. Sein mindestens müssen 2 Buchstaben lang. Ein starker Benutzer-Passwort sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl. + + <BR> + <A NAME="vicidial_users-force_change_password"> + <BR> + <B>Zwingen Sie Passwort ändern -</B> Wenn diese Option gesetzt, um dann Y der Benutzer aufgefordert, ihr Passwort ändern sie das nächste Mal in der Verwaltung Webseite anzumelden. Standard ist N. <BR> <A NAME="vicidial_users-full_name"> @@ -3040,6 +4276,11 @@ if ($ADD==99999) <BR> <B>Aktive - </B> Dieses Feld legt fest, ob der Benutzer in das System und können VICIDIAL Ressourcen. Der Standardwert ist Y + <BR> + <A NAME="vicidial_users-voicemail_id"> + <BR> + <B>Voicemail-ID -</B> Dies ist die Voicemail-Box, die Anrufe in einer in-group AGENTDIRECT wird am Tropfen Zeit gerichtet, wenn die in-group hat die Drop-Methode gesetzt, um Sprachnachrichten und Voicemail-Feld auf AGENTVMAIL. + <BR> <A NAME="vicidial_users-optional"> <BR> @@ -3055,6 +4296,11 @@ if ($ADD==99999) <BR> <B>Mittel wählen Ingroups -</B> Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, die ingroups zu wählen, denen sie Anrufe von wenn sie LOGONzu einer GENAUEREN oder INBOUND Kampagne empfangen. Andernfalls mußder Manager dieses auf ihrem Benutzersonderkommandoschirm der adminSeite einstellen. + <BR> + <A NAME="vicidial_users-agent_choose_blended"> + <BR> + <B>Wählen Sie Blended-Agent -</B> Diese Option, wenn dieser Wert auf 1 kann der Anwender wählen, ob der Agent hat ihre Kampagne zu Blended-Set oder nicht, und wenn nicht, dann wird die Standard-Einstellung wird gemischt verwendet werden. Standard ist 1 für aktivierte. + <BR> <A NAME="vicidial_users-agent_choose_territories"> <BR> @@ -3107,6 +4353,16 @@ if ($ADD==99999) <BR> <B>Agent Shift Vollstreckung Override -</B> Diese Einstellung überschreibt, was die Benutzer Benutzer-Gruppe hat für die Vollstreckung Shift. DEAKTIVIERT wird die Benutzergruppe Einstellung. AUS wird nicht in allen Schichten durchzusetzen. START wird nur die Durchsetzung der Login-Zeit, sondern wirkt sich nicht auf einen Vertreter, der mit über die Verlagerung, wenn sie bereits eingeloggt ALL wird durchzusetzen Verlagerung starten und meldet einen Agenten aus, nachdem sie über das Ende ihrer Schicht Zeit. Option ist standardmäßig deaktiviert. + <BR> + <A NAME="vicidial_users-agent_call_log_view_override"> + <BR> + <B>Agent-Call Log anzeigen Override -</B> Diese Einstellung hat Vorrang vor was auch immer der Benutzer Benutzer-Gruppe hat für Agent Call Log Ansicht eingestellt. Deaktiviert wird, verwenden Sie die Benutzergruppe Einstellung. N wird nicht zulassen, welche die Benutzer Anrufliste. Y ermöglicht, welche die Benutzer Anrufliste. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Agent-Lead-Suche Override -</B> Diese Einstellung hat Vorrang, was die Kampagne für Agent Lead-Suche eingestellt. NOT_ACTIVE verwenden die Kampagne Einstellung. ENABLED ermöglicht Blei Suche und DEAKTIVIERT werden nicht zulassen, Blei Suche. Die Standardeinstellung ist NOT_ACTIVE. + <BR> <A NAME="vicidial_users-alert_enabled"> <BR> @@ -3118,9 +4374,14 @@ if ($ADD==99999) <B>Lassen Sie Alerts -</B> Dieses Feld gibt Ihnen die Möglichkeit an den Agenten Browser erlauben Benachrichtigung durch die Agenten für die Lage versetzt werden, wenn Anrufe kommen in ihre vicidial.php Sitzung. Der Standardwert ist 0 für NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird. Auch in diesem Abschnitt sind die WEB VARs für jede Kampagne. Diese ermöglichen es jedem Agenten zu haben, eine andere Variable Zeichenfolge, die hinzugefügt werden können, um die Web-Formular oder SCRIPT Registerkarte URLs, indem Sie einfach setzen - A - web_vars - B - wie Sie würde jedem anderen Bereich. + <B>Preset Kontakt Suche -</B> Wenn der Benutzer in eine Kampagne, die Transfer-Presets eingestellt hat KONTAKTE angemeldet ist, dann kann diese Einstellung deaktivieren Kontakt Suche nur für diesen Benutzer. Standard ist die NOT_ACTIVE verwenden, was auch immer die Kampagne Einstellung wird. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird. Auch in diesem Abschnitt sind die WEB VARs für jede Kampagne. Diese ermöglichen es jedem Agenten zu haben, eine andere Variable Zeichenfolge, die hinzugefügt werden können, um die Web-Formular oder SCRIPT Registerkarte URLs, indem Sie einfach setzen - A - web_vars - B - wie Sie würde jedem anderen Bereich. Ein weiterer Bereich, in diesem Abschnitt ist GRADE, das es ermöglicht, den nächsten Agenten campaign_grade_random Rufen Einstellung verwendet werden. Diese Sorte Einstellung erhöht oder verringert sich die Wahrscheinlichkeit, dass der Agent den Anruf erhalten. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3140,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Benutzerdefinierte Felder -</B> Diese fünf Felder können für verschiedene Zwecke verwendet werden, und sie können in das Web-Formular Adressen und Skripte als user_custom_one und so weiter gefüllt werden. + <B>Benutzerdefinierte Felder -</B> Diese fünf Felder können für verschiedene Zwecke verwendet werden, und sie können in das Web-Formular Adressen und Skripte als user_custom_one und so weiter gefüllt werden. Die Custom 5-Feld als Feld genutzt werden kann, um einen Dialplan Zahl definieren, um einen Anruf zu senden aus einer in-group AGENTDIRECT, wenn der Benutzer nicht verfügbar ist, brauchen Sie nur AGENTEXT in der Nachricht oder Erweiterungskörper setzen in der AGENTDIRECT in-group und das System sucht diesen Brauch fünf Feld und schickt den Anruf an diesem Dialplan Zahl. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3187,6 +4448,15 @@ if ($ADD==99999) <B>Last führt -</B> Diese Wahl, wenn Satz bis 1 dem Benutzer erlaubt,vicidial Leitungen in die vicidial_list Tabelle über die Netzgegründete Leitung Ladevorrichtung zu laden. <?php } + if ($SScustom_fields_enabled > 0) + { + ?> + <BR> + <A NAME="vicidial_users-custom_fields_modify"> + <BR> + <B>Benutzerdefinierte Felder bearbeiten -</B> Diese Option, wenn auf 1 gesetzt, kann der Anwender benutzerdefinierte Liste Felder ändern. + <?php + } ?> <BR> @@ -3323,13 +4593,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Exportieren von Berichten -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager für den Zugriff auf die Ausfuhr rufen Berichte über die Berichte Bildschirm. Der Standardwert ist 0. Für die Export-Bericht fordert, um das folgende Feld wird für die Ausfuhr: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Exportieren von Berichten -</B> Diese Einstellung, wenn es auf 1 gesetzt wird es ein Manager, um den Export Call-und Blei-Berichte über den Bildschirm Berichte zugreifen. Standard ist 0. Für den Export Calls und Leads Berichte wurde die folgende Reihenfolge der Felder für den Export verwendet: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> <BR> <B>Löschen von DNC-Listen -</B> Diese Einstellung, wenn auf 1 gesetzt, wird es den Manager, der Telefonnummern aus dem DNC-Listen in der VICIDIAL System zu entfernen. + <BR> + <A NAME="vicidial_users-realtime_block_user_info"> + <BR> + <B>Realtime Block User Info -</B> Diese Einstellung, wenn es auf 1 gesetzt werden Benutzer und Informationen vor dem Bahnhof in der Real-time-Bericht angezeigt zu blockieren. Standard ist 0 für Behinderte. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Ändern Gleiche Benutzer-Niveau -</B> Diese Einstellung gilt nur bis 9 Benutzern zu nivellieren. Wenn diese Option aktiviert es ermöglicht der Stufe 9 Benutzer, ihre eigenen Einstellungen sowie andere Ebene 9 Benutzer ändern. Standard ist 1 für aktivierte. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Admin ausblenden Lead-Daten -</B> Diese Einstellung gilt nur bis Level 7, 8 und 9 Benutzer. Wenn diese Option aktiviert es ersetzt oder des Konsumenten führt Daten in den vielen Berichten und Bildschirmen im System mit Xs. Standard ist 0 für Behinderte. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Admin ausblenden Phone Data -</B> Diese Einstellung gilt nur bis Level 7, 8 und 9 Benutzer. Wenn diese Option aktiviert es ersetzt die Kunden Rufnummern in den vielen Berichten und Bildschirmen im System mit Xs. Die DIGITS Einstellungen zeigt nur die letzten Ziffern der X Telefonnummer. Standard ist 0 für Behinderte. + @@ -3352,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Kampagne Beschreibung -</B> dieses ist ein Protokoll auffangenfür die Kampagne, ist es wahlweise freigestellt und kann ein Maximumvon 255 Buchstaben lang sein. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist der Benutzer mit Administratorrechten für diese Kampagne, ermöglicht diese Admin Betrachten dieser Kampagne sowie den Listen zugewiesen zu dieser Kampagne, um nach Benutzergruppen eingeschränkt werden. Standard ist - ALLE -, die jeder Benutzer admin mit Benutzergruppe Kampagne Rechte, um diese Kampagne sehen können. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -3368,10 +4663,20 @@ if ($ADD==99999) <B>Letzte Kampagne Call Date -</B> Dies ist das letzte Mal, dass ein Anruf wurde durch einen Vertreter in diese Kampagne angemeldet behandelt. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Tägliches Maximum Stats -</B> Das sind Statistiken, die vom System generiert werden, jeden Tag den ganzen Tag, bis die Zeitschaltuhr am Ende des Tages, als es in den Systemeinstellungen eingestellt ist. Diese Zahlen sind aus den Protokollen innerhalb des Systems erzeugt werden, um für viel schneller Anzeige zu ermöglichen. Die Statistiken enthalten sind - Summe der Anrufe, Maximale Bevollmächtigte, Maximale eingehende Anrufe, ausgehende Anrufe Maximale. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_erfrischen"> <BR> <B>Kampagne Notfall erneuern -</B> dieses checkbox erlaubt Ihnen, einenvicidial Notfall zu zwingen erneuern, selbst wenn die Kampagne nichtaktiv ist. + <BR> + <A NAME="vicidial_campaigns-realtime_agent_time_stats"> + <BR> + <B>Echtzeit-Agent Zeitstatistik -</B> Wenn Sie dieses auf alles andere als BEHINDERTE ermöglicht das Sammeln von Agent Zeit Stats for heute für diese Kampagne, die sichtbar sind durch den Echtzeit-Bericht. Ferngespräche sind die durchschnittlichen ruft behandelt pro Agent, ist WAIT die durchschnittliche Wartezeit Agent, CUST der durchschnittliche Kunde Sprechzeit ist, der Durchschnitt liegt bei ACW Anrufnachbearbeitung Zeit, ist die durchschnittliche PAUSE Pausenzeit. Der Standardwert ist DISABLED. + <BR> <A NAME="vicidial_campaigns-active"> <BR> @@ -3380,17 +4685,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Park-Verlängerung -</B> Dieses ist, wo Sie besonders anfertigenkönnen auf-halten Musik für VICIDIAL. Stellen Sie sicher, daß dieVerlängerung im Platz im extensions.conf ist und das, das es auf denDateinamen unten zeigt. + <B>Park Music-on-Hold -</B> Hier können Sie die Wartemusik Kontext für diese Kampagne definieren können. Wählen Sie unbedingt eine gültige Wartemusik Kontext von der Select-Liste und dass der Kontext, den Sie ausgewählt haben, hat gültige Dateien in sich. Die Standardeinstellung ist Standard. <BR> <A NAME="vicidial_campaigns-park_file_name"> <BR> - <B>Park-Dateiname -</B> Dieses ist, wo Sie besonders anfertigen könnenauf-halten Musik für VICIDIAL. Stellen Sie sicher, daß der Dateiname10 Buchstaben lang oder kleiner ist und daß die Akte im Platz im/var/lib/asterisk/sounds Verzeichnis ist. + <B>Park File Name -</B> NOT USED. <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Netz-Form -</B> Dieses ist, wo Sie die kundenspezifische Webseiteeinstellen können, die geöffnet ist, wenn der Benutzer an dieNETZ-FORM-Taste klickt. So passen Sie die Abfragezeichenfolge nach dem Web-Formular, einfach beginnen, die Web-Formular mit VAR und dann die URL, die Sie verwenden möchten, ersetzt die Variablen mit den Variablen-Namen, die Sie verwenden möchten - A - phone_number - B -- genau wie in der Registerkarte INDEXE Abschnitt. + <B>Netz-Form -</B> Dieses ist, wo Sie die kundenspezifische Webseiteeinstellen können, die geöffnet ist, wenn der Benutzer an dieNETZ-FORM-Taste klickt. So passen Sie die Abfragezeichenfolge nach dem Web-Formular, einfach beginnen, die Web-Formular mit VAR und dann die URL, die Sie verwenden möchten, ersetzt die Variablen mit den Variablen-Namen, die Sie verwenden möchten - A - phone_number - B -- genau wie in der Registerkarte INDEXE Abschnitt. Wenn Sie benutzerdefinierte Felder in einem Web-Formular-Adresse verwenden möchten, müssen Sie hinzufügen &CF_uses_custom_fields=Y als Teil der URL. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -3419,7 +4724,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_allow_inbound"> <BR> - <B>Erlauben Sie Inbound und gemischt - dieses ist, wo Sie einstellenkönnen, ob die Benutzer dieser Kampagne die Wahl haben, zum von voninbound Anrufen mit dieser Kampagne zu nehmen. Wenn Sie gemischtesinbound und outbound tun möchten dann, muß dieses auf Y eingestelltwerden. Wenn Sie nur das outbound Wählen auf dieser Kampagne tunmöchten einstellten dieses auf N. Default sind N. + <B>Erlauben Sie Inbound und gemischt - dieses ist, wo Sie einstellenkönnen, ob die Benutzer dieser Kampagne die Wahl haben, zum von voninbound Anrufen mit dieser Kampagne zu nehmen. Wenn Sie gemischtesinbound und outbound tun möchten dann, muß dieses auf Y eingestelltwerden. Wenn Sie nur das outbound Wählen auf dieser Kampagne tunmöchten einstellten dieses auf N. Default sind N. <BR> <A NAME="vicidial_campaigns-dial_status"> @@ -3451,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Startet mit Ost-West Zeitzonen und arbeitet <BR>   - DOWN TIMEZONE: Startet mit westlichen Zeitzonen und arbeitet Osten + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Liste Auftrag Randomize -</B> Diese Option ermöglicht es Ihnen, die Reihenfolge der Leitungen in den Trichter Last innerhalb der Ergebnisse von den obengenannten Kriterien definiert randomisieren. Zum Beispiel wird die Reihenfolge der Liste erhalten bleiben, aber die Ergebnisse werden innerhalb dieser Sortierung randomisiert. Wenn diese Option auf Y wird diese Funktion aktivieren. Standard ist für behinderte N. Hinweis, wenn Sie eine große Zahl von Kaufinteressenten haben diese Option kann verlangsamen die Geschwindigkeit des Trichters Laden Skript. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Liste Auftrag Sekundäre -</B> Diese Option ermöglicht es Ihnen, die zweite Sortierreihenfolge der Hauptrollen in dem Trichter nach dem Last-Liste Reihenfolge und innerhalb der Ergebnisse von den obengenannten Kriterien definiert auszuwählen. Zum Beispiel wird die Reihenfolge der Liste für die erste Art der Leitungen verwendet werden, aber die Ergebnisse werden zum zweiten Mal innerhalb dieser Sortierung über den gleichen Satz von der ersten Liste sortiert werden. Zum Beispiel, wenn Sie Auftrag Liste gesetzt zu COUNT DOWN-und haben Sie nur Leitungen, die 1 und 2 mal versucht haben, dann, wenn Sie die Reihenfolge der Liste sekundäre Gruppe zu allen Versuch 1 führt LEAD_ASCEND haben wird von den ältesten Leitungen sortiert werden erste und wird in den Trichter so gesetzt werden. Standard ist LEAD_ASCEND. Bedenken Sie, dass wenn Sie eine große Anzahl von Leitungen mit einer der Optionen CALLTIME verlangsamen die Geschwindigkeit des Trichters Laden Skript. Wenn Liste Auftrag Randomize aktiviert ist, wird diese Option ignoriert. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Zufuhrbehälter waagerecht ausgerichtet -</B> Dieses ist, wieviele dieVDhopper Indexversuche führt, um in der vicidial_hopper Tabelle fürdiese Kampagne zu halten. Wenn Sie VDhopper Index jede Minute laufenlassen, bilden Sie dieses etwas grösser als die Zahl Leitungen, dieSie in eine Minute durchmachen. + <B>Minimale Stufe Hopper -</B> Dies ist die minimale Anzahl der führt die VDhopper Skript versucht, in der Tabelle vicidial_hopper für diese Kampagne zu halten. Wenn Laufen VDhopper Skript jede Minute, machen diese etwas größer als die Zahl der führt Sie durch in einer Minute gehen. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Automatische Hopper Stufe -</B> Wenn Sie dieses auf Y wird es sich jeder leisten kann damit automatisch den Trichter aus den Einstellungen haben Sie in Ihrer Kampagne basiert. Die Formel sie verwendet, um dies zu tun ist:<BR>Number of Aktive Bevollmächtigte * Selbstvorwahlknopf-Niveau * ( 60 seconds / Vorwahlknopf-Abschaltung ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Automatische Hopper Multiplier -</B> Dies ist Multiplikator für die Auto-Hopper. Wenn Sie diese weniger als 1 bewirkt, dass der Auto-Hopper-Algorithmus, um weniger Leitungen als normalerweise zu laden. Wenn Sie diesen Wert größer als 1 bewirkt, dass der Auto-Hopper-Algorithmus, um mehr Leads als es normalerweise tun würde zu laden. Standard ist 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Auto Trim Hopper -</B> Wenn Sie dieses auf Y wird es sich jeder leisten, um automatisch entfernen überschüssige Leads aus dem Trichter. Der Standardwert ist Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Hopper VLC Dup Prüfen -</B> Wenn Sie dieses auf Y wird in jedem führen, dass in den Trichter durch vendor_lead_code überprüft, um sicherzustellen, gibt es kein Duplikat eingefügt führen Leitungen mit der gleichen vendor_lead_code eingefügt. Dies ist besonders nützlich, wenn Auto-Alt-Dialing mit MULTI_LEAD. Standard ist N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Leitung Filter -</B> Dieses ist eine Methode der Entstörung IhrerLeitungen mit einem Fragment einer SQL Frage. Benutzen Sie dieseFunktion mit Vorsicht, es ist einfach mit, der geringfügigstenÄnderung zur SQL Aussage versehentlich zu wählen zu stoppen.Rückstellung ist KEINE. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Anzahl der Anrufe-Limit -</B> Dies erzwingt eine Grenze für die Anzahl der Anrufversuche für die Leitungen in dieser Kampagne gewählt. Ein Lead kann sich über diese Grenze gehen, wenn etwas Blei-Recycling oder Auto-Alt-Dialing aktiviert ist. Standard ist 0 für kein Limit. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Anzahl der Anrufe Ziel -</B> Diese Option wird nur für Zwecke der Berichterstattung verwendet werden und hat keinen Einfluss auf den Leitungen gewählt. Standard ist 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -3481,11 +4826,21 @@ if ($ADD==99999) <BR> <B>Selbstvorwahlknopf-Niveau -</B> Dieses ist, wohin Sie einstellen,wieviele VICIDIAL sollte pro Mittel 0 verwenden des aktiven Mittelsnull zeichnet, Automobil, daswählen aus ist und die Mittel klicken,um jede Nummer zu wählen. Andernfalls hält VICIDIALWählverbindungen gleich den aktiven Mitteln, die mit demVorwahlknopfniveau multipliziert werden, um zu, wievielen Linien zukommen diese Kampagne auf jedem Bediener erlauben sollte. Das ANPASSENÜBERSTEUERUNG checkbox erlaubt Ihnen, ein neuesVorwahlknopfniveau zu zwingen, obwohl die Vorwahlknopfmethode in einemANPASSENMODUS ist. Dieses ist nützlich, wenn es eine drastischeVerschiebung in der Qualität der Leitungen gibt und Sie dasdial_level drastisch manuell ändern möchten. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Auto Dial Schwellwert -</B> Diese Einstellung funktioniert nur mit einem ADAPT oder RATIO Wählmethode, und es muss auf etwas anderes als BEHINDERTE und die Anzahl der Agenten Einstellung muss über 0 eingestellt werden. Diese Funktion erlaubt Ihnen, eine Mindestanzahl Agenten eingestellt, dass prädiktive Algorithmus wird bei der Arbeit. Wenn die Anzahl der Agenten unterschreitet die Nummer, die Sie eingestellt haben, dann wird die DFÜ-Ebene wird auf 1,0 gehen, bis mehr Agenten melden Sie sich an oder gehen in den ausgewählten Zustand. Angemeldete IN_AGENTS wird alle Mittel in die Kampagne angemeldet zu zählen, wird NON-PAUSED_AGENTS zählen nur Agenten, die darauf warten oder sich unterhalten, und WAITING_AGENTS wird nur zählen, dass Agenten auf einen Anruf warten. Der Standardwert ist DISABLED. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Vorhandenes nur Tally -</B> dieses fangen auf, wenn Satz zu YINCALL und WARTESCHLANGE Statusmittel ausläßt, wenn er die ZahlAnrufen zum Vorwahlknopf wenn nicht in MANUELLEN Vorwahlknopfmoduserrechnet. Rückstellung ist N. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Erhältlich Nur Tally Threshold -</B> Diese Einstellung funktioniert nur mit einem ADAPT oder RATIO Wählmethode, erhältlich nur Tally auf N gesetzt werden muss, muss diese Einstellung auf etwas anderes als DISABLED gesetzt werden und die Anzahl der Agenten Einstellung muss über 0 sein. Diese Funktion ermöglicht es Ihnen, die Anzahl der Agenten, unterhalb derer Erhältlich Nur Tally aktiviert sein wird eingestellt. Wenn die Anzahl der Agenten unterschreitet die Nummer, die Sie eingestellt haben, dann ist die Verfügbar Nur Tally Einstellung mit zu gehen, um vorübergehend y bis mehreren Mitteln, sich anzumelden oder gehen in den ausgewählten Zustand. Angemeldete IN_AGENTS wird alle Mittel in die Kampagne angemeldet zu zählen, wird NON-PAUSED_AGENTS zählen nur Agenten, die darauf warten oder sich unterhalten, und WAITING_AGENTS wird nur zählen, dass Agenten auf einen Anruf warten. Der Standardwert ist DISABLED. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -3509,7 +4864,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Vorwahlknopf-waagerecht ausgerichtetes Unterschied-Ziel -</B> diesesfangen wird verwendet zu definieren auf, ob Sie Haben einerspezifischen Anzahl von den Mitteln zielen möchten, die Anruf- oderAnklopfenmittel warten. Z.B. wenn Sie immer auf Durchschnitt einerMittel haben möchten frei, Anrufe sofort zu nehmen, würden Siedieses bis -1 einstellen, wenn Sie ein immer haben zielen möchtenersuchen um den Einfluß, der ein Mittel wartet, das Sie dieses bis 1einstellen würden. Rückstellung ist 0. Dieses fangen wirdverwendet nicht durch den HANDBUCH- oder VERHÄLTNIS-VorwahlknopfMethoden auf. + <B>Vorwahlknopf-Waagerecht ausgerichtetes Unterschied-Ziel -</B> Dieses Feld wird festgelegt, ob Sie gezielt mit einer bestimmten Anzahl von Agenten warten auf Anrufe oder Anrufe in der Warteschlange für die Agenten wollen. Zum Beispiel, wenn Sie möchte immer im Durchschnitt ein Agent frei zu nehmen haben, ruft sofort würden Sie diese auf -1 gesetzt, wenn Sie möchten, zu zielen immer mit einem Anruf zu halten für einen Agenten warten Sie dies auf 1 gesetzt würde. Standard ist 0. Dieses Feld wird nicht durch das Handbuch oder INBOUND_MAN Einwahl verwendeten Methoden. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Wählen Level Difference Zielmethode -</B> Mit dieser Option können Sie festlegen, ob die Einwahl Pegeldifferenz Zielsetzung nur auf die Berechnung des Zifferblattes Ebene oder auch auf die tatsächliche Wahl auf jeder Einwahl-Server angewendet wird. Wenn Sie mit einer kleinen Kampagne mit angemeldeten Agenten in auf vielen Servern Sie die ADAPT_CALC_ONLY Option verwenden können, weil die CALLS_PLACED Option in weniger Anrufe werden als Moeglichkeiten nach platziert führen kann. Diese Option ist nur aktiv, wenn Dial Level Difference Ziel auf etwas anderes als 0 gesetzt ist. Die Standardeinstellung ist ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -3519,17 +4879,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>Queue-Priorität - </B> Diese Einstellung wird verwendet, um die Reihenfolge, in der die Anrufe von diesem ausgehende Kampagne zu beantworten in Bezug auf die eingehenden Anrufe, wenn diese Kampagne ist in Blended-Modus. + <B>Queue-Priorität - </B> Diese Einstellung wird verwendet, um die Reihenfolge, in der die Anrufe von diesem ausgehende Kampagne zu beantworten in Bezug auf die eingehenden Anrufe, wenn diese Kampagne ist in Blended-Modus. Wir empfehlen nicht, die Einstellung eingehende Anrufe an eine höhere Priorität als die Outbound Kampagnen, weil die Leute rufen in zu warten, erwarten, und die Menschen aufgerufen erwarten, für jemanden da zu sein auf dem Handy. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> <BR> <B>Mehrere Kampagne Drop Rate Group -</B> Diese Funktion erlaubt Ihnen, eine Kampagne als Mitglied einer Kampagne Drop-Rate-Fraktion, oder eine Gruppe von Kampagnen Menge, deren Human Beantwortete Anrufe und Drop fordert für alle Kampagnen in der Gruppe werden in einen gemeinsamen Drop Prozentsatz, oder aufgeben und abstimmen kombiniert werden. Dies ermöglicht es Ihnen, mehrere Kampagnen gleichzeitig und leichter Ablaufsteuerung Ihre Drop-Rate. Dies ist besonders nützlich in Großbritannien, wo die Vorschriften dieser Drop-Rate Berechnungsmethode mit Kampagnen-Gruppierung in der gleichen Firma Bewilligung, auch wenn es mehrere Kampagnen, die Firma läuft am selben Tag. Um dies für eine Kampagne zu aktivieren, wählen Sie einfach eine Gruppe aus der Liste. Es gibt 10 Gruppen in das System standardmäßig definiert, können Sie Ihren Systemadministrator wenden, um mehr hinzuzufügen. Option ist standardmäßig deaktiviert. + <BR> + <A NAME="vicidial_campaigns-inbound_queue_no_dial"> + <BR> + <B>Eingangswarteschlange No Dial -</B> Diese Funktion, wenn auf ENABLED einstellen können Sie ausgehende automatische Einwahl dieser Kampagne zu verhindern, wenn es irgendwelche eingehende Anrufe in der Warteschlange, die Teil der zulässigen eingehenden in dieser Kampagne festgelegt sind. Wenn Sie dieses auf ALL_SERVERS ändert den Algorithmus, um alle eingehenden Anrufe als aktive Anrufe auf diesem Server zu berechnen, auch wenn sie auf einem anderen Server, die die Chance auf unnötigen ausgehenden Anrufen reduziert werden, wenn Sie Anrufe kommen in auf einem anderen Server haben sollen. Der Standardwert ist DISABLED. + <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Wählende SelbstAlt-zahl -</B> diese Einstellung wird benutzt, umwechselnde Nummer automatisch zu wählen auffängt, beimWählen im VERHÄLTNIS und ANPASST Vorwahlknopfmethoden, wenn eskeinen Kontakt an der Haupttelefonnummer für eine Leitung, die Na, B,DC und N Status gibt. Diese Einstellung wird nicht durch die MANUELLEVorwahlknopfmethode benutzt. EXTENDED stellvertretenden Zahlen sind die Zahlen in das System außerhalb der Standard-Bildschirm führen. Mit Extended können Sie Hunderte von Telefonnummern für einen einzigen Kunden aufnehmen. + <B>Wählende SelbstAlt-zahl -</B> diese Einstellung wird benutzt, umwechselnde Nummer automatisch zu wählen auffängt, beimWählen im VERHÄLTNIS und ANPASST Vorwahlknopfmethoden, wenn eskeinen Kontakt an der Haupttelefonnummer für eine Leitung, die Na, B,DC und N Status gibt. Diese Einstellung wird nicht durch die MANUELLEVorwahlknopfmethode benutzt. EXTENDED stellvertretenden Zahlen sind die Zahlen in das System außerhalb der Standard-Bildschirm führen. Mit Extended können Sie Hunderte von Telefonnummern für einen einzigen Kunden aufnehmen. Mit MULTI_LEAD erlaubt Ihnen, eine separate Leitung für jede Nummer auf einem Kundenkonto, dass alle eine gemeinsame vendor_lead_code verwenden, und die Art der Rufnummer jeweils mit einem Etikett im Feld Besitzer definiert. Diese Option wird deaktiviert einige Optionen auf dem Bildschirm ändern Kampagne und zeigen einen Link zu dem Multi-Alt-Einstellungen Seite, die Sie an, welche Telefonnummer Typen, definiert durch die Beschriftung der einzelnen Blei festlegen können, wird gewählt und in welcher Reihenfolge. Dies wird eine spezielle Blei-Filter und wird das Feld Rang aller Leads innerhalb der Listen gesetzt, um diese Kampagne zu ändern, um sie in der von Ihnen angegebenen Reihenfolge nennen. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -3539,14 +4904,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Kampagne VDAD Erweiterung -</B> Dieses Feld erlaubt eine kundenspezifische Erweiterung VDAD Übertragung. Auf diese Weise können Sie verschiedene Call-Handling-Methoden je nach Ihrer Kampagne. - - 8364 - wie 8368 - - 8365 - wird die Forderung nur einem Agenten auf demselben Server wie der Anruf auf - - 8366 - Wird für die Presse-1 und Umfrage-Kampagnen - - 8367 - wird versuchen, zunächst schicken Sie die Forderung nach einem Agenten auf dem lokalen Server, dann wird es sich auf einem anderen Server - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Wird für Anrufbeantworter-Erkennung nach, dass ein gleiches Verhalten wie 8368 - - 8373 - Wird für Anrufbeantworter-Erkennung, die nach dem gleichen Verhalten wie 8366 + <B>Routing-Erweiterung -</B> In diesem Feld können für eine benutzerdefinierte Outbound-Routing-Erweiterung. Dies ermöglicht Ihnen, verschiedene Methoden Anrufbearbeitung je nachdem, wie Sie Anrufe über Ihren Outbound-Kampagnen nutzen. Früher nannte Kampagne VDAD Erweiterung. + <BR>- 8364 - wie 8368 + <BR>- 8365 - Wird der Anruf nur an einen Agenten auf dem gleichen Server zu senden, als der Anruf in Verkehr gebracht wird + <BR>- 8366 - Wird für Presse-1-, Broadcast-und Umfrage-Kampagnen + <BR>- 8367 - Werden versuchen, senden Sie zunächst den Anruf an einen Agenten auf dem lokalen Server, dann wird es auf anderen Servern suchen + <BR>- 8368 - DEFAULT - wird der Anruf zur nächsten freien Agenten zu senden, egal welchem ​​Server sie sind auf + <BR>- 8369 - Wird für Anrufbeantworter-Erkennung nach, dass das gleiche Verhalten wie 8368 + <BR>- 8373 - Wird für Anrufbeantworter-Erkennung nach dieser gleiche Verhalten wie 8366 + <BR>- 8374 - Wird für Presse-1-, Broadcast-und Umfrage-Kampagnen mit Cepstral Text-to-Speech + <BR>- 8375 - Wird für Anrufbeantworter-Erkennung und drücken Sie dann-1-, Broadcast-und Umfrage-Kampagnen mit Cepstral Text-to-Speech <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -3588,6 +4955,16 @@ if ($ADD==99999) <BR> <B>Sicherheitsnebenstelle -</B> Dies ist die Wählplan Nebenstelle, wo sich die gewünschte Sicherheits-Audiodatei auf Ihrem Server befindet. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Safe-Harbor-Audio -</B> Dies ist der Audio-Datei, die prompt gespielt, wenn die Drop-Aktion zu AUDIO eingestellt ist. Die Standardeinstellung ist Buzz. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Safe-Harbor-Call-Menü -</B> Dies ist der Anruf-Menü, dass ein Aufruf gesendet, wenn die Drop-Aktion ist auf CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -3688,7 +5065,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Umfrage-Methode - </B> Diese Option legt fest, was geschieht, auf eine Ausschreibung nach den Kunden hat sich in. AGENT_XFER wird der Anruf an den nächsten verfügbaren Agenten. VOICEMAIL wird der Anruf an die Voicemail-Box, die in den Bereich Voicemail. AUSDEHNUNG wird der Kunde auf die Ausdehnung der Definition in der Umfrage XFER Erweiterung Bereich. HANGUP hängt die Kunden. CAMPREC_60_WAV wird der Kunde auf eine Aufnahme, die mit ihrer Antwort, diese Aufnahme wird in einem Ordner mit dem Namen, wie sich die Kampagne innerhalb der Umfrage Kampagne Aufnahme Directory. + <B>Umfrage-Methode - </B> Diese Option legt fest, was geschieht, auf eine Ausschreibung nach den Kunden hat sich in. AGENT_XFER wird der Anruf an den nächsten verfügbaren Agenten. VOICEMAIL wird der Anruf an die Voicemail-Box, die in den Bereich Voicemail. AUSDEHNUNG wird der Kunde auf die Ausdehnung der Definition in der Umfrage XFER Erweiterung Bereich. HANGUP hängt die Kunden. CAMPREC_60_WAV wird der Kunde auf eine Aufnahme, die mit ihrer Antwort, diese Aufnahme wird in einem Ordner mit dem Namen, wie sich die Kampagne innerhalb der Umfrage Kampagne Aufnahme Directory. CALLMENU wird den Kunden mit dem Call-Menü in der Auswahlliste unten definiert schicken. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -3740,6 +5117,16 @@ if ($ADD==99999) <BR> <B>Agent Anzeige dialable Leads -</B> Diese Option aktiviert wird, wenn die Anzahl der wählbaren führt in die Kampagne in der Agenten-Bildschirm zeigen. Diese Zahl wird in das System einmal pro Minute aktualisiert und wird auf dem Bildschirm des Agenten aktualisiert werden, alle paar Sekunden. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Umfrage Call-Menü -</B> Wenn die Methode zu CALLMENU gesetzt wird, ist dies das Menü Anruf, dass der Kunde wird gesendet, wenn sie opt-in. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Umfrage Recording -</B> Wenn aktiviert, wird diese Aufnahme starten, wenn der Anruf beantwortet wird. Nur empfohlen, wenn das Verfahren nicht eingestellt ist, um an einen Agenten zu übertragen. Standard ist für behinderte N. Wenn gesetzt, um auch Anrufbeantworter Y_WITH_AMD erkannt Nachricht Anrufe werden aufgezeichnet. + <?php } ?> @@ -3753,6 +5140,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. <BR>   - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. <BR>   - campaign_rank: Aufträge durch den Rank gegeben zum Mittel für dieKampagne. Stark zu am niedrigsten. + <BR>   - campaign_grade_random: ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten. <BR>   - fewest_calls: Aufträge durch die Zahl den Anrufen empfangen durch einMittel für diese spezifische inbound Gruppe. Wenige Anrufe zuerst. <BR>   - longest_wait_time: Bestellungen durch die Zeit, die Agenten aktiv gewartet auf einen Anruf. @@ -3766,6 +5154,11 @@ if ($ADD==99999) <BR> <B>Vorwahlknopf-Präfix -</B> Dieses fangen zuläßt einen Wegdes Wählens leicht ändern auf, zum durch eine andere Methode zuerlöschen, ohne ein Umladen im Sternchen zu tun. Rückstellung ist 9gegründet nach einem 91NXXNXXXXXX im dial plan - extensions.conf. + <BR> + <A NAME="vicidial_campaigns-manual_dial_prefix"> + <BR> + <B>Manuelle Vorwahl -</B> Dieses optionale Feld können Sie die Vorwahl nur verwendet werden, bei der Platzierung manuelle Einwahl Anrufe aus dem Agenten-Interface, wie zum Beispiel mit dem Manual Dial Feature-Set, oder Wählen Sie die nächste Nummer, wenn in der MANUAL Zifferblatt Methode oder manuelle alt Nummernwahl, oder geplant vom Benutzer nur Rückrufe. Standard ist leer für Behinderte, die die Vorwahl im Feld oben definiert nutzen werden. Diese Option funktioniert nicht mit dem 3-fach Vorwahl Option stören. + <BR> <A NAME="vicidial_campaigns-omit_phone_code"> <BR> @@ -3776,6 +5169,11 @@ if ($ADD==99999) <BR> <B>Kampagne CallerID -</B> Dieses fangen zuläßt das Senden einer kundenspezifischen callerid Zahl bei den outbound Anrufen auf. Dieses ist die Zahl, die oben auf dem callerid der Person darstellen würde, die, Sie anrufen. Die Rückstellung ist UNBEKANNT. Wenn Sie T1 benutzen, oder Eß, zum dieser Wahl heraus zu wählen nur vorhanden ist, wenn Sie PRIs verwenden - ISDN Tß oder Eß - die die kundenspezifische callerid Eigenschaft haben, die eingeschaltet wird, arbeitet dieses nicht mit Berauben-Spitze Service - RBS- Stromkreise. Dieses arbeitet auch durch das meiste VOIP - SIP oder IAX Stammversorger, die dynamisches outbound callerID erlauben. Das kundenspezifische callerID trifft nur auf die Anrufe zu, die direkt für die VICIDIAL Kampagne gesetzt werden, benennt jede mögliche 3. Partei, oder Übertragungen senden nicht das kundenspezifische callerID. ANMERKUNG: UNBEKANNT oder PRIVAT in auffangen manchmal sich setzen erbringt das Senden Ihrer Rückstellung callerID Zahl durch Ihre Fördermaschine mit den Anrufen. Sie können dieses prüfen wünschen und fangen 0000000000 in das callerid sich zu setzen anstatt auf, wenn Sie nicht Ihnen CallerID schicken möchten. + <BR> + <A NAME="vicidial_campaigns-use_custom_cid"> + <BR> + <B>Benutzerdefinierte CallerID -</B> Wenn auf Y gesetzt, ermöglicht Ihnen diese Option, um die security_phrase Feld in der Tabelle vicidial_list verwenden als die CallerID zu senden, bei der Platzierung für jeden spezifischen Blei. Wenn dieses Feld hat keine CID es dann in die Kampagne CallerID umrissen sind, sollen stattdessen verwendet werden. Diese Option deaktiviert die Liste CallerID überschreiben, wenn es eine CID in der security_phrase Feld. Standard ist N. Bei Einstellung auf AREACODE Sie haben die Fähigkeit, in die AC-CID Untermenü zu gehen und zu definieren, um mehrere callerids pro Ortsvorwahl verwendet werden. + <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -3789,13 +5187,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Kampagne Rec Dateiname -</B> Dieses fangen erlaubt Ihnen, denNamen der Aufnahme besonders anzufertigen auf, wenn Kampagne AufnahmeONDEMAND oder ALLCALLS ist. Die erlaubten Variablen sind KAMPAGNECUSTPHONE FULLDATE TINYDATE EPOCHE-MITTEL. Die Rückstellung istFULLDATE_MITTELund würde wie dieses 20051020-103108_6666 aussehen.Ein anderes Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, das wie diesesTESTCAMP_51020103108_3125551212 aussehen würde. 50 char max. + <B>Kampagne Rec Dateiname -</B> In diesem Feld können Sie den Namen der Aufnahme anpassen, wenn Kampagne Aufnahme ist ONDEMAND oder ALLCALLS. Die Variablen sind erlaubt CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH MITTELVENDORLEADCODE LEADID. Der Standardwert ist FULLDATE_MITTELund würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE das so aussehen würde TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>Das Notieren verzögert -</B> für ALLCALLS und ALLFORCE nur Aufnahme.Dieser Einstellung Wille verzögert das Beginnen der Aufnahme beiallen Anrufen für die Zahl den Sekunden, die diesbezüglichspezifiziert werden, auffangen. Rückstellung ist 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Rufen Sie Noten pro Anruf -</B> Wenn Sie diese Option auf Enabled ermöglicht es Agenten in Notes für jeden Anruf sie im Agent-Interface handhaben eingeben. Die Noten Eingabefeld unter dem Feld Bemerkungen im Agent-Interface erscheinen. Auch, wenn der Agent Benutzer-Gruppe ist berechtigt, Anzeigen von Anruflisten dann der Agent in der Lage, Vergangenheit Anrufanmerkungen für eine Führung jederzeit einsehen. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Agent-Lead-Suche -</B> Wenn diese Option auf ENABLED ermöglicht Agenten für Leads durchsuchen und Artikel lesen Blei Informationen während der Pause im Agent-Interface. Auch, wenn der Agent Benutzer-Gruppe ist berechtigt, Anzeigen von Anruflisten dann der Agent in der Lage, Vergangenheit Anrufanmerkungen für jeden Lead dass die dort verfügbaren Informationen zu sehen. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Agent-Lead-Suchmethode -</B> Wenn Agent Lead-Suche aktiviert ist, legt diese Einstellung in der der Agent erlaubt sein wird, für Leads zu suchen. SYSTEM wird das gesamte System zu suchen, wird im Inneren CAMPAIGNLISTS alle aktiven Listen innerhalb der Kampagne zu suchen, wird im Inneren CAMPLISTS_ALL alle aktiven und inaktiven Listen innerhalb der Kampagne suchen, listet nur suchen im Manual Dial-ID-Liste, wie in der Kampagne definiert . Die Standardeinstellung ist CAMPLISTS_ALL. Eine dieser Optionen mit USER_ vor werden nur innerhalb von Leads, die das Feld Besitzer Anpassung der Benutzer-ID des Agenten suchen haben, werden die Optionen mit GROUP_ vor nur innerhalb von Leads, die das Feld Besitzer Anpassung der Benutzer-Gruppe ist, dass der Benutzer zu suchen, Mitglied, mit den Optionen TERRITORY_ vor werden nur innerhalb von Leads, die das Feld Besitzer passend zu den Gebieten, die der Agent ausgewählt haben, suchen. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -3804,7 +5217,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Erhalten Sie Anruf-Produkteinführung -</B> Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. + <B>Erhalten Sie Anruf-Produkteinführung -</B> Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. Wenn benutzerdefinierte Liste Felder auf Ihrem System aktiviert sind, bilden die Registerkarte Formular bei der Verbindung eines Anrufs öffnen, um einen Agenten. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -3814,17 +5227,47 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Quick Transfer Button -</B> Diese Option wird ein Quick Transfer-Taste, um den Agenten Bildschirm unter dem Transfer-Conf Schaltfläche -Hinzufügen- klicken, dass man blind Weiterleitung der Gespräche, damit werden die ausgewählten In-Group oder einer Nummer. IN_GROUP werden Anrufe an die Standard-Xfer für diese Kampagne, oder In-Group, wenn es einen eingehenden Anruf. Die Voreinstellungen werden die Aufrufe an die gewählte Voreinstellung. Der Standardwert ist N für Behinderte. + <B>Quick Transfer Button -</B> Diese Option wird ein Quick Transfer-Taste, um den Agenten Bildschirm unter dem Transfer-Conf Schaltfläche -Hinzufügen- klicken, dass man blind Weiterleitung der Gespräche, damit werden die ausgewählten In-Group oder einer Nummer. IN_GROUP werden Anrufe an die Standard-Xfer für diese Kampagne, oder In-Group, wenn es einen eingehenden Anruf. Die Voreinstellungen werden die Aufrufe an die gewählte Voreinstellung. Der Standardwert ist N für Behinderte. Die LOCKED Optionen werden verwendet, um den Wert auf die Schnelle Transfer-Taste sperren, auch wenn der Agent verwendet die Übertragung Konferenz-Funktionen während eines Gesprächs vor der Verwendung des Quick-Transfer-Taste. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Custom 3-Wege-Taste Transfer- -</B> Diese Option wird eine benutzerdefinierte Schaltfläche Übertragung an den Agenten-Bildschirm unterhalb der Transfer-Conf-Taste, die es einem Klick Drei-Wege-Anrufe über das ausgewählte Preset oder ein Feld hinzufügen. Die PRESET_ Optionen findet Anrufe mit der Preset-Wert definiert. Die field_groupj Optionen findet Anrufe mit der Nummer in das ausgewählte Feld aus der Führung. BEHINDERTE nicht zeigen Sie die Taste auf dem Agenten-Bildschirm. Die PARK_ Optionen wird den Kunden vor dem Wählen zu parken. Der Standardwert ist DISABLED. Die VIEW_PRESET Option öffnen Sie einfach die Übertragung Rahmen und die voreingestellte Frame. Die VIEW_CONTACTS Option wird eine Suche Kontakte-Fenster zu öffnen, wird dies nur funktionieren, wenn Presets zu aktivieren KONTAKTE eingestellt ist. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> <BR> <B>Vorab gefüllt Transfer Preset -</B> Diese Option wird in der Anzahl zu Dial-Feld füllen Sie das Transfer Conference Rahmen des Bildschirms, wenn der Agent definiert. Der Standardwert ist N für Behinderte. + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Aktivieren Transfer-Presets -</B> Diese Option ermöglicht es den Presets Untermenü, an der Spitze der Kampagne Modifikation Seite erscheinen, und auch Sie werden die Fähigkeit zur Preset-Rufnummern für Bevollmächtigte, um in der Transfer-Konferenz Rahmen des Agent-Interface verwenden, genau angeben. Der Standardwert ist DISABLED. Kontakte ist ein Option nur, wenn contact_information auf Ihrem System aktiviert ist, das ist eine benutzerdefinierte Funktion. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Aktivieren Transfer-Presets -</B> Diese Option ermöglicht es den Presets Untermenü, an der Spitze der Kampagne Modifikation Seite erscheinen, und auch Sie werden die Fähigkeit zur Preset-Rufnummern für Bevollmächtigte, um in der Transfer-Konferenz Rahmen des Agent-Interface verwenden, genau angeben. Der Standardwert ist DISABLED. Kontakte ist ein Option nur, wenn contact_information auf Ihrem System aktiviert ist, das ist eine benutzerdefinierte Funktion. + + <BR> + <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> + <BR> + <B>Übertragung ausblenden Zu wählende Nummer -</B> Diese Option blendet die Nummer Feld in der Transfer-Konferenz Rahmen des Agent-Interfaces Dial. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call"> + <BR> + <B>Anruf parken IVR -</B> Diese Option ermöglicht ein Agent einen Anruf mit einem separaten IVR-PARK Taste CALL auf ihren Agenten-Interface parken, wenn diese Option aktiviert ist oder ENABLED_PARK_ONLY. Die ENABLED_PARK_ONLY Option ermöglicht es dem Agenten, um den Anruf zu parken, aber nicht senden klicken, um das Gespräch wie die Option Aktiviert abzurufen. Die ENABLED_BUTTON_HIDDEN Option ermöglicht die Funktion nur über die API. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call_agi"> + <BR> + <B>Anruf parken IVR AGI -</B> Wenn der Anruf parken IVR-Bereich nicht deaktiviert ist, dann wird dieses Feld als String AGI Anwendung, dass der Kunde gesendet wird verwendet. Dies ist eine Einstellung, die vom Administrator festgelegt werden sollte, wenn möglich. + <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Timer-Aktion -</B> Mit dieser Funktion können Sie die Aktionen nach einer bestimmten Zeit auslösen. D1 und D2 DIAL Optionen werden einen Aufruf der Transfer Conference Anzahl Presets starten und senden sie an die Agenten-Sitzung wird dies in der Regel für einfache IVR Validierung AGI-Anwendungen oder nur eine vorher aufgenommene Nachricht zu spielen verwendet. WebForm öffnet sich das Web-Formular-Adresse. MESSAGE_ONLY wird einfach Anzeige die Meldung, dass unten in das Feld ist. Niemand wird diese Funktion zu deaktivieren und ist der Standard -. + <B>Timer-Aktion -</B> Mit dieser Funktion können Sie die Aktionen nach einer bestimmten Zeit auslösen. D1 und D2 DIAL Optionen werden einen Aufruf der Transfer Conference Anzahl Presets starten und senden sie an die Agenten-Sitzung wird dies in der Regel für einfache IVR Validierung AGI-Anwendungen oder nur eine vorher aufgenommene Nachricht zu spielen verwendet. WebForm öffnet sich das Web-Formular-Adresse. MESSAGE_ONLY wird einfach Anzeige die Meldung, dass unten in das Feld ist. Niemand wird diese Funktion zu deaktivieren und ist der Standard -. HANGUP hängen bleiben wird das Gespräch, wenn der Timer ausgelöst wird, wird CALLMENU den Anruf an den Anruf-Timer-Menü im Feld Ziel angegeben Aktion zu senden, EXTENSION, wird der Anruf an die Erweiterung, die in der Timer-Aktion Feld Ziel angegeben wird, zu senden, wird IN_GROUP senden der Aufruf an die In-Group in den Timer-Aktion Feld Ziel angegeben. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -3836,11 +5279,46 @@ if ($ADD==99999) <BR> <B>Timer-Aktion Sekunden -</B> Dies ist die Zeit nach dem Anruf des Kunden, dass die Timer-Aktion wird ausgelöst, verbunden. Der Standardwert ist -1, die auch inaktiv. + <BR> + <A NAME="vicidial_campaigns-timer_action_destination"> + <BR> + <B>Timer-Aktion Reiseziel -</B> Dieses Feld ist, wo Sie das Call-Menü, Erweiterung oder In-Group angeben, dass Sie den Anruf an, wenn die Zeit Aktion zu CALLMENU, Erweiterung oder IN_GROUP eingestellt werden soll. Standard ist leer. + <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Zeitlich geplante Wiederholungsbesuche -</B> Diese Wahl erlaubt einemMittel zur Einteilung einen Anruf als CALLBK und wählt die Daten unddie Zeit, an denen die Leitung reaktiviert wird. + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> + <BR> + <B>Geplante Rückrufe Alarm -</B> Diese Option ermöglicht die Rückrufe Statuszeile im Agent-Interface, rot zu sein, blinken oder blinkt rot, wenn es sich AGENTONLY Rückrufe, die ihre Zeit und das Datum Trigger getroffen haben soll. Der Standardwert ist NONE für Standard-Status-Zeile. Die DEFER Optionen auf zu blinken und die Anzeige-oder rot auf, wenn Sie die Rückrufe zu überprüfen, bis die Anzahl der Rückrufe Änderungen. + + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_count"> + <BR> + <B>Geplante Rückrufe Count -</B> Mit dieser Option können Sie festlegen, ob nur LIVE-Rückrufe, benutzerfreundliche nur geplante Rückrufe, die ihre Trigger Datum und Uhrzeit, oder ALL_ACTIVE Rückrufe getroffen haben, benutzerfreundliche nur Rückrufe, die aktiv sind in der Anlage sowie LIVE-Rückrufe sollten be3 int zählte er Agent-Callback-Benachrichtigung Abschnitt über die Agenten-Bildschirm. Die Standardeinstellung ist ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Geplante Rückrufe Tage zu begrenzen -</B> Diese Option ermöglicht Ihnen, den Agenten zu reduzieren geplant Rückrufe Kalender, um eine wählbare Anzahl von Tagen ab heute, die volle 12-monatigen Kalender wird immer noch angezeigt, aber nur die festgelegte Anzahl von Tagen wird auswählbar sein. Standard ist 0 für unbegrenzt. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Geplante Rückrufe Stunden-Block -</B> Diese Option ermöglicht es Ihnen, eine USERONLY geplanten Rückruf von auf dem Agent Rückrufliste bis X Stunden angezeigt, nachdem diese festgelegt wurde zu beschränken. Standard ist 0 für kein Block. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Geplante Rückrufe Calltime-Block -</B> Diese Option aktiviert, wenn das geplante Rückruf in der Agenten-Callback-Liste aus, die gewählt zu verhindern, wenn es außerhalb des planmäßigen calltime für die Kampagne ist. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Meine Rückrufe Checkbox Standard -</B> Diese Option ermöglicht es Ihnen, Voreinstellung der Eig.Rückruf Checkbox auf der Callback-Agent geplant Bildschirm. Überprüft wird das Kontrollkästchen automatisch, ob für jeden Anruf. Die Standardeinstellung ist UNCHECKED. + <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -3851,6 +5329,26 @@ if ($ADD==99999) <BR> <B>Nachbereitungsnachricht -</B> Dies ist eine Kampagnen-spezifische Nachricht, die bei gesetzten Sekunden Nachbereitung auf dem Nachbereitungsbildschirm angezeigt wird. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Deaktivieren Sie Dispo-Screen -</B> Diese Option ermöglicht es Ihnen, die Disposition Bildschirm im Agent-Interface zu deaktivieren. Das Deaktivieren der Dispo-Status Feld darunter muss für diese Option funktioniert gefüllt werden. Die Standardeinstellung ist DISPO_ENABLED. Die DISPO_SELECT_DISABLED Option wird nicht deaktivieren Sie die Dispo-Bildschirm vollständig, sondern wird das Dispo-Bildschirm ohne jegliche Verfügungen anzeigen zu lassen, sollte diese Option nur verwenden, wenn Sie zu zwingen, Ihren Agenten zu Ihrem CRM-Software, die den Status an das System sendet über die API nutzen möchten werden. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Deaktivieren Sie Dispo-Status -</B> Wenn der Dispo-Screen-Option deaktivieren, um DISPO_DISABLED gesetzt ist, dann muss dieses Feld ausgefüllt Du jede Verfügung, die Sie für dieses Feld verwenden können, solange sie von 1 bis 6 Zeichen lang mit nur Buchstaben und Zahlen ist zu. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Agent-Bildschirm Labels -</B> Sie können eine Reihe von Agenten-Bildschirm Etiketten mit dieser Option zu nutzen. Standard ist - SYSTEM-EINSTELLUNGEN - für die Standard-Etiketten. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Status Anzeige-Felder -</B> Sie können auswählen, welche Variablen für Anrufe in der Statuszeile des Agenten-Bildschirm wird angezeigt. CALLID wird die 20-stelligen eindeutigen Anruf-ID anzuzeigen, LEADID wird das System Blei-ID anzuzeigen, wird die Liste ListId ID. Die Standardeinstellung ist CALLID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -3864,13 +5362,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-closer_campaigns"> <BR> - <B>Gewährte Inbound Gruppen -</B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. + <B>Gewährte Inbound Gruppen -</B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. <BR> <A NAME="vicidial_campaigns-agent_pause_codes_active"> <BR> <B>Mittel-Pause kodiert aktives -</B> läßt Mittel einen Pause Codevorwählen, wenn sie an die PAUSE Taste in vicidial.php klicken. PauseCodes sind pro Kampagne am unteren Bildschirmrand KampagneAnsichtdetail definierbar und sie werden in der vicidial_agent_logTabelle gespeichert. Rückstellung ist N. FORCE wird erzwungen, dass der Makler, um eine PAUSE-Code, wenn sie klicken Sie auf die PAUSE-Taste. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Auto Pause Pre-Call Work -</B> Im Auto-Dial-Modus, wenn diese Einstellung aktiviert wird gesetzt, um den Agenten automatisch angehalten, wenn der Agent klickt auf eine der folgenden Funktionen, die ihnen inne-Manual Dial, Fast Dial, Lead Suche, Call Log View benötigt, überprüfen Sie Rückrufe, Geben Sie Pause Code. Standard ist für inaktive N. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Auto-Resume-Pre-Call Work -</B> Im Auto-Dial-Modus, wenn diese Einstellung aktiviert ist wird der Agent an aktiven automatisch eingestellt, wenn der Agent klickt, die aus oder Stempeln, auf eine der folgenden Funktionen, die ihnen inne-Manual Dial, Fast Dial, Lead Suche sein muss, Call Melden Sie sehen, Rückrufe, Enter Pause Code. Standard ist für inaktive N. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Auto Pause Pre-Call-Vorwahl -</B> Wenn das Auto Pause Pre-Call Work-Funktion über aktiv ist, und AgentPause Codesaktiv ist, wird diese Einstellung die Pause-Code, der verwendet wird, wenn der Agent für diese Aktivitäten angehalten wird. Die Standardeinstellung ist PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -3886,6 +5399,11 @@ if ($ADD==99999) <BR> <B>Agent Anzeige Queue Count - </B> Wenn Sie auf Y, wenn ein Kunde wartet auf einen Agenten, der Queue fordert Anzeige oben auf der Agenten-Bildschirm wird rot und zeigen die Anzahl der wartenden Anrufe. Der Standardwert ist Y. + <BR> + <A NAME="vicidial_campaigns-manual_dial_override"> + <BR> + <B>Manuelle Wahl Override -</B> Die Einstellung kann der Benutzer überschreiben die Einstellung für die manuelle Einwahl Möglichkeit für Agenten, wenn sie in dieser Kampagne werden protokolliert. NONE wird die Benutzer-Einstellung folgen, ALLOW_ALL wird jedes Mittel in dieser Kampagne auf manuelle Einwahl Anrufe getätigt werden protokolliert zulassen, wird DISABLE_ALL niemandem erlauben, in diese Kampagne angemeldet, um manuelle Einwahl von Anrufen. Der Standardwert ist NONE. + <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> <BR> @@ -3894,7 +5412,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Manual Dial Filter - </B> Auf diese Weise können Sie zum Filtern der Anrufe, die Agenten sind im manuellen Modus wählen Sie für diese Kampagne durch eine Kombination der folgenden: DNC - die Kick Out, CAMPAIGNLISTEN - die Zahl muss innerhalb der Listen für die Kampagne KEINE - kein Filter auf manuelle Einwahl oder schnelle Einwahl Listen. + <B>Manual Dial Filter - </B> Auf diese Weise können Sie zum Filtern der Anrufe, die Agenten sind im manuellen Modus wählen Sie für diese Kampagne durch eine Kombination der folgenden: DNC - die Kick Out, CAMPAIGNLISTS - die Zahl muss innerhalb der Listen für die Kampagne KEINE - kein Filter auf manuelle Einwahl oder schnelle Einwahl Listen. CAMPLISTS_ALL - wird inaktiv Listen bei der Suche nach der Zahl enthalten. + + <BR> + <A NAME="vicidial_campaigns-manual_preview_dial"> + <BR> + <B>Manuelle Vorschau Dial -</B> Dadurch kann der Agent im manuellen Modus Zifferblatt, die Führung zu Informationen sehen, wenn sie nächstes klicken Sie auf DFÜ-Nummer wählen, bevor sie aktiv den Anruf. Es ist ein optionaler Link, um das Blei überspringen und zum nächsten, wenn ausgewählt. Die Standardeinstellung ist PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Manuelle Wahl API -</B> Diese Option ermöglicht es Ihnen, die Agent-API gesetzt, um entweder ein Anruf zu einem Zeitpunkt, STANDARD, oder die Fähigkeit, Schlange stehen manuelle Einwahl Anrufe zu tätigen und haben sie automatisch zu wählen, sobald der Agent geht auf Pause oder ist verfügbar, um ihre nächsten Aufruf der Rücknahme Option, um die automatische Wahl der Anrufe, Warteschlange oder QUEUE_AND_AUTOCALL die die gleiche wie Warteschlange, aber ohne die Möglichkeit, die automatische Anwahl dieser Anrufe zu deaktivieren ist deaktiviert. Wenn ein Agent hat mehr als einen Aufruf für sie in der Warteschlange werden sie die zählen, wie viele manuelle Einwahl Anrufe in der Warteschlange direkt unterhalb der Pause-Taste zu sehen, oder wählen Sie Nächste Nummer drücken. Wir schlagen vor, dass, wenn Warteschlange verwendet wird, dass Sie API-Aktionen mit der Vorschaufunktion = YES Option, damit Sie nicht wiederholt werden Tätigen von Anrufen für den Agenten ohne vorherige Ankündigung zu senden. Auch, wenn mit Queue und stark durch manuelle Einwahl Anrufe in einer nicht MANUAL Zifferblatt Methode, würden wir empfehlen, die Agent-Pause nach jedem Call-Option auf Y Voreingestellt ist standard. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Manuell überprüfen Sie Anrufdauer -</B> Wenn diese Option aktiviert ist, wird es prüfen alle Anrufe auf manuelle Einwahl sicherzustellen, dass sie innerhalb der Zeit während des Bereitschaftsdienstes Einstellungen für die Kampagne eingestellt. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Manuelle Wahl CID -</B> Dieser legt fest, ob ein Agent macht manuelle Einwahl Anrufe haben die Kampagne callerID Einstellungen verwendet, oder ihrer Bevollmächtigten Telefon callerID Einstellungen verwendet. Die Standardeinstellung ist KAMPAGNE. Wenn die Use Custom CID Kampagne Option aktiviert ist oder die Liste Kampagne CID Override Einstellung wird verwendet, wird diese Einstellung ignoriert werden. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Telefon Post Time Difference-Alert -</B> Dieses Handbuch-Einwahl nur Funktion, falls aktiviert, wird eine Warnung anzeigen, wenn die Zeitzone für die Führung Postleitzahl oder eine Postleitzahl ein, unterscheidet sich von der Zeitzone von der Vorwahl der Rufnummer für die Führung. Die OUTSIDE_CALLTIME_ONLY Option wird nur die Warnung, wenn die beiden Zeitzonen unterschiedlich sind und eine der Zeitzonen liegt außerhalb des Bereitschaftsdienstes für die Kampagne ausgewählt. OUTSIDE_CALLTIME_PHONE prüfen lediglich die Zeitzone der Telefonnummer des Blei-und alarmieren, wenn es außerhalb des lokalen Zeit während des Bereitschaftsdienstes ist. OUTSIDE_CALLTIME_POSTAL prüfen lediglich die Zeitzone der Postleitzahl des Blei-und alarmieren, wenn es außerhalb des lokalen Zeit während des Bereitschaftsdienstes ist. OUTSIDE_CALLTIME_BOTH wird die Postleitzahl und die Telefonnummer für Sein im Ortsgespräch Zeit zu überprüfen, auch wenn sie in der gleichen Zeitzone befinden. Diese Warnungen werden in der Anrufliste Info, Rückrufe List-Info, Suchergebnisse Info, wenn eine Leitung gewählt wird und wenn ein Interessent eine Vorschau zu zeigen. Der Standardwert ist DISABLED. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -3904,13 +5447,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>3-Wege-Call Outbound CallerID - </B> Diese legt fest, was gesendet wird, wie der Ausgang CallerID Reihe von 3-Wege-Anrufe, die von den Agenten, die Kampagne verwendet die eigene Kampagne CallerID, Kunde nutzt die Zahl der Kunden ist, dass aktive auf dem Bildschirm und Agenten AGENT_PHONE verwendet die CallerID für das Telefon, dass der Agent angemeldet ist, in. AGENT_CHOOSE ermöglicht es dem Agenten zu entscheiden, welche CallerID, die für 3-Wege-Anrufe aus einer Liste von Optionen. + <B>3-Wege-Call Outbound CallerID - </B> Diese legt fest, was gesendet wird, wie der Ausgang CallerID Reihe von 3-Wege-Anrufe, die von den Agenten, die Kampagne verwendet die eigene Kampagne CallerID, Kunde nutzt die Zahl der Kunden ist, dass aktive auf dem Bildschirm und Agenten AGENT_PHONE verwendet die CallerID für das Telefon, dass der Agent angemeldet ist, in. AGENT_CHOOSE ermöglicht es dem Agenten zu entscheiden, welche CallerID, die für 3-Wege-Anrufe aus einer Liste von Optionen. CUSTOM_CID wird die Custom CID, die im Bereich der security_phrase vicidial_list Tabelle definiert ist für die Leitung verwendet. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> <BR> <B>3-Wege-Call-Vorwahl - </B> Diese legt fest, was als Vorwahl für 3-Wege-Anrufe, standardmäßig ist leer, so dass die Kampagne Vorwahl verwendet wird, so können Sie passthru Klingelton hören ist 88. + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> + <BR> + <B>Kunde 3-Wege-Hangup Logging -</B> Wenn diese Option aktiviert die user_call_log wird protokolliert, wenn ein Kunde Hangup-up, wenn sie während einer 3-Wege-Anruf zu hängen. Außerdem kann dieser für den Kunden erlauben 3-Wege-Hangup Aktion, wenn man unten defineed wird. Standardeinstellung lautet AKTIVIERT. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> + <BR> + <B>Kunde 3-Wege-Hangup Sekunden -</B> Wenn der Kunde 3-Wege-Protokollierung aktiviert ist, können Sie mit dieser Option die Anzahl der Sekunden definieren, nachdem der Kunde hangup erkannt wird, bevor es tatsächlich angemeldet ist und der Kunde optional 3-Wege-Hangup-Aktion ausgeführt wird. Die Standardeinstellung ist 5 Sekunden. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_action"> + <BR> + <B>Kunde 3-Wege-Hangup Aktion -</B> Wenn der Kunde 3-Wege-Protokollierung aktiviert ist, können Sie mit dieser Option haben die Agenten-Bildschirm automatisch auflegen auf den Anruf und rufen Sie die DISPO Bildschirm, wenn diese Option, um DISPO eingestellt ist. Der Standardwert ist NONE. + <?php if ($SSqc_features_active > 0) { @@ -3983,6 +5541,31 @@ if ($ADD==99999) <BR> <B>Vtiger Status Call -</B> Wenn Vtiger Integration ist in den Systemeinstellungen aktivieren, dann wird diese Einstellung fest, ob der Status der vtiger-Konto mit dem Status der VICIDIAL Aufruf aktualisiert wird, nachdem es dispositioned worden ist. Der Standardwert ist N. + <BR> + <A NAME="vicidial_campaigns-queuemetrics_callstatus"> + <BR> + <B>QM CallStatus Override -</B> Wenn QueueMetrics Integration in den Systemeinstellungen aktiviert ist, wird diese Einstellung erlauben das vorrangige der System-Einstellungen die Einstellung für CallStatus queue_log Einträge. Der Standardwert ist DISABLED, welche den System-Einstellung verwenden. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>QM-Telefon Umwelt -</B> Wenn QueueMetrics Integration in den Systemeinstellungen aktiviert ist, wird diese Einstellung erlauben das Einfügen von Daten dieser Wert im Feld der data4 queue_log für Agententätigkeit Datensätze. Standard ist leer für Behinderte. + + <BR> + <A NAME="vicidial_campaigns-extension_appended_cidname"> + <BR> + <B>Erweiterung anhängen CID -</B> Wenn diese Option aktiviert, werden die Anrufe von dieser Kampagne platziert haben einen Raum und die Durchwahl des Agenten an das Ende des CallerID Name für den Anruf, bevor es an den Agenten gesendet wird. Standard ist für behinderte N. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>PLLB Gruppierung -</B> Telefon Einloggen Load Balancing Gruppierung, nur zulässig, wenn es mehrere Agent-Server sind und Telefon-Aliase sind auf dem System vorhanden. Bei der Einstellung ONE_SERVER_ONLY wird es erzwingen, dass alle Agenten für diese Kampagne, um auf den gleichen Server einloggen. Wenn in Cascading es in Agenten auf dem gleichen Server werden protokolliert Gruppe bis PLLB Gruppierung Anzahl der Agenten-Limit erreicht gesetzt sind, dann ist der nächste Agent wird an den nächsten Server mit der geringsten Anzahl von Agenten anmelden. Wenn der Maßstab Telefon Aliases Verhalten jedes Agenten Finden der Server mit der geringsten Anzahl von Nicht-Remote-Agenten hinein protokolliert Deaktiviert, um genutzt werden. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>PLLB Limit-Gruppierung -</B> Telefon Einloggen Load Balancing Verbund Limit. Wenn PLLB Gruppierung zu CASCADING eingestellt ist, dann wird diese Einstellung bestimmt die Anzahl der Agenten akzeptabel in jedem Server für diese Kampagne. Standard ist 50. + <BR> <A NAME="vicidial_campaigns-crm_popup_login"> <BR> @@ -4003,6 +5586,11 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> Diese Web-URL-Adresse wird nicht von den Agenten zu sehen, aber es ist, wann immer ein Anruf von einem Agenten dispositioned, wenn sie gefüllt wird. Verwendet die gleichen Variablen wie die Web-Formularfelder und Skripte. dispo und talk_time sind die Variablen, die Sie verwenden können, um den Agenten abrufen definierten Disposition für den Anruf und die tatsächliche Sprechzeit in Sekunden des Anrufs. Diese URL kann nicht ein relativer Pfad. Der Standardwert ist leer. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>Kein Anruf-Agent URL -</B> Diese Web-URL-Adresse wird nicht durch den Agenten zu sehen, aber wenn es gefüllt wird aufgerufen, wenn ein Ruf, der nicht von einem Agenten gehandhabt wird nach oben oder aufgehängt übertragen. Verwendet die gleichen Variablen wie die Web-Formular und Indexe verwenden. dispo kann verwendet werden, um die vom System vorgegebene Disposition für den Anruf abzurufen. Diese URL kann kein relativer Pfad sein. Standardeinstellung ist leer. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4038,13 +5626,28 @@ if ($ADD==99999) <BR> <B>Agent Pause nach jedem Anruf -</B> Diese Option, wenn auf Y wird der Agent Pause nach jedem Anruf automatisch. Der Standardwert ist N. + <BR> + <A NAME="vicidial_campaigns-blind_monitor_warning"> + <BR> + <B>Blinden-Monitor Warnung -</B> Diese Option aktiviert wird, wenn wir das Mittel in verschiedene optionale Möglichkeiten wissen, ob sie blind zu sein von jemandem überwacht werden. DISABLED bedeutet diese Funktion nicht aktiv ist, wird nur eingeblendet ALERT eine Warnung auf dem Bildschirm Agent, NOTICE wird eine Notiz, die sich bleibt auf dem Agent-Bildschirm, solange Theyâ Re überwachten veröffentlichen, wird der Ton spielen Sie den Dateinamen unten definiert, wenn ein Agent beginnt, überwacht werden und die anderen Optionen sind combibnations der oben genannten Optionen. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_message"> + <BR> + <B>Blinden-Monitor und Datenschutz -</B> Das ist die Botschaft, die auf dem Bildschirm zeigen Agent wird, während sie überwacht wird, wenn die Bekanntmachung Option ausgewählt ist. Die Standardeinstellung ist -Someone is blind monitoring your session-. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_filename"> + <BR> + <B>Blinden-Monitor Dateiname -</B> Dies ist der Audio-Datei, in der Agenten-Session zu Beginn der Überwachung jemand blinde ihnen zu spielen. Diese Aufforderung wird für jeden in der Sitzung mit dem Kunden, wenn eine vorhanden ist, gespielt werden. Standard ist leer. + <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_LISTENTABELLE</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTSTABELLE</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>Liste Identifikation -</B> Dieses ist der numerische Name der Liste,es ist nicht editable nach Ausgangsunterordnung, muß nur Zahlenenthalten und muß zwischen 2 und 8 Buchstaben lang sein. Must be a number greater than 100. @@ -4108,11 +5711,26 @@ if ($ADD==99999) <BR> <B>Drop Inbound-Fraktion Override -</B> Ist dieses Feld gesetzt ist, in dieser Gruppe wird für ausgehende Anrufe, in dieser Liste verwendet werden, die Tropfen aus dem Outbound-Kampagne statt der Drop-in in der Kampagne Detailbild gesetzt. Der Standardwert ist nicht gesetzt. + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Netz-Form Override - </ B> Das ist die benutzerdefinierte Adresse, dass beim Klicken auf dem Webformular-Button in jeder leisten bringt Sie zur Seite für Anrufe, die in dieser Liste kommen. Wenn Sie benutzerdefinierte Felder in einem Web-Formular-Adresse verwenden möchten, müssen Sie hinzufügen &CF_uses_custom_fields=Y als Teil der URL. + <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>Xfer-Conf-Nr Override -</B> Diese fünf Felder ermöglichen Sie den Transfer Conference Anzahl Presets zu überschreiben, wenn das Blei aus dieser Liste. Der Standardwert ist leer. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Inventory Report -</B> Wenn das Inventory Report auf Ihrem System aktiviert ist, wird diese Option entscheiden, ob diese Liste in den Bericht aufgenommen wird oder nicht. Die Standardeinstellung ist J für Ja. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Zeitzonen-Einstellung -</B> Diese Option ermöglicht es Ihnen, die Methode der Aufrechterhaltung der aktuellen Zeitzone Nachschlag für die Leitungen innerhalb dieser Liste gesetzt. Dieser Prozess wird nur in der Nacht geschehen ist werden die Änderungen nicht in der unmittelbaren. COUNTRY_AND_AREA_CODE ist die Standardeinstellung und wird die Landes-und Ortsvorwahl der Telefonnummer verwenden, um die Zeitzone des Bleis bestimmen. POSTAL_CODE verwenden die Postleitzahl falls vorhanden die Zeitzone des Bleis zu bestimmen. NANPA_PREFIX funktioniert nur in den USA und wird die Vorwahl und die Vorwahl der Telefonnummer verwenden, um die Zeitzone des Bleis bestimmen, aber dies ist nicht standardmäßig im System aktiviert, so dass Sie sicher, Sie haben die NANPA Präfix Daten verladen Ihr System, bevor Sie diese Option auswählen. OWNER_TIME_ZONE_CODE wird die Standard-Zeitzone abbraviation in das Feld Besitzer des Blei beladen benutzen, um die Zeitzone zu bestimmen, in den USA Beispiele sind AST, EST, CST, MST, PST, AKST, HST. Dieses Leistungsmerkmal muss von Ihrem Systemadministrator aktiviert werden, um in Kraft treten. + <BR> <A NAME="vicidial_list-dnc"> @@ -4143,10 +5761,20 @@ if ($ADD==99999) <BR> <B>Aktiv -</B> Dieses stellt fest, ob diese Gruppe oben imVorwählerkasten wenn Maschinenbordbücher eines VICIDIAL Mittelsinnen zeigen. + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Inbound-Gruppe, ermöglicht diese Admin Betrachten dieser in-group von Benutzergruppe beschränkt. Standard ist - ALLE -, die jeder Benutzer admin, dies in-group sehen können. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>In-Group Calldate -</B> Dies ist das letzte Datum und die Zeit, dass ein Anruf auf diese Gruppe gerichtet war Inbound. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Netz-Form -</B> Dieses ist die kundenspezifische Adresse, die dasKlicken auf der NETZ-FORM-Taste in VICIDIAL Ihnen für zu den Anrufennimmt, die auf diese Gruppe hereinkommen. + <B>Netz-Form -</B> Dieses ist die kundenspezifische Adresse, die dasKlicken auf der NETZ-FORM-Taste in VICIDIAL Ihnen für zu den Anrufennimmt, die auf diese Gruppe hereinkommen. Wenn Sie benutzerdefinierte Felder in einem Web-Formular-Adresse verwenden möchten, müssen Sie hinzufügen &CF_uses_custom_fields=Y als Teil der URL. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4155,14 +5783,30 @@ if ($ADD==99999) <BR>   - random: Aufträge durch den gelegentlichen Updatewert in dervicidial_live_agents Tabelle <BR>   - oldest_call_start: Aufträge bis zum dem letzten Mal ein Mittel wurden einem Anrufgeschickt. Resultate in den Mitteln, die insgesamt ungefähr gleicheZahl von Anrufen empfangen. <BR>   - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. + <BR>   - oldest_inbound_call_start: Aufträge von der letzten Zeit wurde ein Agent einen eingehenden Anruf gesendet. Ergebnisse in Agenten erhalten etwa die gleiche Anzahl der Anrufe insgesamt. + <BR>   - oldest_inbound_call_finish: Bestellungen durch das letzte Mal ein Agent beendet einen eingehenden Anruf. AKA-Agent wartet am längsten erhält ersten nennen. <BR>   - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. <BR>   - inbound_group_rank: Aufträge durch den Rank gegeben zum Mittel fürdie spezifische inbound Gruppe. Stark zu am niedrigsten. - <BR>   - fewest_calls: Aufträge durch die Zahl den Anrufen empfangen durch einMittel für diese spezifische inbound Gruppe. Wenige Anrufe zuerst. <BR>   - campaign_rank: Aufträge durch den Rank gegeben zum Mittel für dieKampagne. Stark zu am niedrigsten. + <BR>   - ingroup_grade_random: ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten durch in-group. + <BR>   - campaign_grade_random: ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten von Kampagne. + <BR>   - fewest_calls: Aufträge durch die Zahl den Anrufen empfangen durch einMittel für diese spezifische inbound Gruppe. Wenige Anrufe zuerst. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: Bestellungen durch die Zeit, die Agenten aktiv gewartet auf einen Anruf. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> HINWEISE: Für ring_all, die Agenten, die mit Handys, die über Hook-Agent aktiviert haben, werden ihre Telefone klingeln und der erste, der auf die Forderung und die Informationen auf dem Bildschirm Agenten erhalten haben. Seit ring_all ignoriert Agent Wartezeit und das Ranking und wird alle Mittel, die für die Warteschlange ist anzurufen, empfehlen wir nicht mit dieser Methode für große Warteschlangen. Bei der Verwendung von ring_all werden Agenten mit Telefonen, die das Aufgelegt-Agent deaktiviert angemeldet haben müssen, um die Anrufe in Warteschlange Panel verwenden und klicken Sie auf den Link zum Gespräch annehmen Anrufe in der Warteschlange zu nehmen. Die Zeit, die Agenten-Telefon für ring_all klingelt an die On-Hakenring Zeiteinstellung oder der kürzesten Zeit Ring der Telefone, die aufgerufen wird eingestellt. Wir empfehlen nicht die Verwendung ring_all auf hohem Anrufvolumen Warteschlangen oder Warteschlangen mit vielen Agenten. Die ring_all Methode soll mit nur wenigen Mitteln und auf niedrigem Gesprächsaufkommen in-Gruppen verwendet werden. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>On-Hakenring Zeit -</B> Diese Option wird nur für Agenten, die in Handys, die mit den Agenten-On-Hook-Funktion aktiviert haben, werden protokolliert verwendet. Dies ist die Anzahl der Sekunden, dass jeder Anrufversuch an den Agent wird für das System wird bis 1 Sekunde warten und klingeln die Telefone verfügbaren Agenten erneut ertönen. Dieses Feld kann überschrieben werden, wenn die Agenten-Telefone zu einem unteren Ring der Zeit, die notwendig sein, um Anrufe von Telefonen gesendet werden ein Voicemail verhindern kann eingestellt werden. Die Standardeinstellung ist 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>On-Haken CID -</B> Diese Option wird nur für Agenten, die in Handys, die mit den Agenten-On-Hook-Funktion aktiviert haben, werden protokolliert verwendet. Dies ist die Anrufer-ID zeigen sich nicht auf ihren Agenten Handys, wenn die Anrufe klingeln. GENERIC ist eine generische RINGAGENT00000000001 Art der Benachrichtigung. Eigengruppe wird zeigen, nur die in-group der Anruf kam. CUSTOMER_PHONE zeigt nur den Kunden Telefonnummer. CUSTOMER_PHONE_RINGMITTELwird RINGAGENT_3125551212 mit dem RINGMITTELals Teil des CID mit dem Kunden Rufnummer zu erhalten. CUSTOMER_PHONE_INGROUP zeigt die ersten 10 Zeichen des In-Group durch den Kunden Telefonnummer gefolgt. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4177,10 +5821,15 @@ if ($ADD==99999) <BR> <B>Kampagne Index -</B> Dieses Menü erlaubt Ihnen, den Index zu wählen,der auf dem Mittelschirm für diese Kampagne erscheint. Wählen SieKEINE vor, keinen Index für diese Kampagne zu zeigen. + <BR> + <A NAME="vicidial_inbound_groups-ignore_list_script_override"> + <BR> + <B>Ignorieren-Liste Script Override-</B> Diese Option ermöglicht es Ihnen, die Liste ID Script Override-Option für Anrufe kommen in dieser In-Group zu ignorieren. Wenn Sie dieses auf Y ignoriert dann sämtliche Listen-ID Script-Einstellungen. Standard ist N. + <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Erhalten Sie Anruf-Produkteinführung -</B> Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. + <B>Erhalten Sie Anruf-Produkteinführung -</B> Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. Wenn benutzerdefinierte Liste Felder auf Ihrem System aktiviert sind, bilden die Registerkarte Formular bei der Verbindung eines Anrufs öffnen, um einen Agenten. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4190,7 +5839,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Timer-Aktion -</B> Mit dieser Funktion können Sie die Aktionen nach einer bestimmten Zeit auslösen. D1 und D2 DIAL Optionen werden einen Aufruf der Transfer Conference Anzahl Presets starten und senden sie an die Agenten-Sitzung wird dies in der Regel für einfache IVR Validierung AGI-Anwendungen oder nur eine vorher aufgenommene Nachricht zu spielen verwendet. WebForm öffnet sich das Web-Formular-Adresse. MESSAGE_ONLY wird einfach Anzeige die Meldung, dass unten in das Feld ist. Niemand wird diese Funktion zu deaktivieren und ist der Standard -. Diese Einstellung überschreibt die Kampagne Einstellungen. + <B>Timer-Aktion -</B> Mit dieser Funktion können Sie die Aktionen nach einer bestimmten Zeit auslösen. D1 und D2 DIAL Optionen werden einen Aufruf der Transfer Conference Anzahl Presets starten und senden sie an die Agenten-Sitzung wird dies in der Regel für einfache IVR Validierung AGI-Anwendungen oder nur eine vorher aufgenommene Nachricht zu spielen verwendet. WebForm öffnet sich das Web-Formular-Adresse. MESSAGE_ONLY wird einfach Anzeige die Meldung, dass unten in das Feld ist. Niemand wird diese Funktion zu deaktivieren und ist der Standard -. Diese Einstellung überschreibt die Kampagne Einstellungen. HANGUP hängen bleiben wird das Gespräch, wenn der Timer ausgelöst wird, wird CALLMENU den Anruf an den Anruf-Timer-Menü im Feld Ziel angegeben Aktion zu senden, EXTENSION, wird der Anruf an die Erweiterung, die in der Timer-Aktion Feld Ziel angegeben wird, zu senden, wird IN_GROUP senden der Aufruf an die In-Group in den Timer-Aktion Feld Ziel angegeben. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4202,6 +5851,11 @@ if ($ADD==99999) <BR> <B>Timer-Aktion Sekunden -</B> Dies ist die Zeit nach dem Anruf des Kunden, dass die Timer-Aktion wird ausgelöst, verbunden. Der Standardwert ist -1, die auch inaktiv. + <BR> + <A NAME="vicidial_inbound_groups-timer_action_destination"> + <BR> + <B>Timer-Aktion Reiseziel -</B> Dieses Feld ist, wo Sie das Call-Menü, Erweiterung oder In-Group angeben, dass Sie den Anruf an, wenn die Zeit Aktion zu CALLMENU, Erweiterung oder IN_GROUP eingestellt werden soll. Standard ist leer. + <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> @@ -4215,18 +5869,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Drop-Erweiterung - </B> Wenn Drop-Aktion ist auf MESSAGE Dies ist der Plan wählen, dass sich die Aufforderung an, wenn sie erreicht Drop Call Sekunden. + <B>Drop-Erweiterung - </B> Wenn Drop-Aktion ist auf MESSAGE Dies ist der Plan wählen, dass sich die Aufforderung an, wenn sie erreicht Drop Call Sekunden. Für in-Gruppen AGENTDIRECT, wenn der Benutzer nicht verfügbar ist, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>Voicemail -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + <B>Voicemail -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Drop-Transfer-Fraktion - </B> Wenn Drop-Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie erreicht Drop Call Sekunden. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Drop-Call-Menü -</B> Wenn Drop-Aktion zu CALLMENU gesetzt ist, wird der Anruf mit dieser Aufforderung Menü geschickt werden, wenn sie auf Anruf beenden Sekunden erreicht. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Aktion Transfer-CID -</B> Wird für Tropfen, Afterhours und No-Agent-no-Warteschlange Aktionen. Dies ist die Anrufer-ID-Nummer, dass der Anruf, bevor es zu Erweiterungen, Nachrichten, Voicemail-oder Call-Menüs übertragen wird, verwendet. Sie können Kunden in diesem Bereich nutzen, um dem Kunden die Telefonnummer oder Kampagne zu verwenden, um die erste Kampagne erlaubte Anrufer-ID-Nummer zu verwenden. Die Standardeinstellung ist KUNDEN. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4245,22 +5909,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Nach Stunden Verlängerung - die dialplan Verlängerung, zum desAnrufs zu senden, wenn die Tätigkeit auf VERLÄNGERUNG eingestelltwird. Rückstellung ist 8300. + <B>Nach Stunden Verlängerung - die dialplan Verlängerung, zum desAnrufs zu senden, wenn die Tätigkeit auf VERLÄNGERUNG eingestelltwird. Rückstellung ist 8300. Für in-Gruppen AGENTDIRECT, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Nach Stunden Voicemail - der voicemail Kasten, zum des Anrufs zusenden, wenn die Tätigkeit auf VOICEMAIL eingestellt wird. + <B>Nach Stunden Voicemail - der voicemail Kasten, zum des Anrufs zusenden, wenn die Tätigkeit auf VOICEMAIL eingestellt wird. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>After Hours Transfer Group - </B>, wenn After Hours Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie die in der Gruppe außerhalb der Aufforderung zur Einreichung von Zeitplanung für die in-group. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>After Hours Call-Menü -</B> Wenn After Hours Aktion zu CALLMENU gesetzt ist, wird der Anruf an diesem Call-Menü geschickt werden, wenn sie die in-group außerhalb des Bereitschaftsdienstes Schema für die in-group definiert betritt. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>Nr. Bevollmächtigte Nr. Queueing -</B> Ist dieses Feld auf Y oder NO_PAUSED dann keine Anrufe in die Warteschlange für diese in-Gruppe gesetzt werden, wenn es keine Agenten und die Forderungen angemeldet gehen an die Nr. Agent Nr. Queue Aktion sind. Die NO_PAUSED Option wird auch das Senden der Anrufer in der Warteschlange, wenn es nur angehalten Agenten in der in-group sind. Der Standardwert ist N. + <B>Nr. Bevollmächtigte Nr. Queueing -</B> Ist dieses Feld auf Y oder NO_PAUSED dann keine Anrufe in die Warteschlange für diese in-Gruppe gesetzt werden, wenn es keine Agenten und die Forderungen angemeldet gehen an die Nr. Agent Nr. Queue Aktion sind. Die NO_PAUSED Option wird auch das Senden der Anrufer in der Warteschlange, wenn es nur angehalten Agenten in der in-group sind. Der Standardwert ist N. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen. Sie können auch AGENTEXT in diesem Bereich, wenn es um Infusionsleitung ist und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -4272,6 +5941,21 @@ if ($ADD==99999) <BR> <B>Kein Agent Nr. Queue Preis-Aktion -</B> Dies ist der Wert für die Aktion vor. Der Standardwert ist nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Max ruft die Methode -</B> Diese Option kann damit die maximale gleichzeitige Anrufe für diese Funktion in-group. Bei der Einstellung TOTAL, dann ist die Gesamtzahl der Anrufe von Agenten in der Warteschlange und in dieser in-group gehandhabt wird nicht gestattet, das Max-Calls Graf Anzahl der Zeilen wie unten definiert überschreiten werden. Wenn zu IN_QUEUE gesetzt ist, dann, wenn die Anzahl der Anrufe in der Warteschlange für die Agenten nicht erlaubt wird, den Max überschreiten werden Calls Graf, egal wie viele Anrufe sind mit Agenten für diese in-group. Der Standardwert ist DISABLED. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Max ruft Graf -</B> Diese Option muss gesetzt höher als 0 sein, wenn Sie mit der MAX-Funktion ruft die Methode wollen. Standard ist 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Max ruft Aktion -</B> Dies ist der zu treffenden Maßnahme, wenn der Max ruft die Methode aktiviert ist und die Anzahl der Anrufe übersteigt, was oben in der Max-Calls gesetzt Count-Einstellung sein. Die Anrufe über diesen Betrag wird entweder mit dem Drop-Aktion, die Afterhours Aktion oder der NO_AGENT_NO_QUEUE Aktion geschickt werden und werden als MAXCAL Status mit einem MaxCalls hangup Grund angemeldet sein. Die Standardeinstellung ist NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -4297,6 +5981,16 @@ if ($ADD==99999) <BR> <B>Auf Einfluß-Aufforderung Abstand - die Zeitspanne in den Sekunden, zuwarten, bevor an die haltenaufforderung gespielt wird. Rückstellungist 60. So deaktivieren Sie die On-Hold-Prompt, das Intervall auf 0. + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> + <BR> + <B>Hold On Prompt keine Block -</B> Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf in die Warteschleife, wo die Eingabeaufforderung zu spielen, um an einen Agenten gehen, wenn man zur Verfügung steht, während die Nachricht abgespielt wird. Während die On Hold Prompt Filename Nachricht an einen Kunden spielt sie können nicht an einen Agenten geschickt werden. Standard ist N. + + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> + <BR> + <B>Hold On Prompt Sekunden -</B> Dieses Feld muss auf die Anzahl der Sekunden, die das On Hold Prompt Dateiname spielt für eingestellt werden. Standard ist 10. + <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> <BR> @@ -4307,35 +6001,160 @@ if ($ADD==99999) <BR> <B>Jetzt Geschätzte Hold Time - </B> Diese legt fest, ob die Anrufer hören, halten Sie die geschätzte Zeit, bevor sie übertragen werden, zu einem Makler. Der Standardwert ist N. Wenn der Kunde gehalten wird, und hört diese geschätzte hold time Nachricht, die Mindestzeit, die abgespielt werden soll 15 Sekunden. + <BR> + <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> + <BR> + <B>Berechnen Sie Geschätzte Hold-Sekunden -</B> Dies definiert die Anzahl der Sekunden in der Warteschlange, die der Kunde wartet vor der voraussichtlichen Hold Time wird berechnet und optional gespielt. Minimum beträgt 3 Sekunden, auch wenn weniger als 3 gesetzt. Standard ist 0. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> + <BR> + <B>Geschätzte Mindest-Haltezeit Dateiname -</B> Wenn der geschätzte Hold Time ist aktiv und es wird berechnet, um am oder unter dem Minimum von 15 Sekunden sein, dann ist dies prompt Datei wird anstelle des Standard-Ankündigung abgespielt. Standardwert ist Empty für inaktive. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> + <BR> + <B>Geschätzte Mindest-Haltezeit Prompt keine Block -</B> Wenn Geschätzte Hold Time aktiv ist und die geschätzte Hold Time Minimum Feld Dateiname oben ist ausgefüllt, dann ist diese Option für Anrufe in der Schlange hinter einem Anruf, wo die Eingabeaufforderung zu spielen, um an einen Agenten gehen, wenn man zur Verfügung stehen wird, während die Nachricht abgespielt wird erlauben . Während die Eingabeaufforderung an einen Kunden spielt sie nicht an einen Agenten gesendet werden. Standard ist N. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> + <BR> + <B>Geschätzte Mindest-Haltezeit Prompt Sekunden -</B> Dieses Feld muss auf die Anzahl der Sekunden, dass die geschätzte Hold Time Minimum Dateiname Eingabeaufforderung für spielt eingestellt werden. Standard ist 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option"> + <BR> + <B>Wait Time Option -</B> Dies ermöglicht Ihnen, den Kunden Möglichkeiten, um die Warteschlange zu verlassen, wenn ihre Wartezeit ist über die Anzahl der Sekunden unten angegeben. Standardwert ist NONE. Wenn einer der PRESS_ Optionen gewählt wird, wird es spielen die Presse Dateiname unten definiert und geben dem Kunden die Möglichkeit, ein auf ihrem Handy drücken, um die Warteschlange zu verlassen, und führen Sie die gewählte Option. Die PRESS_STAY Option wird den Kunden zurück in die Warteschlange zu senden, ohne dabei ihren Platz in der Linie. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_second_option"> + <BR> + <B>Wartezeit Zweite Option -</B> Gleiche wie die erste Option Wait Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 2 zu prüfen. Standardwert ist NONE. Wenn keine Wartezeit erste Option gewählt dann ist diese Option nicht angeboten werden. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_third_option"> + <BR> + <B>Wartezeit Third Option -</B> Gleiche wie die erste Option Wait Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 3 zu überprüfen. Standardwert ist NONE. Wenn keine zweite Wartezeit Option ausgewählt wird dann diese Option nicht angeboten werden. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> + <BR> + <B>Wait Time Option Sekunden -</B> Wenn Wartezeit Option, um alles andere als NONE gesetzt ist, ist dies die Anzahl der Sekunden, dass der Kunde in der Warteschleife gewartet, dass die Wartezeit Optionen auslösen wird. Standardwert ist 120 Sekunden. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_exten"> + <BR> + <B>Wait Time Option Erweiterung -</B> Wenn Wartezeit Option auf PRESS_EXTEN, ist dies der Dialplan-Erweiterung, dass der Aufruf gesendet werden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt. Für in-Gruppen AGENTDIRECT, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> + <BR> + <B>Wait Time Option Callmenu -</B> Wenn Wartezeit Option zum PRESS_CALLMENU gesetzt wird, ist dies das Menü Anruf, dass der Aufruf gesendet werden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> + <BR> + <B>Wait Time Option Voicemail -</B> Wenn Wartezeit Option auf PRESS_VMAIL, ist dies der Voicemail-Box, dass der Aufruf, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt wird gesendet. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> + <BR> + <B>Wait Time Option Transfer-In-Group -</B> Wenn Wartezeit Option zum PRESS_INGROUP gesetzt wird, ist dies die Gruppe, dass der eingehende Anruf wird weiterverbunden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> + <BR> + <B>Wait Time Option Drücken Dateiname -</B> Wenn Wartezeit Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die gespielt wird, wenn der Kunde Wartezeit überschreitet die Wartezeit Option Seconds to geben dem Kunden die Option auf 1, 2 oder 3 auf ihrem Handy drücken, um laufen die ausgewählten Wartezeit Drücken Sie Optionen. Es ist sehr wichtig, dass Sie Optionen in der Audiodatei für alle Ihre ausgewählten Wait Time-Optionen, und dass die Audiodatei in Sekunden Länge ist richtig in das Feld Dateiname Sekunden unten definiert oder wird es Probleme geben sind. Standard ist zu-sein-als-back. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> + <BR> + <B>Wait Time Option Presse keine Block -</B> Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf, wo die Wartezeit Option Dateiname Presse prompt zu spielen, um an einen Agenten zu gehen, wenn einer verfügbar wird, während die Nachricht abgespielt wird. Während die Wartezeit Option Drücken Dateiname Nachricht an einen Kunden spielt sie nicht an einen Agenten gesendet werden. Standard ist N. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> + <BR> + <B>Wait Time Option Drücken Dateiname Sekunden -</B> Dieses Feld muss auf die Anzahl der Sekunden, die Wartezeit Option Dateiname spielt für Presse eingestellt werden. Standard ist 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> + <BR> + <B>Wait Time Option Nach dem Drücken Dateiname -</B> Wenn Wartezeit Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die spielten, nachdem der Kunde 1, 2 oder 3 gedrückt hat, wird. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> + <BR> + <B>Wait Time Option Rückruf-Liste-ID -</B> Wenn Wartezeit Option zum PRESS_CID_CALLBACK gesetzt wird, ist dies die ID-Liste der Aufruf wird als neuer Lead hinzugefügt, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt. + + <BR> + <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> + <BR> + <B>Warten Halten Sie die Wahltaste Priorität -</B> Wenn beide Optionen Geschätzte Hold Time und Wartezeit Optionen aktiv sind, wird diese Einstellung festlegen, ob eine, das andere oder beide dieser Funktionen aktiv sind. Zum Beispiel, wenn der geschätzte Hold Time Option auf 360 gesetzt ist, die Wartezeit Option auf 120 gesetzt und der Kunde hat für 120 Sekunden gewartet und es gibt noch schätzungsweise 400 Sekunden Haltezeit, dann sind sie beide zur gleichen Zeit aktiv sein und diese Einstellung wird überprüft, um zu sehen, welche Möglichkeiten angeboten werden soll. Standard ist nur WAIT. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Hold Time Option - </B> Auf diese Weise können Sie die Weiterleitung von den Anruf halten, wenn die geschätzte Zeit über dem Betrag von Sekunden aus. Der Standardwert ist KEINE. + <B>Geschätzte Hold Time Option - </B> Auf diese Weise können Sie die Weiterleitung von den Anruf halten, wenn die geschätzte Zeit über dem Betrag von Sekunden aus. Der Standardwert ist KEINE. Wenn einer der PRESS_ Optionen gewählt wird, wird es spielen die Presse Dateiname unten definiert und geben dem Kunden die Möglichkeit, ein auf ihrem Handy drücken, um die Warteschlange zu verlassen, und führen Sie die gewählte Option. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_second_option"> + <BR> + <B>Hold Time Zweite Option -</B> Gleiche wie die erste Option Hold Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 2 zu prüfen. Standardwert ist NONE. Wenn kein erster Hold Time Option gewählt dann ist diese Option nicht angeboten werden. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_third_option"> + <BR> + <B>Hold Time Third Option -</B> Gleiche wie die erste Option Hold Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 3 zu überprüfen. Standardwert ist NONE. Wenn kein Sekunden Haltezeit Option gewählt dann ist diese Option nicht angeboten werden. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> <BR> <B>Hold Time Option Sekunden - </B> Wenn Hold Time-Option ist gesetzt, was aber keiner, das ist die Anzahl der Sekunden des geschätzten halten auslösen wird Zeit, dass die Hold-Zeit-Option. Der Standardwert ist 360 Sekunden. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> + <BR> + <B>Hold Time Option in einer Mindestharmonisierung -</B> Wenn Hold Time Option aktiviert, ist dies die minimale Anzahl von Sekunden der Anruf warten muss, bevor es mit der Haltezeit Option vorgestellt werden. Die Haltezeit Option wird sofort zu diesem Zeitpunkt vorgelegt werden, wenn der geschätzte Haltezeit ist größer als die Haltezeit Option Sekunden-Wert. Standardwert ist 0 Sekunden. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Hold Time Option Extension - </B> Wenn Hold Time-Option auf Verlängerung, ist dies die dialplan, dass sich die Aufforderung an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + <B>Hold Time Option Extension - </B> Wenn Hold Time-Option auf Verlängerung, ist dies die dialplan, dass sich die Aufforderung an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. Für in-Gruppen AGENTDIRECT, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> + <BR> + <B>Hold Time Option Callmenu -</B> Wenn Hold Time Option zum CALL_MENU gesetzt wird, ist dies das Menü Anruf, dass der Aufruf gesendet werden, wenn der geschätzte Haltezeit übersteigt die Haltezeit Option Sekunden. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>Hold Time Option Voicemail - </B> Wenn Hold Time auf Voicemail, das ist die Voice-Mailbox, dass der Anruf an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + <B>Hold Time Option Voicemail - </B> Wenn Hold Time auf Voicemail, das ist die Voice-Mailbox, dass der Anruf an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> <BR> <B>Hold Time Option Transfer In-Group - </B> Wenn Hold Time-Option ist auf IN_GROUP, das ist die Gruppe, dass die eingehenden Anruf werden, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> + <BR> + <B>Hold Time Option Drücken Dateiname -</B> Wenn Hold Time Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die gespielt wird, wenn der geschätzte Haltezeit übersteigt die Haltezeit Option Sekunden, um den Kunden die Möglichkeit, ein auf ihrem Handy drücken, um das ausgewählte Hold Time laufen Drücken Sie Option. Es ist sehr wichtig, dass diese Audio-Datei 10 Sekunden oder weniger ist oder wird es Probleme geben. Standard ist zu-sein-als-back. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> + <BR> + <B>Hold Time Option Presse keine Block -</B> Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf, wo die Hold Time Option Dateiname Presse prompt zu spielen, um an einen Agenten zu gehen, wenn einer verfügbar wird, während die Nachricht abgespielt wird. Während die Hold Time Option Drücken Filename Nachricht an einen Kunden spielt sie können nicht an einen Agenten geschickt werden. Standard ist N. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> + <BR> + <B>Hold Time Option Drücken Dateiname Sekunden -</B> Dieses Feld muss auf die Anzahl der Sekunden, die Hold Time Option Dateiname spielt für Presse eingestellt werden. Standard ist 10. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Hold Time Option Rückruf Dateiname - </B> Wenn Hold Time-Option ist auf CALLERID_CALLBACK, Dies ist der Dateiname ein, dass gespielt wird, bevor der Anruf wird protokolliert, als eine neue dazu führen, dass die ID-Liste unten, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + <B>Hold Time Option Nach dem Drücken Dateiname -</B> Wenn Hold Time Option auf eine der Optionen oder PRESS_ CALLERID_CALLBACK gesetzt wird, ist dies der Dateiname Eingabeaufforderung, die spielten, nachdem der Kunde 1 gedrückt wurde oder wird der Anruf an die Callback-Liste hinzugefügt. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -4365,7 +6184,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>In-Group-Aufnahme Dateiname - </B> Mit diesem Feld werden die Aufnahme der Kampagne Dateibenennungsschemata Regelung, es sei denn, es ist auf Keine eingestellt. Die Variablen sind erlaubt KAMPAGNE CUSTPHONE FullDate TINYDATE EPOCH AGENT. Der Standardwert ist FULLDATE_MITTELund würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, die wie folgt aussehen TESTCAMP_51020103108_3125551212. 50 Zeichen max. Der Standardwert ist KEINE. + <B>In-Group Recording Filename -</B> This field will override the Kampagne Aufnahme Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH MITTELVENDORLEADCODE LEADID. Der Standardwert ist FULLDATE_MITTELund würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE das so aussehen würde TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -4434,11 +6253,35 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. + <BR> + <A NAME="vicidial_inbound_groups-add_lead_url"> + <BR> + <B>Fügen Sie führen zur URL -</B> Diese Web-URL-Adresse wird nicht durch den Agenten gesehen, aber es wird immer dann aufgerufen, eine Leitung mit dem System über den eingehenden zugegeben wird. Standardeinstellung ist leer. Sie müssen diese URL mit VAR beginnen, wenn Sie Variablen verwenden möchten, und natürlich - A - und - B - rund um die eigentliche Variable in der URL, wo Sie sie benutzen wollen. Hier ist die Liste der Variablen, die verfügbar sind für diese Funktion. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>Kein Anruf-Agent URL -</B> Diese Web-URL-Adresse wird nicht durch den Agenten zu sehen, aber wenn es gefüllt wird aufgerufen, wenn ein Ruf, der nicht von einem Agenten gehandhabt wird nach oben oder aufgehängt übertragen. Verwendet die gleichen Variablen wie die Web-Formular und Indexe verwenden. dispo kann verwendet werden, um die vom System vorgegebene Disposition für den Anruf abzurufen. Diese URL kann kein relativer Pfad sein. Standardeinstellung ist leer. + <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> <BR> <B>Standard-Fraktion Alias - </B> Wenn Sie erlaubt Gruppe Aliases für die Kampagne, dass der Agent angemeldet ist, dann ist dies in der Gruppe ist, dass Alias zuerst ausgewählten standardmäßig auf einen Anruf, die von dieser Gruppe, wenn die Inbound-Agent dafür, Verwendung eines Alias-Fraktion für einen ausgehenden Anruf Handbuch. Der Standardwert ist Keine oder leer. + <BR> + <A NAME="vicidial_inbound_groups-extension_appended_cidname"> + <BR> + <B>Erweiterung anhängen CID -</B> Wenn aktiviert, kommen die Anrufe in ins In-Gruppe wird eine Raum und die Durchwahl des Mittels an das Ende des CallerID Namen für den Anruf, bevor es an den Agenten gesendet wird. Standard ist für behinderte N. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_display"> + <BR> + <B>UniqueId Statusanzeige -</B> Wenn aktiviert, wenn ein Agent einen Anruf erhält durch diese In-Group werden sie sehen den uniqueid des Anrufs hinzugefügt, um die Status-Zeile in ihrer Agent-Interface. Die Option Präfix wird das Präfix definiert Schlag auf den Beginn des uniqueid in der Anzeige. Der Standardwert ist DISABLED. Wenn es bereits eine UniqueId auf einen Anruf Betreten dieser in-Gruppe definiert, wird die ursprüngliche uniqueid wird angezeigt. Wenn die Option preserve verwendet wird und der Anruf wird zu einem zweiten Agenten, der uniqueid gesendet und Präfix zu dem ersten Agenten angezeigt wird auch an den zweiten Agenten angezeigt werden. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> + <BR> + <B>UniqueId Status-Prefix -</B> Wenn PREFIX Option ausgewählt wird dann oben das ist der Wert dieses Präfix. Standard ist leer. @@ -4461,11 +6304,21 @@ if ($ADD==99999) <BR> <B>DID-Aktive - </B> Das ist der Bereich, in dem Sie die DID Eintrag aktiv oder nicht. Der Standardwert ist Y. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das hat, ermöglicht diese Betrachtung von Admin dies durch Nutzergruppe hat beschränkt. Standard ist - ALLE -, die jeder Benutzer admin an, um dieses tat erlaubt. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> <B>DID-Route - </B> Diese Art der Route, die Sie der DID zu verwenden. Verlängerung wird ersucht, um die Erweiterung in unten, Voicemail senden Anrufe direkt an die Voicemail-Box eingetragen unter, der Agent wird Gespräche auf eine VICIDIAL Agenten, wenn sie angemeldet sind, TEL wird der Anruf zu einem ausgewählten Eintrag Telefone unter, IN_GROUP wird Senden Sie Anrufe direkt auf die angegebene Inbound-Gruppe. Standard ist die Erweiterung. CALLMENU wird der Anruf an die definierten Ruf-Menü. + <BR> + <A NAME="vicidial_inbound_dids-record_call"> + <BR> + <B>Anruf aufzeichnen -</B> Diese Option ermöglicht es Ihnen, die Anrufe kommen in diese DID aufgezeichnet werden eingestellt. Y wird die gesamte Anruf aufzeichnen, wird Y_QUEUESTOP das Gespräch mitschneiden, bis der Anruf ist hungup oder tritt in eine Warteschlange in-group, N nimmt nicht auf den Anruf. Die Standardeinstellung ist N. + <BR> <A NAME="vicidial_inbound_dids-extension"> <BR> @@ -4519,7 +6372,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> Wenn IN_GROUP ist wie die DID-Route ausgewählt, dann ist dies die Anrufannahme-Methode für diese Anrufe verwendet. CID wird eine neue Lead-Datensatz mit jedem Anruf mit der CallerID wie die Telefonnummer hinzufügen, wird CIDLOOKUP Versuch, die Telefonnummer, unter der CallerID im gesamten System-Lookup wird CIDLOOKUPRL Versuch, die Telefonnummer, unter der CallerID nur in einer speziellen Liste Lookup , wird CIDLOOKUPRC Versuch, die Telefonnummer, unter der CallerID in allen Listen, die auf die angegebene Kampagne gehören Lookup, CLOSER ist für VICIDIAL Closer fordert angegeben, wird eine neue ANI führen Datensatz hinzufügen bei jedem Anruf mit der ANI wie die Telefonnummer, ANILOOKUP wird versuchen, die Telefonnummer, unter der ANI im gesamten System-Lookup wird ANILOOKUPRL Versuch, die Telefonnummer, unter der ANI nur in einer speziellen Liste Lookup wird XDIGITID der Anrufer von einem X-stelligen Code prompt vor dem Aufruf wird gestellt werden, in der Warteschlange, wird der Anrufer VIDPROMPT prompt für ihre ID-Nummer und eine neue Lead-Satz mit dem CallerID wie die Telefonnummer und die ID als die Hersteller-ID zu erstellen, wird VIDPROMPTLOOKUP Versuch, die ID in das gesamte System-Lookup wird VIDPROMPTLOOKUPRL Versuch, Lookup die Hersteller-ID von der ID nur in einer speziellen Liste, wird VIDPROMPTLOOKUPRC Versuch, den Anbieter von der Lookup-ID ID in allen Listen, die auf die angegebene Kampagne gehören. Der Standardwert ist CID. + <B>In-Group Call Handle-Methode -</B> Wenn IN_GROUP ist wie die DID-Route ausgewählt, dann ist dies die Anrufannahme-Methode für diese Anrufe verwendet. CID wird eine neue Lead-Datensatz mit jedem Anruf mit der CallerID wie die Telefonnummer hinzufügen, wird CIDLOOKUP Versuch, die Telefonnummer, unter der CallerID im gesamten System-Lookup wird CIDLOOKUPRL Versuch, die Telefonnummer, unter der CallerID nur in einer speziellen Liste Lookup , wird CIDLOOKUPRC Versuch, die Telefonnummer, unter der CallerID in allen Listen, die auf die angegebene Kampagne gehören Lookup, CLOSER ist für VICIDIAL Closer fordert angegeben, wird eine neue ANI führen Datensatz hinzufügen bei jedem Anruf mit der ANI wie die Telefonnummer, ANILOOKUP wird versuchen, die Telefonnummer, unter der ANI im gesamten System-Lookup wird ANILOOKUPRL Versuch, die Telefonnummer, unter der ANI nur in einer speziellen Liste Lookup wird XDIGITID der Anrufer von einem X-stelligen Code prompt vor dem Aufruf wird gestellt werden, in der Warteschlange, wird der Anrufer VIDPROMPT prompt für ihre ID-Nummer und eine neue Lead-Satz mit dem CallerID wie die Telefonnummer und die ID als die Hersteller-ID zu erstellen, wird VIDPROMPTLOOKUP Versuch, die ID in das gesamte System-Lookup wird VIDPROMPTLOOKUPRL Versuch, Lookup die Hersteller-ID von der ID nur in einer speziellen Liste, wird VIDPROMPTLOOKUPRC Versuch, den Anbieter von der Lookup-ID ID in allen Listen, die auf die angegebene Kampagne gehören. Der Standardwert ist CID. Wenn eine Methode mit CIDLOOKUP ALT verwendet wird, wird es die alt_phone Feld für die Telefonnummer zu suchen, wenn keine Übereinstimmung für die Haupt-Telefonnummer zu finden sind. Wenn eine Methode mit CIDLOOKUP ADDR3 verwendet wird, wird es die Address3 Feld für die Telefonnummer zu suchen, wenn keine Übereinstimmung für die Haupt-Telefonnummer und optional den alt_phone Bereich zu finden sind. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -4541,6 +6394,44 @@ if ($ADD==99999) <BR> <B>In-Group Telefon Code - </B> Wenn IN_GROUP ist als der DID-Route, dann ist das Telefon-Code verwendet, wenn eine neue Führung wird erstellt. + <BR> + <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> + <BR> + <B>Reinigen Sie CID-Nummer -</B> In diesem Feld können Sie eine Anzahl von Ziffern angeben, um den eingehenden Anrufer-ID-Nummer zu beschränken, indem sie ein R vor der Anzahl der Stellen, zum Beispiel um an die richtigen Stellen Sie in 10 R10 geben würde, zu beschränken. Sie können diese Funktion auch verwenden, um nur eine führende Ziffer oder Ziffern, indem sie ein L vor den spezifischen Ziffern, die Sie entfernen möchten, zum Beispiel, um eine 1 als erste Ziffer Sie in L1 geben würde entfernen zu entfernen. Standard ist leer. Wenn mehr als eine Regel angegeben wird sicherstellen, dass Sie trennen Sie diese mit einem Leerzeichen und dem R wird vor der Ausführung L. + + <BR> + <A NAME="vicidial_inbound_dids-filter_inbound_number"> + <BR> + <B>Filter Inbound-Nummer -</B> Diese Option, falls aktiviert können Sie Anrufe kommen in diese DID und schicken sie auf eine alternative Handlung, wenn sie eine Telefonnummer, die im Filter Phone Group oder einer URL-Antwort ist, wenn man ein so konfiguriert haben, passen zu filtern. Der Standardwert ist DISABLED. Gruppe wird in einem Filter-Phone-Gruppe zu finden. URL senden Sie eine URL und treffen zu, wenn eine 1 zurück gesendet wird. + + <BR> + <A NAME="vicidial_inbound_dids-filter_phone_group_id"> + <BR> + <B>Filter Phone Gruppe Identifikation -</B> Wenn der Filter Inbound Feld Nummer GRUPPE gesetzt ist, dann ist dies die ID des Filter-Phone Group, die haben ihre Zahlen gesucht auf der Suche nach einer Übereinstimmung mit dem Anrufer-ID-Nummer des eingehenden Anrufs wird. + + <BR> + <A NAME="vicidial_inbound_dids-filter_url"> + <BR> + <B>URL-Filter -</B> Wenn der Filter Inbound-Nummer Feld URL gesetzt ist, dann ist dies die Web-Adresse von einem Skript, das eine Remote-System zu suchen und zurück wird eine 1 für ein Spiel und eine 0 für kein Spiel. Nur zwei Variablen sind in der Adresse zur Verfügung, wenn Sie die VAR-Präfix wie mit Webformular-Adressen in Kampagnen zu nutzen, - A - phone_number - B - und - A - did_pattern - B - können in der URL verwendet werden auf die Anrufer-ID des Anrufers und zeigt die DID, dass der Kunde in aufgerufen. + + <BR> + <A NAME="vicidial_inbound_dids-filter_action"> + <BR> + <B>Filteraktion -</B> Wenn Filter Inbound-Nummer wird aktiviert und eine Übereinstimmung gefunden wird, dann ist dies die Aktion, die zu nehmen ist. Dies ist die gleiche wie die Route, die Sie wählen für eine DID, und die folgenden Einstellungen funktionieren genau wie sie es tun für eine Standard-Routing. + + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>Benutzerdefinierte Felder DID - </ B> Diese fünf Felder können für verschiedene Zwecke verwendet werden, vor allem in Bezug auf kundenspezifische Programmierung und Berichte. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID Remote Agent Erweiterung Overrides -</B><BR>Dieser Abschnitt erlaubt Ihnen, zu ermöglichen DIDs Erweiterung Überschreibungen für Remote-Agenten geroutet haben ruft durch in-Gruppen. Der Nutzer muss eine gültige Start-Remote-Agent User Anfang sein, oder wenn Sie die Erweiterung Überschreiben Eintrag für alle Anrufe zu arbeiten wollen, dann können Sie --- Alle --- in der User Feld Start. Wenn es mehrere Einträge für denselben DID und Benutzer starten dann die aktiven Einträge in einem Round-Robin-Verfahren verwendet werden. + @@ -4549,7 +6440,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENUTABELLE</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>Menü-ID -</B> Dies ist die ID für diesen Schritt der Aufforderung Menü. Dies wird auch angezeigt, wie der Kontext, die in der dialplan für diesen Aufruf ist im Menü. + <B>Menü-ID -</B> Dies ist die ID für diesen Schritt der Aufforderung Menü. Dies wird auch angezeigt, wie der Kontext, die in der dialplan für diesen Aufruf ist im Menü. Hier ist eine Liste der reservierten Sätze, die nicht als Menü-IDs verwendet werden kann: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -4561,6 +6452,11 @@ if ($ADD==99999) <BR> <B>Prompt Menu -</B> Dieses Feld enthält den Dateinamen der Audio-Eingabeaufforderung zu Beginn dieses Menüs spielen. Sie können mehrere propmts in dieses Feld eingeben und den anderen Bereichen, prompt, indem Sie diese mit einem Pipe-Zeichen. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -4601,10 +6497,20 @@ if ($ADD==99999) <BR> <B>Tracking-Fraktion -</B> Dies ist die ID, die Sie für Anrufe an dieser Aufforderung Menü Länge, wenn man die IVR-Bericht verwenden können. Die Liste enthält CALLMENU als Standard-sowie alle In-Gruppen. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>LOG-Taste drücken -</B> Diese Option wird aktiviert, wenn die DTMF-Taste drücken durch den Anrufer in dieser Aufforderung Menü anmelden. Standard ist 0 für Behinderte. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Protokollfeld -</B> Wenn die LOG-Taste drücken Option aktiviert ist, kann diese optionale Einstellung ermöglicht die Reaktion auf auch in dieser Liste Feld gespeichert werden. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. Der Standardwert ist NONE für Behinderte. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Optionswert -</B> Dieses Feld ist, wo Sie den Menüpunkt definieren, Wahlmöglichkeiten: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Die besondere TIMECHECK Option kann nur verwendet werden, wenn Sie Menü Time Check aktiviert und es gibt einen Call Time definiert für die Menü -. Um eine Option zu löschen, einfach die Route zu entfernen und die Option wird gelöscht, wenn Sie auf den Submit-Button. + <B>Optionswert -</B> Dieses Feld ist, wo Sie den Menüpunkt definieren, Wahlmöglichkeiten: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Die besondere TIMECHECK Option kann nur verwendet werden, wenn Sie Menü Time Check aktiviert und es gibt einen Call Time definiert für die Menü -. Um eine Option zu löschen, einfach die Route zu entfernen und die Option wird gelöscht, wenn Sie auf den Submit-Button. TIMEOUT können Sie festlegen, was mit dem Anruf, wenn es mal aus, ohne Eingaben des Anrufers. INVALID können Sie festlegen, was passiert, wenn der Anrufer eine ungültige Option. INVALID_2ND und 3. kann nur dann aktiv, wenn ungültige nicht verwendet wird, wird es erst in der zweiten oder dritten ungültigen Eintrag durch den Anrufer warten, bevor es die Option ausführt. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -4626,15 +6532,45 @@ if ($ADD==99999) <BR> <B>Option Route Preis Kontext -</B> Dieses Feld ist optional und nur für die Extension Option Routen eingesetzt. + <BR> + <A NAME="vicidial_call_menu-ingroup_settings"> + <BR> + <B>Rufen Sie Menü In-Group-Einstellungen -</B> Wenn die Fahrtroute eingestellt ist, um Eigengruppe dann gibt es viele Optionen, die Sie setzen, um festzulegen, wie der Aufruf wird in die Warteschlange gesendet werden können. In-Group ist die Inbound-Gruppe, die Sie den Anruf an gehen wollen. Handle-Methode ist, wie Sie wollen den Anruf zu handhabenden, <a href="#vicidial_inbound_dids-call_handle_method">Klicken Sie hier, um eine Liste der verfügbaren Methoden siehe Griff</a>. Suchmethode definiert, wie die Warteschlange wird beim nächsten Agenten zu finden, empfehlen lassen Sie dieses auf LB. ID-Liste ist die Liste, dass die neue Führung in eingesetzt wird, auch wenn die Methode nicht um eine Lookup-Methode und das Blei wird nicht gefunden. Kampagnen-ID ist die Kampagne, um Listen durch, wenn eine der RC-Verfahren verwendet wird, zu suchen. Telefon Code ist die phone_code Feld Eintrag für die Führung, die mit eingefügt wird. VID eingeben, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird Dateiname verwendet wird, ist es die Audio-Aufforderung gespielt, um den Kunden zu bitten, ihre ID eingeben. VID-ID-Nummer Dateiname verwendet wird, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, ist es die Audio-Aufforderung spielte nach Kunde gibt seine ID, so etwas wie Sie eingegeben haben. VID bestätigen Dateiname verwendet wird, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, ist es die Audio-Aufforderung gespielt, um ihre Identifikation zu bestätigen, so etwas wie PRESS 1 bestätigen und 2, um erneut einzugeben. VID Digits wird verwendet, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, wenn es zu einer Reihe ist es die Anzahl der Stellen, die vom Kunden eingegeben werden, wenn für ihre ID aufgefordert werden müssen, wenn sie leer oder X dann das gesetzt wird Kunde muss Nummernzeichen drücken auf ihre Aufnahme ihrer ID beenden. + <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dilplan Eintrag -</B> Dieses Feld ermöglicht es Ihnen, in jedem dialplan Elemente, die Sie für die Call-Menü eingeben wollen. + <B>Benutzerdefinierte Dialplan Eintrag -</B> Dieses Feld ermöglicht es Ihnen, in jedem dialplan Elemente, die Sie für die Call-Menü eingeben wollen. + <BR><BR><BR><BR> + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> + <BR> + <B>Filter Phone Gruppe Identifikation -</B> Dies ist die ID des Filter-Phone Group, die die Container für eine Gruppe von Telefonnummern, die Sie automatisch durchsucht haben, wenn ein Anruf in ein DID und senden Sie eine alternative Route, wenn es eine Übereinstimmung gibt. Dieses Feld sollte zwischen 2 und 20 Zeichen lang sein und haben keine Satzzeichen außer Unterstrich. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> + <BR> + <B>Filter Phone Gruppe Name -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> + <BR> + <B>Filter Phone Group Beschreibung -</B> Dies ist die Beschreibung des Filter Phone Group, ist es rein für die Notation Zwecken und ist nicht ein erforderliches Feld. + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_REMOTE_AGENTSTABELLE</FONT></B><BR><BR> @@ -4657,6 +6593,11 @@ if ($ADD==99999) <BR> <B>Externe Verlängerung -</B> Dieses ist die Zahl, daß Sie die Anrufewünschen, die zu nachgeschickt werden. Überprüfen Sie, ob es einevolle dial plan Zahl ist und daß, wenn Sie 9 am Anfang benötigen, Sieihn innen hier setzen. Prüfen Sie, indem Sie diese Nummer von einemTelefon auf dem System wählen. + <BR> + <A NAME="vicidial_remote_agents-extension_group"> + <BR> + <B>Erweiterungs-Gruppe -</B> Wenn etwas anderes als NONE oder leer dies wird die externe Feld Erweiterung außer Kraft setzen und nutzen den Extension-Gruppe Einträge, die die gleiche Ausdehnung Gruppen-ID eingestellt haben. Der Standardwert ist NONE deaktiviert. + <BR> <A NAME="vicidial_remote_agents-status"> <BR> @@ -4665,7 +6606,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_remote_agents-campaign_id"> <BR> - <B>Kampagne -</B> Ist hier, wo Sie die Kampagne vorwählen, daß dieseRemotemittel in geloggt werden. Inbound Notwendigkeiten, die GENAUEREKampagne zu verwenden und die inbound Kampagnen unter dervorzuwählen, die Sie Anrufe von empfangen möchten. + <B>Kampagne -</B> Ist hier, wo Sie die Kampagne vorwählen, daß dieseRemotemittel in geloggt werden. Inbound Notwendigkeiten, die GENAUEREKampagne zu verwenden und die inbound Kampagnen unter dervorzuwählen, die Sie Anrufe von empfangen möchten. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>Auf-Hook-Agent -</B> Diese Option ist nur für eingehende Anrufe gehen auf diese Remote-Agent verwendet. Diese Funktion ruft die Remote-Agenten und wird nicht sendet dem Kunden an den Remote-Agent, bis die Leitung beantwortet wird. Standard ist für behinderte N. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>On-Hakenring Zeit -</B> Diese Option wird nur verwendet, wenn der On-Hook-Agent-Feld oben auf Y gesetzt und dann auch nur für eingehende Anrufe kommen auf diese Remote-Agent. Dies ist die Anzahl der Sekunden, dass jeder Anrufversuch wird, klingeln, um zu versuchen, eine Antwort zu bekommen. Es wird empfohlen, dass Sie diese Einstellung auf ein paar Sekunden weniger, als es für einen Aufruf an die Voicemail gesendet werden braucht. Die Standardeinstellung ist 15. <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> @@ -4675,7 +6626,30 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTEN</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPSTABELLE</FONT></B><BR><BR> + <A NAME="vicidial_extension_groups-extension_group_id"> + <BR> + <B>Erweiterungs-Gruppe -</B> Dieses erforderliche Feld ist, wo Sie die Gruppen-ID, die Sie wollen, dass diese Erweiterung in Kraft gesetzt werden. Keine Leerzeichen oder Sonderzeichen außer Unterstrich Buchstaben und Zahlen. + + <BR> + <A NAME="vicidial_extension_groups-extension"> + <BR> + <B>Extension -</B> Dieses Feld ist erforderlich, wo Sie die Dialplan-Erweiterung stellen, dass Sie wollen, dass der Remote-Agent ruft an, um für diese Nebenstelle Gruppe Eintrag gesendet werden. + + <BR> + <A NAME="vicidial_extension_groups-rank"> + <BR> + <B>Rank -</B> In diesem Feld können Sie die Einträge, die Verlängerung Gruppe die gleiche Ausdehnung Gruppe teilen Rang. Standard ist 0. + + <BR> + <A NAME="vicidial_extension_groups-campaign_groups"> + <BR> + <B>Kampagnen Gruppen -</B> In diesem Feld können Sie legte eine Liste von Kampagnen-IDs und Gruppen-IDs oder Inbound, dass Sie die Nutzung der Erweiterung für die Gruppe zu beschränken. Liste werden getrennt durch Rohrleitungen und eine Leitung am Anfang und Ende des Strings. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>Die Listen innerhalb dieser Kampagne werden hier verzeichnet, ob siewerden bezeichnet durch das Y aktiv sind, oder N und Sie zum ListeSchirm gehen können, indem sie auf der Liste Identifikation in derersten Spalte klicken.</B> @@ -4699,7 +6673,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYSTABELLE</FONT></B><BR><BR> <A NAME="vicidial_campaign_hotkeys"> <BR> - <B>Durch den Gebrauch von kundenspezifischen Kampagne hot keys, benenntVertreter, die verwenden, der vicidial Netz-Klient Dose Hängezustandund Einteilung, gerade indem sie einen einzelnen Schlüssel auf ihrerTastatur betätigen.</B> There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead. + <B>Durch den Gebrauch von kundenspezifischen Kampagne hot keys, benenntVertreter, die verwenden, der vicidial Netz-Klient Dose Hängezustandund Einteilung, gerade indem sie einen einzelnen Schlüssel auf ihrerTastatur betätigen.</B> Es gibt two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead. @@ -4740,6 +6714,28 @@ if ($ADD==99999) + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR> + <A NAME="vicidial_xfer_presets"> + <BR> + <B>Wenn die Kampagne Einstellung für Presets auf Aktiviert eingestellt ist, dann haben die Fähigkeit, Transfer-Presets, die Konferenz zur Verfügung stehen, um dem Agenten wird es ihnen ermöglicht, 3-Wege nennen diese Presets oder blind Anrufe an diese vorgegebenen Zahlen zu definieren. Diese Voreinstellungen haben auch eine Option, um die Zahl mit jedem Preset aus dem Agenten verbunden zu verbergen.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN CID AREACODES</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Wenn die Einstellung SYSTEM bei Vorwahl CIDs aktiviert ist und die Kampagne für die Einstellung Use Benutzerdefinierte CallerID soll AREACODE dann haben Sie die Möglichkeit, Vorwahl CIDs, die verwendet werden, wenn ausgehende Anrufe, um Leads in diesem speziellen Kampagne zu definieren. Sie können mehrere callerIDs pro Ortsvorwahl und Sie können aktivieren und deaktivieren jeweils in Echtzeit. Wenn mehr als ein callerID ist für eine bestimmte Ortsvorwahl aktiv dann wird das System mit der CallerID, die die geringste Anzahl von Zeiten heute verwendet wurde. Wenn keine callerIDs für die Vorwahl der Region aktiv sind, dann ist die Kampagne CallerID oder Override-Liste CallerID verwendet werden.</B> + + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_USER_GROUPSTABELLE</FONT></B><BR><BR> @@ -4775,14 +6771,66 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Agent Status Sichtbare Gruppen -</B> Dies ist eine Liste der wählbaren Benutzer-Gruppen und User-Funktionen, auf die Mitglieder dieser Benutzergruppe den Status sowie die Übertragung Anrufe innerhalb des Agent-Bildschirm anzeigen können. Der ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Gruppe zu sehen und Anrufe für jeden Benutzer auf dem System. Die Kampagnen-AGENTUREN Option können Benutzer in dieser Gruppe zu sehen und Anrufe für jeden Benutzer in der Kampagne, dass sie angemeldet sind, in. + <B>Agent Status Sichtbare Gruppen -</B> Dies ist eine Liste der wählbaren Benutzer-Gruppen und User-Funktionen, auf die Mitglieder dieser Benutzergruppe den Status sowie die Übertragung Anrufe innerhalb des Agent-Bildschirm anzeigen können. Der ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Gruppe zu sehen und Anrufe für jeden Benutzer auf dem System. Die Kampagnen-AGENTUREN Option können Benutzer in dieser Gruppe zu sehen und Anrufe für jeden Benutzer in der Kampagne, dass sie angemeldet sind, in. Die NICHT-logged-in-Agenten Option können alle Benutzer im System angezeigt werden soll, auch wenn sie nicht eingeloggt sind in curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> <BR> <B>Agent Status View Time -</B> Diese Option legt fest, ob der Agent die Höhe der Zeit, dass die Nutzer in ihrer Bevollmächtigten Seitenleiste in ihren aktuellen Status zu sehen gewesen sein wird. Der Standardwert ist N nicht oder deaktiviert. + <BR> + <A NAME="vicidial_user_groups-agent_call_log_view"> + <BR> + <B>Agent-Call Log anzeigen -</B> Diese Option legt fest, ob der Agent in der Lage, ihre Anrufliste für Anrufe über das sich jeder leisten Agent Bildschirm behandelt sehen. Standard ist für keine N-oder ausgeschaltet. + + <BR> + <A NAME="vicidial_user_groups-agent_xfer_options"> + <BR> + <B>Agent-Transfer-Optionen -</B> Mit diesen Optionen können für die Sperrung von bestimmten Tasten in der Transfer Conference Abschnitt des Agent-Schnittstelle. Die Standardeinstellung ist J für Ja oder aktiviert. + + <BR> + <A NAME="vicidial_user_groups-agent_fullscreen"> + <BR> + <B>Agent-Vollbild -</B> Diese Option wenn der Wert auf Y wird die Höhe und Breite der sich jeder leisten Agent Bildschirm, um die Größe des Browser-Fenster ohne Berücksichtigung des Agenten anzeigen gesetzt ist, ruft in Queue-Ansicht oder Anrufe in Session-Ansicht. Standard ist für keine N-oder ausgeschaltet. + + <BR> + <A NAME="vicidial_user_groups-allowed_reports"> + <BR> + <B>Erlaubt Berichte -</B> Wenn ein Benutzer in dieser Gruppe auf Benutzer-Ebene 7 oder höher festgelegt ist, dann ist dieses Feature kann verwendet werden, um die Berichte, dass die Benutzer sehen können eingeschränkt werden. Der Standardwert ist ALL. Wenn Sie mehr als einen Bericht auswählen möchten und drücken Sie die Strg-Taste auf Ihrer Tastatur, wenn Sie die Berichte auswählen. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Erlaubte Benutzer-Gruppen -</B> Dies ist eine Liste der wählbaren Benutzergruppen, denen die Mitglieder dieser Benutzergruppe ansehen und ggf. bearbeiten. Benutzer-Gruppen können den Zugriff auf nahezu alle Aspekte des Systems, vom Wareneingang bis DIDs Telefone an die Voicemail-Boxen. Die - ALLE - Option erlaubt den Benutzern in dieser Gruppe zu sehen und melden Sie sich an, um jeden Datensatz auf dem System, wenn ihre Benutzerberechtigungen für sie erlauben. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Anruf erlaubt Zeiten -</B> Dies ist eine Liste der wählbaren Zeiten anrufen, an die Mitglieder dieser Benutzergruppe in Kampagnen verwenden können, in Gruppen-und Call-Menüs. Die - ALLE - Option erlaubt den Benutzern in dieser Gruppe, um alle Call-Zeiten im System verwenden. + + <?php + if (strlen($SSwebphone_url) > 5) + { + ?> + <BR> + <A NAME="vicidial_user_groups-webphone_url_override"> + <BR> + <B>Webphone URL Override -</B> Diese Einstellung ermöglicht es Ihnen, eine alternative URL webphone nur für die Mitglieder einer Benutzergruppe festzulegen. Standard ist leer. + + <BR> + <A NAME="vicidial_user_groups-webphone_systemkey_override"> + <BR> + <B>Webphone System Key Override -</B> Diese Einstellung ermöglicht es Ihnen, einen alternativen webphone System Key nur für die Mitglieder einer Benutzergruppe festzulegen. Standard ist leer. + + <BR> + <A NAME="vicidial_user_groups-webphone_dialpad_override"> + <BR> + <B>Webphone Dialpad Override -</B> Diese Einstellung können Sie aktivieren oder deaktivieren Sie das Tastenfeld auf der webphone nur für die Mitglieder einer Benutzergruppe. Der Standardwert ist DISABLED. ROCKER kann der Benutzer zum Anzeigen und Ausblenden der Wähltasten durch Anklicken eines Links. TOGGLE_OFF ausfällt, um nicht das Tastenfeld beim ersten Laden, sondern ermöglicht es dem Benutzer, die Wähltasten, indem Sie zeigen, auf dem Tastenfeld Link. + + <?php + } + if ($SSqc_features_active > 0) { ?> @@ -4794,7 +6842,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> <BR> - <B>QC erlaubt Inbound Gruppen - </B> Dies ist eine Liste der wählbaren Eingang Gruppen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Benutzergruppe zu QC jede eingehende Gruppe über das System. + <B>QC erlaubt Inbound Gruppen - </B> Dies ist eine Liste der wählbaren Eingang Gruppen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Benutzergruppe zu QC jede eingehende Gruppe über das System. <?php } ?> @@ -4817,14 +6865,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Index kommentiert -</B> Dieses ist, wo Sie Anmerkungen für einenVicidial Index wie - geändert, um Aufsteigen an Sept. 23 freizugeben-. Maximum 255 Buchstaben setzen können, Minimum von 2 Buchstaben. + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Index-Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Index-Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + Sie können auch eine spezielle Variable IGNORENOSCROLL zu Bildlaufleisten auf der Registerkarte Skript zwingen, selbst wenn Sie mit einem iFrame sind darin. <BR> <A NAME="vicidial_scripts-active"> @@ -4854,6 +6909,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>Filter kommentiert -</B> Dieses ist, wo Sie Anmerkungen für einenVicidial Filter wie - Anrufe alle Kalifornien Leitungen -. Maximum 255Buchstaben setzen können, Minimum von 2 Buchstaben. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>Filter SQL -</B> Dieses ist, wohin Sie das SQL Frage Fragment setzen,das Sie vorbei filtern möchten anfangen nicht, oder Ende mit UND, dasdurch den Zufuhrbehälter cron Index automatisch hinzugefügt wird.eine Beispiel SQL Frage, die hier arbeiten würde, ist called_count \4 und called_count \. @@ -4879,14 +6939,23 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>Anrufzeit Kommentare -</B> Hier können Sie Kommentare für eine Vicidial Anrufzeit Definition wie -10 bis 14 Uhr mit eigenen Beschränkungen für das angerufene Land- machen. Maximal 255 Zeichen. + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_call_times-ct_default_start"> - <B>Standard Start and Stop Zeiten -</B> Dies ist die Standardzeit, zu der Anrufe innerhalb der Anrufzeitdefinition gestartet oder gestoppt werden dürfen, wenn die Wochentag Startzeit nicht definiert ist. 0 ist Mitternacht. Um Anrufe komplett zu verhindern den Wert auf 2400 und die Standard Stopzeit ebenfalls auf 2400 setzen. Um Anrufe für 24 Stunden am Tag zu erlauben die Startzeit auf 0 und die Stopzeit auf 2400 setzen. + <B>Standard Start and Stop Zeiten -</B> Dies ist die Standardzeit, zu der Anrufe innerhalb der Anrufzeitdefinition gestartet oder gestoppt werden dürfen, wenn die Wochentag Startzeit nicht definiert ist. 0 ist Mitternacht. Um Anrufe komplett zu verhindern den Wert auf 2400 und die Standard Stopzeit ebenfalls auf 2400 setzen. Um Anrufe für 24 Stunden am Tag zu erlauben die Startzeit auf 0 und die Stopzeit auf 2400 setzen. Für nur eingehend, können Sie auch den Anschlag Anrufzeit höher als 2400, wenn Sie die Forderung der Zeit, über Mitternacht gehen wollen. Also, wenn Sie möchten Ihren Anruf Zeit von 6 Uhr morgens bis 2 Uhr am nächsten Tag, würden Sie 0600 als Startzeit und 2600 gelegt, als der Stoppzeit. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> <B>Wochentag Start and Stop Zeit -</B> Dies sind die speziellen Zeiten pro Tag, welche für die Anrufzeit Definition gesetzt werden können. Es gelten die selben Regeln wie für Start und Stop Zeiten. + <BR> + <A NAME="vicidial_call_times-default_afterhours_filename_override"> + <B>After Hours Dateiname Override -</B> In diesen Feldern können Sie die After Hours Nachricht für eingehende Gruppen außer Kraft setzen, wenn es um etwas eingestellt wird. Standard ist leer. + <BR> <A NAME="vicidial_call_times-ct_state_call_times"> <B>Land Anrufzeit Definition -</B> Dies ist die Liste der landspezifischen Anrufzeit Definitionen, die von dieser Anrufzeit Definition beachtet werden. @@ -4909,6 +6978,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Shift Name - </B> Dies ist eine beschreibende Bezeichnung der Shift Definition. Dies ist eine kurze Zusammenfassung der Shift Definition. max 50 Zeichen, mindestens 2-Zeichen. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Start Time Shift - </B> Es ist an der Zeit, dass die Kampagne Schicht beginnt. Darf nur Zahlen, 9:30 AM wäre 0930 und 5:00 PM wäre 1700. @@ -4921,13 +6995,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Shift Wochentage - </B> In diesem Abschnitt sollten Sie die Tage der Woche, dass diese Verschiebung ist aktiv. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Bericht Option -</B> Diese Option ermöglicht diese spezielle Schicht zu zeigen, bis in ausgewählte Berichte, die diese Option unterstützen. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Melde Rang -</B> Diese Option ermöglicht es Ihnen, Verschiebungen in ausgewählte Berichte, die diese Option unterstützen Rang. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio-Store -</B> Dieses Dienstprogramm ermöglicht es Ihnen, Audio-Dateien-Upload auf den Webserver, so dass sie auf alle ViciDial Server in einer Multi-Server-Cluster verteilt werden. Ein wichtiger Hinweis, nur zwei Audio-Dateitypen funktionieren wird,. Wav-Dateien, die PCM 16bit und 8k. GSM-Dateien, die 8bit 8k sind. Bitte überprüfen Sie, dass Ihre Dateien vor dem Upload korrekt formatiert sind sie hier. + <B>Audio-Store -</B> Dieses Dienstprogramm ermöglicht es Ihnen, Audio-Dateien auf den Webserver hochladen, so dass sie auf alle sich jeder leisten Servern in einer Multi-Server-Cluster verteilt werden können. Ein wichtiger Hinweis, werden nur zwei Audio-Datei-Typen zu arbeiten,. Wav-Dateien, die PCM-Mono 16bit und 8k sind. GSM-Dateien, die 8bit 8k sind. Bitte überprüfen Sie, ob Ihre Dateien ordnungsgemäß vor dem Hochladen hier formatiert. @@ -4946,6 +7027,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Aktive -</B> Diese Option ermöglicht es Ihnen, die Wartemusik Eintrag aktiv oder inaktiv gesetzt. Inaktive wird entfernen Sie den Eintrag aus der conf-Dateien. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Zufälliger Reihenfolge -</B> Diese Option ermöglicht es Ihnen, die Wiedergabe der Audio-Dateien in zufälliger Reihenfolge zu definieren. Wenn auf N dann die festgelegten Reihenfolge verwendet werden. @@ -4972,9 +7058,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Aktive -</B> Diese Option ermöglicht es Ihnen, die TTS-Eintrag aktiv oder inaktiv gesetzt. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + + <BR> + <A NAME="vicidial_tts_prompts-tts_voice"> + <B>TTS-Stimme -</B> Hier können Sie die Stimme definieren, die in der TTS-Erzeugung verwendet werden. Die Standardeinstellung ist Allison-8kHz. + <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Text -</B> Dies ist der eigentliche Text To Speech Datenfeld Cepstral, die für die Erstellung der Audio-Datei gesendet wird, um dem Kunden gespielt werden. Sie können Speech Synthesis Markup Language-SSML-Einsatz in diesem Bereich, zum Beispiel, <break time='1000ms'/> für 1 Sekunde Pause. Sie können auch mehrere Variablen wie Vorname, Nachname und Titel wie ViciDial Variablen wie Sie in einem Skript: - A - first_name - B -. Hier ist eine Liste der verfügbaren Variablen:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Text -</B> Dies ist der eigentliche Text To Speech Datenfeld Cepstral, die für die Erstellung der Audio-Datei gesendet wird, um dem Kunden gespielt werden. Sie können Speech Synthesis Markup Language-SSML-Einsatz in diesem Bereich, zum Beispiel, <break time='1000ms'/> für eine 1 Sekunde Pause. Sie können auch mehrere Variablen wie Vorname, Nachname und Titel wie sich jeder leisten Variablen wie nur Sie tun, in einem Index: - A - vorname - B -. Wenn Sie statische Audiodateien, die Sie verwenden möchten, auf den Wert eines der Felder, die Sie für diese ebenfalls verwenden können mit C-und D-Tags basieren. Die Dateinamen müssen kleingeschrieben sein und sie müssen 8k 16bit PCM WAV-Dateien sein. Der Name des Feldes muss die gleiche, aber ohne die. Wav im Dateinamen sein. Zum Beispiel - C ---- A - Address3 - B ---- D - zuerst finden würde, den Wert für Address3, dann würde es versuchen, eine Audio-Datei passenden Wert, dass es in den Prompt legte finden. Hier ist eine Liste der verfügbaren Variablen: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -5002,12 +7097,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <BEmail-</B> Mit dieser Einstellung können Sie die Voicemail-Nachrichten geschickt haben eine E-Mail-Konto, wenn Ihr System so eingerichtet ist, senden E-Mail. Wenn dieses Feld leer ist, dann wird keine E-Mails verschickt werden. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Löschen Voicemail Nach E-Mail -</B> Mit dieser Einstellung können Sie die Voicemail-Nachrichten aus dem System gelöscht haben, nachdem sie per E-Mail haben gewesen. Der Standardwert ist N. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Voicemail-Zone -</B> Diese Einstellung können Sie die Zone, dass diese Voicemail-Box wird an eingestellt werden, wenn die Zeit für eine Meldung protokolliert wird eingestellt. Standard wird in den Systemeinstellungen festgelegt. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Voicemail-Optionen -</B> Diese optionale Einstellung ermöglicht es Ihnen, zusätzliche Voicemail-Einstellungen zu definieren. Es wird empfohlen, dass Sie dieses Feld leer lassen, wenn Sie wissen was Sie tun. <?php if ($SSoutbound_autodial_active > 0) @@ -5024,7 +7129,7 @@ if ($ADD==99999) <LI>Verkäufer-Leitung Code - zeigt oben im Verkäufer, den Identifikationvom GUI auffangen <LI>Quellenprogramm - interner Gebrauch nur für admins und DBAs <LI>Liste Identifikation - die Liste Zahl, die diese Leitungen obendarunter zeigen - <LI>Telefon-Code - das Präfix für die Telefonnummer - 1 für US, 01144für Großbritannien, 01161 für AUS, usw. + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Telefonnummer - muß mindestens 8 Stellen lang sein <LI>Titel - Titel dem Kunden - Herr Ms Mrs, usw.... <LI>Vorname @@ -5048,6 +7153,15 @@ if ($ADD==99999) <BR>ANMERKUNGEN: Die übertreffenleitung Ladevorrichtung Funktionalitätwird durch eine Reihe Perl Indexe ermöglicht und muß eine richtigzusammengebaute /etc/astguiclient.conf Akte im Platz auf dem webserver haben. Auch ein Paarperl Module müssen für sie, um außerdemzu arbeiten - OLE-Storage_Lite-Storage_Lite undVerteilungsbogen-ParseExcel geladen werden. Sie können aufLaufzeitfehler in diesen überprüfen, indem Sie Ihre Apache error_logAkte betrachten. Auch für Doppelprüfungen gegen gampaignverzeichnet, die Liste, die neue Leitungen hat, in es einzusteigenmuß im System verursacht werden, bevor Sie beginnen, die Leitungen zuladen. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Kundenspezifischer Plan" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>Vorlagen-ID -</B> If the user has selected "Kundenspezifischer Plan" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -5063,7 +7177,7 @@ if ($ADD==99999) <B><FONT SIZE=3>TELEFON-TABELLE</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Telefonverlängerung -</B> Dieses fangen ist auf, wohin Sieden Telefonnamen setzen, während er scheint, nicht einschließlichdas Protokoll oder den Schrägstrich am Anfang mit einem Sternchenzuversehen. Z.B.: für das SIP Telefon SIP\/test101 würde dieTelefonverlängerung test101 sein. Auch denn Telefone IAX2 stellen Siesicher, daß Sie den vollen Telefonnamen verwenden:IAX2\/IAXphone1@IAXphone1 würde IAXphone1@IAXphone1 sein. Für ZapTelefone sicherstellen, daß Sie die volle Führung setzen: Zap/25-1würde 25-1 sein. Eine andere Anmerkung, stellen sicher, daß Sie dasProtokoll unten richtig für Ihre Art des Telefons einstellen. + <B>Durchwahl -</B> Dieses Feld ist, wo Sie die Telefone Namen setzen, wie es zu Asterisk nicht einschließlich des Protokolls oder Schrägstrich am Anfang erscheint. Zum Beispiel: für das SIP-Telefon SIP/test101 die Telefon-Durchwahl würde test101 sein. Auch für IAX2 phones: IAX2/IAXphone1 @ IAXphone1 würde IAXphone1 sein. Für Zap und Dahdi angehängten channelbank oder FXS-Telefone stellen Sie sicher stellen das gesamte Kanal-Nummer ohne das Präfix: Zap/25-1 würde 25-1 sein. Noch ein Hinweis, sicherstellen, dass Sie das Protokoll mit folgendem richtig für Ihre Art des Telefons. <BR> <A NAME="phones-dialplan_number"> @@ -5075,11 +7189,24 @@ if ($ADD==99999) <BR> <B>Voicemail Kasten -</B> Dieses fangen ist für den voicemailKasten auf, daß die Anzeigen für zum Benutzer dieses Telefons gehen.Wir verwenden dieses, um auf voicemail Anzeigen und auf den Benutzerzu überprüfen, zum in der Lage zuSEIN, die VOICEMAIL Taste aufastGUIclient APP zu benutzen. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Voicemail-Zone -</B> Diese Einstellung können Sie die Zone, dass diese Voicemail-Box wird an eingestellt werden, wenn die Zeit für eine Meldung protokolliert wird eingestellt. Standard wird in den Systemeinstellungen festgelegt. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Voicemail-Optionen -</B> Diese optionale Einstellung ermöglicht es Ihnen, zusätzliche Voicemail-Einstellungen zu definieren. Es wird empfohlen, dass Sie dieses Feld leer lassen, wenn Sie wissen was Sie tun. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>Outbound CallerID -</B> Dieses fangen ist auf, wo Sie diecallerID Zahl eintragen würden, die Sie möchten, daß auf outboundAnrufe gesetzter Form der astguiclient Netz-Klient aussieht. Diesesarbeitet nicht auf RBS, non-PRI, T1/Eß. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -5098,12 +7225,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>LOGON -</B> Der LOGON gewöhnt ge$$$WESEN für den Telefonbenutzer anLOGON zu den Klient Anwendungen. + <B>Agent-Bildschirm Anmelden -</B> Die Anmeldung für den Benutzer verwendet werden, um telefonisch zu den Client-Anwendungen anmelden, wie die sich jeder leisten Agent Bildschirm. <BR> <A NAME="phones-pass"> <BR> - <B>Kennwort -</B> Das Kennwort gewöhnt ge$$$WESEN für denTelefonbenutzer an LOGON zu den Klient Anwendungen. Wichtig ist dies das Passwort nur für den Agenten Weboberfläche Telefon anmelden, um die sip.conf oder iax.conf vergessen, oder geheim zu ändern, für dieses Telefon-Gerät müssen Sie die Conf-Datei Secret Feld weiter unten auf dieser Seite ändern. + <B>Login Passwort -</B> Das Passwort für den Benutzer verwendet werden, um telefonisch zu den Web-basierten Client-Anwendungen anmelden. Wichtig ist, ist dies das Passwort nur für den Agenten, Web-Interface Telefon anmelden, um die sip.conf oder iax.conf Kennwort ein, oder geheim zu ändern, für dieses Telefon Gerät, das Sie, um die Registrierung Passwort in das nächste Feld zu ändern müssen. + + <BR> + <A NAME="phones-conf_secret"> + <BR> + <B>Anmeldung Passwort -</B> Das ist das Geheimnis, oder das Passwort für das Telefon in der IAX oder SIP-auto-generated conf-Datei für dieses Telefon. Der Grenzwert beträgt 20 alphanumerischen Zeichen Bindestrich und Unterstrich akzeptiert. Default is test. Früher nannte conf-Datei Geheimnis. Eine starke Registrierung Passwort sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl. + + <BR> + <A NAME="phones-is_webphone"> + <BR> + <B>Set As Webphone -</B> Wenn diese Option auf Y wird versuchen, ein Web-basiertes Handy zu laden, wenn der Agent loggt sich in ihren Agenten-Bildschirm. Die Standardeinstellung ist N. + + <BR> + <A NAME="phones-webphone_dialpad"> + <BR> + <B>Webphone Dialpad -</B> Diese Einstellung können Sie aktivieren oder deaktivieren Sie das Tastenfeld für diese webphone. Standard ist für Y aktiviert. ROCKER kann der Benutzer zum Anzeigen und Ausblenden der Wähltasten durch Anklicken eines Links. Diese Funktion ist nicht bei allen Versionen zur Verfügung webphone. TOGGLE_OFF ausfällt, um nicht das Tastenfeld beim ersten Laden, sondern ermöglicht es dem Benutzer, die Wähltasten, indem Sie zeigen, auf dem Tastenfeld Link. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Webphone Auto-Antwort -</B> Mit dieser Einstellung kann die Web-Telefon eingerichtet werden, dass Anrufe automatisch, die kommen, indem es auf Y, oder um Anrufe Ring indem Sie sie auf N. Standard haben, ist Y. + + <BR> + <A NAME="phones-use_external_server_ip"> + <BR> + <B>Mit externen Bediener IP -</B> Bei Verwendung als Web-Telefon, können Sie dies auf Y gesetzt, um die Server zu verwenden, um externe IP statt des Server-IP registrieren. Standard ist leer. <BR> <A NAME="phones-status"> @@ -5169,6 +7321,11 @@ if ($ADD==99999) <BR> <B>Telefon Ring Timeout -</B> Dies ist die Zeit, in Sekunden, die das Telefon in der dialplan, bevor der Anruf an die Voicemail-Ring wird. Der Standardwert ist 60 Sekunden. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>On-Haken Agent Login -</B> Diese Option ist nur für eingehende Anrufe gehen an einen Agenten angemeldet mit diesem Telefon verwendet. Diese Funktion ruft den Agenten und wird nicht sendet dem Kunden an den Agenten Sitzung, bis die Leitung beantwortet wird. Standard ist für behinderte N. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -5245,9 +7402,14 @@ if ($ADD==99999) <B>Telefon Kontext -</B> Dies ist die Wählplan Zusammenhang, dass dieses Handy für die Einwahl zu verwenden. Wenn Sie ein Call-Center ausgeführt werden und Sie nicht möchten, dass Ihre Mitarbeiter in der Lage sein zu wählen, die außerhalb des ViciDial Anwendung zum Beispiel, dann würden Sie dieses Feld auf ein dialplan Zusammenhang, dass es nicht gibt, so etwas wie agent-nodial. Standardmäßig ist der Standard -. <BR> - <A NAME="phones-conf_secret"> + <A NAME="phones-codecs_list"> <BR> - <B>Conf-Datei Secret -</B> Das ist das Geheimnis, oder das Passwort für das Telefon in der IAX oder SIP-auto-generated conf-Datei für dieses Telefon. Der Grenzwert beträgt 20 alphanumerischen Zeichen Bindestrich und Unterstrich akzeptiert. Default is test. + <B>Erlaubt Codecs -</B> Sie können eine durch Kommas getrennte Liste von Codecs als die Standard-Codecs für dieses Telefon eingestellt werden. Optionen für Codecs beinhalten ulaw, alaw, GSM, G729, Speex, G722, G723, G726, ilbc, ... Einige dieser Codecs ist möglicherweise nicht auf Ihrem System zur Verfügung, wie G729 oder G726. Wenn das Feld leer ist, dann werden die System-Standard-Codecs oder das Telefon über diesem Eintrag wird man für den zulässigen Codecs verwendet werden. Standard ist leer. + + <BR> + <A NAME="phones-codecs_with_template"> + <BR> + <B>Erlaubt Codecs mit Schablone-</B> Wenn diese Option auf 1 umfassen auch die Codecs oben definiert, wenn eine conf-Datei Vorlage verwendet wird. Standard ist 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -5340,12 +7502,12 @@ if ($ADD==99999) <B>VMail Taste -</B> Stellen Sie ein, um auszurichten, um die VOICEMAILTaste anzuzeigen und die Anzeigen zählen Anzeige auf astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_erfrischen"> <BR> <B>Schnell erneuern Sie -</B> Stellen Sie ein, um auszurichten, um einerneuen Rate von zu ermöglichen erneuern von den Anrufinformationenfür das astGUIclient. Rückstellung arbeitsunfähige Rate ist 1000zweite des Ms.1. Kann Anlagen-Belastung erhöhen, wenn Sie diese Zahlsenken. <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_erfrischen_rate"> <BR> <B>Schnell erneuern Sie Rate -</B> in den Millisekunden. Nur verwendet,wenn schnell, erneuern Sie wird ermöglicht. Rückstellungarbeitsunfähige Rate ist 1000 zweite des Ms.1. Kann Anlagen-Belastungerhöhen, wenn Sie diese Zahl senken. @@ -5489,6 +7651,11 @@ if ($ADD==99999) <BR> <B>Aktiv -</B> Stellen Sie ein, ob der Sternchenbediener aktiv oderunaktiviert ist. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="servers-sysload"> <BR> @@ -5557,7 +7724,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf-Datei Secret -</B> Das ist das Geheimnis, oder das Passwort für den Server in die IAX automatisch generierte conf für diesen Server auf anderen Servern benötigt. Der Grenzwert beträgt 20 alphanumerischen Zeichen Bindestrich und Unterstrich akzeptiert. Default is test. + <B>Conf-Datei Secret -</B> Das ist das Geheimnis, oder das Passwort für den Server in die IAX automatisch generierte conf für diesen Server auf anderen Servern benötigt. Der Grenzwert beträgt 20 alphanumerischen Zeichen Bindestrich und Unterstrich akzeptiert. Default is test. Eine starke conf-Datei Geheimnis sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl. <BR> <A NAME="servers-local_gmt"> @@ -5619,6 +7786,16 @@ if ($ADD==99999) <BR> <B>Alternate Recording Bediener IP - </B> Diese Einstellung können Sie eine Server-IP oder andere Rechner-Namen ein, kann anstelle der server_ip in die Links zu den Aufnahmen in der Admin-Web-Seiten. Der Standardwert ist leer. + <BR> + <A NAME="servers-external_server_ip"> + <BR> + <B>Externe Bediener IP -</B> Diese Einstellung ist, wo Sie eine Server-IP oder andere Maschine Namen, der an Stelle des server_ip verwendet werden können, wenn ein webphone im Agent-Interface stellen können. Damit dies funktioniert, müssen Sie auch die Telefone Eintrag auf den externen Bediener IP zu verwenden. Standard ist leer. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>Aktive Twin-Server-IP -</B> Einige jeder leisten Systeme erfordern die Einrichtung jeder leisten Servern in Paaren. Diese Einstellung ist, wo man die Server-IP von einem anderen Server sich jeder leisten, dass dieser Server mit Partnerstadt stellen können. Standard ist leer für Behinderte. + <BR> <A NAME="servers-active_asterisk_server"> <BR> @@ -5659,6 +7836,11 @@ if ($ADD==99999) <BR> <B>Carrier Aktive Logging -</B> Diese Einstellung erlaubt Ihnen, alle hangup Return-Codes für jede ausgehende Liste Wählen log Anrufe, die Sie platzieren. Der Standardwert ist N. + <BR> + <A NAME="servers-custom_dialplan_entry"> + <BR> + <B>Benutzerdefinierte Dialplan Eintrag -</B> Dieses Feld ermöglicht es Ihnen, in allen Dialplan Elemente, die Sie für den Server eingeben, werden die Zeilen in die Standard-Kontext hinzugefügt werden. + @@ -5676,6 +7858,11 @@ if ($ADD==99999) <BR> <B>Template Name - </B> Dies ist der beschreibende Name der Conf-Datei-Vorlage Eintrag. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -5702,6 +7889,11 @@ if ($ADD==99999) <BR> <B>Carrier Beschreibung -</B> Dies ist in den Kommentaren des Sternchens conf-Dateien über den dialplan und Account-Einträge setzen. Maximal 255 Zeichen. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -5810,16 +8002,46 @@ if ($ADD==99999) <BR> <B>Admin Haupt-URL -</B> dieses ist die URL oder Web site Adresse, daß Siegehen, wenn Sie an die HAUPTVERBINDUNG an der Oberseite der admin.phpSeite klicken. + <BR> + <A NAME="settings-admin_modify_erfrischen"> + <BR> + <B>Admin Ändern Auto-Refresh -</B> Dies ist das Aktualisierungsintervall in Sekunden der modify-Bildschirme in diesem Admin-Interface. Sie diesen Wert auf 0 deaktiviert es, indem ich sie unter 5 wird meistens machen die Steuerwerte Bildschirme unbrauchbar, weil sie zu schnell wird aktualisiert, um Felder zu ändern. Diese Option ist nützlich in Situationen, in denen mehr als ein Manager Controlling Einstellungen basiert auf einer aktiven Kampagne oder in-group, damit die Einstellungen häufig aktualisiert werden. Standard ist 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Admin No-Cache -</B> Wenn Sie diesen Wert auf 1 wird alle Admin-Seiten auf Web-Browser no-cache gesetzt, so dass jeder Bildschirm muss jedes Mal neu geladen wird es angesehen werden, auch wenn Sie wieder auf den Browser. Standard ist 0 für Behinderte. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> <B>Ermöglichen Sie Vertreter-Übergangsprotokolldatei - diese Wahlprotokolliert in einer Textprotokolldatei auf dem webserver, jedesmalwenn ein Anruf auf ein Mittel gebracht wird. Rückstellung ist 0,gesperrt. + <BR> + <A NAME="settings-enable_agc_dispo_log"> + <BR> + <B>Aktivieren Agenten Disposition Logfile -</B> Diese Option wird in einer Textdatei auf dem Webserver Logfiles protokollieren jedes Mal, wenn ein Anruf von einem Agenten dispositioned wird. Standard ist 0, deaktiviert. + <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Timeclock End of Day - </B> Diese Einstellung legt fest, wenn alle Benutzer werden automatisch abgemeldet der timeclock System. Läuft nur einmal pro Tag. darf nur 4 Ziffern 2 Digit Stunden und 2 Minuten in Ziffer 24 Stunden Zeit. Standard ist 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Standard Lokales GMT -</B> Diese Einstellung legt fest, was standardmäßig verwendet werden, wenn neue Telefone und Server hinzugefügt werden, mit dieser Admin Web-Interface. Die Standardeinstellung ist -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Standard-Voicemail-Zone -</B> Diese Einstellung definiert, in welcher Zone wird standardmäßig verwendet werden, wenn neue Telefone und Voicemail-Boxen erstellt werden. Die Liste der verfügbaren Zonen wird direkt aus dem voicemail.conf Datei entnommen. Die Standardeinstellung ist Ost. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Bevollmächtigte Calls zurücksetzen -</B> Diese Einstellung legt fest, ob die angemeldeten Agenten und aktive Anrufe Aufzeichnungen zurückgesetzt werden an der Zeitschaltuhr am Ende des Tages sind. Standard ist 1 für aktivierte. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -5888,6 +8110,11 @@ if ($ADD==99999) <BR> <B>Sounds Web-Verzeichnis -</B> Diese automatisch generierten Verzeichnis-Name wird zufällig vom System als den Ort, dass die Audio-Lager gehalten werden geschaffen. Alle Audio-Dateien befinden sich in diesem Verzeichnis. + <BR> + <A NAME="settings-admin_web_directory"> + <BR> + <B>Admin Web Directory -</B> Dies ist das Verzeichnis, dass Ihr administation Web-Inhalte, wie admin.php, sind in. Die Standardeinstellung ist sich jeder leisten. Um herauszufinden, Ihre Admin-Web-Verzeichnis, es ist alles, was zwischen dem Domainnamen und der admin.php in der URL auf dieser Seite ist, ohne Anfang und am Ende Schrägstriche. + <BR> <A NAME="settings-active_voicemail_server"> <BR> @@ -5911,7 +8138,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Lassen Sie Custom Dialplan Einträge -</B> Diese Option ermöglicht es Ihnen, benutzerdefinierte dialplan Zeilen in Call-Menüs geben. Der Standardwert ist 0 für inaktive. + <B>Lassen Sie Custom Dialplan Einträge -</B> Diese Option ermöglicht es Ihnen, benutzerdefinierte Dialplan Linien in Anruf-Menüs,-Server und System-Einstellungen eingeben. Standard ist 0 für inaktive. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>PLLB Limit-Gruppierung -</B> Telefon Einloggen Load Balancing Verbund Limit. Wenn PLLB Gruppierung in Cascading auf der Kampagnen-Ebene eingestellt ist, dann wird diese Einstellung bestimmt die Anzahl der Agenten akzeptabel auf jedem Server in allen Kampagnen. Der Standardwert ist 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Generieren Sie Cross-Server-Durchwahls -</B> Diese Option, wenn auf 1 gesetzt wird Dialplan Einträge für jedes Telefon auf eine Multi-Server-System zu generieren. Standard ist 0 für inaktive. <BR> <A NAME="settings-user_territories_active"> @@ -5928,11 +8165,142 @@ if ($ADD==99999) <BR> <B>Aktivieren TTS Integration -</B> Diese Einstellung ermöglicht es Ihnen zu ermöglichen, Text-to-Speech Integration mit Cepstral. Dies ist derzeit nur für Outbound-Kampagnen Art Umfrage. Der Standardwert ist 0 für Behinderte. + <BR> + <A NAME="settings-callcard_enabled"> + <BR> + <B>Aktivieren CallCard -</B> Diese Einstellung aktiviert die CallCard Features mit sich jeder leisten, damit für Anrufer Pin-Nummern und card_ids, die ein Gleichgewicht von Minuten und die Salden können Agenten Gesprächszeit auf Kundenanrufe in-Gruppen abgezogen haben haben zu verwenden. Standard ist 0 für Behinderte. + + <BR> + <A NAME="settings-custom_fields_enabled"> + <BR> + <B>Aktivieren Sie Benutzerdefinierte Liste Felder -</B> Diese Einstellung ermöglicht die benutzerdefinierte Liste Felder Feature, das für benutzerdefinierte Datenfelder in der Webschnittstelle auf einer Pro-Liste auf Basis definiert werden und dann müssen die Felder in einer Form vor Registerkarte, um den Agenten in der Agenten-Web-Interface ermöglicht. Standard ist 0 für Behinderte. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Aktivieren Kampagne Test-Anrufe -</B> Diese Einstellung ermöglicht die Fähigkeit, ein Telefon und die Telefonnummer in die Felder eingeben am unteren Ende der Kampagne Detailbild und legen Sie einen Anruf an diese Nummer als wäre es eine Führung in das System auto-gewählt wurden. Die Rufnummer wird als eine neue Führung in der Liste manuelle Einwahl-ID-Liste gespeichert werden. Die Kampagne muss aktiv sein, damit diese Funktion aktiviert werden, und es wird empfohlen, dass die Listen zugeordnet der Kampagne alle auf inaktiv gesetzt werden. Die Vorwahl, Dial-Timeout und alle anderen Wahlverfahren verwandten Funktionen, mit Ausnahme von DNC und Call-Optionen eingeben, wird Auswirkungen auf die Wahl der Prüfnummer. Der Anruf wird auf dem Server als dem Voicemail-Server in den Systemeinstellungen ausgewählt platziert werden. Standard ist 0 für Behinderte. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Aktivieren Sie Erweiterte Liste Stats -</B> Diese Einstellung ermöglicht es zwei weitere Säulen, auf die meisten der Liste Status Zusammenbruch Tabellen auf der Liste Modifizierung und Änderung Kampagne Seiten angezeigt werden. Penetration ist als der Prozentsatz von Leitungen, die bei oder oberhalb der Kampagne Anruf Count Limit sind und oder der Status wird als abgeschlossen gekennzeichnet definiert. Standard ist 1 für aktivierte. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Aktivieren Kampagne Vorwahl CID -</B> Diese Einstellung ermöglicht es die Möglichkeit, bestimmte abgehende CallerID Zahlen, die pro Kampagne verwendet werden soll. Standard ist 1 für aktivierte. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Aktivieren Sie Remote Agent Erweiterung Overrides -</B> Diese Einstellung ermöglicht DIDs auf Verlängerung Überschreibungen für Remote-Agenten geroutet haben ruft durch in-Gruppen. Standard ist 0 für Behinderte. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Kontakte aktiviert -</B> Diese Einstellung aktiviert die Kontakte Abs. Admin in die ein Manager zu ändern oder zu löschen Kontakte im System, die als Teil einer benutzerdefinierten Transfer in einer Kampagne, wo ein Agent für Kontakte nach Vorname Nachname oder Büro suchen können verwendet werden kann hinzufügen können Nummer und wählen Sie dann eine der vielen Zahlen mit diesem Kontakt zugeordnet. Diese Funktion wird oft von den Betreibern oder im Schaltschrank, wo Funktionen muss der Benutzer einen Anruf an einen Nicht-Agent Telefon übertragen würden verwendet. Standard ist 0 für Behinderte. + + <BR> + <A NAME="settings-first_login_trigger"> + <BR> + <B>Erster Login-Trigger -</B> Mit dieser Einstellung kann für die Erstkonfiguration des Bediener Bildschirm, um dem Administrator angezeigt werden, wenn sie in das System zuerst anmelden. + + <BR> + <A NAME="settings-default_phone_registration_password"> + <BR> + <B>Standard-Telefon-Anmeldung Passwort -</B> Dies ist die Standard-Registrierung Passwort verwendet werden, wenn neue Handys auf dem System hinzugefügt werden. Die Standardeinstellung ist Test. + + <BR> + <A NAME="settings-default_phone_login_password"> + <BR> + <B>Standard-Telefon Login Passwort -</B> Dies ist die Standard Web-Telefon Login Passwort verwendet werden, wenn neue Handys auf dem System hinzugefügt werden. Die Standardeinstellung ist Test. + + <BR> + <A NAME="settings-default_server_password"> + <BR> + <B>Standard-Server-Kennwort -</B> Dies ist die Standard-Server-Passwort verwendet werden, wenn neue Server mit dem System hinzugefügt werden. Die Standardeinstellung ist Test. + + <BR> + <A NAME="settings-slave_db_server"> + <BR> + <B>Slave Database Server -</B> Wenn Sie eine MySQL-Slave-Datenbank-Server haben, dann geben Sie die lokale IP-Adresse für diesen Server hier. Diese Option ist derzeit nur durch die ausgewählten Berichte in der nächsten Option genutzt und hat nichts mit der automatischen Konfiguration von MySQL Master-Slave-Replikation zu tun. Standard ist leer für Behinderte. + + <BR> + <A NAME="settings-reports_use_slave_db"> + <BR> + <B>Berichte auf Slave DB verwenden -</B> Mit dieser Option können Sie die Berichte, die Sie haben den MySQL-Slave-Datenbank zu verwenden, wie in der oben genannten Option anstelle der Master-Datenbank, die sich jeder leisten Ihre Live-System ausgeführt wird definiert auszuwählen. Sie müssen die die MySQL-Slave-Replikation, bevor Sie diese Option aktivieren können. Standard ist leer für Behinderte. + + <BR> + <A NAME="settings-default_field_labels"> + <BR> + <B>Standard Feldbezeichner -</B> Diese 19 Felder können Sie den Namen gesetzt, wie es in der sich jeder leisten Agent-Interface sowie die administrative Führung modify Seite erscheint. Der Standardwert ist leer, was wird die hartcodierte Standardwerte im Agent-Interface verwenden. Sie können auch einen Aufkleber auf --- --- Verberge, um sowohl das Etikett und das Feld zu verstecken. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Beschriftung ausblenden in Anrufprotokolle -</B> Wird ein Etikett zu setzen --- Verberge --- dann sind die Agenten Anruflisten, wenn über die Kampagne aktiviert ist, werden immer noch das Feld und Daten, wenn diese Option gesetzt, um Standard-Y ist N. + <BR> <A NAME="settings-qc_features_active"> <BR> <B>QC Funktionen Aktive - </B> Mit dieser Option können Sie aktivieren oder deaktivieren Sie die QC oder Quality Control-Funktionen. Der Standardwert ist 0 für inaktiv. + <BR> + <A NAME="settings-default_webphone"> + <BR> + <B>Standard Webphone -</B> Wenn auf 1 gesetzt, diese Option wird alle neuen Handys erstellt wurden als Webphone Satz zu Y. Standardwert ist 0. + + <BR> + <A NAME="settings-webphone_systemkey"> + <BR> + <B>Webphone System Key -</B> Wenn Ihr System oder Anbieter erfordert es, das ist, wo das System für den Key eingegeben webphone sollte in. Standard ist leer werden. + + <BR> + <A NAME="settings-default_codecs"> + <BR> + <B>Standard-Codecs -</B> Sie können eine durch Kommas getrennte Liste von Codecs als die Standard-Codecs für alle Systeme festgelegt werden. Optionen für Codecs beinhalten ulaw, alaw, GSM, G729, Speex, G722, G723, G726, ilbc, ... Standard ist leer. + + <BR> + <A NAME="settings-custom_dialplan_entry"> + <BR> + <B>Benutzerdefinierte Dialplan Eintrag -</B> Dieses Feld ermöglicht es Ihnen, in allen Dialplan Elemente, die Sie für all die Asterisk-Servern eingeben, werden die Zeilen in die Standard-Kontext hinzugefügt werden. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Auf Servern neu laden Dialplan -</B> Diese Option ermöglicht es Ihnen, ein erneutes Laden der Dialplan auf allen Asterisk-Server im Cluster zu zwingen. Wenn Sie Änderungen in den Custom Dialplan Eintrag oben gemachten Sie dies auf 1 gesetzt und reichen sollte, um diese Änderungen in Kraft treten müssen auf den Servern. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Keine Antwort Anmelden -</B> Diese Option wird protokolliert die Wählautomatik Anrufe, die nicht auf einer separaten Tabelle beantwortet werden. Standard ist N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>DID-Agent-Protokoll -</B> Diese Option wird protokolliert die eingehenden Anrufe DID zusammen mit einer Gruppe in-und Benutzer-ID, falls zutreffend, in eine separate Tabelle. Standard ist N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt-Log DB Server -</B> Dies ist der alternative Log-Datenbank-Server. Dies ist optional und ermöglicht einige Protokolle auf einer separaten Datenbank geschrieben werden. Standard ist leer. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Alt-Log-Tabellen -</B> Dies sind die Tabellen, die für die Protokollierung auf dem alternativen Protokoll-Datenbank-Server sind. Standardeinstellung ist leer. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>Externe Server-IP-Standard -</B> Wenn auf 1 gesetzt, diese Option wird alle neuen Telefone erstellt haben Mit externen Bediener IP auf Y gesetzt Standard ist 0. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>Webphone URL -</B> Dies ist die URL des webphone, die mit diesem System verwendet werden soll, wenn es in der Rekord-Telefone aktiviert ist, dass ein Agent verwendet. Standard ist leer. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -5973,6 +8341,31 @@ if ($ADD==99999) <BR> <B>QueueMetrics EnterQueue stellen voran -</B> dieses fangen wirdverwendet, das Voranstellen von einer der vicidial_list Datenzuzulassen auffängt vor der Telefonnummer des Kunden fürkundengebundene QueueMetrics Berichte auf. Rückstellung ist KEINE,alles nicht zu bevölkern. + <BR> + <A NAME="settings-queuemetrics_loginout"> + <BR> + <B>QueueMetrics Login-Out -</B> Diese Option wirkt sich, wie sich jeder leisten wird die An-und Abmeldungen von einem Agenten in der queue_log anmelden. Voreingestellt ist standard auf Standard AGENTLOGIN AGENTLOGOFF verwenden, wird Rückruf nutzen AGENTCALLBACKLOGIN und AGENTCALLBACKLOGOFF dass QM wird anders parsen, NONE wird protokolliert keine An-und Abmeldungen innerhalb queue_log. + + <BR> + <A NAME="settings-queuemetrics_callstatus"> + <BR> + <B>QueueMetrics CallStatus -</B> Diese Option, wenn der Wert auf 0 wird nicht in der CALLSTATUS die Einreise in queue_log, wenn ein Agent einen Anruf Dispositionen. Standard ist 1 für aktivierte. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics AddMember Aktiviert -</B> Diese Option, wenn auf 1 gesetzt wird und ADDMEMBER2 removeMember Einträge in queue_log generieren. Standard ist 0 für Behinderte. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>QueueMetrics Dispo Pausecode -</B> Diese Option, wenn besiedelt, können Sie definieren, ob ein Dispo Pause Code in queue_log, wenn ein Agent ist in Dispo-Status eingetragen wird. Standard ist leer für Behinderte. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>QueueMetrics Telefon Umwelt Telefon anhängen -</B> Diese Option, falls aktiviert, wird der Agent anhängen Telefon anmelden, um die data4 Rekord in der Warteschlange Log-Tabelle, wenn die Kampagne Telefon Umwelt-Feld gefüllt wird. Standard ist 0 für Behinderte. + <BR> <A NAME="settings-enable_vtiger_integration"> <BR> @@ -6009,7 +8402,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUSESTABELLE</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Durch den Gebrauch von Systemstatus, können Sie Status haben, diefür Kampagne und Ingruppe bestehen. Der Status muß 1-6 Buchstabenlang sein, muß die Beschreibung 2-30 Buchstaben lang sein undauswählbar definiert, ob es oben in VICIDIAL als Mitteleinteilungzeigt. Human_answered auffangen wird verwendet, als, denTropfenprozentsatz oder Ungezwungenheit Rate errechnend. Einstellunghuman_answered zu Y verwendet diesen Status, als, diemenschlich-geantworteten Anrufe zählend. Die Kategorie Wahl erlaubtIhnen, einige Status in ein catogy zu gruppieren, das fürstatistische Analyse verwendet werden kann. Außerdem gibt es 5 zusätzliche Einstellungen, die die Art Status:Verkauf, DNC, Kundenkontakt, nicht daran interessiert, nicht praktikabel definieren wird.</B> + <B>Durch den Gebrauch von Systemstatus, können Sie Status haben, diefür Kampagne und Ingruppe bestehen. Der Status muß 1-6 Buchstabenlang sein, muß die Beschreibung 2-30 Buchstaben lang sein undauswählbar definiert, ob es oben in VICIDIAL als Mitteleinteilungzeigt. Human_answered auffangen wird verwendet, als, denTropfenprozentsatz oder Ungezwungenheit Rate errechnend. Einstellunghuman_answered zu Y verwendet diesen Status, als, diemenschlich-geantworteten Anrufe zählend. Die Kategorie Wahl erlaubtIhnen, einige Status in ein catogy zu gruppieren, das fürstatistische Analyse verwendet werden kann. Außerdem gibt es 5 zusätzliche Einstellungen, die die Art Status:Verkauf, DNC, Kundenkontakt, nicht daran interessiert, nicht praktikabel definieren wird, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELSTABELLE</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a pro Kampagne basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Screen-Label-ID -</B> Dieses Feld muss mindestens 2 Zeichen lang sein und nicht länger als 20 Zeichen lang sein, keine Leerzeichen oder Sonderzeichen enthalten. Dies ist die ID, die verwendet werden, um den Bildschirm Label im gesamten System identifiziert wird. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Screen-Label Name -</B> Dies ist der beschreibende Name des Bildschirms Etikett Eintrag. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Admin Benutzer-Gruppe -</B> Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Beschriftung ausblenden in Anrufprotokolle -</B> Wird ein Etikett zu setzen --- Verberge --- dann sind die Agenten Anruflisten, wenn über die Kampagne aktiviert ist, werden immer noch das Feld und Daten, wenn diese Option gesetzt, um Standard-Y ist N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Standard Feldbezeichner -</B> Diese 19 Felder können Sie den Namen gesetzt, wie es in der sich jeder leisten Agent-Interface sowie die administrative Führung modify Seite erscheint. Der Standardwert ist leer, was wird die hartcodierte Standardwerte im Agent-Interface verwenden. Sie können auch einen Aufkleber auf --- --- Verberge, um sowohl das Etikett und das Feld zu verstecken. @@ -6021,6 +8447,58 @@ if ($ADD==99999) <B>Durch den Gebrauch von Systemstatuskategorien, können Sie diezusammen gruppieren Status, um statistische Analyse auf einer GruppeStatus zuzulassen. Die Kategorie Identifikation muß 2-20 Buchstabenlang ohne Räume sein, muß der Name 2-50 Buchstaben lang sein, istdie Beschreibung wahlweise freigestellt und TimeonVDAD Anzeigedefiniert, ob dieser Status einer von bis zu 4 Status ist, die auf derZeit auf VDAD Realzeitreport errechnet werden und angezeigt werdenkönnen.</B> Der Verkauf Kategorie und Dead Lead Kategorie sind auch die von den US-Vorschlag, wenn die Analyse Liste Statistiken. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Erstellen Sie eine neue Vorlage - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Löschentemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "Vorlage löschen". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>Vorlagen-ID -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Template Name -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>Template Description -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>Liste Identifikation -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Spaltes highlighted in blue are standard columns from the vicidial_list table. Spaltes highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "SUBMIT TEMPLATE" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Maximale Systemspannung Statistik Berichte</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Diese Statistiken werden zwischengespeichert Summen, die jeden Tag überall in Echtzeit durch Back-End-Prozesse gespeichert werden. Bei eingehenden Anrufen werden die gesamten Anrufe pro in-group für jeden Anruf, den Prozess, der berechnet betritt berechnet. Für das gesamte System zählt, werden die Summen von Log-Einträgen sowie andere in-group-und Kampagnen-Summen erzeugt. Diese Summen können nicht addieren sich aufgrund der Einstellungen, die Sie in Ihrem System haben, sowie, wenn der Anruf aufgelegt. + + <?php if ($SSqc_features_active > 0) { @@ -6030,7 +8508,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL QC-Status-Codes</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>Das Quality Control QC-System innerhalb VICIDIAL hat seinen eigenen Satz der Status-Codes, getrennt von denen der Call-Handling Funktionen der VICIDIAL. QC statuse Codes muss zwischen 2 und 8 Zeichen lang sein und keine Sonderzeichen wie Leerzeichen oder Doppelpunkt. Die QK-Status-Code Beschreibung muss zwischen 2 und 30 Zeichen lang sein.</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -6070,12 +8548,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -6085,7 +8564,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -6110,13 +8589,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Zeige Anzahl anrufbarer Anschlüsse</B> -<BR><BR>\n"; echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n"; - echo "<B>LISTEN:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>STATUSES:</B> $dial_statuses<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -6140,6 +8621,8 @@ 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'; @@ -6198,13 +8681,22 @@ if ($ADD==7111111) $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'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -6214,6 +8706,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6272,10 +8766,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6335,6 +8832,15 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -6355,8 +8861,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_erfrischen > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
    "; + } ###################################################################################################### @@ -6398,34 +8906,25 @@ if ($ADD=="1") } else { - echo "Benutzer-Zahl: $NWB#vicidial_users-user$NWE\n"; + echo "Benutzer-Zahl: $NWB#vicidial_users-user$NWE\n"; } - echo "Kennwort:$NWB#vicidial_users-pass$NWE\n"; + + echo "Kennwort:$NWB#vicidial_users-pass$NWE     Stärke: \n"; + echo "Voller Name: $NWB#vicidial_users-full_name$NWE\n"; echo "Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE\n"; echo "Benutzer-Gruppe: $NWB#vicidial_users-phone_login$NWE\n"; echo "Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -6472,9 +8971,11 @@ if ($ADD=="1A") } else { - echo "Benutzer-Zahl: $NWB#vicidial_users-user$NWE\n"; + echo "Benutzer-Zahl: $NWB#vicidial_users-user$NWE\n"; } - echo "Kennwort:$NWB#vicidial_users-pass$NWE\n"; + + echo "Kennwort:$NWB#vicidial_users-pass$NWE     Stärke: \n"; + echo "Voller Name: $NWB#vicidial_users-full_name$NWE\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6482,7 +8983,7 @@ if ($ADD=="1A") echo "Source User: \n"; + echo "\n"; echo "
    \n"; if ($voi_count > 0) { @@ -6542,15 +9044,18 @@ if ($ADD==11) } 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"; @@ -6619,10 +9124,12 @@ if ($ADD==11) echo "$scripts_list"; echo "$NWB#vicidial_campaigns-campaign_script$NWE\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
    Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
    Kampagne Beschreibung: $NWB#vicidial_campaigns-campaign_description$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_campaigns-user_group$NWE
    Aktiv:$NWB#vicidial_campaigns-active$NWE
    Park-Verlängerung: $NWB#vicidial_campaigns-park_ext$NWE
    Park-Dateiname: $NWB#vicidial_campaigns-park_file_name$NWE
    Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
    Selbstvorwahlknopf-Niveau:
    Minimale Stufe Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
    Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
    \n"; } @@ -6671,7 +9178,7 @@ if ($ADD==12) echo "Quellkampagne:$NWB#vicidial_lists-list_description$NWE\n"; echo "Kampagne: \n"; } echo "\n"; - echo "\n"; + echo "\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) + { + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; 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_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_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 ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    FILTER Phone Group ZAHL NICHT GELÖSCHT - Diese Rufnummer ist nicht im Filter-Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER Phone Group Nummer gelöscht: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    FILTER Phone Group ZAHL NICHT HINZUGEFÜGT - Diese Rufnummer ist bereits in der Filter-Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER Phone Group Zahl hinzugefügt: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
    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 Gruppe:
    Telefon-Nummern:

    (einer Telefonnummer pro Zeile nur)
    $NWB#vicidial_list-dnc$NWE
    Hinzufügen oder Löschen:
    \n"; + + if ($LOGuser_level >= 9) + { + echo "
    Download numbers in this list to a file:
    \n"; + echo "\n"; + echo "
    \n"; + } + } @@ -6953,17 +9576,23 @@ if ($ADD==1111) echo "
    Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
    Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
    Aktiv:$NWB#vicidial_inbound_groups-active$NWE
    Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_inbound_groups-user_group$NWE
    Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Index: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    \n"; } @@ -7012,7 +9641,7 @@ if ($ADD==1211) echo "Source Gruppe Identifikation: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; echo "DID-Beschreibung:$NWB#vicidial_inbound_dids-did_description$NWE\n"; + echo "Admin Benutzer-Gruppe: $NWB#vicidial_inbound_dids-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7084,7 +9717,7 @@ if ($ADD==1411) echo "Quelle DID: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Menu Name: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Admin Benutzer-Gruppe: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7192,7 +9829,7 @@ if ($ADD==1611) echo "Quelle Menü: \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Filter Phone Gruppe Identifikation: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Filter Phone Gruppe Name: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Beschreibung: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7232,7 +9901,7 @@ if ($ADD==11111) echo "
    ADDIEREN SIE NEUE REMOTEMITTEL
    \n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7512,6 +10245,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7531,7 +10268,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
    Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Benutzernummer Anfang: (nur Zahlen, incremented, muss ein vorhandener Benutzer sich jeder leisten sein)$NWB#vicidial_remote_agents-user_start$NWE
    Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
    Bediener IP: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + echo "
    Erweiterung hinzufügen Gruppeneintrag\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Erweiterungs-Gruppe: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Erweiterung: (nur Zahlen)$NWB#vicidial_extension_groups-extension$NWE
    Rang: $NWB#vicidial_extension_groups-rank$NWE
    Kampagnen Gruppen: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -7339,12 +10048,19 @@ if ($ADD==1111111) echo "
    Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
    Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
    Aktiv:$NWB#vicidial_scripts-active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_scripts-user_group$NWE
    Index-Text: "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -7452,6 +10177,10 @@ if ($ADD==11111111) } echo "
    Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_lead_filters-user_group$NWE
    Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -7481,6 +10210,10 @@ if ($ADD==111111111) echo "
    Anrufzeit ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
    Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
    Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_call_times-user_group$NWE
    Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
    State Call Time State: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-state_call_time_state$NWE
    Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
    Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_call_times-user_group$NWE
    Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7541,6 +10278,10 @@ if ($ADD==131111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -7554,6 +10295,7 @@ if ($ADD==131111111) echo "Freitag
    \n"; echo "Samstag
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Shift-ID: (keine Räume oder Interpunktion)$NWB#vicidial_shifts-shift_id$NWE
    Shift Name: (Kurze Beschreibung der Verlagerung)$NWB#vicidial_shifts-shift_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_shifts-user_group$NWE
    Start Time Shift:\n"; echo "   Shift End Time:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Bericht Option: $NWB#vicidial_shifts-report_option$NWE
    \n"; } @@ -7571,7 +10313,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -7594,32 +10336,36 @@ if ($ADD==11111111111) echo "
    \n"; if ($voi_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"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Telefonverlängerung: Auto-Generated $NWB#phones-extension$NWE
    Tel. Durchwahl:Auto-Generated $NWB#phones-extension$NWE
    Telefonverlängerung: $NWB#phones-extension$NWE
    Tel. Durchwahl:$NWB#phones-extension$NWE
    Dial Plan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
    Voicemail-Box: (nur Stellen)$NWB#phones-voicemail_id$NWE
    Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
    Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
    Bediener IP:
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    Bediener IP: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Kennwort:$NWB#phones-pass$NWE
    Agent-Bildschirm Anmelden: $NWB#phones-login$NWE
    Login Passwort: $NWB#phones-pass$NWE
    Anmeldung Passwort: $NWB#phones-conf_secret$NWE     Stärke:
    Status:$NWB#phones-status$NWE
    Aktives Konto: $NWB#phones-active$NWE
    Telefon-Art: $NWB#phones-phone_type$NWE
    Voller Name: $NWB#phones-fullname$NWE
    Firma:$NWB#phones-company$NWE
    Abbildung:$NWB#phones-picture$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Klient Protokoll: $NWB#phones-protocol$NWE
    Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
    Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
    \n"; } @@ -7637,7 +10383,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7649,6 +10395,10 @@ if ($ADD==12111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7668,7 +10418,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
    Alias-ID:$NWB#phones-alias_id$NWE
    Alias-Name: $NWB#phones-alias_name$NWE
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    Telefon Logins Liste: (comma separated)$NWB#phones-logins_list$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7683,6 +10433,10 @@ if ($ADD==13111111111) echo "
    CallerID Anzahl: $NWB#phones-caller_id_number$NWE
    CallerID Name: $NWB#phones-caller_id_name$NWE
    Aktiv:
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    \n"; @@ -7714,6 +10468,10 @@ if ($ADD==111111111111) echo "
    Bediener-IP address: $NWB#servers-server_ip$NWE
    Aktiv:$NWB#servers-active$NWE
    Sternchen-Version: $NWB#servers-asterisk_version$NWE
    Admin Benutzer-Gruppe: $NWB#servers-user_group$NWE
    \n"; } @@ -7742,6 +10500,10 @@ if ($ADD==131111111111) echo "
    Vorlagen-ID: $NWB#vicidial_conf_templates-template_id$NWE
    Template Name: $NWB#vicidial_conf_templates-template_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_conf_templates-user_group$NWE
    Template-Inhalt: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -7760,7 +10522,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -7824,13 +10576,63 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) + { + echo "
    \n"; echo ""; @@ -7772,10 +10534,14 @@ if ($ADD==141111111111) echo "
    Carrier-ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Beschreibung: $NWB#vicidial_server_carriers-carrier_description$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_server_carriers-user_group$NWE
    Anmeldung String: $NWB#vicidial_server_carriers-registration_string$NWE
    Vorlagen-ID:
    Dialplan Eintrag: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    Bediener IP: $NWB#vicidial_server_carriers-server_ip$NWE
    "; + $SYSTEMRELEASE_graph.=" "; + $AGENTRELEASE_graph.=" "; + $SALES_graph.=" "; + $DNCS_graph.=" "; + $NAS_graph.=" "; + $DROPS_graph.=" "; + $LOGINTIME_graph.=" "; + $PAUSETIME_graph.=" "; + } + $CALLS_graph.="
    \n"; + echo ""; + + echo "
    ADD KOPIERT CARRIER\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
    Carrier-ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
    Bediener IP: $NWB#vicidial_server_carriers-server_ip$NWE
    Quelle Carrier-: $NWB#vicidial_server_carriers-carrier_id$NWE
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### if ($ADD==151111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7842,6 +10644,10 @@ if ($ADD==151111111111) echo "
    TTS-ID: $NWB#vicidial_tts_prompts-tts_id$NWE
    TTS Name: $NWB#vicidial_tts_prompts-tts_name$NWE
    Aktiv:
    Admin Benutzer-Gruppe: $NWB#vicidial_tts_prompts-user_group$NWE
    \n"; @@ -7860,7 +10666,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7872,6 +10678,10 @@ if ($ADD==161111111111) echo "
    Music On Hold ID: $NWB#vicidial_music_on_hold-moh_id$NWE
    Music On Hold Name: $NWB#vicidial_music_on_hold-moh_name$NWE
    Zufälliger Reihenfolge:
    Admin Benutzer-Gruppe: $NWB#vicidial_music_on_hold-user_group$NWE
    \n"; @@ -7890,7 +10700,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    \n"; echo ""; @@ -7904,6 +10714,81 @@ if ($ADD==171111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Aktiv:
    E-Mail:$NWB#vicidial_voicemail-email$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_voicemail-user_group$NWE
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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#vicidial_screen_labels-label_id$NWE
    Screen-Label Name: $NWB#vicidial_screen_labels-label_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_screen_labels-user_group$NWE
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
    Vorname: $NWB#contact_information$NWE
    Letzter Name: $NWB#contact_information$NWE
    Office Number: $NWB#contact_information$NWE
    Handy-Nummer: $NWB#contact_information$NWE
    Andere Anzahl 1: $NWB#contact_information$NWE
    Andere Anzahl 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Gruppe:$NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; @@ -7932,9 +10817,7 @@ if ($ADD==1111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
    Bediener IP: $NWB#conferences-server_ip$NWE
    \n"; @@ -7963,9 +10846,7 @@ if ($ADD==11111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
    Bediener IP: $NWB#conferences-server_ip$NWE
    \n"; @@ -8018,10 +10899,10 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
    BENUTZER NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    voller Name und Kennwort müssen mindestens 2 Buchstaben lang sein\n"; echo "
    Sie müssen sich für eine Benutzergruppe\n"; } @@ -8118,6 +10999,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8205,7 +11096,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8296,10 +11187,10 @@ if ($ADD=="2A") {echo "
    BENUTZER NICHT ADDIERT - es gibt bereits einen Benutzer im System mitdieser Benutzerzahl\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) { echo "
    BENUTZER NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    voller Name und Kennwort müssen mindestens 2 Buchstaben lang sein\n"; echo "\n"; } @@ -8342,7 +11233,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8400,6 +11291,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8487,7 +11388,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8600,12 +11501,30 @@ if ($ADD==21) { echo "
    KAMPAGNE ADDIERT: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8664,13 +11583,31 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_erfrischen,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) 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_erfrischen,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -8682,6 +11619,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8726,7 +11669,7 @@ if ($ADD==22) { echo "
    KAMPAGNE STATUS ADDIERT: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -8967,6 +11910,176 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PRESET NICHT HINZUGEFÜGT - Existiert bereits ein Eintrag für diese Kampagne mit dieser voreingestellten\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
    PRESET NICHT HINZUGEFÜGT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    CID NICHT ADDED AREACODE - Existiert bereits ein Eintrag für diese Kampagne mit diesem CID
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    CID NICHT ADDED AREACODE - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    AREACODE CID NICHT GELÖSCHT - Dieser Eintrag existiert nicht
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    AREACODE CID NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \n"; + } + else + { + echo "AREACODE CID MODIFIZIERTE: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9013,7 +12126,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTEN', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9066,12 +12179,15 @@ if ($ADD==2111) } 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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPPE FÜGTE HINZU: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -9131,9 +12247,15 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPPE FÜGTE HINZU: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -9178,7 +12300,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9223,7 +12345,7 @@ if ($ADD==2411) } 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) 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 from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9271,31 +12393,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_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";} + { + echo "
    CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + 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 - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
    Call Menü-ID muss zwischen 2 und 50 Zeichen lang sein und enthalten keine ' '.\n"; + echo "
    Rufen Sie Menü-ID kann nicht verwendet werden reservierte Wörter: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
    CALL MENU NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    Call Menü-ID muss zwischen 2 und 50 Zeichen lang sein und enthalten keine ' '.\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_query($stmt, $link); - echo "
    CALL MENU ADDED: $menu_id $menu_name\n"; + echo "
    CALL MENU ADDED: $menu_id $menu_name\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9324,34 +12460,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_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";} + { + echo "
    CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + 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 - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
    Call Menü-ID muss zwischen 2 und 50 Zeichen lang sein und enthalten keine ' '.\n"; + echo "
    Rufen Sie Menü-ID kann nicht verwendet werden reservierte Wörter: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
    CALL MENU NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    Call Menü-ID muss zwischen 2 und 50 Zeichen lang sein und enthalten keine ' '.\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
    CALL MENU ADDED: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PHONE Filter Gruppe NICHT HINZUGEFÜGT - es besteht bereits eine PHONE Filter Gruppe in das System mit dieser ID\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
    PHONE FILTER GRUPPE NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; + echo "
    Telefon-Filter-Gruppen-ID muss zwischen 2 und 20 Zeichen lang sein und darf keine ' '.\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_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
    CALL MENU ADDED: $menu_id - $menu_name\n"; + echo "
    PHONE Filter Gruppe ADDED: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + $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 ADDIEREN SIE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9369,30 +12558,94 @@ if ($ADD==21111) {echo "
    REMOTEMITTEL NICHT ADDIERT - es gibt bereits eineRemotemitteleintragung beginnend mit diesem userID\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    REMOTEMITTEL NOT ADDED - Sie müssen einen gültigen als user_start für Remote-Agenten verwenden\n";} + else { - echo "
    REMOTEMITTEL NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
    Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    REMOTEMITTEL NOT ADDED - Ihre Anzahl der Zeilen Überschneidungen mit anderen 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 "
    REMOTEMITTEL NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; + echo "
    Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
    REMOTEMITTEL FÜGTEN HINZU: $user_start\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Nebenstellengruppe Eintrag nicht hinzugefügt - Existiert bereits ein Eintrag Verlängerung Gruppe mit diesen Werten\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
    Nebenstellengruppe Eintrag nicht hinzugefügt - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
    REMOTEMITTEL FÜGTEN HINZU: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
    Nebenstellengruppe Eintrag hinzugefügt: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9428,9 +12681,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; + $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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
    BENUTZER-GRUPPE ADDIERT: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -9556,7 +12834,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
    INDEX FÜGTE HINZU: $script_id\n"; @@ -9609,7 +12887,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9649,7 +12927,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9689,7 +12967,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9753,7 +13031,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9830,7 +13108,7 @@ if ($ADD==21111111111) { echo "
    TELEFON FÜGTE HINZU\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9879,7 +13157,7 @@ if ($ADD==22111111111) { echo "
    TEL ALIAS ADDED\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9920,7 +13198,7 @@ if ($ADD==23111111111) { echo "
    GROUP ALIAS ADDED\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9957,7 +13235,7 @@ if ($ADD==211111111111) { echo "
    BEDIENERADDED\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10054,7 +13332,7 @@ if ($ADD==231111111111) { echo "
    CONF TEMPLATE ADDED\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10090,7 +13368,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10109,6 +13387,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    CARRIER NOT ADDED - Es gibt bereits ein Luftfahrtunternehmen in das System mit dieser ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
    CARRIER NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
    KOPIERT Träger zugesetzt\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_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10129,7 +13446,7 @@ if ($ADD==251111111111) { echo "
    TTS Entry Hinzugefügt\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10165,7 +13482,7 @@ if ($ADD==261111111111) { echo "
    MUSIC ON HOLD Entry Hinzugefügt\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10208,7 +13525,7 @@ if ($ADD==271111111111) { echo "
    Voicemail-Box ADDED\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -10233,6 +13550,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    SCREEN Label nicht ADDED - Es ist bereits ein Etikett in dem System mit dieser ID\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
    SCREEN Label nicht ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
    SCREEN Etikett hinzugefügt\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    NICHT hinzugefügten Kontakt - Ist bereits ein Kontakt in das System mit diesem Namen und die Nummer\n";} + else + { + if (strlen($last_name) < 2) + {echo "
    NICHT hinzugefügten Kontakt - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
    Kontakt hinzugefügt\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -10296,7 +13693,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -10320,7 +13717,7 @@ if ($ADD==221111111111111) { echo "
    SYSTEMSTATUS ADDIERT: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10461,11 +13858,11 @@ if ($ADD=="4A") } echo "
    BENUTZER ÄNDERTE - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -10513,6 +13910,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10600,7 +14007,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10694,7 +14101,7 @@ if ($ADD=="4B") } echo "
    BENUTZER ÄNDERTE - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10746,6 +14153,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10833,7 +14250,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10921,7 +14338,7 @@ if ($ADD==4) { echo "
    BENUTZER ÄNDERTE: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10973,6 +14390,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11060,7 +14487,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -11141,6 +14568,7 @@ if ($ADD==41) 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'; @@ -11169,6 +14597,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -11183,32 +14613,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
    ACTIVE LISTEN CHANGED"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Testen Sie Outbound Call';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
    "; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTEN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
    ACTIVE LISTEN CHANGED"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -11220,77 +14739,124 @@ if ($ADD==41) } else { - echo "
    KAMPAGNE ÄNDERTE: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
    CAMPAIGN NOT MODIFIED - Bitte warten Sie für die gesamte Seite zu laden, bevor Sie das Formular\n"; } else { - if ($dial_level_override > 0) + echo "
    KAMPAGNE ÄNDERTE: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
    ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; - echo "
    - Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_erfrischen='$campaign_stats_erfrischen',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
    ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; + echo "
    - Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -11343,7 +14909,7 @@ if ($ADD==42) { echo "
    KUNDENSPEZIFISCHER KAMPAGNE STATUS GEÄNDERT: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11450,6 +15016,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -11472,7 +15040,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTEN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11521,7 +15089,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11712,7 +15280,7 @@ if ($ADD=='40A') { echo "
    UMFRAGE EINSTELLUNGEN MODIFIZIERT: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11798,7 +15366,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -11832,7 +15400,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -11906,7 +15474,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -11999,56 +15567,128 @@ if ($ADD==49) ###################### -# ADD=411 submit list modifications to the system +# ADD=401 modify campaign preset in the system ###################### -if ($ADD==411) +if ($ADD==401) { - if ($LOGmodify_lists==1) + if ($LOGmodify_campaigns==1) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    LISTE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; - echo "
    Liste Name muß mindestens 2 Buchstaben lang sein\n"; + echo "
    PRESET NICHT VERÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 { - if (strlen($reset_time) < 4) {$reset_time='';} + echo "
    PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; - echo "
    LISTE ÄNDERTE: $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' where list_id='$list_id';"; + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTEN', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } - if ($reset_list == 'Y') + +###################### +# 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) { - echo "
    ZURÜCKSTELLEN VON VON LIST-CALLED-STATUS\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTEN', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
    ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
    LISTE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; + echo "
    Liste Name muß mindestens 2 Buchstaben lang sein\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
    LISTE ÄNDERTE: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
    ZURÜCKSTELLEN VON VON LIST-CALLED-STATUS\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
    ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -12067,84 +15707,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
    GRUPPE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
    Gruppe Name und Gruppe Farbe muß mindestens 2 Buchstaben lang sein\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
    BENUTZER NOT MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', 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_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
    GRUPPE GEÄNDERT: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; } } else { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
    GRUPPE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; + echo "
    Gruppe Name und Gruppe Farbe muß mindestens 2 Buchstaben lang sein\n"; + } + else + { + if ($form_end != 'END') + { + echo "
    GROUP NOT MODIFIED - Bitte warten Sie für die gesamte Seite zu laden, bevor Sie das Formular\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
    GRUPPE GEÄNDERT: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -12169,7 +15909,7 @@ if ($ADD==4311) { echo "
    DID VERÄNDERTE: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12209,12 +15949,12 @@ if ($ADD==4511) { 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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -12231,27 +15971,35 @@ if ($ADD==4511) 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["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"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -12292,7 +16040,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -12334,32 +16082,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
    REMOTEMITTEL NICHT GEÄNDERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
    Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; + echo "
    FILTER PHONE GRUPPE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; + echo "
    Filter Phone Gruppe Name and ID 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' where remote_agent_id='$remote_agent_id';"; + $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_query($stmt, $link); - echo "
    REMOTEMITTEL GEÄNDERT\n"; + echo "
    FILTER Phone Group MODIFIZIERTE\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12369,10 +16117,108 @@ if ($ADD==41111) echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    REMOTEMITTEL NOT MODIFIED - Sie müssen einen gültigen als user_start für Remote-Agenten verwenden\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    REMOTEMITTEL NOT MODIFIED - Ihre Anzahl der Zeilen Überschneidungen mit anderen 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 "
    REMOTEMITTEL NICHT GEÄNDERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; + echo "
    Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    REMOTEMITTEL GEÄNDERT\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
    Nebenstellengruppe Eintrag nicht MODIFIZIERTE - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + echo "
    Nebenstellengruppe Eintrag dahingehend angepasst\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12390,117 +16236,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Sie sind nicht berechtigt, eigene Benutzergruppe bearbeiten\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - - $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' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - echo "
    BENUTZER-GRUPPE GEÄNDERT\n"; + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY User Group', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "
    BENUTZER-GRUPPE GEÄNDERT\n"; - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY User Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -12532,7 +16413,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
    INDEX ÄNDERTE\n"; @@ -12574,7 +16455,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
    FILTER GEÄNDERT\n"; @@ -12630,7 +16511,7 @@ if ($ADD==411111111) $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' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    Anrufzeit geändert\n"; @@ -12686,7 +16567,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    Landesspezifische Anrufzeit geändert\n"; @@ -12715,7 +16596,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -12737,7 +16618,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
    UMSCHALT VERÄNDERTE\n"; @@ -12766,14 +16647,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
    TELEFON NICHT GEÄNDERT - es gibt bereits ein Telefon im System mitdiesem extension/server\n";} else { @@ -12783,7 +16664,7 @@ if ($ADD==41111111111) { echo "
    TELEFON GEÄNDERT: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_erfrischen='$enable_fast_erfrischen', fast_erfrischen_rate='$fast_erfrischen_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12814,7 +16695,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12827,7 +16708,7 @@ if ($ADD==42111111111) { echo "
    TEL ALIAS VERÄNDERTE: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12854,7 +16735,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12867,7 +16748,7 @@ if ($ADD==43111111111) { echo "
    GROUP ALIAS VERÄNDERTE: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12901,14 +16782,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
    BEDIENERNOT MODIFIED - there is already a server in the system with this server_id\n";} else { $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
    BEDIENER NICHT GEÄNDERT - es gibt bereits einen Bediener im Systemmit diesem server_ip\n";} else { @@ -12916,7 +16797,7 @@ if ($ADD==411111111111) {echo "
    BEDIENER NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13019,7 +16900,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
    CONF TEMPLATE MODIFIED: $template_id\n"; @@ -13048,7 +16929,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -13056,7 +16937,7 @@ if ($ADD==441111111111) {echo "
    CARRIER NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -13088,7 +16969,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -13096,7 +16977,7 @@ if ($ADD==451111111111) {echo "
    TTS Eintrag nicht MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
    TTS ENTRY MODIFIED: $tts_id\n"; @@ -13125,7 +17006,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -13158,7 +17039,7 @@ if ($ADD==461111111111) {echo "
    MUSIC ON HOLD Eintrag nicht MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -13226,7 +17107,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -13234,7 +17115,7 @@ if ($ADD==471111111111) {echo "
    Voicemail-Box NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -13265,6 +17146,87 @@ if ($ADD==471111111111) } +###################### +# 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 NICHT VERÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + echo "
    SCREEN LABEL MODIFIZIERTE: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
    NICHT VERÄNDERT KONTAKT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $linkALT); + + echo "
    CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN KONTAKT ZU ÄNDERN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -13278,7 +17240,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    KONFERENZ NICHT GEÄNDERT - es gibt bereits eine Konferenz im Systemmit diesem Verlängerung-Bediener\n";} else { @@ -13288,7 +17250,7 @@ if ($ADD==4111111111111) { echo "
    KONFERENZ ÄNDERTE: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13315,7 +17277,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    VICIDIAL KONFERENZ NICHT GEÄNDERT - es gibt bereits eine Konferenz im Systemmit diesem Verlängerung-Bediener\n";} else { @@ -13325,7 +17287,7 @@ if ($ADD==41111111111111) { echo "
    VICIDIAL KONFERENZ ÄNDERTE: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13352,11 +17314,37 @@ if ($ADD==411111111111111) echo "
    VICIDIAL SYSTEM EINSTELLUNGEN GEÄNDERT WORDEN\n"; - $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';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_erfrischen='$admin_modify_erfrischen',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -13378,7 +17366,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13421,7 +17409,7 @@ if ($ADD==421111111111111) { echo "
    SYSTEMSTATUS GEÄNDERT: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13449,7 +17437,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13672,7 +17660,7 @@ if ($ADD==53) else { echo "
    VDAC AUSLÖSEBESTÄTIGUNG: $campaign_id\n"; - echo "

    Klicken Sie hier, um das älteste zu löschen LEBEN Aufzeichnung inVDAC für $campaign_id


    \n"; + echo "

    Klicken Sie hier, um das älteste zu löschen LEBEN Aufzeichnung inVDAC für $campaign_id


    \n"; } # go to campaign modification below @@ -13770,6 +17758,28 @@ if ($ADD==5511) $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 Gruppe nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
    FILTER Phone Group Löschbestätigung: $filter_phone_group_id\n"; + echo "

    Klicken Sie hier, um FILTER Phone Group löschen $filter_phone_group_id


    \n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13792,6 +17802,28 @@ if ($ADD==51111) $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 "
    Nebenstellengruppe Eintrag nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    extension_id be at least 1 characters in length\n"; + } + else + { + echo "
    VERLÄNGERUNG Gruppeneintrag Löschbestätigung: $extension_id\n"; + echo "

    Klicken Sie hier, um die Verlängerung Gruppe Eintrag löschen $extension_id


    \n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14124,6 +18156,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
    SCREEN LABEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    Label ID be at least 2 characters in length\n"; + } + else + { + echo "
    SCREEN LABEL Löschbestätigung: $label_id - $label_name\n"; + echo "

    Klicken Sie hier, um Bildschirm-Label löschen $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 "
    KONTAKT NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
    Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
    KONTAKT Löschbestätigung: $contact_id - $first_name - $last_name\n"; + echo "

    Klicken Sie hier, um zu löschencontact $contact_id - $first_name - $last_name


    \n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -14193,27 +18269,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Sie sind nicht berechtigt, eigene Benutzer bearbeiten\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    BENUTZER-AUSLASSUNG FÜHRTE DURCH: $user\n"; - echo "

    \n"; + echo "
    BENUTZER-AUSLASSUNG FÜHRTE DURCH: $user\n"; + echo "

    \n"; + } } - $ADD='0'; # go to user list } @@ -14232,44 +18315,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + echo "
    ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14307,7 +18399,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -14318,6 +18410,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -14357,7 +18450,7 @@ if ($ADD==62) if ($DB) {echo "\n
    VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -14407,7 +18500,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -14418,55 +18511,139 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; - if ($DB) {echo "
    $stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
    $stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
    $stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
    $stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -14514,7 +18691,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14563,7 +18740,7 @@ if ($ADD==65) { echo "
    KAMPAGNE LEITUNG BEREITEN GELÖSCHT AUF: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14594,7 +18771,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14610,12 +18787,12 @@ if ($ADD==66) { echo "
    SELBSTALT VORWAHLKNOPF-STATUS GELÖSCHT: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14657,7 +18834,7 @@ if ($ADD==67) { 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';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14688,7 +18865,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14704,12 +18881,12 @@ if ($ADD==68) { echo "
    KAMPAGNE VORWAHLKNOPF-STATUS ENTFERNT: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14731,6 +18908,51 @@ if ($ADD==68) $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 "
    KAMPAGNE PRESET NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14746,11 +18968,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
    ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    ENTFERNEN DER LISTE LEITUNGEN VON DER VICIDIAL_LIST TABELLE\n"; @@ -14761,7 +18983,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTEN', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -14787,7 +19009,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -14799,6 +19021,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -14830,7 +19055,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14863,7 +19088,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -14884,6 +19109,42 @@ if ($ADD==6511) $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 Gruppe nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER Phone Group LÖSCHUNG ABGESCHLOSSEN: $filter_phone_group_id\n"; + echo "

    \n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14917,6 +19178,41 @@ if ($ADD==61111) $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 "
    Nebenstellengruppe Eintrag nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Nebenstellengruppe Eintragslöschnachricht ABGESCHLOSSEN: $extension_id\n"; + echo "

    \n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -14932,21 +19228,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Sie sind nicht berechtigt, eigene Benutzergruppe bearbeiten\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE User Group', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE User Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    BENUTZER-GRUPPE AUSLASSUNG DURCHGEFÜHRT: $user_group\n"; - echo "

    \n"; + echo "
    BENUTZER-GRUPPE AUSLASSUNG DURCHGEFÜHRT: $user_group\n"; + echo "

    \n"; + } } - $ADD='100000'; # go to user group list } @@ -14965,7 +19268,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14999,7 +19302,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15033,7 +19336,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15067,7 +19370,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -15125,7 +19428,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15160,7 +19463,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -15196,7 +19499,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15229,7 +19532,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15263,7 +19566,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15346,7 +19649,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15384,7 +19687,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -15420,7 +19723,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15456,7 +19759,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -15489,7 +19792,7 @@ if ($ADD==671111111111) } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15515,6 +19818,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
    SCREEN LABEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    SCREEN LABEL LÖSCHUNG ABGESCHLOSSEN: $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 "
    KONTAKT NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Kontakt löschen', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

    \n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -15603,10 +19979,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_erfrischen=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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15683,8 +20065,30 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
    Sie haben nicht Erlaubnis, diesen Benutzer zu ändern: $user\n"; } @@ -15700,14 +20104,25 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 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"; @@ -15756,6 +20172,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15775,18 +20192,22 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -15808,6 +20229,12 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; #9BB9FB @@ -15830,6 +20257,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15855,6 +20287,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -15862,8 +20307,17 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } - echo "\n"; + echo "\n"; echo "
    Benutzer-Zahl: $user$NWB#vicidial_users-user$NWE
    Kennwort:$NWB#vicidial_users-pass$NWE
    Kennwort:$NWB#vicidial_users-pass$NWE     Stärke:
    Zwingen Sie Passwort ändern: $NWB#vicidial_users-force_change_password$NWE
    Voller Name: $NWB#vicidial_users-full_name$NWE
    Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE
    Benutzer-Gruppe:
    Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
    Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
    Aktiv:$NWB#vicidial_users-active$NWE
    Voicemail-ID: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
    E-Mail:$NWB#vicidial_users-optional$NWE
    User Code: $NWB#vicidial_users-optional$NWE
    Main Territory: $NWB#vicidial_users-optional$NWE
    MITTEL-SCHNITTSTELLE WAHLEN:
    Mittel Wählen Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Wählen Sie Blended-Agent: $NWB#vicidial_users-agent_choose_blended$NWE
    Wählen Sie Agent Territories: $NWB#vicidial_users-agent_choose_territories$NWE
    Agent Alter Kunden Telefon AllowOverride:$NWB#vicidial_users-alter_custphone_override$NWE
    Agent Shift Vollstreckung Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Agent-Call Log anzeigen Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Agent-Lead-Suche Override: $NWB#vicidial_users-agent_lead_search_override$NWE
    Alarm aktiv: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    Lassen Sie Alerts: $NWB#vicidial_users-allow_alerts$NWE
    Preset Kontakt Suche: $NWB#vicidial_users-preset_contact_search$NWE
    Kampagne Rank:$NWB#vicidial_users-campaign_ranks$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKcampaigns_list"; echo "
    \n"; echo "
    Inbound Gruppen: $NWB#vicidial_users-closer_campaigns$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKgroups_list"; echo "
    \n"; echo "
    Admin zu melden OPTIONS:
    Realtime Block User Info: $NWB#vicidial_users-realtime_block_user_info$NWE
    Admin ausblenden Lead-Daten: $NWB#vicidial_users-admin_hide_lead_data$NWE
    Admin ausblenden Phone Data: $NWB#vicidial_users-admin_hide_phone_data$NWE
    ADMIN SCHNITTSTELLE WAHLEN:
    Exportieren von Berichten: $NWB#vicidial_users-export_reports$NWE
    Löschen von DNC-Listen: $NWB#vicidial_users-delete_from_dnc$NWE
    Benutzerdefinierte Felder bearbeiten: $NWB#vicidial_users-custom_fields_modify$NWE
    Ändern Sie Kampagnen: $NWB#vicidial_users-modify_sections$NWE
    Kampagne Detail: $NWB#vicidial_users-campaign_detail$NWE
    Löschung-Kampagnen: $NWB#vicidial_users-delete_campaigns$NWE
    Bearbeite Anrufzeits: $NWB#vicidial_users-modify_call_times$NWE
    Lösche Anrufzeits: $NWB#vicidial_users-delete_call_times$NWE
    Ändern Sie Bediener: $NWB#vicidial_users-modify_sections$NWE
    Ändern Verschiebungen: $NWB#vicidial_users-modify_sections$NWE
    ÄndernHandys: $NWB#vicidial_users-modify_sections$NWE
    ÄndernTräger: $NWB#vicidial_users-modify_sections$NWE
    ÄndernLabels: $NWB#vicidial_users-modify_sections$NWE
    ÄndernStatus: $NWB#vicidial_users-modify_sections$NWE
    ÄndernVoicemail: $NWB#vicidial_users-modify_sections$NWE
    ÄndernAudio-Store: $NWB#vicidial_users-modify_sections$NWE
    ÄndernMusic On Hold: $NWB#vicidial_users-modify_sections$NWE
    ÄndernTTS: $NWB#vicidial_users-modify_sections$NWE
    ÄndernContacts: $NWB#vicidial_users-modify_sections$NWE
    CallCard Zugang: $NWB#vicidial_users-modify_sections$NWE
    Agent API-Zugang:$NWB#vicidial_users-vdc_agent_api_access$NWE
    AddTimeclock Log Record: $NWB#vicidial_users-add_timeclock_log$NWE
    Löschen der RegistrierungTimeclock Record: $NWB#vicidial_users-delete_timeclock_log$NWE
    Shift Manager Vollstreckung Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    Ändern Gleiche Benutzer-Niveau: $NWB#vicidial_users-modify_same_user_level$NWE
    \n"; if ($LOGdelete_users > 0) @@ -15877,7 +20331,7 @@ if ($ADD==3) echo "

    Klicken Sie hier für Benutzer Wiederholungsbesuch Einflüsse\n"; if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu diesem Eintrag
    \n"; + echo "

    Klicken Sie hier um Admin Änderungen an diesem Datensatz zu sehen\n"; } } } @@ -15902,6 +20356,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_erfrischen=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -15912,6 +20371,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -15919,16 +20388,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -15978,7 +20450,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_erfrischen = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -16060,13 +20532,82 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Einstellungen";} + else + {$ALTmultiDISABLE=0; $ALTmultiLINK='';} + + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -16077,7 +20618,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -16105,7 +20646,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -16149,7 +20690,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -16180,7 +20721,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -16204,9 +20745,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -16229,6 +20772,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -16248,9 +20816,13 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -16263,6 +20835,14 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16271,7 +20851,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
    $row[0]: Basic   Basic Detail StatusHotKeysUmfragePause Codes Voreinstellungen AC-CIDQC Real-Time Real-Time
    \n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
    \n"; @@ -16284,26 +20864,38 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; if ($SSoutbound_autodial_active > 0) { - echo "\n"; + echo "\n"; $o=0; while ($Ds_to_print > $o) @@ -16325,137 +20917,198 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -16516,7 +21169,11 @@ if ($ADD==31) } echo "(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       PASSEN SIE ÜBERSTEUERUNG AN\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + 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"; @@ -16665,24 +21328,32 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + 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"; if ($SSoutbound_autodial_active > 0) { @@ -16727,26 +21410,46 @@ if ($ADD==31) } 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"; @@ -16757,7 +21460,15 @@ if ($ADD==31) echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -16776,6 +21487,11 @@ if ($ADD==31) } 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"; @@ -16789,9 +21505,21 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -16799,16 +21527,22 @@ if ($ADD==31) { echo "\n"; } - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -16857,17 +21591,50 @@ if ($ADD==31) 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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { - echo "\n"; @@ -16885,6 +21652,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
    Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    Kampagne Identifikation: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
    Kampagne Beschreibung: $NWB#vicidial_campaigns-campaign_description$NWE
    Kampagne Datum ändern: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Kampagne Login Datum: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Kampagne Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Aktiv:$NWB#vicidial_campaigns-active$NWE
    Park-Verlängerung: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
    Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
    \n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
    Aktiv:$NWB#vicidial_campaigns-active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_campaigns-user_group$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Netz-Form Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Netz-Form Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Netz-Form-Target: $NWB#vicidial_campaigns-web_form_target$NWE
    Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Erlauben Sie Inbound und gemischt:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
    Erlauben Sie Inbound und gemischt:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
    Add A Dial Status:
    Fügen Sie eine DFÜ-Status-to-Call:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
    US-Mix:
    Liste Auftrag: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Liste Auftrag Randomize: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
    Liste Auftrag Sekundäre: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
    US-Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Leitung Filter: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Drop Lockout Time: $NWB#vicidial_campaigns-drop_lockout_time$NWE
    Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
    Anzahl der Anrufe-Limit: $NWB#vicidial_campaigns-call_count_limit$NWE
    Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Anzahl der Anrufe Ziel: $NWB#vicidial_campaigns-call_count_target$NWE
    Minimale Stufe Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Automatische Hopper Stufe: $NWB#vicidial_campaigns-use_auto_hopper$NWE
    Automatische Hopper Multiplier: $NWB#vicidial_campaigns-hopper_level$NWE
    Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
    Hopper VLC Dup Prüfen: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
    Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Vorwahlknopf-Methode: $NWB#vicidial_campaigns-dial_method$NWE
    Vorhandenes Nur Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Auto Dial Schwellwert: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
    Vorhandenes Nur Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Erhältlich Nur Tally Threshold: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
    Tropfen-Prozentsatz-Begrenzung: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
    Gleichzeitige Übertragungen: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Wählen Level Difference Zielmethode: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
    Gleichzeitige Übertragungen: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Queue-Priorität:$NWB#vicidial_campaigns-drop_rate_group$NWE
    Eingangswarteschlange No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    SelbstAlt-zahl Wählen: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    SelbstAlt-zahl Wählen: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
    Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
    Ortsgespräch-Zeit:
    Vorwahlknopf-Präfix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Manuelle Vorwahl: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Lassen Sie Telefon-Code Aus: $NWB#vicidial_campaigns-omit_phone_code$NWE
    Kampagne CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Benutzerdefinierte CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Kampagne VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Routing-Erweiterung: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Kampagne Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
    Das Notieren Verzögert: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
    Rufen Sie Noten pro Anruf: $NWB#vicidial_campaigns-per_call_notes$NWE
    Agent-Lead-Suche: $NWB#vicidial_campaigns-agent_lead_search$NWE
    Agent-Lead-Suchmethode: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
    Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
    Antwortende Maschine Anzeige: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
    Antwortende Maschine Anzeige: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -16711,15 +21382,27 @@ if ($ADD==31) echo "
    BringenSie Zahl 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Quick Transfer Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Aktivieren Transfer-Presets: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Übertragung ausblenden Zu wählende Nummer: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Quick Transfer Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Custom 3-Wege-Taste Transfer-: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
    Vorab gefüllt Transfer Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Timer-Aktion: $NWB#vicidial_campaigns-timer_action$NWE
    Anruf parken IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Timer-Aktion Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Anruf parken IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Timer-Aktion Sekunden: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer-Aktion: $NWB#vicidial_campaigns-timer_action$NWE
    Timer-Aktion Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Timer-Aktion Sekunden: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer-Aktion Reiseziel: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Zeitlich geplante Wiederholungsbesuche: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Geplante Rückrufe Alarm: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Geplante Rückrufe Count: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Geplante Rückrufe Tage zu begrenzen: $NWB#vicidial_campaigns-callback_days_limit$NWE
    Geplante Rückrufe Stunden-Block: $NWB#vicidial_campaigns-callback_hours_block$NWE
    Geplante Rückrufe Calltime-Block: $NWB#vicidial_campaigns-callback_list_calltime$NWE
    Meine Rückrufe Checkbox Standard: $NWB#vicidial_campaigns-my_callback_option$NWE
    Verbindungsaufbau Sekunden: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Drop-Aktion:$NWB#vicidial_campaigns-drop_action$NWE
    Drop-Aktion:$NWB#vicidial_campaigns-drop_action$NWE
    Sicherheitsnebenstelle: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
    Voicemail: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Safe-Harbor-Audio: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
    Safe-Harbor-Call-Menü: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
    Voicemail: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Drop-Transfer-Gruppe:$NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Deaktivieren Sie Dispo-Screen: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
    Deaktivieren Sie Dispo-Status:$NWB#vicidial_campaigns-disable_dispo_status$NWE
    Nachbereitung Sekunden $NWB#vicidial_campaigns-wrapup_seconds$NWE
    Nachbereitung Nachricht $NWB#vicidial_campaigns-wrapup_message$NWE
    AgentPause CodesAktiv:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
    Kampagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Auto Pause Pre-Call Work: $NWB#vicidial_campaigns-auto_pause_precall$NWE
    Auto-Resume-Pre-Call Work: $NWB#vicidial_campaigns-auto_resume_precall$NWE
    Auto Pause Pre-Call-Vorwahl: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
    Kampagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_erfrischen$NWE
    Echtzeit-Agent Zeitstatistik: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Sperren Sie Ändern Kunde Daten: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Deaktivieren Alter Kunde Telefon:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agent Anzeige dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
    Agent-Bildschirm Labels: $NWB#vicidial_campaigns-screen_labels$NWE
    Status Anzeige-Felder: $NWB#vicidial_campaigns-status_display_fields$NWE
    Agent Anzeige Queue Count:$NWB#vicidial_campaigns-display_queue_count$NWE
    Agent Pause nach jedem Anruf: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Manuelle Wahl Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Manuelle Vorwahlknopf-Liste Identifikation:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Manual Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manual Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manuelle Vorschau Dial: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Manuell überprüfen Sie Anrufdauer: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
    Manuelle Wahl API: $NWB#vicidial_campaigns-api_manual_dial$NWE
    Manuelle Wahl CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
    Telefon Post Time Difference-Alert: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
    Agent Screen Zwischenablage kopieren: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    Agent Screen Erweiterte Alt Zifferblatt: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
    3-Wege-Call Outbound CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Wege-Call Outbound CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Wege-Call-Vorwahl: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Kunde 3-Wege-Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Kunde 3-Wege-Hangup Sekunden: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Kunde 3-Wege-Hangup Aktion: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Alias-Gruppe erlaubt: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    QM-Telefon Umwelt: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
    PLLB Gruppierung: $NWB#vicidial_campaigns-pllb_grouping$NWE
    PLLB Limit-Gruppierung: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
    CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Popup-Adresse: $NWB#vicidial_campaigns-crm_login_address$NWE
    CRM Popup-Adresse: $NWB#vicidial_campaigns-crm_login_address$NWE
    Start Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Start Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Kein Anruf-Agent URL: $NWB#vicidial_campaigns-na_call_url$NWE
    Erweiterung anhängen CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Blinden-Monitor Warnung: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Blinden-Monitor und Datenschutz: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Blinden-Monitor Dateiname: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    Gewährte Inbound Gruppen:
    "; + echo "
    Gewährte Inbound Gruppen:
    "; echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
    \n"; echo "$groups_list"; echo "
    \n"; @@ -16904,6 +21673,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -16911,6 +21681,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -16919,14 +21691,14 @@ if ($ADD==31) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -16971,8 +21743,6 @@ if ($ADD==31) echo "\n"; echo "
    LISTE IDENTIFIKATIONLISTE NAMELISTE NAMEBESCHREIBUNGLEADS COUNTAKTIV

    \n"; - echo "
    \n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -16981,13 +21751,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

    \n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
    Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
    Status innerhalb der aktiven Listen Für diese Kampagne:\n"; + echo " - Verberge
    "; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    STATUSSTATUS-NAMEBENANNTNICHT BENANNTDIALABLEPENETRATION
    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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-NAMEBENANNTNICHT BENANNT
    $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]."
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]    
    GESAMTMENGE$lead_list[count]$dialable_total $total_complete_pct%  
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "Zeige LEAD Zustände in dieser Kampagne

    "; + } + + + + echo "
    \n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - Verberge

    "; } else @@ -16996,7 +21948,7 @@ if ($ADD==31) echo " - Zeige

    "; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -17007,9 +21959,36 @@ if ($ADD==31) echo "Klicken Sie hier, um ein VDAD Bericht für diese Kampagne

    \n"; } echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

    \n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Testen Sie Outbound Call: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


    \n"; + } + else + { + echo "Test-Aufruf deaktiviert

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

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Kampagne
    \n"; + echo "

    Klicken Sie hier um Admin Änderungen an dieser Kampagne zu sehen\n"; } echo "
    \n"; } @@ -17020,7 +21999,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -17037,17 +22016,45 @@ if ($ADD==31) echo "
    \n"; echo "
    KUNDENSPEZIFISCHE STATUS INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_statuses$NWE
    \n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + echo "
    STATUSBESCHREIBUNGAUSWÄHLBARMENSCHLICHE ANTWORTKATEGORIEMODIFY-DELETE
    \n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -17062,42 +22069,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
    S
    T
    A
    T
    U
    S
    BESCHREIBUNGKATEGORIE
    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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "LÖSCHUNG\n"; - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "LÖSCHUNG\n"; + } + else + { + echo "LÖSCHUNG\n"; + } echo "
    \n"; + echo "
    ADDIEREN SIE NEUEN KUNDENSPEZIFISCHEN KAMPAGNE STATUS
    \n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Beschreibung:   \n"; - echo "Auswählbar:  
    \n"; - echo "Human Antwort:   \n"; + echo "Auswählbar:   \n"; + echo "Human Antwort:  
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Kategorie:\n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17163,7 +22180,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -17176,7 +22193,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -17302,7 +22319,7 @@ if ($ADD==31) echo "
    HOT KEYSTATUSBESCHREIBUNGLÖSCHUNG
    \n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -17342,7 +22359,7 @@ if ($ADD==31) ##### 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -17367,7 +22384,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -17380,7 +22397,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -17434,7 +22451,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -17453,17 +22470,155 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    PAUSE CODESVERRECHENBARÄNDERN SieLÖSCHUNG
    Umfrage nicht interessiert Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
    Umfrage Opt-in Audio-Datei: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
    Umfrage nicht interessiert Audio-Datei: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
    Umfrage-Methode: $NWB#vicidial_campaigns-survey_method$NWE
    Umfrage-Methode: $NWB#vicidial_campaigns-survey_method$NWE
    Umfrage Nr. Response-Aktion: $NWB#vicidial_campaigns-survey_no_response_action$NWE
    Umfrage kein Interesse Status: $NWB#vicidial_campaigns-survey_ni_status$NWE
    Umfrage Kampagne Aufnahme Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
    Voicemail: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
    Umfrage Call-Menü: $NWB#vicidial_campaigns-survey_menu_id$NWE
    Umfrage Recording: $NWB#vicidial_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_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + + echo "

    $presets_to_print PRESETS Für diese Kampagne:   $NWB#vicidial_xfer_presets$NWE
    \n"; + + echo "
    ADD NEW PRESET -
    \n"; + echo "\n"; + echo "\n"; + echo "Preset Name: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Rufnummer unterdrücken:  \n"; + echo "
    \n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # PRESET NAMEZAHLDTMFVerbergeÄNDERN SieLÖSCHUNG
    $o $rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  LÖSCHUNG
    \n"; + } + + + ##### CAMPAIGN AREACODE CID ##### + if ($SUB==202) + { + echo "

    AREACODE CIDS Für diese Kampagne:   $NWB#vicidial_campaign_cid_areacodes$NWE
    \n"; + if ($use_custom_cid != 'AREACODE') + {echo "
    The campaign setting Benutzerdefinierte 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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 NUMBERBESCHREIBUNGAKTIVCALLSLÖSCHUNG
      $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   LÖSCHUNG
    \n"; + echo "

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

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

    \n"; echo "LOGGEN SIE ALLE MITTEL AUS DIESER KAMPAGNE HERAUS

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

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

    \n"; if ($LOGdelete_campaigns > 0) { @@ -17490,6 +22645,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_erfrischen=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17500,8 +22660,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -17526,9 +22696,10 @@ if ($ADD==34) $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_stats_erfrischen = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -17536,13 +22707,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Einstellungen";} + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -17560,7 +22738,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -17581,7 +22759,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -17592,7 +22770,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -17622,14 +22800,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -17644,21 +22822,24 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: $campaign_id: Grundlegende Ansicht Detail-Ansicht US-Mix Echtzeit Bildschirm Echtzeit Bildschirm  
    \n"; - echo "\n"; + 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"; $o=0; while ($Ds_to_print > $o) @@ -17679,133 +22860,160 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -17905,6 +23113,7 @@ if ($ADD==34) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -17912,6 +23121,8 @@ if ($ADD==34) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -17920,99 +23131,208 @@ if ($ADD==34) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $whereLOGallowed_campaignsSQL group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); - echo "
    Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    Kampagne Identifikation: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
    Kampagne Beschreibung: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
    Kampagne Datum ändern: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Kampagne Login Datum: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Aktiv:$NWB#vicidial_campaigns-active$NWE
    Park-Verlängerung: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
    Admin Benutzer-Gruppe: $user_group $NWB#vicidial_campaigns-user_group$NWE
    Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Netz-Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Erlauben Sie Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Rückstellung Übergangsgruppe:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    Erlauben Sie Inbound und gemischt:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
    Erlauben Sie Inbound und gemischt:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
    Add A Dial Status:
    Fügen Sie eine DFÜ-Status-to-Call:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
    US-Mix:
    Liste Auftrag: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
    US-Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
    Leitung Filter: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Minimale Stufe Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
    LISTE IDENTIFIKATIONLISTE NAMEBESCHREIBUNGLEADS COUNTAKTIVLAST CALL DATUMÄNDERN Sie
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
    LISTE IDENTIFIKATIONLISTE NAMEBESCHREIBUNGLEADS COUNTAKTIVLAST CALL DATUMÄNDERN Sie
    $row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]ÄNDERN Sie

    \n"; + echo "
    \n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

    \n"; + + + if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) ) + { + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]ÄNDERN Sie

    \n"; - echo "
    \n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

    \n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - Verberge

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

    "; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

    \n"; - echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

    \n"; - echo "Klicken Sie hier, um ein VDAD Bericht für diese Kampagne

    \n"; + echo "
    Status innerhalb der aktiven Listen Für diese Kampagne:\n"; + echo " - Verberge
    "; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
    STATUSSTATUS-NAMEBENANNTNICHT BENANNT
    $CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "Zeige LEAD Zustände in dieser Kampagne

    "; + } + + + 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 " - Verberge

    "; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - Zeige

    "; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

    \n"; + echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

    \n"; + echo "Klicken Sie hier, um ein VDAD Bericht für diese Kampagne

    \n"; } echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

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

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Kampagne\n"; + echo "

    Klicken Sie hier um Admin Änderungen an dieser Kampagne zu sehen\n"; } echo "
    \n"; @@ -18022,24 +23342,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
    \n"; echo "
    MITTEL-RANK FÜR DIESE KAMPAGNE:
    \n"; - echo "\n"; - echo "\n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
    USER     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

    \n"; @@ -18076,7 +23397,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -18095,7 +23416,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
    WARNUNG, empfehlen wir nur Liste Mix für fortgeschrittene Anwender, Bitte lesen Sie die ViciDial Manager-Handbuch
    \n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -18104,7 +23425,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -18303,341 +23624,403 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
    \n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + 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 ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    KUNDENSPEZIFISCHE KAMPAGNE STATUS-AUFLISTUNGEN:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KUNDENSPEZIFISCHE KAMPAGNE STATUS-AUFLISTUNGEN:\n"; + echo "
    CAMPAIGNNAMESTATUSESÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNAMESTATUSESÄNDERN Sie
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY STATUSES
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUSES
    \n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    KAMPAGNE HOTKEYS AUFLISTUNGEN:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KAMPAGNE HOTKEYS AUFLISTUNGEN:\n"; + echo "
    CAMPAIGNNAMEHOTKEYSÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNAMEHOTKEYSÄNDERN Sie
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY HOTKEYS
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
    \n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    KAMPAGNE LEITUNG BEREITEN AUFLISTUNGEN AUF:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KAMPAGNE LEITUNG BEREITEN AUFLISTUNGEN AUF:\n"; + echo "
    CAMPAIGNNAMELEITUNG BEREITET AUFÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNAMELEITUNG BEREITET AUFÄNDERN Sie
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY LEITUNG BEREITET AUF
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LEITUNG BEREITET AUF
    \n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    KAMPAGNE LEITUNG AUTO-ALT VORWAHLKNOPF-AUFLISTUNGEN:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KAMPAGNE LEITUNG AUTO-ALT VORWAHLKNOPF-AUFLISTUNGEN:\n"; + echo "
    CAMPAIGNNAMEAUTO-ALT DIALÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNAMEAUTO-ALT DIALÄNDERN Sie
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NONE";} - echo "MODIFY AUTO-ALT DIAL
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
    \n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    KAMPAGNE MITTEL-PAUSE CODE-AUFLISTUNGEN:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KAMPAGNE MITTEL-PAUSE CODE-AUFLISTUNGEN:\n"; + echo "
    CAMPAIGNNAMEPAUSE CODESÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNAMEPAUSE CODESÄNDERN Sie
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY PAUSE CODES
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PAUSE CODES
    \n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
    \n"; + { + echo "
    \n"; + echo ""; + + echo "
    KAMPAGNE LISTE MISCHUNG AUFLISTUNGEN:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    CAMPAIGNNAMELIST MIXÄNDERN Sie
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
    \n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; + + echo "
    \n"; echo ""; -echo "
    KAMPAGNE LISTE MISCHUNG AUFLISTUNGEN:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    KAMPAGNE PRESET DIAZeige:\n"; + echo "
    CAMPAIGNNAMELIST MIXÄNDERN Sie
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -18645,23 +24028,97 @@ echo "\n"; while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; + $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 (eregi("1$|3$|5$|7$|9$", $o)) + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
    CAMPAIGNNAMEPRESETSÄNDERN Sie
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PRESETS
    \n"; + } + + + +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
    \n"; + echo ""; + + echo "
    KAMPAGNE AREACODE CID DIAZeige:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "$row[0] "; $p++; } - if ($p<1) - {echo "NONE";} echo ""; - echo "\n"; + echo "\n"; + + $k++; $o++; } -echo "
    CAMPAIGNNAMECUSTOM CIDAC-CIDSÄNDERN Sie
    $campaigns_id_list[$o]
    $campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -18671,17 +24128,15 @@ echo "
    MODIFY LIST MIX
    MODIFY AC-CIDS
    \n"; -} - - + echo "
    \n"; + } @@ -18693,10 +24148,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_erfrischen=1; + } echo "\n"; echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -18834,19 +24306,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -18715,9 +24175,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18726,10 +24190,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18738,13 +24203,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -18757,7 +24223,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -18791,7 +24257,7 @@ if ($ADD==311) echo "
    Liste Beschreibung: $NWB#vicidial_lists-list_description$NWE
    Kampagne: $NWB#vicidial_lists-drop_inbound_group_override$NWE
    Netz-Form: $NWB#vicidial_lists-web_form_address$NWE
    Netz-Form Two: $NWB#vicidial_lists-web_form_address$NWE
    BringenSie Zahl 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    BringenSie Zahl 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    BringenSie Zahl 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Inventory Report: $NWB#vicidial_lists-inventory_report$NWE
    Zeitzonen-Einstellung: $NWB#vicidial_lists-time_zone_setting$NWE
    \n"; echo "
    \n"; echo "
    STATUS INNERHALB DIESER LISTE:
    \n"; - echo "\n"; - echo "\n"; + + if ($SSexpanded_list_stats > 0) + { + echo "
    STATUSSTATUS-NAMEBENANNTNICHT BENANNT
    \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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    STATUSSTATUS-NAMEBENANNTNICHT BENANNTDIALABLEPENETRATION
    \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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18900,15 +24411,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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-NAMEBENANNTNICHT BENANNT
    $CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    $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]."
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]    
    GESAMTMENGE$lead_list[count]$dialable_total $total_complete_pct%  
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]

    \n"; unset($lead_list); @@ -18918,7 +24467,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18957,7 +24506,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -18979,67 +24528,142 @@ if ($ADD==311) echo "
    \n"; echo "
    PRIVAT in dieser Liste:
    \n"; - echo "
    GMT VERSETZTE JETZT (lokale Zeit)BENANNTNICHT BENANNT
    \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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
    OWNERBENANNTNICHT BENANNT
    \n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
    OWNERBENANNTNICHT BENANNTRESET
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]
    \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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
    OWNERBENANNTNICHT BENANNT
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
    GESAMTMENGE$lead_list[count]

    \n"; unset($lead_list); @@ -19052,7 +24676,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -19114,7 +24738,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -19231,7 +24855,16 @@ if ($ADD==311) echo "
    \n"; - echo "

    Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Liste

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

    Benutzerdefinierte Felder für diese Liste definiert: $rowx[0]
    \n"; + } + + echo "

    Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Liste
    \n"; echo "

    Klicken Sie hier, um diese Liste

    \n"; if ($LOGdelete_lists > 0) @@ -19240,7 +24873,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Liste
    \n"; + echo "

    Klicken Sie hier um Admin Änderungen an dieser Liste sehen\n"; } } else @@ -19260,10 +24893,16 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_erfrischen=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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19333,9 +24972,85 @@ if ($ADD==3111) $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]; + + ##### 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_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + $Wmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -19346,6 +25061,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -19356,6 +25073,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -19408,6 +25132,10 @@ if ($ADD==3111) {$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 @@ -19417,17 +25145,29 @@ if ($ADD==3111) echo "
    ÄNDERN Sie Einen GRUPPEN SATZ: $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"; if ($SSenable_second_webform > 0) { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19469,41 +25218,49 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19617,7 +25440,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -19655,11 +25478,21 @@ if ($ADD==3111) 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) @@ -19671,7 +25504,7 @@ if ($ADD==3111) $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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -19695,7 +25528,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19721,7 +25554,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19734,7 +25567,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19767,16 +25600,16 @@ if ($ADD==3111) } echo "
    Gruppe Identifikation: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
    Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
    Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
    Aktiv:$NWB#vicidial_inbound_groups-active$NWE
    Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    In-Group Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
    \n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
    Admin Benutzer-Gruppe: $NWB#vicidial_inbound_groups-user_group$NWE
    Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Netz-Form Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Netz-Form Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Queue-Priorität: $NWB#vicidial_inbound_groups-queue_priority$NWE
    On-Hakenring Zeit: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
    On-Haken CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
    Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Ignorieren-Liste Script Override: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    BringenSie DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    BringenSie Zahl 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Timer-Aktion: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer-Aktion: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer-Aktion Message: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Timer-Aktion Sekunden: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Timer-Aktion Reiseziel: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Verbindungsaufbau Sekunden: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Drop-Aktion:$NWB#vicidial_inbound_groups-drop_action$NWE
    Drop-Aktion:$NWB#vicidial_inbound_groups-drop_action$NWE
    Verbindungsaufbaunebenstelle: $NWB#vicidial_inbound_groups-drop_exten$NWE
    Voicemail: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Voicemail: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Drop-Transfer-Gruppe:
    Drop Transfer Group: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
    Drop-Call-Menü:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
    Anruf-Zeit:$NWB#vicidial_inbound_groups-call_time_id$NWE
    Nach Stunden Tätigkeit:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Aktion Transfer-CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
    Nach Stunden Anzeige Dateinamen: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Nach Stunden Tätigkeit:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Nach Stunden Anzeige Dateinamen: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Nach Stunden Verlängerung:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
    Nach Stunden Voicemail: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Nach Stunden Voicemail: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    After Hours Transfer-Gruppe:
    After Hours Transfer Group: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
    After Hours Call-Menü:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
    Nr. Bevollmächtigte Nr. Queueing: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
    Kein Agent Nr. Queue Aktion: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -19534,9 +25291,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   Liste Identifikation: "; echo "
    Kampagne Identifikation: audio chooser\n"; + echo "Audio-Datei: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -19578,37 +25335,103 @@ if ($ADD==3111) echo "
     
    Willkommener Anzeige Dateiname: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Max ruft die Methode: $NWB#vicidial_inbound_groups-max_calls_method$NWE
    Max ruft Graf: $NWB#vicidial_inbound_groups-max_calls_count$NWE
    Max ruft Aktion: $NWB#vicidial_inbound_groups-max_calls_action$NWE
    Willkommener Anzeige Dateiname: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Jetzt Grußwort:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    Musik Auf Einfluß-Kontext: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Musik Auf Einfluß-Kontext: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Auf Einfluß-Aufforderung Dateinamen: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Auf Einfluß-Aufforderung Dateinamen: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Auf Einfluß-Aufforderung Abstand:$NWB#vicidial_inbound_groups-prompt_interval$NWE
    Hold On Prompt keine Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    Hold On Prompt Sekunden: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Jetzt im Einklang:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Jetzt Geschätzte Hold Time:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Hold Time Option:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Berechnen Sie Geschätzte Hold-Sekunden: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Geschätzte Mindest-Haltezeit Dateiname: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Geschätzte Mindest-Haltezeit Prompt keine Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Geschätzte Mindest-Haltezeit Prompt Sekunden: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Wait Time Option: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Wartezeit Zweite Option: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Wartezeit Third Option: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Wait Time Option Sekunden: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Wait Time Option Erweiterung: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Wait Time Option Callmenu: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Wait Time Option Voicemail: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Wait Time Option Transfer-In-Gruppe:$NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Wait Time Option Drücken Dateiname: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Wait Time Option Presse keine Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Wait Time Option Drücken Dateiname Sekunden: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Wait Time Option Nach dem Drücken Dateiname: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Wait Time Option Rückruf-Liste-ID: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Warten Halten Sie die Wahltaste Priorität: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Geschätzte Hold Time Option:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Hold Time Zweite Option: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Hold Time Third Option: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Hold Time Option Sekunden:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Hold Time Option in einer Mindestharmonisierung: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Hold Time Option Extension:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Hold Time Option Voicemail: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Hold Time Option Callmenu: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Hold Time Option Voicemail: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Hold Time Option Transfer In-Group:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
    Hold Time Option Rückruf Dateiname: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Hold Time Option Drücken Dateiname: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Hold Time Option Presse keine Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Option Drücken Dateiname Sekunden: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Hold Time Option Nach dem Drücken Dateiname: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Hold Time Option Liste Rückruf-ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Agent Alert Dateiname: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Agent Alert Dateiname: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Mittel-Alarm Verzögert:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
    Statistiken Prozent der Anrufe innerhalb von X Sekunden 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
    Start Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Start Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Fügen Sie führen zur URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Kein Anruf-Agent URL: $NWB#vicidial_inbound_groups-na_call_url$NWE
    Erweiterung anhängen CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    UniqueId Statusanzeige: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    UniqueId Status-Prefix: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
    \n"; - echo "

    \n"; + echo "


    \n"; ### list of agent rank or skill-level for this inbound group - echo "
    \n"; + echo "
    \n"; echo "
    MITTELRANKS FOR THIS INBOUND GROUP:
    \n"; - echo "\n"; - echo "\n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19786,26 +25619,215 @@ if ($ADD==3111) $rowx=mysql_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_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + $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_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='SUBMIT') + { + $o=0; + while ($users_to_print > $o) + { + $o++; + + $ARIG_checked=''; + $ARIG_ranked=''; + $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 = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_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_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ( ($ARIG_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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_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 (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + $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 "
    USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

    \n"; + echo "$users_output"; - echo "

    \n"; + echo "

    \n"; echo "Klicken Sie hier, um zu sehen, einen Bericht für diese Gruppe ein -

    \n"; + echo "Klicken Sie hier, um die angemeldeten Agenten in dieser Gruppe sehen Inbound

    \n"; + echo "
    \n"; - echo "DIDS USING THIS IN-GROUP:
    \n"; + echo "DIDS Mit diesem 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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -19817,10 +25839,10 @@ if ($ADD==3111) } echo "

    \n"; - echo "CALL MENUS USING THIS IN-GROUP:
    \n"; + echo "CALL MENUS Mit diesem 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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -19835,7 +25857,7 @@ if ($ADD==3111) echo "KAMPAGNEN, diese Erlaubnis in-group:
    \n"; echo "
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19850,12 +25872,12 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; + # echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; echo "

    LÖSCHEN SIE DIESES IN-GROUP\n"; } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser In-Group\n"; + echo "

    Klicken Sie hier um Admin Änderungen an diesem In-Group sehen\n"; } } else @@ -19863,6 +25885,7 @@ if ($ADD==3111) echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; exit; } + } @@ -19875,13 +25898,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19986,7 +26072,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20008,7 +26094,7 @@ if ($ADD==3311) 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_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $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 "
    \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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19905,9 +25933,36 @@ if ($ADD==3311) $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 order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19920,53 +25975,79 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\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') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\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 eine DID RECORD:$row[0]
    \n"; @@ -19976,7 +26057,12 @@ if ($ADD==3311) echo "
    DID-Erweiterung:$NWB#vicidial_inbound_dids-did_pattern$NWE
    DID-Beschreibung:$NWB#vicidial_inbound_dids-did_description$NWE
    Aktiv:$NWB#vicidial_inbound_dids-did_active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_inbound_dids-user_group$NWE
    DID-Route:$NWB#vicidial_inbound_dids-did_route$NWE
    Anruf aufzeichnen: $NWB#vicidial_inbound_dids-record_call$NWE
    Erweiterung:$NWB#vicidial_inbound_dids-extension$NWE
    Erweiterung Kontext:$NWB#vicidial_inbound_dids-exten_context$NWE
    Voicemail-Box: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    In-Gruppe Identifikation: $NWB#vicidial_inbound_dids-group_id$NWE
    In-Group Call Griff Methode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    In-Group Call Griff Methode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    In-Group-Agent Suche Methode:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    In-Group US-ID:$NWB#vicidial_inbound_dids-list_id$NWE
    In-Group Kampagnen-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
    In-Group Telefon Code:$NWB#vicidial_inbound_dids-phone_code$NWE
    Reinigen Sie CID-Nummer: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Filter Inbound-Nummer: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filter Phone Gruppe Identifikation: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    URL-Filter: $NWB#vicidial_inbound_dids-filter_url$NWE
    Filteraktion: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Erweiterung:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Erweiterung Kontext:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter Voicemail-Box: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    Filter Tel. Durchwahl:$NWB#vicidial_inbound_dids-phone$NWE
    Filter Bediener IP: $NWB#vicidial_inbound_dids-server_ip$NWE
    Filter Call-Menü: $NWB#vicidial_inbound_dids-menu_id$NWE
    Filter User Agent:$NWB#vicidial_inbound_dids-user$NWE
    Filter User-Aktion nicht verfügbar:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
    Filter User-Einstellungen In Route-Gruppe:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
    Filter In-Gruppe Identifikation: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter In-Group Call Griff Methode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter In-Group-Agent Suche Methode:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter In-Group US-ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter In-Group Kampagnen-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter In-Group Telefon Code:$NWB#vicidial_inbound_dids-phone_code$NWE
    Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
    \n"; echo "

    \n"; echo "
    Klicken Sie hier, um ein Traffic-Bericht für das DID

    \n"; + echo "
    Klicken Sie hier, um zu sehen, eine Liste der Aufnahmen und fordert, dass dies DID
    \n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    Sahen Remote Agent EXTENSION Überschreibungen für diesen DID\n"; + } if ($LOGdelete_dids > 0) { echo "

    DELETE Das war\n"; } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser DID\n"; + echo "

    Klicken Sie hier um Admin Änderungen an diese Aktion durchgeführt hat\n"; } } else @@ -20041,6 +26188,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
    \n"; + echo ""; + + echo "
    Remote Agent EXTENSION OVERRIDE DIAZeige:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    DIDNAMERA-EXTENSÄNDERN Sie
    $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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/ÄndernDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    DID Remote Agent EXTENSION OVERRIDE NICHT HINZUGEFÜGT - Existiert bereits ein Eintrag für diese DID mit diesem RA EXTENSION
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    DID Remote Agent EXTENSION OVERRIDE NICHT HINZUGEFÜGT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    DID Remote Agent EXTENSION OVERRIDE NICHT GELÖSCHT - Dieser Eintrag existiert nicht
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    DID Remote Agent EXTENSION OVERRIDE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \n"; + } + else + { + echo "
    DID REMOTE MITTELEXTENSION 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 MITTELEXTENSION OVERRIDE NOT MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben
    \n"; + } + else + { + echo "DID Remote Agent EXTENSION OVERRIDE MODIFIZIERTE: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/ÄndernDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_erfrischen=1; + } + echo "
    \n"; + echo ""; + echo "

    Remote Agent EXTENSION Überschreibungen für diesen DID:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTVERLÄNGERUNGBESCHREIBUNGAKTIVCALLSLÖSCHUNG
      $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   LÖSCHUNG
    \n"; + echo "

    \n"; + + echo "
    ADD NEW REMOTE MITTELEXTENSION OVERRIDE
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "User Start: \n"; + echo "Erweiterung:
    \n"; + echo "Beschreibung:\n"; + echo "
    \n"; + + echo "

    \n"; + + echo "

    Ändern dieser DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

    Klicken Sie hier um Admin Änderungen an diese Aktion durchgeführt hat
    \n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -20049,10 +26496,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_erfrischen=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -20066,6 +26518,9 @@ if ($ADD==3511) $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]; echo "
    Ändern einer CALL MENU RECORD: $menu_id
    \n"; @@ -20074,6 +26529,10 @@ if ($ADD==3511) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20110,6 +26569,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -20141,7 +26612,7 @@ if ($ADD==3511) $dtmf_list = ""; echo " "; - echo "   Handle Method: \n"; - echo "
    Search Method: "; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; + echo "
    Suchmethode: \n"; echo "   Liste Identifikation: "; echo "
    Kampagne Identifikation: \n"; echo "   Phone Code: "; + echo "
      VID Geben Sie Dateiname: audio chooser"; + echo "
      VID-ID-Nummer Dateiname: audio chooser"; + echo "
      VID bestätigen Dateiname: audio chooser"; + echo "   VID Digits: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -20220,7 +26700,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "Audio-Datei: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -20244,12 +26724,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
    Menü-ID: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
    Menu Name: $NWB#vicidial_call_menu-menu_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_call_menu-user_group$NWE
    Prompt Menu: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
    Menü-Timeout: $NWB#vicidial_call_menu-menu_timeout$NWE
    Menü-Timeout Prompt: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
    LOG-Taste drücken: $NWB#vicidial_call_menu-dtmf_log$NWE     Protokollfeld: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
    Call-Optionen-Menü:
    Custom Dialplan Eintrag:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Benutzerdefinierte Dialplan Eintrag:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Custom Dialplan Eintrag: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Benutzerdefinierte Dialplan Eintrag: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    \n"; echo "

    \n"; - echo "DIDS USING THIS CALL MENU:
    \n"; + echo "DIDS Mit dieser Funktion 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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -20312,7 +26792,7 @@ if ($ADD==3511) echo "

    \n"; - echo "CALL MENUS USING THIS CALL MENU:
    \n"; + echo "CALL MENUS Mit dieser Funktion 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';"; @@ -20335,7 +26815,7 @@ if ($ADD==3511) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um Admin chages vgl. in diesem CALL MENU\n"; + echo "

    Klicken Sie hier um Admin Änderungen an dieser CALL MENU sehen\n"; } } else @@ -20355,10 +26835,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20368,38 +26853,232 @@ if ($ADD==31111) $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]; - echo "
    ÄNDERN Sie Eine REMOTEMITTEL-EINTRAGUNG: $row[0]
    \n"; - echo "\n"; - echo "\n"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; + $rsltx=mysql_query($stmt, $link); + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
    ÄNDERN Sie Eine REMOTEMITTEL-EINTRAGUNG: $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 "
    Benutzernummer Anfang: (nur Zahlen, incremented, muss ein vorhandener Benutzer sich jeder leisten sein)$NWB#vicidial_remote_agents-user_start$NWE
    Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
    Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
    Externe Verlängerung: (dial plan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
    Erweiterungs-Gruppe: $NWB#vicidial_remote_agents-extension_group$NWE
    Status:$NWB#vicidial_remote_agents-status$NWE
    Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
    Auf-Hook-Agent: $NWB#vicidial_remote_agents-on_hook_agent$NWE
    On-Hakenring Zeit: $NWB#vicidial_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 Gruppen: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; + echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    ES GIBT $didraext_count DID Remote Agent EXTENSION Überschreibungen für diesen Remote Agent\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

    LÖSCHEN SIE DIESES REMOTEMITTEL\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Klicken Sie hier, um Änderungen an diesem Admin Remote-Agent zu sehen
    \n"; + } + } + else + { + echo "Benutzer-Start für diese Remote-Agent existiert nicht: $user_start\n"; + exit; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=3711 modify filter phone group info in the system +###################### + +if ($ADD==3711) + { + if ($LOGmodify_dids==1) + { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_erfrischen=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + $user_group = $row[3]; + + echo "
    Ändern Filter Phone Gruppe:$filter_phone_group_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 "
    Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
    Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
    Externe Verlängerung: (dial plan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
    Status:$NWB#vicidial_remote_agents-status$NWE
    Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
    Inbound Gruppen: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    Filter Phone Gruppe Identifikation: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Filter Phone Gruppe Name: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Beschreibung: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; - echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

    Die Zahlen in diesem Filter Phone Gruppe:$row[0]"; - if ($LOGdelete_remote_agents > 0) + if ($LOGdelete_dids > 0) { - echo "

    LÖSCHEN SIE DIESES REMOTEMITTEL\n"; + echo "

    LÖSCHEN SIE DIESEN FILTER Phone Group\n"; } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Remote Agent
    \n"; + echo "

    Klicken Sie hier, um die Zahlen in diesem Filter Phone Group downloaden\n"; + + echo "

    Klicken Sie hier um Admin Änderungen an diesem Filter Phone Group sehen\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_erfrischen=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
    Ändern eines EXTENSION Gruppeneintrag: $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 "
    Erweiterungs-Gruppe: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Erweiterung: (nur Zahlen)$NWB#vicidial_extension_groups-extension$NWE
    Rang: $NWB#vicidial_extension_groups-rank$NWE
    Kampagnen Gruppen: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Anzahl der Anrufe Heute: $call_count_today
    Last Anruf-Zeit:$last_call_time
    Last Call ID: $last_callerid
    \n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

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

    Klicken Sie hier, um die Änderungen zu sehen Admin to this extension group entry
    \n"; } } else @@ -20418,158 +27097,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

    Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Gruppe

    \n"; - echo "

    Klicken Sie hier, um zu sehen, dieTimeclock Status für diese Gruppe

    \n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - - echo ""; - - echo "
    ÄNDERN Sie Eine BENUTZER-GRUPPE EINTRAGUNG\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - echo "\n"; + echo "
    Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
    Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
    ForceTimeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift Vollstreckung: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Erlaubte Kampagnen:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; - echo "$campaigns_list
     "; - echo "
    Gruppe Verschiebungen:
    $NWB#vicidial_user_groups-group_shifts$NWE
    \n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " 1) and ($modify_erfrischen_set < 1) ) { - if (ereg(" $shift_id_value ", $GROUP_shifts)) - { - echo " CHECKED"; - } - $p++; + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_erfrischen=1; } - echo "> $shift_id_value - $shift_name_value
    \n"; - $o++; - } - echo "
     
    \n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
    \n"; - echo "
    BENUTZER INNERHALB DIESER BENUTZER-GRUPPE: $users_to_print
    \n"; - 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + echo "
    ÄNDERN Sie Eine BENUTZER-GRUPPE EINTRAGUNG\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 "
    Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
    Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
    ForceTimeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift Vollstreckung: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Erlaubte Kampagnen:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; + echo "$campaigns_list
     "; + echo "
    Agent Status Sichtbare Gruppen:
    $NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
    \n"; - echo "ALL-GROUPS - All user groups in the system
    \n"; - echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; - - $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo "
    Gruppe Verschiebungen:
    $NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) { - if (ereg(" $vgroups_id_value ", $VGROUP_vgroups)) + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
    \n"; + $o++; } - echo "> $vgroups_id_value - $vgroups_name_value
    \n"; - $o++; - } - echo "
     
    Agent Status View Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    QC erlaubt Kampagnen:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; - echo "$qc_campaigns_list"; echo "
     
    QC erlaubt Inbound Gruppen:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; - echo "$qc_groups_list"; + + + echo "
    Agent Status Sichtbare Gruppen:
    $NWB#vicidial_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 - Alle Benutzer im System, auch nicht angemeldete Benutzer
    \n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } echo "
     
    \n"; + echo "
    Agent Status View Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Agent-Call Log anzeigen: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agenten ermöglichen Beratenden Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Erlauben Sie Dial-Agent-Override Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    \n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
    USERFULL NAMELEVELAKTIV
    Agenten ermöglichen Voicemail-Nachricht Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agenten die blinde Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agenten ermöglichen Zifferblatt mit Kunden Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agenten erlauben Park Kunden Dial Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent-Vollbild: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Erlaubt Berichte: $NWB#vicidial_user_groups-allowed_reports$NWE
    Webphone URL Override: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone System Key Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    $rowx[0]$rowx[1]$rowx[2]$rowx[3]

    \n"; + if ($SSqc_features_active > 0) + { + echo "
    QC erlaubt Kampagnen:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; + echo "$qc_campaigns_list"; + echo "
     
    QC erlaubt Inbound Gruppen:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; + echo "$qc_groups_list"; + echo "
     
    Erlaubte Benutzer-Gruppen:
    $NWB#vicidial_user_groups-admin_viewable_groups$NWE
    \n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
    \n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

    LÖSCHEN SIE DIESE BENUTZER-GRUPPE\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Benutzergruppe\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } + echo "
     
    Anruf erlaubt Zeiten:
    $NWB#vicidial_user_groups-admin_viewable_call_times$NWE
    \n"; + echo "ALL-CALLTIMES - Alle Call-Zeiten im 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_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
    \n"; + echo "
    BENUTZER INNERHALB DIESER BENUTZER-GRUPPE: $users_to_print
    \n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    USERFULL NAMELEVELAKTIV
    $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 "
    Hinzufügen oder Entfernen von In-Group Für aktive Benutzer in diesem Benutzer-Gruppe gewählte
    \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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Gruppe:
    \n"; + echo "
    \n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

    Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Gruppe

    \n"; + echo "

    Klicken Sie hier, um zu sehen, dieTimeclock Status für diese Gruppe

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

    LÖSCHEN SIE DIESE BENUTZER-GRUPPE\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Klicken Sie hier um Admin Änderungen an dieser Nutzergruppe sehen\n"; + } } } else @@ -20588,32 +27439,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    ÄNDERN Sie Einen INDEX
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Index Identifikation: $script_id$NWB#vicidial_scripts-script_name$NWE
    Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
    Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_scripts-user_group$NWE
    Aktiv:$NWB#vicidial_scripts-active$NWE
    Index-Text:

    Vorbetrachtung-Index
    "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -20681,10 +27556,10 @@ if ($ADD==3111111) echo "


    \n"; - echo " KAMPAGNEN USING THIS SCRIPT:
    \n"; + echo " KAMPAGNEN mit diesem Skript:
    \n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20696,10 +27571,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " IN-GROUPS USING THIS SCRIPT:
    \n"; + echo " In-Gruppen mit diesem Skript:
    \n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20711,10 +27586,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; + echo " LISTE Überschreibt mit diesem Skript:
    \n"; echo "\n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20725,17 +27600,15 @@ if ($ADD==3111111) $o++; } - echo "
    \n"; - - if ($LOGdelete_scripts > 0) { echo "

    LÖSCHEN SIE DIESEN INDEX\n"; } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu diesem Skript
    \n"; + echo "

    Klicken Sie hier um Admin Änderungen an diesem Skript siehe
    \n"; } + } else { @@ -20753,30 +27626,42 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    ÄNDERN Sie Einen FILTER\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Filter Identifikation:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
    Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_lead_filters-user_group$NWE
    Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20805,7 +27690,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages dieser Filter
    \n"; + echo "

    Klicken Sie hier um Admin Änderungen an diesem Filter sehen
    \n"; } } else @@ -20817,13 +27702,18 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_erfrischen=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -20869,10 +27759,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_erfrischen=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20894,6 +27789,15 @@ if ($ADD==311111111) $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]; echo ""; @@ -20901,17 +27805,22 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - 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; @@ -20931,7 +27840,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20941,10 +27850,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -20970,7 +27879,7 @@ if ($ADD==311111111) echo "Kampagnen, die diese Anrufzeit nutzen:
    \n"; echo "
    Anrufzeit ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
    Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
    Standard Start Standard Stop $NWB#vicidial_call_times-ct_default_start$NWE
    Sonntag Start Sonntag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Montag Start Montag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Dienstag Start Dienstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Mittwoch Start Mittwoch Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Donnerstag Start Donnerstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Freitag Start Freitag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Sonnabend Start Sonnabend Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_call_times-user_group$NWE
    Standard Start Standard Stop $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Sonntag Start Sonntag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Montag Start Montag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Dienstag Start Dienstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Mittwoch Start Mittwoch Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Donnerstag Start Donnerstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Freitag Start Freitag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Sonnabend Start Sonnabend Stop $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20985,7 +27894,7 @@ if ($ADD==311111111) 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';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21005,7 +27914,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Aufforderung Zeit\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this call time\n"; } } else @@ -21024,10 +27933,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_erfrischen=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -21049,6 +27963,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -21056,10 +27971,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21074,7 +27994,7 @@ if ($ADD==3111111111) echo "Anrufzeiten, die diese landesspezifische Anrufzeit benutzen:
    \n"; echo "
    Anrufzeit ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
    Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
    Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_call_times-user_group$NWE
    Standard Start Standard Stop $NWB#vicidial_call_times-ct_default_start$NWE
    Sonntag Start Sonntag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    Montag Start Montag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
    \n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21106,18 +28026,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -21147,6 +28075,10 @@ if ($ADD==331111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -21174,6 +28106,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Samstag
    \n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    Shift-ID:$shift_id
    Shift Name: (Kurze Beschreibung der Verlagerung)$NWB#vicidial_shifts-shift_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_shifts-user_group$NWE
    Start Time Shift:\n"; echo "   Shift End Time:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Bericht Option: $NWB#vicidial_shifts-report_option$NWE
    Melde Rang: $NWB#vicidial_shifts-report_rank$NWE
    \n"; @@ -21181,7 +28124,7 @@ if ($ADD==331111111) echo "USER-Gruppen, die diese Verschiebung:
    \n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21201,7 +28144,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Verschiebung\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this shift\n"; } } else @@ -21218,12 +28161,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_erfrischen=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21231,11 +28179,18 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21258,6 +28236,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21273,11 +28252,12 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21292,8 +28272,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21310,7 +28290,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "
    Telefonverlängerung: $NWB#phones-extension$NWE (Agent Screen Telefon-LOGON)
    Tel. Durchwahl:$NWB#phones-extension$NWE
    Dial Plan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
    Voicemail-Box: (nur Stellen)$NWB#phones-voicemail_id$NWE
    Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
    Bediener IP: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Kennwort:$NWB#phones-pass$NWE
    Agent-Bildschirm Anmelden: $NWB#phones-login$NWE
    Login Passwort: $NWB#phones-pass$NWE
    Anmeldung Passwort: $NWB#phones-conf_secret$NWE     Stärke:
    Set As Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Webphone Auto-Antwort: $NWB#phones-webphone_auto_answer$NWE
    Mit externen Bediener IP: $NWB#phones-use_external_server_ip$NWE
    Status:$NWB#phones-status$NWE
    Aktives Konto: $NWB#phones-active$NWE
    Telefon-Art: $NWB#phones-phone_type$NWE
    Voller Name: $NWB#phones-fullname$NWE
    E-Mail: $NWB#phones-email$NWE
    Löschen Voicemail Nach E-Mail: $NWB#phones-delete_vm_after_email$NWE
    Voicemail-Zone: $NWB#phones-voicemail_timezone$NWE
    Voicemail-Optionen: $NWB#phones-voicemail_options$NWE
    Firma:$NWB#phones-company$NWE
    Abbildung:$NWB#phones-picture$NWE
    Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
    Klient Protokoll: $NWB#phones-protocol$NWE
    Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
    Telefon Ring Timeout: $NWB#phones-phone_ring_timeout$NWE
    Auf-Hook-Agent: $NWB#phones-on_hook_agent$NWE
    Manager-LOGON: $NWB#phones-ASTmgrUSERNAME$NWE
    Manager-Geheimnis: $NWB#phones-ASTmgrSECRET$NWE
    VICIDIAL Rückstellung Benutzer: $NWB#phones-login_user$NWE
    VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
    Exten Kontext: $NWB#phones-ext_context$NWE
    Telefon Kontext: $NWB#phones-phone_context$NWE
    Conf-Datei Secret: $NWB#phones-conf_secret$NWE
    Erlaubt Codecs: $NWB#phones-codecs_list$NWE
    Erlaubt Codecs mit Schablone: $NWB#phones-codecs_with_template$NWE
    DTMFSend Führung: $NWB#phones-dtmf_send_extension$NWE
    Outbound Anruf-Gruppe: $NWB#phones-call_out_number_group$NWE
    Datenbanksuchroutine-Position: $NWB#phones-client_browser$NWE
    Bringen Sie Verzeichnis An: $NWB#phones-install_directory$NWE
    CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
    VICIDIAL Rückstellung URL: $NWB#phones-VICIDIAL_web_URL$NWE
    Anruf-Protokollierung: $NWB#phones-AGI_call_logging_enabled$NWE
    Warteschlange Ermöglicht: $NWB#phones-QUEUE_ACTION_enabled$NWE
    CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
    VMail Taste: $NWB#phones-voicemail_button_enabled$NWE
    Schnell Erneuern Sie: $NWB#phones-enable_fast_refresh$NWE
    Schnell Erneuern Sie Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
    Schnell Erneuern Sie: $NWB#phones-enable_fast_erfrischen$NWE
    Schnell Erneuern Sie Rate: (in ms)$NWB#phones-fast_erfrischen_rate$NWE
    Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
    Selbstvorwahlknopf-Folgende Zahl: $NWB#phones-auto_dial_next_number$NWE
    Stoppen Sie Rec nach jedem Anruf: $NWB#phones-VDstop_rec_after_each_call$NWE
    DBY Tor: (ZweitensDB Port)$NWB#phones-DBY_port$NWE
    Vorlagen-ID: \n"; echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21366,7 +28357,11 @@ if ($ADD==32111111111) 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
    Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    Handys Logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; @@ -21379,15 +28374,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -21405,7 +28401,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu diesem Telefon Alias\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this phone alias\n"; } } else @@ -21422,12 +28418,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_erfrischen=1; + } echo "
    LOGINVERLÄNGERUNGSERVERPROTOCOLIP
    \n"; echo "\n"; +echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21437,6 +28438,10 @@ if ($ADD==33111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21450,7 +28455,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Gruppe Alias\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this group alias\n"; } } else @@ -21469,10 +28474,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_erfrischen=1; + } echo "
    Alias-ID-Gruppe: $row[0] $NWB#phones-group_alias_id$NWE
    Gruppe Alias-Name: $NWB#phones-group_alias_name$NWE
    Admin Benutzer-Gruppe: $NWB#phones-user_group$NWE
    CallerID Anzahl: $NWB#phones-caller_id_number$NWE
    CallerID Name: $NWB#phones-caller_id_name$NWE
    Aktiv:
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -21546,7 +28564,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21555,8 +28573,10 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21565,6 +28585,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21514,6 +28524,10 @@ if ($ADD==311111111111) $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]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21532,6 +28546,10 @@ if ($ADD==311111111111) echo "
    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
    Admin Benutzer-Gruppe: $NWB#servers-user_group$NWE
    Sternchen-Version: $NWB#servers-asterisk_version$NWE
    Maximale VICIDIAL Stämme: $NWB#servers-max_vicidial_trunks$NWE
    Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf-Datei Secret: $NWB#servers-conf_secret$NWE
    Conf-Datei Secret: $NWB#servers-conf_secret$NWE     Stärke:
    Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
    VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
    VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
    Bediener-Maschinenbordbücher: $NWB#servers-vd_server_logs$NWE
    AGI Ausgang: $NWB#servers-agi_output$NWE
    Carrier Aktive Logging: $NWB#servers-carrier_logging_active$NWE
    Aufnahme Web-Link: $NWB#servers-recording_web_link$NWE
    Aufnahme Web-Link: $NWB#servers-recording_web_link$NWE
    Alternate Recording Bediener IP: $NWB#servers-alt_server_ip$NWE
    Externe Bediener IP: $NWB#servers-external_server_ip$NWE
    Aktive Twin-Server-IP: $NWB#servers-active_twin_server_ip$NWE
    Aktive Asterisk Server: $NWB#servers-active_asterisk_server$NWE
    Aktive Agent Server: $NWB#servers-active_agent_login_server$NWE
    Conf-Dateien erzeugen: $NWB#servers-generate_vicidial_conf$NWE
    Klingt Update: $NWB#servers-sounds_update$NWE
    ViciDial Recording-Limit: $NWB#servers-vicidial_recording_limit$NWE
    Benutzerdefinierte Dialplan Eintrag: $NWB#servers-custom_dialplan_entry$NWE
    Benutzerdefinierte Dialplan Eintrag: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; @@ -21575,7 +28605,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -21622,7 +28652,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21654,7 +28684,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21752,7 +28782,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu diesem Server\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this server\n"; } } else @@ -21771,15 +28801,21 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_erfrischen=1; + } echo "
    KAMPAGNE STÄMME BESCHRÄNKUNG DELETE
    \n"; echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_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"; @@ -21788,6 +28824,10 @@ if ($ADD==331111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Vorlagen-ID: $template_id
    Template Name: $NWB#vicidial_conf_templates-template_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_conf_templates-user_group$NWE
    Template-Inhalt: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -21802,7 +28842,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21833,7 +28873,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21864,7 +28904,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu dieser Vorlage conf
    \n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this conf template\n"; } } else @@ -21881,12 +28921,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_erfrischen=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21962,7 +28998,7 @@ if ($ADD==341111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages zu diesem Träger\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this carrier\n"; } } else @@ -21979,18 +29015,25 @@ if ($ADD==341111111111) if ($ADD==351111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_tts==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=351111111111&tts_id=$tts_id"; + $modify_footer_erfrischen=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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -21900,6 +28945,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
    MODIFY A RECORD CARRIER: $row[0]\n"; echo "\n"; @@ -21909,10 +28955,14 @@ if ($ADD==341111111111) echo "
    Carrier-ID: $carrier_id
    Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Beschreibung: $NWB#vicidial_server_carriers-carrier_description$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_server_carriers-user_group$NWE
    Anmeldung String: $NWB#vicidial_server_carriers-registration_string$NWE
    Vorlagen-ID:
    Dialplan Eintrag: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    Bediener IP: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -22013,7 +29062,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um Admin chages vgl. in diesem TTS-Eintrag\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this TTS entry\n"; } } else @@ -22030,18 +29079,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; + $user_group = $row[5]; echo "
    Ändern eines TTS RECORD: $tts_id\n"; echo "\n"; @@ -22000,6 +29043,12 @@ if ($ADD==351111111111) echo "
    TTS-ID: $tts_id
    TTS Name: $NWB#vicidial_tts_prompts-tts_name$NWE
    Aktiv:$NWB#vicidial_tts_prompts-active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_tts_prompts-user_group$NWE
    TTS-Stimme: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Text: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -22050,6 +29105,12 @@ if ($ADD==361111111111) echo "
    \n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -22091,7 +29152,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um Admin chages vgl. in diesem Music On Hold-Eintrag\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this Music On Hold entry\n"; } } else @@ -22108,12 +29169,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_erfrischen=1; + } echo "
    Music On Hold ID: $moh_id
    Music On Hold Name: $NWB#vicidial_music_on_hold-moh_name$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_music_on_hold-user_group$NWE
    Aktiv:$NWB#vicidial_music_on_hold-active$NWE
    Zufälliger Reihenfolge: $NWB#vicidial_music_on_hold-random$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22149,7 +29240,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um Admin chages vgl. in diesem Voicemail-Box\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to this voicemail box\n"; } } else @@ -22160,6 +29251,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_erfrischen=1; + } + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -22124,6 +29190,9 @@ if ($ADD==371111111111) $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]; echo "
    Ändern einer Voicemail-Box: $tts_id\n"; echo "\n"; @@ -22135,7 +29204,29 @@ if ($ADD==371111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    E-Mail:$NWB#vicidial_voicemail-email$NWE
    Aktiv:$NWB#vicidial_voicemail-active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_voicemail-user_group$NWE
    Löschen Voicemail Nach E-Mail: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
    Voicemail-Zone: $NWB#vicidial_voicemail-voicemail_timezone$NWE
    Voicemail-Optionen: $NWB#vicidial_voicemail-voicemail_options$NWE
    Neue Anzeigen: $messages
    Alte Anzeigen: $old_messages
    \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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $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#vicidial_screen_labels-label_name$NWE
    Aktiv:$NWB#vicidial_screen_labels-active$NWE
    Admin Benutzer-Gruppe: $NWB#vicidial_screen_labels-user_group$NWE
    Beschriftung ausblenden in Anrufprotokolle: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
    Label-Titel: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Vorname: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Mittlere Initiale: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Nachname: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Adresse1: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Address2: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Address3: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Stadt: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Kennzeichnungsschild: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Provinz: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-PLZ: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Hersteller Blei-Code: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Geschlecht: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Telefonnummer: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Telefon Code: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Alt-Phone: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Sicherheit Phrase: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-E-Mail: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label-Kommentare: $NWB#vicidial_screen_labels-default_field_labels$NWE
    \n"; + + echo "
    \n"; + + + echo "


    \n"; + echo " Kampagnen mit diesem Schirm zu LABEL:
    \n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
    $row[0] $row[1]


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

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

    Klicken Sie hier um Admin Änderungen in diesem Fenster sehen Etikett
    \n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + + +###################### +# ADD=391111111111 modify contact in the system +###################### +if ($ADD==391111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) + { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_erfrischen=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_query($stmt, $linkALT); + $row=mysql_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 "
    KONTAKT ZU ÄNDERN: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
    Vorname: $NWB#contact_information$NWE
    Letzter Name: $NWB#contact_information$NWE
    Office Number: $NWB#contact_information$NWE
    Handy-Nummer: $NWB#contact_information$NWE
    Andere Anzahl 1: $NWB#contact_information$NWE
    Andere Anzahl 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Gruppe:$NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; + + echo "
    \n"; + + if ($LOGast_delete_phones > 0) + { + echo "

    Diesen Kontakt löschen\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Klicken Sie hier um Admin Änderungen an diesem Kontakt sehen\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -22168,6 +29476,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_erfrischen=1; + } echo "\n"; + + } -echo "\n"; - - -} - echo "
    \n"; echo ""; @@ -22214,6 +29527,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; @@ -22261,10 +29579,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_erfrischen=1; + } 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"; @@ -22452,15 +29904,138 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + 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"; @@ -22478,6 +30053,16 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22312,6 +29688,66 @@ if ($ADD==311111111111111) $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_erfrischen = $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]; echo "
    ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN\n"; echo "\n"; @@ -22322,6 +29758,10 @@ if ($ADD==311111111111111) echo "
    DB Schema Update Date: $db_schema_update_date
    Auto User-add Value: $auto_user_add_value
    Installieren Datum: $install_date
    Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
    Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
    Gebrauch Nicht-Lateinisch: $NWB#settings-use_non_latin$NWE
    Webroot Schreibbar: $NWB#settings-webroot_writable$NWE
    VICIDIAL Mittel Sperren Anzeige: $NWB#settings-vicidial_agent_disable$NWE
    Erlauben Sie SIPSAK Anzeigen: $NWB#settings-allow_sipsak_messages$NWE
    Admin Haupt-URL: $NWB#settings-admin_home_url$NWE
    Admin Ändern Auto-Refresh: $NWB#settings-admin_modify_erfrischen$NWE
    Admin No-Cache: $NWB#settings-nocache_admin$NWE
    Ermöglichen Sie Vertreter-Übergangsprotokolldatei: $NWB#settings-enable_agc_xfer_log$NWE
    Aktivieren Agenten Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
    Timeclock End-of-Day:$NWB#settings-timeclock_end_of_day$NWE
    Standard Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#settings-default_local_gmt$NWE
    Standard-Voicemail-Zone: $NWB#settings-default_voicemail_timezone$NWE
    Bevollmächtigte Calls zurücksetzen: $NWB#settings-agents_calls_reset$NWE
    LetzteTimeclock Auto Logout: $timeclock_last_reset_date
    Agent-Header Datum Screen Format:
    Central Sound Control Aktiv:$NWB#settings-sounds_central_control_active$NWE
    Sounds Web Server: $NWB#settings-sounds_web_server$NWE
    Sounds Web-Verzeichnis: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
    Admin Web Directory: $NWB#settings-admin_web_directory$NWE
    Aktive Voicemail-Server: $NWB#settings-active_voicemail_server$NWE
    Lassen Sie Custom Dialplan Einträge: $NWB#settings-allow_custom_dialplan$NWE
    PLLB Limit-Gruppierung: $NWB#settings-pllb_grouping_limit$NWE
    Generieren Sie Cross-Server-Durchwahls: $NWB#settings-generate_cross_server_exten$NWE
    User Gebiete Aktiv:$NWB#settings-user_territories_active$NWE
    Aktivieren Zweiten Webform: $NWB#settings-enable_second_webform$NWE
    Aktivieren TTS Integration: $NWB#settings-enable_tts_integration$NWE
    Aktivieren CallCard: $NWB#settings-callcard_enabled$NWE
    Aktivieren Sie Benutzerdefinierte Liste Felder: $NWB#settings-custom_fields_enabled$NWE
    Aktivieren Kampagne Test-Anrufe: $NWB#settings-test_campaign_calls$NWE
    Aktivieren Sie Erweiterte Liste Stats: $NWB#settings-expanded_list_stats$NWE
    Aktivieren Kampagne Vorwahl CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
    Aktivieren Sie Remote Agent Erweiterung Overrides: $NWB#settings-did_ra_extensions_enabled$NWE
    Enable Contacts: $NWB#settings-contacts_enabled$NWE
    Erster Login-Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Standard-Telefon-Anmeldung Passwort: $NWB#settings-default_phone_registration_password$NWE     Stärke:
    Standard-Telefon Login Passwort: $NWB#settings-default_phone_login_password$NWE     Stärke:
    Standard-Server-Kennwort: $NWB#settings-default_server_password$NWE     Stärke:
    Slave Database Server: $NWB#settings-slave_db_server$NWE
    Berichte auf Slave DB verwenden: $NWB#settings-reports_use_slave_db$NWE
    Benutzerdefinierte Dialplan Eintrag: $NWB#settings-custom_dialplan_entry$NWE
    Auf Servern neu laden Dialplan: $NWB#settings-reload_dialplan_on_servers$NWE
    Benutzerdefinierte Dialplan Eintrag: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Beschriftung ausblenden in Anrufprotokolle: $NWB#settings-label_hide_field_logs$NWE
    Label-Titel: $NWB#settings-default_field_labels$NWE
    Label-Vorname: $NWB#settings-default_field_labels$NWE
    Label Mittlere Initiale: $NWB#settings-default_field_labels$NWE
    Label-Nachname: $NWB#settings-default_field_labels$NWE
    Label-Adresse1: $NWB#settings-default_field_labels$NWE
    Label-Address2: $NWB#settings-default_field_labels$NWE
    Label-Address3: $NWB#settings-default_field_labels$NWE
    Label-Stadt: $NWB#settings-default_field_labels$NWE
    Kennzeichnungsschild: $NWB#settings-default_field_labels$NWE
    Label-Provinz: $NWB#settings-default_field_labels$NWE
    Label-PLZ: $NWB#settings-default_field_labels$NWE
    Label-Hersteller Blei-Code: $NWB#settings-default_field_labels$NWE
    Label-Geschlecht: $NWB#settings-default_field_labels$NWE
    Label-Telefonnummer: $NWB#settings-default_field_labels$NWE
    Label-Telefon Code: $NWB#settings-default_field_labels$NWE
    Label-Alt-Phone: $NWB#settings-default_field_labels$NWE
    Label Sicherheit Phrase: $NWB#settings-default_field_labels$NWE
    Label-E-Mail: $NWB#settings-default_field_labels$NWE
    Label-Kommentare: $NWB#settings-default_field_labels$NWE
    QC Funktionen aktiv: $NWB#settings-qc_features_active$NWE
    QC Letzte Pull Zeit: $qc_last_pull_time
    Standard-Codecs: $NWB#settings-default_codecs$NWE
    Standard Webphone: $NWB#settings-default_webphone$NWE
    Externe Server-IP-Standard: $NWB#settings-default_external_server_ip$NWE
    Webphone URL: $NWB#settings-webphone_url$NWE
    Webphone System Key: $NWB#settings-webphone_systemkey$NWE
    Keine Antwort Anmelden: $NWB#settings-noanswer_log$NWE
    DID-Agent-Protokoll: $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 Kennwort:$NWB#settings-alt_log_server_ip$NWE
    Alt-Log-Tabellen: $NWB#settings-tables_use_alt_log_db$NWE
    Ermöglichen Sie Der QueueMetrics Protokollierung: $NWB#settings-enable_queuemetrics_logging$NWE
    QueueMetrics Bediener IP: $NWB#settings-queuemetrics_server_ip$NWE
    QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
    QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallStatus:$NWB#settings-queuemetrics_callstatus$NWE
    QueueMetrics AddMember Aktiviert: $NWB#settings-queuemetrics_addmember_enabled$NWE
    QueueMetrics Dispo Pausecode: $NWB#settings-queuemetrics_dispo_pause$NWE
    QueueMetrics Telefon Umwelt Telefon anhängen: $NWB#settings-queuemetrics_pe_phone_append$NWE
    Aktivieren vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Klicken Sie hier, um synchronisieren Sie Benutzer mit vtiger\n"; @@ -22494,7 +30079,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Klicken Sie hier, um zu sehen, Admin chages auf die System-Einstellungen\n"; + echo "

    Klicken Sie hier, um die Änderungen zu sehen Admin to the system settings\n"; } } else @@ -22515,15 +30100,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_erfrischen=1; + } echo "
    \n"; echo ""; echo "
    \n"; echo "VICIDIAL STATUS INNERHALB DIESES SYSTEMS:  $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -22540,8 +30142,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -22562,15 +30163,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -22598,14 +30197,16 @@ if ($ADD==321111111111111) echo "
    ADDIEREN SIE NEUEN SYSTEMSTATUS
    \n"; echo "\n"; echo "Status:   \n"; - echo "Beschreibung:
    \n"; + echo "Beschreibung:   \n"; echo "Auswählbar:   \n"; - echo "Human Antwort:   \n"; + echo "Human Antwort:
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Kategorie:\n"; echo "
    STATUSBESCHREIBUNGSELECT-
    ABLE
    HUMAN
    ANTWORT
    KATEGORIEMODIFY/DELETE
    S
    T
    A
    T
    U
    S
    BESCHREIBUNGKATEGORIE
    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 "\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])) @@ -22581,15 +30189,6 @@ if ($ADD==321111111111111) { echo "LÖSCHUNG\n"; } - - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
    \n"; echo ""; @@ -22677,7 +30283,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -22741,6 +30347,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_erfrischen_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_erfrischen=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -22829,7 +30440,7 @@ if ($ADD==550) echo "
    Benutzer-Niveau:
    Benutzer-Gruppe: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23186,6 +30801,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23210,6 +30826,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -23217,6 +30834,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -23225,7 +30844,7 @@ if ($ADD==100) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23233,7 +30852,7 @@ if ($ADD==100) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23166,6 +30780,7 @@ if ($ADD==10) echo "Kampagnen-ID
    NAME
    ACTIVE   GROUP   DIAL METHOD  
    $row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -23265,7 +30884,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23292,7 +30911,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23301,7 +30919,7 @@ if ($ADD==1000) echo "
    LISTE IDENTIFIKATIONLISTE NAMELISTE NAMEBESCHREIBUNGRTIMELEADS COUNT
    "; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -23329,6 +30948,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23347,7 +30967,7 @@ if ($ADD==1300) echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -23312,6 +30930,7 @@ if ($ADD==1000) echo "NAMEPRIORITYAKTIVADMIN-GruppeTIMECOLORÄNDERN Sie $row[1] $row[2] $row[3] $row[6] $row[4]  ÄNDERN Sie
    "; echo "\n"; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23374,7 +30996,9 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23391,7 +31015,7 @@ if ($ADD==1500) echo "
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); @@ -23358,7 +30978,9 @@ if ($ADD==1300) echo "DIDBESCHREIBUNGAKTIVADMIN-GruppeROUTERECÄNDERN Sie
    $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -23416,6 +31041,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -23431,6 +31057,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -23442,6 +31069,72 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
    \n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -23400,6 +31024,7 @@ if ($ADD==1500) echo "
    MENU IDNAMEGROUPPROMPTTIMEOUTOPTIONS
    $menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
    \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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
    FILTER PHONE Group Einträge:\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=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    FPG IDFPG NAMEBESCHREIBUNGADMIN-GruppePHONES COUNTÄNDERN Sie
    $row[0] $row[1] $row[2] $row[4] $row[3]ÄNDERN Sie
    $row[0] $row[1] $row[2] $row[4] $row[3]ÄNDERN Sie
    \n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23450,7 +31143,28 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23479,6 +31194,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23487,6 +31203,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23461,6 +31175,7 @@ if ($ADD==10000) echo "LINESBEDIENER  CONF-EXTEN   GROUP   STATUS   CAMPAIGN   ÄNDERN Sie
    $row[4] $row[5] $row[6] $row[7]ÄNDERN Sie
    \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_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
    VERLÄNGERUNG Group Einträge:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    GROUPVERLÄNGERUNGRANK   RESTRICT   COUNT   LAST CALL   LAST ID   ÄNDERN Sie
    $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]ÄNDERN Sie
    \n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -23495,7 +31258,7 @@ if ($ADD==100000) echo "
    \n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -23534,7 +31297,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23557,6 +31321,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23573,7 +31338,7 @@ if ($ADD==10000000) echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -23544,6 +31307,7 @@ if ($ADD==1000000) echo "SCRIPT IDSkriptnamenACTIVE   ADMIN-Gruppe   ÄNDERN Sie
    $row[0] $row[1] $row[2] $row[3]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23594,6 +31360,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23610,7 +31377,10 @@ if ($ADD==100000000) echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -23582,6 +31347,7 @@ if ($ADD==10000000) echo "
    FILTER IDFILTER NAMEADMIN-GruppeÄNDERN Sie
    $row[0] $row[1] $row[2]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23635,6 +31406,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23650,7 +31422,7 @@ if ($ADD==1000000000) echo "
    \n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -23621,6 +31391,7 @@ if ($ADD==100000000) echo "CALLTIME NAMEDEFAULT STARTDEFAULT STOPADMIN-GruppeÄNDERN Sie
    $row[1] $row[2] $row[3] $row[4] ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23677,6 +31450,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23692,7 +31466,7 @@ if ($ADD==130000000) echo "
    \n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -23662,6 +31434,7 @@ if ($ADD==1000000000) echo "CALLTIME NAMEDEFAULT STARTDEFAULT STOPADMIN-GruppeÄNDERN Sie
    $row[2] $row[3] $row[4] $row[5] ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23719,6 +31494,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23747,7 +31523,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -23761,6 +31537,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23779,7 +31556,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -23795,7 +31573,7 @@ if ($ADD==12000000000) echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -23704,6 +31478,7 @@ if ($ADD==130000000) echo "UMSCHALT STARTUMSCHALT LÄNGEWOCHEADMIN-GruppeÄNDERN Sie
    $row[2] $row[3] $row[4] $row[5] ÄNDERN Sie
    STATUSNAMEVMAILGROUPLINKS
    $row[5] $row[6] $row[7]$row[8]$row[8]$row[9]ÄNDERN Sie | Notfall
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23818,6 +31597,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23833,7 +31613,7 @@ if ($ADD==13000000000) echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23805,6 +31583,7 @@ if ($ADD==12000000000) echo "ALIAS IDAlias-NameTEL Logins LISTEGROUPÄNDERN Sie
    $row[0]$row[1]$row[2]$row[3]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23860,6 +31641,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23875,7 +31657,7 @@ if ($ADD==100000000000) echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23845,6 +31625,7 @@ if ($ADD==13000000000) echo "CID NUMBERCID NAMEAKTIVADMIN-GruppeÄNDERN Sie
    $row[2]$row[3]$row[4]$row[5]ÄNDERN Sie
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -23921,7 +31703,7 @@ if ($ADD==130000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23942,6 +31725,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23957,7 +31741,7 @@ if ($ADD==140000000000) echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); @@ -23930,6 +31712,7 @@ if ($ADD==130000000000) echo "
    Vorlagen-IDTemplate NameADMIN-GruppeÄNDERN Sie
    $row[0]$row[1]$row[2]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23986,6 +31771,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24002,7 +31788,7 @@ if ($ADD==150000000000) echo "
    \n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -23970,6 +31754,7 @@ if ($ADD==140000000000) echo "ProtocolAnmeldungAktiveADMIN-GruppeÄNDERN Sie
    $row[3]$row[4]$row[5]$row[6]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24030,7 +31818,9 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24047,7 +31837,7 @@ if ($ADD==160000000000) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24012,7 +31798,9 @@ if ($ADD==150000000000) echo "TTS-IDTTS NameAktiveTTS-StimmeTTS TextADMIN-GruppeÄNDERN Sie
    $row[0]$row[1]$row[2]$row[4]$row[3]$row[5]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24076,6 +31867,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24092,7 +31884,7 @@ if ($ADD==170000000000) echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -24058,6 +31848,7 @@ if ($ADD==160000000000) echo "MOH NameAktiveZufälliger ReihenfolgeADMIN-GruppeÄNDERN Sie
    $row[1]$row[2]$row[3]$row[4]ÄNDERN Sie
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24122,6 +31915,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24130,6 +31924,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -24105,6 +31897,7 @@ if ($ADD==170000000000) echo "Neue AnzeigenAlte AnzeigenDeleteADMIN-GruppeÄNDERN Sie
    $row[3]$row[4]$row[5]$row[6]ÄNDERN Sie
    \n"; + echo ""; + + $stmt="SELECT label_id,label_name,active,user_group from vicidial_screen_labels $whereLOGadmin_viewable_groupsSQL order by label_id"; + $rslt=mysql_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
    Agent-Bildschirm Labels:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    LABEL IDNameAktiveADMIN-GruppeÄNDERN Sie
    $row[0]$row[1]$row[2]$row[3]ÄNDERN Sie
    \n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24284,6 +32181,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24305,7 +32203,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    NAMEOffice NumberBU NameDepartmentGroupJob TitleLocationÄNDERN Sie
    $row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ÄNDERN Sie
    \n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -24230,7 +32126,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24244,6 +32140,7 @@ if ($ADD==700000000000000) echo "
    SECTIONTYPERECORD IDGROUPBESCHREIBUNGGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24369,6 +32268,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24387,73 +32287,90 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
    \n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -24314,7 +32212,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24328,6 +32226,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGROUPBESCHREIBUNGGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
    Änderung der Registrierung ADMIN: Abschnitt 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"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDBESCHREIBUNGGOTO
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + $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 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    Änderung der Registrierung ADMIN: Abschnitt Records - $category - $stage\n"; + echo "
    \n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $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')";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
    \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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDGROUPBESCHREIBUNGGOTO
    $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 "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; } - echo "


    \n"; - echo "\n"; - echo "
    \n"; } @@ -24463,53 +32380,66 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
    Änderung der Registrierung ADMIN: 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"; - $row[9] = eregi_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]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; - echo "\n"; - echo "
    \n"; + 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_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
    Änderung der Registrierung ADMIN: 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] = eregi_replace("',","' ,",$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-Gruppe: $row[11]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; + echo "\n"; + echo "
    \n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; } } @@ -24524,7 +32454,7 @@ if ($ADD==999999) 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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -24546,13 +32476,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -24564,54 +32500,104 @@ if ($ADD==999999)
          - Real-Time Berichte
    -
    - Inbound and Outbound Calling Berichte
    -
      -
    • Inbound Report -
    • Inbound Service Level Report -
    • Inbound Zusammenfassung Stunden-Report -
    • Inbound DID Report -
    • Inbound IVR Report -
    • Outbound Calling Report -
    • Outbound Summary Interval Report -
    • Fronter - Closer Report - - Real-Time Berichte
      \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 Kampagne Summary/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Real-Time Kampagne Summary\n";} + echo "

      \n"; + echo "Inbound and Outbound Calling Berichte
      \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-Bericht von 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 Zusammenfassung Stunden-Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound Zusammenfassung Stunden-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 fordert Bericht/",$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("/Listen Kampagne Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Listen Kampagne Status Report\n";} + if ( (preg_match("/Kampagne Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Kampagne Status List Report\n";} + # echo "
      • MITTELSPREADSHEETLEISTUNG\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 ($LOGexport_reports >= 1) { - echo "
      • Export fordert Bericht\n"; + if ( (preg_match("/Export fordert Bericht/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Export fordert Bericht\n";} + if ( (preg_match("/Export Leads Bericht/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
      • Export Leads Bericht\n";} } - ?> -
      + echo "
    \n"; + echo "
    \n"; + echo "      \n"; + echo "\n"; + echo "Agent Berichte
    \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-Statistiken/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
    • User-Statistiken\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 Berichte
    \n"; + echo "
      \n"; + if ( (preg_match("/UserTimeclock Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
    • UserTimeclock Report\n";} + if ( (preg_match("/Benutzer-GruppeTimeclock Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
    • Benutzer-GruppeTimeclock Status Report\n";} + if ( (preg_match("/UserTimeclock Detail Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
    • UserTimeclock Detail Report\n";} + echo "

    \n"; + echo "Other Berichte 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";} -
    -       - - Agent Berichte
    -
    - Time Clock Berichte
    -
    - Other Berichte and Links
    -
      -
    • Server Perforrmance Report - = 9) + 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"; } @@ -24623,58 +32609,117 @@ if ($ADD==999999) { echo "
    • VtigerCRM Home\n"; } - if ($list_update_count > 0) + 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"; } - ?> -
    -
    - - -
    
    -		
    -		 $o)
    +		if ($SScallcard_enabled > 0)
     			{
    -			$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";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			$o++;
    +			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
    +				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERBESCHREIBUNGIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Berichte 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;
    +			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";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				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_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    BEDIENER-BESCHREIBUNGIPACTLOADCHANDISKTIME
    BEDIENER+BESCHREIBUNGIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      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-Dienstprogramme\n"; + } + } } else { @@ -24682,6 +32727,463 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    + "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -186,12 +309,33 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; + + ### Log search + echo "
    \n"; + echo "
    "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
    + \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 "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='MODIFY', record_id='$user', event_code='USER FORCE PASSWORT ÄNDERN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Kennwort aktualisiert wurde, können Sie jetzt auch\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    PASSWORT ÄNDERN\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Neues Passwort:     Stärke:
    Sie sind verpflichtet, Ihr Passwort zu ändern, bevor Sie fortfahren können, um auf Administration. Ein sicheres Kennwort verfügt sowohl Klein-und Großbuchstaben sowie mindestens eine Zahl enthalten. Ihr Passwort muss 2-20 Zeichen lang sein und darf keine Zeichen, die keine Buchstaben oder Zahlen. Seien Sie sicher, dass dieses Passwort etwas, dass Sie mich erinnern kann ist, denn sobald Sie diese Änderung vorgenommen werden Sie aufgefordert, Ihr neues Passwort eingeben, um sich wieder anmelden, um Verwaltung werden
    \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 "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='BENUTZER', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Passwörter aktualisiert worden sind, können Sie nun auf in Verwaltung weiter.

    Vielleicht möchten Sie starten durch das Lesen der sich jeder leisten Manager Handbuch finden Sie unter vicidial.org (gibt es eine kostenlose Version verfügbar)\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    Willkommen bei jeder leisten, anfängliche Setup-Bildschirm

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Sie sind verpflichtet, Ihr Passwort zu ändern, bevor Sie fortfahren können, um auf Administration. Ein sicheres Kennwort verfügt sowohl Klein-und Großbuchstaben sowie mindestens eine Zahl enthalten. Ihr Passwort muss 2-20 Zeichen lang sein und darf keine Zeichen, die keine Buchstaben oder Zahlen. Seien Sie sicher, dass dieses Passwort etwas, dass Sie mich erinnern kann ist, denn sobald man diese anfängliche Setup-Bildschirm füllen Sie aufgefordert, Ihr neues Passwort erneut eingeben, um in wieder einloggen, um Verwaltung werden
    Neues Passwort:     Stärke:
     
    Die nächsten drei Standard-Passwörter werden im Abschnitt Systemeinstellungen definiert, und Sie können sie ändern, nachdem Sie sie hier definieren. Es ist eine gute Idee, um diese Passwörter so stark, dass niemand in Ihr Telefon Konten und Ort telefonieren ohne Ihr Wissen zu hacken. Die Standard-Registrierung Passwort verwendet werden, wenn neue Handys mit dem System wie dem SIP-oder IAX-VOIP-Telefon, Passwort hinzugefügt werden. Die Standard-Telefon Web-Login-Passwort verwendet werden, wenn neue Handys mit dem System hinzugefügt werden, wie das Telefon vergessen, dass ein Agent würde in der sich jeder leisten Agent-Schnittstelle zu verwenden. Der Standard-Server-Passwort verwendet werden, wenn neue Server mit dem System hinzugefügt werden für Server, um miteinander zu kommunizieren.
    Standard-Telefon-Anmeldung Passwort:     Stärke:
    Standard-Telefon Login Passwort:     Stärke:
    Standard-Server-Kennwort:     Stärke:
     
    Die nächsten beiden Einstellungen sind auch im Abschnitt Systemeinstellungen definiert, und Sie können sie ändern, nachdem Sie sie hier definieren. Sie sollten die Standard-Lokale Zeitzone GMT auf die, dass Ihre Agenten wollen in. sein Die Voicemail-Zone ist die Auflistung der Voicemail-Zeitzonen, dass Voicemail-Nachrichten werden mit der Zeit, wenn neue Nachrichten bleiben eingeloggt sein.
    Standard Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#settings-default_local_gmt$NWE
    Standard-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 "
    Willkommen bei jeder leisten: Urheber-, Marken-und Lizenz-Seite

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   Das sich jeder leisten Call Center-Suite wird von beibehalten ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" ist ein eingetragenes Warenzeichen der ViciDial Group. Hier ist unsere Marke Use Policy
    License:   Das sich jeder leisten Call Center Suite ist durch die das freigesetzte AGPLv2 Open-Source-Lizenz
    Source Code:   Das sich jeder leisten Call Center Suite-Software steht zum Download und zur Nutzung zur Verfügung, kostenlos. Sie können die einfach zu installieren ViciBox CD-ISO-Version, oder nur die Source-Code
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Weiter geht es nach der Ersteinrichtung

      \n"; + } + } +##### END copyright trademark license page ##### + + +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: versteckte Dienstprogramme Seite - wenn Sie nicht wissen, was diese Programme tun, sollten Sie wahrscheinlich nicht verwenden

    \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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Sie haben nicht Erlaubnis, diese Seite anzusehen";} + + 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Sie haben nicht Erlaubnis, diese Seite anzusehen";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + echo "
    \n"; @@ -24695,24 +33197,127 @@ echo "
    \n"; echo "

    "; echo "VERSION: $admin_version
    "; -echo "BAU: $build
    \n"; - +echo "BAU: $build\n"; +if (!preg_match("/_BAU_/",$SShosted_settings)) + {echo "
    © 2012 ViciDial Group
    ";} +echo "\n"; ?>
    - - 1) and ($modify_footer_erfrischen > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_erfrischen > 1) and ($modify_footer_erfrischen > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Es gibt $complete_leads abgeschlossen führt in diesen Listen\n";} + } + else + { + echo "keine Vorwahlknopfstatus vorgewählt für diese Kampagne\n"; + } + } + else + { + echo "Keine aktiven Listen für diese Kampagne gewählt\n"; + } + } +else + { + echo "Keine aktiven Listen für diese Kampagne gewählt\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -25035,7 +33640,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -25047,8 +33658,11 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; - echo "Diese Kampagne hat$active_leads führt, in jenen Listen gewählt zu werden\n"; + if ($DB > 0) {echo "|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {echo "Diese Kampagne hat$active_leads führt, in jenen Listen gewählt zu werden\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_campaign_multi_alt.php new file mode 100644 index 00000000..4d9a9a7f --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +VERWALTUNG: Kampagne Multi-Alt-Leads +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Diese Kampagne ist nicht auf Auto-Alt-Zifferblatt MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_SUBMIT") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-Kanal-Auto-Dialing-Einstellungen Alt Formular<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_SUBMIT>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS KAMPAGNE: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>BENANNT</td><td>NICHT BENANNT</td><td>SELECTED</td><td>OLD RANK</td><td>NEW RANK</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>TEILSUMMEN</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>GESAMTMENGE</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Liste Auftrag Randomize: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Liste Auftrag Sekundäre: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Version: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_header.php index 4a715e6f..3b993bf6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,25 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -27,15 +46,23 @@ if($short_header) ?> <TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR> <TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22>   </TD> + <?php if ($reports_only_user < 1) { + ?> <TD>   <A HREF="admin.php" ALT="Benutzer"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Benutzer</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10" ALT="Kampagnen"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Kampagnen</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100" ALT="Listen"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Listen</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=1000000" ALT="Indexe"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Indexe</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000000" ALT="Filter"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Filter</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=1000" ALT="In-Gruppen"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>In-Gruppen</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=1000" ALT="Inbound"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Inbound</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100000" ALT="Benutzer-Gruppen"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Benutzer-Gruppen</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000" ALT="Remotemittel"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Remotemittel</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=10000000000" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=999998" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <?php + } + else + { ?> + <TD width=600>     </TD> + <?php } ?> <TD>   <A HREF="admin.php?ADD=999999" ALT="Berichte"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Berichte</B></A>   </TD> </TR> </TABLE> @@ -319,41 +346,99 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_erfrischen > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_erfrischen;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("erfrischen_countdown").innerHTML = "<font color=black> screen erfrischen in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_erfrischen_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -519,22 +604,47 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) ) } + + +### Javascript for shift end-time calculation and display +if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) + { + ?> + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + <?php + } + + +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -546,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -558,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -570,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -622,13 +732,17 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 if (selected_route=='INGROUP') { if (value_context.length < 10) - {value_context = 'CID,LB,998,TESTCAMP,1';} - var value_context_split = value_context.split(","); - var IGhandle_method = value_context_split[0]; - var IGsearch_method = value_context_split[1]; - var IGlist_id = value_context_split[2]; - var IGcampaign_id = value_context_split[3]; - var IGphone_code = value_context_split[4]; + {value_context = 'CID,LB,998,TESTCAMP,1,,,,';} + var value_context_split = value_context.split(","); + var IGhandle_method = value_context_split[0]; + var IGsearch_method = value_context_split[1]; + var IGlist_id = value_context_split[2]; + var IGcampaign_id = value_context_split[3]; + var IGphone_code = value_context_split[4]; + var IGvid_enter_filename = value_context_split[5]; + var IGvid_id_number_filename = value_context_split[6]; + var IGvid_confirm_filename = value_context_split[7]; + var IGvid_validate_digits = value_context_split[8]; if (route == selected_route) { @@ -640,14 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Handle-Methode: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 Border=0 ALT="HILFE" ALIGN=TOP></a>'; + new_content = new_content + '<BR>Suchmethode: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   Liste Identifikation: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>Kampagne Identifikation: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + new_content = new_content + "<BR>   VID Geben Sie Dateiname: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID-ID-Nummer Dateiname: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID bestätigen Dateiname: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -667,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "Audio-Datei: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -782,14 +901,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -799,14 +922,19 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Handle-Methode: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Suchmethode: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   Liste Identifikation: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>Kampagne Identifikation: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + // new_content = new_content + "<BR>   VID Geben Sie Dateiname: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID-ID-Nummer Dateiname: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID bestätigen Dateiname: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + } if (selected_route=='DID') { @@ -826,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "Audio-Datei: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,15 +1020,46 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_erfrischen > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_erfrischen_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_de/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Deutsch <img src=\"../agc/images/de.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?> <CENTER> @@ -911,6 +1070,8 @@ $SSenable_tts_integration = $row[1]; <IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="VICIDIAL logo"> <B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR> <TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160> + <?php if ($reports_only_user < 1) { + ?> <!-- BENUTZER NAVIGATION --> <TR WIDTH=160><TD <?php echo $users_hh ?> WIDTH=160> <a href="<?php echo $ADMIN ?>?ADD=0"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $users_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $users_bold ?>Benutzer</a> @@ -966,6 +1127,10 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -989,31 +1154,56 @@ $SSenable_tts_integration = $row[1]; ?> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Pause Codes</a></TD> - <?php } + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>> Voreinstellungen </a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- LISTEN NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { ?> <TR><TD ALIGN=LEFT <?php echo $lists_hh ?>><a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $lists_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $lists_bold ?>Listen</a></TD></TR> <?php - if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-Nummer löschen Von DNC';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-DNC-Nummer löschen';} + else {$DNClink = 'Fügen Sie DNC-Nummer';} ?> - <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Zeigen Sie Listen </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Addieren Sie Eine Neue Liste </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Suche Nach Einer Leitung </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./new_listloader_superL.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Last Neue Leitungen </a> - </TD></TR> - <?php } + <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Zeigen Sie Listen </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Addieren Sie Eine Neue Liste </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Suche Nach Einer Leitung </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Fügen Sie einen neuen Lead </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Last Neue Leitungen </a> + <?php + if ($SScustom_fields_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Liste Custom Fields </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Kopieren Sie benutzerdefinierte Felder </a> + <?php + } + ?> + </TD></TR> + <?php + } } ?> <!-- INDEXE NAVIGATION --> @@ -1051,30 +1241,50 @@ $SSenable_tts_integration = $row[1]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> In-Gruppen </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Inbound </a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-Löschen FPG-Nummer';} + else {$FPGlink = 'Fügen Sie FPG Anzahl';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Zeigen Sie In-Gruppen </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Addieren Sie Eine Neue In-Gruppe </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> KopierenIn-Gruppe </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> KopierenIn-Gruppe </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show DIDS </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Hinzufügen einer neuen DID </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> KopierenDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> KopierenDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Call-Menüs anzeigen </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Fügen Sie ein neues Call-Menü </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy-Ruf-Menü </a> + <HR> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filter Phone Gruppen </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filter hinzufügen Phone Group </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> <?php } ?> @@ -1109,12 +1319,16 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Zeigen Sie Remotemittel </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Addieren Sie Neue Remotemittel </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Erweiterung Gruppen </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Erweiterung hinzufügen Gruppe </a> </TD></TR> <?php } ?> <!-- ADMIN NAVIGATION --> <TR><TD <?php echo $admin_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> + <a href="<?php echo $ADMIN ?>?ADD=999998"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> </TD></TR> <?php if (strlen($admin_hh) > 1) @@ -1135,6 +1349,8 @@ $SSenable_tts_integration = $row[1]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1145,6 +1361,10 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1164,6 +1384,8 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Konferenzen </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> System Einstellungen </a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Screen-Labels </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>>Systemstatus</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1186,7 +1408,23 @@ $SSenable_tts_integration = $row[1]; </TR> <?php } + if ($SScallcard_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cc_sh ?>>   + <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cc_fc ?> SIZE=<?php echo $header_font_size ?>> CallCard Admin </a></TD> + </TR> + + <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } + } ?> <!-- REPORTS NAVIGATION --> <TR><TD <?php echo $reports_hh ?>> @@ -1202,7 +1440,7 @@ $SSenable_tts_integration = $row[1]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HAUPT</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Timeclock</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HAUPT</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Timeclock</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1245,12 +1483,16 @@ $SSenable_tts_integration = $row[1]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Träger </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Träger </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Kopieren Sie ein Carrier- </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> TTS Einträge anzeigen </a>   |   <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New TTS Eintrag </a></TD></TR> <?php } + if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { + ?> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Generate New Numbers </a></TD></TR> + <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> MOH Einträge anzeigen </a>   |   <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Eintrag </a></TD></TR> @@ -1263,6 +1505,14 @@ $SSenable_tts_integration = $row[1]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> System Einstellungen </a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Screen-Labels </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Fügen Sie einen Screen Etiketten </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Hinzufügen eines Kontakts </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Systemstatus</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Status-Kategorien</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>QK-Status-Codes</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..d6123a72 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +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["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"HILFE\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- VERSION: $version BAU: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT VERSETZTE JETZT: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Gegenwärtiger Akte Status:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Last Leitungen von dieser Akte:
    Liste Identifikation Override: + +
    Telefon-Nr Override: + +
    Zu verwenden Dateiaufbau:Standard Format    Kundenspezifischer Plan    Custom Template
    Individuelle Vorlage zu verwenden: Template Builder
    Leitung Duplikat-Überprüfung:
    USA-Canada Check:
    Vorbereitungs- und Anlaufzeit Zone Nachschlagen:
            
            ZURÜCK ZU ADMIN         Old Lead Loader     LIST LOADER 4th Gen-     VERSION:     BAU:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    Liste Identifikation Override:
    Telefon-Nr Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSION:     BAU: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Verarbeitungfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Verarbeitung$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Verarbeitung$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Verarbeitung$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL SpalteAkte Daten
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Sonntag March to First Sonntag November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Sonntag March to First Sonntag November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Sonntag, to 6=Samstag) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Sonntag April to Last Sonntag October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in April and last Sonntag in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Sonntag March to Last Sonntag October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in March and last Sonntag in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Sonntag October to Last Sonntag March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in October and last Sonntag in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Sonntag October to Last Sonntag March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and last Sonntag in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Sonntag in October to First Sonntag in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and first Sonntag in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Sonntag October to Third Sonntag March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and third Sonntag in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Sonntag in September to First Sonntag in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in September and first Sonntag in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Sonntag October to Last Sonntag February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Sonntag October to Last Sonntag February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_third_gen.php new file mode 100644 index 00000000..30244cc9 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +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["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"HILFE\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Last Leitungen von dieser Akte:
    Liste Identifikation Override: + +
    Telefon-Nr Override: + +
    Zu verwenden Dateiaufbau:Standard Format    Kundenspezifischer Plan
    Leitung Duplikat-Überprüfung:
    USA-Canada Check:
    Vorbereitungs- und Anlaufzeit Zone Nachschlagen:
            
            ZURÜCK ZU ADMIN         Old Lead Loader     LIST LOADER 3rd Gen-     VERSION:     BAU:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    Liste Identifikation Override:
    Telefon-Nr Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSION:     BAU: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Verarbeitungfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Verarbeitung$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Verarbeitung$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL SpalteAkte Daten
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Sonntag March to First Sonntag November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Sonntag March to First Sonntag November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Sonntag, to 6=Samstag) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Sonntag April to Last Sonntag October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in April and last Sonntag in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Sonntag March to Last Sonntag October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in March and last Sonntag in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Sonntag October to Last Sonntag March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in October and last Sonntag in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Sonntag October to Last Sonntag March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and last Sonntag in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Sonntag in October to First Sonntag in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and first Sonntag in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Sonntag October to Third Sonntag March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sonntag in October and third Sonntag in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Sonntag in September to First Sonntag in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sonntag in September and first Sonntag in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Sonntag October to Last Sonntag February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Sonntag October to Last Sonntag February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # lokale Zeit calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_lists_custom.php new file mode 100644 index 00000000..50775b2e --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Listet Custom Fields +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HILFE") + { + ?> + + + +
    +
    +
    + ViciDial Listet Custom Fields Help +

    + + +
    + Feldbezeichnung - Dies ist die Datenbank-Feld-ID für dieses Feld. Dies muss eine eindeutige Kennung innerhalb der benutzerdefinierten Felder für diese Liste sein. Verwenden Sie keine Leer-oder Satzzeichen für dieses Feld. max 50 Zeichen, mindestens 2 Zeichen. Sie können auch die Standardeinstellungen sich jeder leisten Felder in einem benutzerdefinierten Feld Setup, und Sie werden sehen, wie sie in Rot in der Liste. Diese Felder werden nicht auf die benutzerdefinierte Liste Datenbank-Tabelle hinzugefügt werden, das Agenten-Interface wird stattdessen Verweis auf die Tabelle direkt vicidial_list. Die Etiketten, die Sie verwenden, um die Standardeinstellungen fieds zählen können, sind - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Feldname - Dies ist der Name des Feldes, wie es wird ein Mittel über die Schnittstelle angezeigt. Sie können die Räume in diesem Bereich, aber keine Satzzeichen, maximal 50 Zeichen und mindestens 2 Zeichen. +

    + +
    +
    + Feld Beschreibung - Die Beschreibung dieses Feldes, wie es wird in der Administrationsoberfläche angezeigt. Dies ist ein optionales Feld mit einem Maximum von 100 Zeichen. +

    + +
    +
    + Feld Rang - Die Reihenfolge, in der diese Felder an den Agenten von der niedrigsten bis zur höchsten auf der Oberseite an der Unterseite wird angezeigt. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Feldhilfe - Optionales Feld, wenn Sie es ausfüllen, wird der Agent in der Lage sein, diesen Text sehen, wenn sie klicken Sie auf einen Hilfe-Link neben dem Feld in ihren Agenten-Interface. +

    + +
    +
    + Feldtyp - Diese Option definiert den Typ des Feldes, der angezeigt wird. TEXT ist eine Standard-Single-Line-Anmeldeformular, Bereich A mehrzeiligen Textfeld ist, wählen Sie eine Single-Auswahl im Pulldown-Menü ist, MULTI ein Multiple-Select-Box ist, ist Radio eine Liste von Radio-Buttons, wo kann nur eine Option ausgewählt werden, CheckBox eine Liste von Checkboxen, in denen mehrere Optionen ausgewählt werden können, ist ein DATE Jahr Monat Tag calendar popup wo der Agent kann wählen das Datum und die Zeit ist eine Zeit Auswahlbox. Die Standardeinstellung ist Text. Für die SELECT-, Multi, und Checkboxes Optionen müssen Sie die Option Werte unterhalb definieren im Bereich Feld Optionen. DISPLAY wird nur nicht angezeigt, und ermöglichen eine Änderung durch den Agenten. Skript wird auch nur anzeigen, aber Sie können Skript-Variablen genau wie im Skripte Funktion nutzen zu können. SCRIPT Felder werden nur angezeigt, auch die Inhalte in den Optionen, und nicht der Feldname wie die Anzeige Typ tut. Verborgenes, das nicht die Agenten das Feld, sondern ermöglicht dem Feld, um Daten in diese importiert und exportiert sie, ebenso wie haben sie für das Skript verfügbare Register und Web-Formular-Adresse. READONLY stellt den Wert der Daten in dem Feld, aber nicht zulassen, dass das Mittel, um die Daten zu ändern. VerbergeBLOB ähnelt HIDDEN außer der Datenspeicherung auf dem Datenbank-Typ ist ein Typ BLOB, geeignet für binäre Daten oder Daten, die gesichert werden muss. +

    + +
    +
    + Feldoptionen - Für die SELECT-, Multi, und Checkboxes Feldtypen, müssen Sie die Option Werte in diesem Feld zu definieren. Sie müssen eine Liste von durch Komma getrennt Option Beschriftung und Option Text hier setzen mit jeder Option ein in einer eigenen Zeile. Der erste Wert sollte keine Leerzeichen enthält, und es werden keine Werte sollten keine Satzzeichen haben. Zum Beispiel - electric_meter, Stromzähler +

    + +
    +
    + Option Position - Für Checkbox und Radio Feldtypen nur, wenn auf Horizontal festgelegt die Optionen auf der gleichen Linie möglicherweise Wickeln auf die Zeile unter, wenn es viele Optionen stehen scheinen. Wenn auf Vertical festgelegt wird es nur eine Option pro Zeile sein. Die Standardeinstellung ist HORIZONTAL. +

    + +
    +
    + Feldgröße - Diese Einstellung wird verschiedene Dinge bedeuten je nachdem, was das Feld Typ ist. Für Textfelder, die Größe ist die Anzahl der Zeichen, die auf dem Gebiet zeigen wird. Für AREA Felder, die Größe ist die Breite des Textfelds in Zeichen. Für MULTI Felder, legt diese Einstellung die Anzahl der Optionen, um im Multi Select-Liste angezeigt werden. Für SELECT, wird Radio, Checkbox, DATE und TIME diese Einstellung ignoriert. +

    + +
    +
    + Feld-Max - Diese Einstellung wird verschiedene Dinge bedeuten je nachdem, was das Feld Typ ist. Für TEXT, kein versteckter und readonly-Feldern, die Größe ist die maximale Anzahl der Zeichen, die in dem Gebiet zulässig sind. Für AREA Felder definiert dieses Feld die Anzahl der Zeilen des Textes sichtbar in das Textfeld ein. Für MULTI, SELECT, Radio, Checkbox, DATE und TIME wird diese Einstellung ignoriert. +

    + +
    +
    + Feld-Standard - Dieses optionale Feld können Sie festlegen, welchen Wert Sie auf ein Feld zuweisen, wenn nichts in dieses Feld geladen wird. Der Standardwert ist NULL, die die Standard-Funktion deaktiviert. Für DATE-Feld-Typen, wird der Standard immer auf heute gestellt, es sei denn eine Zahl im In diesem Fall wird das Datum, dass viele Tage plus oder minus heute gestellt wird. Für ZEIT Feldtypen, wird der Standard immer auf dem aktuellen Server Uhrzeit einzustellen, wenn eine Zahl im in diesem Fall die Zeit wird genommen wird, dass viele Minuten plus oder minus aktuelle Zeit. +

    + +
    +
    + Feld Kostenstelle - Diese Nur-Lese-Feld Ihnen sagt, was die Kosten für dieses Feld in der Tabelle benutzerdefiniertes Feld ist für diese Liste. Es gibt keine feste Grenze für die Anzahl der benutzerdefinierten Felder, die Sie in einer Liste haben kann, aber die Summe der Kosten aller Felder für die Liste muss unter 65000. Diese Regel erlaubt es seit Hunderten von Feldern, aber wenn Sie mehrere Textfelder, die hunderte oder tausende von Zeichen lang sind dann können Sie angeben, diese Grenze schnell getroffen. Wenn Sie so viel Text in einem Feld benötigen, sollten Sie wählen Sie einen Bereich geben, die anders gelagert und verwenden Sie nicht so viel Tabellenbereich. +

    + +
    +
    + Feld erforderlich - Wenn auf Y gesetzt, wird dieses Feld zwingen, den Agenten, um Text einzugeben oder wählen Sie eine Option für dieses Feld. Standard ist N. +

    + +
    +
    + Feldname Position - Wenn auf links eingestellt, wird dieses Feld Name auf der linken Seite des Feldes erscheinen, wenn auf den Namen des Feldes TOP dauert bis die gesamte Zeile erscheinen und über dem Feld. Standard ist LEFT. +

    + +
    +
    + Option Kopieren - Beim Kopieren von Felddefinitionen aus einer Liste in eine andere, haben Sie einige Optionen für den Kopiervorgang zu Werke. APPEND werden die Felder, die nicht vorhanden sind, in der Zielliste hinzufügen, wenn es passende Feldbeschriftungen jene Wille blieb unberührt, werden keine benutzerdefinierten Feld Daten gelöscht oder verändert werden mit dieser Option. UPDATE werden die gemeinsamen field_label Feldern in der Zielliste zu den Feld-Definitionen von der Quelle Liste zu aktualisieren. benutzerdefiniertes Feld Daten können verändert werden oder verloren gehen mit dieser Option. REPLACE werden alle vorhandenen benutzerdefinierten Felder in der Ziel-Liste zu entfernen und ersetzen sie durch den benutzerdefinierten Feldern aus der Quelle-Liste, werden alle Daten gelöscht benutzerdefiniertes Feld mit dieser Option werden. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "FEHLER: Custom Fields sind auf diesem System nicht aktiv\n"; + exit; + } + + +$NWB = "   \"HILFE\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Kopieren Sie Felder in eine andere Liste
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Listen-ID, um Felder aus kopieren:
    Listen-ID, um Felder zu kopieren:
    Option Kopieren: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_SUBMIT") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "Fehler: Sie können nicht kopiert werden Felder in die gleiche Liste: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "Fehler: Quelle-Liste hat keine benutzerdefinierten Felder\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ERFOLG: Custom Field Deleted - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "ERFOLG: Custom Field Hinzugefügt - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "FEHLER: Tabelle ist nicht vorhanden custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ERFOLG: Custom Field Geändert - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: Feld existiert nicht\n
    ";} + else + { + if ($table_exists < 1) + {echo "FEHLER: Tabelle ist nicht vorhanden custom_$list_id\n
    ";} + else + { + echo "

    KLICKEN SIE HIER, um das Löschen dieses Feld CONFIRM: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: Feld existiert nicht\n
    ";} + else + { + if ($table_exists < 1) + {echo "FEHLER: Tabelle ist nicht vorhanden custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ERFOLG: Custom Field Deleted - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "FEHLER: Sie können keine reservierten Wörter für Feldbezeichnungen - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Sie müssen Feldoptionen beim Hinzufügen eines SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "FEHLER: existiert bereits für diese Liste - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "ERFOLG: Custom Field Hinzugefügt - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: Feld existiert nicht\n
    ";} + else + { + if ($table_exists < 1) + {echo "FEHLER: Tabelle ist nicht vorhanden\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Sie müssen Feldoptionen beim Update ein SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ERFOLG: Custom Field Geändert - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    ÄndernCustom Fields: Liste Identifikation $list_id         "; + echo "Einträge in dieser Tabelle benutzerdefinierte: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### ZUSAMMENFASSUNG DER FELDER ### + echo "
    ZUSAMMENFASSUNG DER FELDER:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Es gibt no custom fields for this list
    TOTALS: $o             $total_cost    


    \n"; + + + ### Beispiel einer eigenen FORM ### + echo "\n"; + echo "
    Beispiel einer eigenen FORM:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Es gibt no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='VerbergeBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### Ändern von Feldern ### + echo "
    Ändern von vorhandenen FIELDS:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Feldbezeichnung $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Feld Rang $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Feldname $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Feldname Position $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Feld Beschreibung $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Feldhilfe $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Feldtyp $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Feldoptionen $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Option Position $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Feldgröße $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Feld-Max $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Feld-Standard $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Feld erforderlich $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    ADD ein neues benutzerdefiniertes Feld für diese Liste:
    New Feld Rang:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Feldbezeichnung: $NWB#vicidial_lists_fields-field_label$NWE
    Feldname: $NWB#vicidial_lists_fields-field_name$NWE
    Feldname Position: $NWB#vicidial_lists_fields-name_position$NWE
    Feld Beschreibung: $NWB#vicidial_lists_fields-field_description$NWE
    Feldhilfe: $NWB#vicidial_lists_fields-field_help$NWE
    Feldtyp: $NWB#vicidial_lists_fields-field_type$NWE
    Feldoptionen: $NWB#vicidial_lists_fields-field_options$NWE
    Option Position: $NWB#vicidial_lists_fields-multi_position$NWE
    Feldgröße: $NWB#vicidial_lists_fields-field_size$NWE
    Feld-Max: $NWB#vicidial_lists_fields-field_max$NWE
    Feld-Standard: $NWB#vicidial_lists_fields-field_default$NWE
    Feld erforderlich: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Zur Änderung der Liste Seite für diese Liste

    \n"; + + echo "  Klicken Sie hier um Admin Änderungen an dieser Liste sehens custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    LISTE DIAZeige mit benutzerdefinierten Feldern COUNT:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    LISTE IDENTIFIKATIONLISTE NAMEAKTIVCAMPAIGNCUSTOM FIELDSÄNDERN Sie
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]Ändern von Feldern
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); + } + else + { + echo "Leitung Nachschlagen FIEL für lead_id aus $lead_id       $NOW_TIME\n

    \n"; +# echo "Close this window\n

    \n"; + } - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    Anrufinformationen: $first_name $last_name - $phone_number

    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    Änderung der Registrierung ADMIN: Abschnitt 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"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDBESCHREIBUNGGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATETABELLE custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTERTABELLE custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='VerbergeBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="Zeige COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTERTABELLE custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTERTABELLE custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='VerbergeBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTERTABELLE custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_modify_lead.php index 6695a105..b5596c7b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,19 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -48,8 +61,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -118,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -130,9 +149,15 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -140,26 +165,35 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -169,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -185,50 +219,137 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Stadt'; +$label_state = 'State'; +$label_province = 'Provinz'; +$label_postal_code = 'Postcode'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Geschlecht'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Anmerkungen'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Leitung notieren Änderung + +
    ADMINISTRATION: Leitung notieren Änderung
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "Blei wurde hinzugefügt: $lead_id

    \n"; + $end_call=0; + } + else + {echo "FEHLER: nicht hinzugefügt Blei, bitte gehen Sie zurück und schauen, was Sie gemacht haben

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Informationen geändert

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -248,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -258,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -306,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -315,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -324,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -332,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -366,179 +521,365 @@ else $alts_output .= "
    $row[4]
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $u++; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; - echo "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "VerbergeLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + $entry_list_id = $row[34]; + + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Fügen Sie einen neuen Lead\n";} + else + {echo "
    Anrufinformationen: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     Liste Identifikation: $list_id
    Vorname:   \n"; - echo " Letzter Name:
      \n"; - echo "Postcode:
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    NOTES:   $rowA[0]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} + + if ($LOGadmin_hide_lead_data != '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"; + } + 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"; + } + + if ($lead_id != 'NEW') + { echo "\n"; + echo "(with $list_campaign statuses)\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + } + else + { + echo "\n"; + } - + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) + { echo "\n"; - echo "
    Lead ID: $lead_id     Liste Identifikation: $list_id
    Fronter: $tsr     Called Count: $called_count
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    Main Phone :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    $label_comments :
    (with $log_campaign statuses)
    Ändernvicidial log
    Ändernagent log
    Änderncloser log
    Add closer log record
    \n"; - echo "


    \n"; + } + echo "
    \n"; + echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') + { + echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "ANRUFE ZU DIESEM LEITUNG:\n"; + echo "
    \n"; + echo "Callback Details:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $CB_to_print = mysql_num_rows($rslt); @@ -625,135 +983,376 @@ else echo "New Callback Owner UserID: \n"; echo "
    \n"; } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Anmerkungen: + + +
    + + + + +
    + +
    + + No Callback records found
    \n"; } + } - } - else - { - echo "Leitung Nachschlagen FIEL für lead_id aus $lead_id       $NOW_TIME\n

    \n"; -# echo "Close this window\n

    \n"; - } - - - - echo "

    \n"; - - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENDED alternative Rufnummern FÜR DIESES LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - echo "ANRUFE ZU DIESEM LEITUNG:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "MITTELLOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) + echo "
    Wenn Sie dieses Kabel an einem geplanten Rückruf ändern möchten, ändern Sie zunächst die Disposition zum CBHOLD, dann unterbreiten und Sie in der Lage, um den Rückruf von Datum und Uhrzeit.
    \n"; + } + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    \n"; + + echo "

    \n"; + + echo "
    \n"; + + if ($c > 0) + { + echo "EXTENDED alternative Rufnummern FÜR DIESES LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="ZeigeTABELLES LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "CUSTOM Felder für diesen LEAD:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if (eregi("http",$location)) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo "
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "MITTELLOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # KAMPAGNEDATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Ändernchanges to this lead\n"; + } + + echo "\n"; } - - - echo "
    \n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin_search_lead.php index e4761c5e..56bb6fbb 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -22,6 +22,13 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -39,6 +46,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -54,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -71,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -91,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -141,13 +219,58 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Stadt'; +$label_state = 'State'; +$label_province = 'Provinz'; +$label_postal_code = 'Postcode'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Geschlecht'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Anmerkungen'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
    \n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
    \n"; echo "\n"; echo "\n"; @@ -156,16 +279,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
    Leitung Suche Options:
    Vendor ID(Verkäuferleitung Code):   $label_vendor_lead_code(Verkäuferleitung Code):  
     
    Home Telefonnummer:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Vorname:   $label_first_name:  
    Letzter Name:   $label_last_name:  
     
    Log Search Options:
    Lead ID:  
     
    $label_phone_number Dialed:  
     
    \n"; echo "\n
    \n"; echo "\n"; @@ -200,9 +344,249 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Es gibt no outbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  CAMPAIGN  CALLDATUM  STATUS  USER  LISTE IDENTIFIKATION  LENGTH  DIAL
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
    \n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Es gibt no inbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  INGROUP  CALLDATUM  STATUS  USER  LISTE IDENTIFIKATION  LENGTH  
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
    \n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Es gibt no inbound did calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #DID  PHONE  DID ID  CALLDATUM  
    $o$row[0]$row[1]$row[2]$row[3]
    \n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


    \nNEUE SUCHE"; + + echo "\n\n\n


    \nIndexlaufzeit: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -210,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -244,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -261,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -277,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -301,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -334,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "VerbergeLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -364,7 +811,15 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_de/audio_store.php index 4f8941ea..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/audio_store.php @@ -1,17 +1,20 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -125,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -191,8 +194,28 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +300,26 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +327,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +360,18 @@ if ($action == "MANUALUPLOAD")
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

    -audio file list
    +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav) +

    All spaces will be stripped from uploaded audio file names

    +audio file list
    + + + +




    \n"; + +echo "


    Click here to see a log of the uploads to the audio store
    \n"; + +?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_de/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_de/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_de/call_report_export.php index f4599238..0f10ffa7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,22 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -42,6 +58,18 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -49,38 +77,113 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Export fordert Bericht'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Unzulässiges Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +213,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -197,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -218,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Es gibt no outbound calls during this time period for these parameters\n"; exit; } else @@ -236,9 +354,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -248,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Es gibt no inbound calls during this time period for these parameters\n"; exit; } else @@ -266,9 +403,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -282,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT ERSUCHT BERICHT', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -299,9 +455,50 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,13 +535,243 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="ZeigeTABELLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Es gibt no calls during this time period for these parameters\n"; exit; } } @@ -360,7 +787,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -375,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -390,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -405,7 +832,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +862,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +882,9 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -480,13 +909,17 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export fordert Bericht"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; - echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<font class=\"select_bold\"><B>Zeitraum:</B></font><BR><CENTER>\n"; echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; ?> @@ -498,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Montag week start </script> <?php @@ -514,13 +947,49 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Montag week start </script> <?php + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>Custom Fields:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Kampagnen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -532,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Inbound Gruppen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Listen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -559,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Status:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -571,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Benutzer-Gruppen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_de/callcard_admin.php new file mode 100644 index 00000000..5b865cff --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSION: <?php echo $version ?> BAU: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"HILFE\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Detail<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Status:</td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Gruppe:</td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Anmerkungen: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create User/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate User/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used User/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void User/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTDATUM</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>MITTELDISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ZÄHLIMPULS</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Es gibt $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTDATUM</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ZÄHLIMPULS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ZÄHLIMPULS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Gruppe:</td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     VERSION: <?php echo $version ?>     BAU: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_de/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
    "; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "
    \n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_de/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php index dca45485..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php @@ -1,58 +1,71 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) -{ -$DBCagc = file("/etc/astguiclient.conf"); -foreach ($DBCagc as $DBCline) { - $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); - if (ereg("^PATHlogs", $DBCline)) - {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} - if (ereg("^PATHweb", $DBCline)) - {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} - if (ereg("^VARserver_ip", $DBCline)) - {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} - if (ereg("^VARDB_server", $DBCline)) - {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} - if (ereg("^VARDB_database", $DBCline)) - {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} - if (ereg("^VARDB_user", $DBCline)) - {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} - if (ereg("^VARDB_pass", $DBCline)) - {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} - if (ereg("^VARDB_port", $DBCline)) - {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; } -} -else -{ -#defaults for DB connection -$VARDB_server = 'localhost'; -$VARDB_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -if (!$link) { +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { die('MySQL connect ERROR: ' . mysql_error()); -} + } mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_de/fcstats.php index eb88cb4c..f16a22f4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,18 +39,60 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "In-Group Fronter-Closer Stats Report\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           DOWNLOAD | ÄNDERN Sie | REPORTS
    Anzeige as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK SUBMIT\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK SUBMIT\n";
     }
     
     else
    @@ -167,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -185,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -216,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| MITTEL                   |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALS FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| MITTEL                   |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -246,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -270,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -309,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -324,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -354,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -369,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -397,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| MITTEL | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| MITTEL | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -425,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -449,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -532,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -546,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -591,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -613,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/functions.php b/agc_2-X/trunk/LANG_www/vicidial_de/functions.php index f3a6e7b7..66038bb0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "   \"HILFE\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_de/group_hourly_stats.php index c4ead42c..3a10cd44 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTAL $status $hour_calls $total_calls $day_calls
    TOTAL $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Melden Sie bitte die Gruppe an, die Sie stündlichen Notfall fürerhalten möchten:
    \n"; - echo "\n"; - echo "group: \n"; +echo "group:
    \n"; - echo "status:   (example: XFER)
    \n"; - echo "date with hour:   (example: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "status:   (example: XFER)
    \n"; +echo "date with hour:   (example: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \nIndexlaufzeit: $RUNtime seconds
    "; exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_de/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_de/lead_report_export.php new file mode 100644 index 00000000..2c8f3a89 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +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 (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Export Leads Bericht'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Es gibt no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Es gibt no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="ZeigeTABELLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Es gibt no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Leads Bericht</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Dieser Bericht zieht Blei Informationen für Anrufe in den ausgewählten Zeitraum gewählt. Ein Lead ist nur einmal, egal wie viele Anrufe bearbeitet wurden exportiert. Die Stromzuführung Status verwendet wird.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Zeitraum:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Montag week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Montag week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>Custom Fields:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Kampagnen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Inbound Gruppen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Listen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Status:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Benutzer-Gruppen:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_de/leadloader_template_display.php new file mode 100644 index 00000000..09a7106d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/line.js b/agc_2-X/trunk/LANG_www/vicidial_de/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_de/list_download.php index 6d988fb0..de5a74f0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ 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["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Es gibt keine Rufnummern in der Liste: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Kampagne DNC list validation ##### + $event_code_type='CAMPAIGN DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Es gibt keine Leitungen in der Kampagne DNC Liste: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Es gibt keine Leitungen in diesem Filter Phone Gruppe:$group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Es gibt no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTS') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTS') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="ZeigeTABELLES LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTS') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_de/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_de/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_de/listloaderMAIN.php index a7126dcc..b205c853 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_de/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_de/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_de/new_listloader_superL.php index ed71b514..51170b18 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -30,11 +30,16 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -127,22 +132,29 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -171,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -203,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -348,6 +360,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <form action=<?php echo $PHP_SELF ?> method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> <input type=hidden name='leadfile_name' value="<?php echo $leadfile_name ?>"> +<input type=hidden name='DB' value="<?php echo $DB ?>"> <?php if ($file_layout!="custom") { ?> <table align=center width="700" border=0 cellpadding=5 cellspacing=0 bgcolor=#D9E6FE> <tr> @@ -384,7 +397,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <tr> <td align=center colspan=2><input type=submit value="SUBMIT" name='submit_file'>        <input type=button onClick="javascript:document.location='new_listloader_superL.php'" value="BEGINNEN SIE RÜBER" name='reload_page'></td> </tr> - <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">ZURÜCK ZU ADMIN</a></font></td><td align=right><font size=1>LIST LOADER-     VERSION: <?php echo $version ?>     BAU: <?php echo $build ?>     </td></tr> + <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">ZURÜCK ZU ADMIN</a>         <a href="./admin_listloader_third_gen.php">3rd Gen Lead Loader</a>     </font></td><td align=right><font size=1>LIST LOADER-     VERSION: <?php echo $version ?>     BAU: <?php echo $build ?>     </td></tr> </table> <?php } ?> @@ -398,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -409,7 +422,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Verarbeitung$delim_name-delimited file...\n"; @@ -445,7 +458,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +478,36 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +519,69 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +708,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +719,54 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -642,9 +778,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -666,7 +802,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; { print "<BR><BR>TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override<BR><BR>\n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +810,13 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>VerarbeitungCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +844,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +864,112 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1094,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1107,53 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -905,9 +1164,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -919,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTEN', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -930,9 +1189,9 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -941,8 +1200,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1210,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1244,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1264,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1428,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,21 +1443,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1181,9 +1479,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1194,10 +1492,10 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1504,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1512,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1230,8 +1528,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>VerarbeitungCSV file... \n"; @@ -1258,7 +1556,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1576,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1740,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,21 +1754,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LISTE IDENTIFIKATION</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1452,9 +1789,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1464,6 +1801,7 @@ if ($leadfile) { print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; } else { + ##### BEGIN field chooser ##### print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>"; flush(); print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n"; @@ -1472,15 +1810,67 @@ if ($leadfile) { print " <th><font class='standard' color='white'>Akte Daten</font></th>\r\n"; print " </tr>\r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ZeigeTABELLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1488,8 +1878,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1536,10 +1926,10 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1937,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1945,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1571,8 +1961,8 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>VerarbeitungCSV file... \n"; @@ -1617,6 +2007,8 @@ if ($leadfile) { print "</table>\r\n"; # } print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>"; @@ -1638,7 +2030,7 @@ exit; function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { -require("dbconnect.php"); +global $link; $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_de/non_agent_api.php index faecfc20..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -31,10 +38,40 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -129,6 +166,139 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +306,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -186,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -201,13 +372,76 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -216,23 +450,22 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -260,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -280,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -515,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Real-Time Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Wählen Sie Report anzeigen Optionen"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "Jetzt Nachladen"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       ÄNDERN Sie | \n";} +else + {echo "       ÄNDERN Sie | \n";} + +echo "SUMMARY \n"; + + +echo "       erfrischen: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       Verberge User Group";} +else + {echo "       VIEW User Group";} +if ($SERVdisplay>0) + {echo "       Verberge BEDIENERINFO";} +else + {echo "       Zeige BEDIENERINFO";} +if ($CALLSdisplay>0) + {echo "       Verberge WAITING CALLS";} +else + {echo "       Zeige WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       Verberge IN-GROUP STATS";} +else + {echo "       Zeige IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       Verberge PHONES";} +else + {echo "       Zeige PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       Verberge CUSTPHONES";} +else + {echo "       Zeige CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_de/remote_dispo.php index dc991f1f..630523be 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_de/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/server_stats.php b/agc_2-X/trunk/LANG_www/vicidial_de/server_stats.php deleted file mode 100644 index 0040f875..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_de/server_stats.php +++ /dev/null @@ -1,97 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# 61101-1331 - Added SIP/IAX listen/barge links -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Bediener-Notfall and Reports -VICIDIAL: Bediener-Notfall and Reports                           -ZURÜCK ZU ADMIN

    - - -
    
    -
    - $o)
    -	{
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	$o++;
    -	}
    -
    -?>
    -
    SERVERBESCHREIBUNGIP ADDRESSAKTIVVDAD timeVDcall timePARK timeCLOSER/INBOUND time
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_de/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_edit.php index 1f626d3f..2782484e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_report.php index f44a4bc3..53da7a25 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,36 +44,60 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'UserTimeclock Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +106,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -83,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -99,49 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE>UserTimeclock Report - -<?php +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -161,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -187,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Zeitraum:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Zeitraum:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Montag week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Montag week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Benutzer-Gruppen:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Benutzer-Gruppen:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>User:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Anzeige as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "UserTimeclock Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>User:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Time range: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="UserTimeclock Report $NOW_TIME\n"; + +$CSV_text.="\"UserTimeclock Report - $NOW_TIME\"\n"; +$CSV_text.="\"Time range: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -301,92 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Time range: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"CALL HANGUP GRUND STATS\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} - -$TOThours = $TOTdbHOURS; -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; - -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_status.php index 8970956d..2e403878 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -10,9 +10,14 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -33,25 +38,41 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +$report_name = 'Benutzer-GruppeTimeclock Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,13 +89,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -86,35 +112,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else - { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -131,18 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Timeclock Status -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -162,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Timeclock Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>User Group</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Timeclock Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>User Group</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -228,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -247,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -291,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -311,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR User Gruppe:$user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR User Gruppe:$user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR User Gruppe:$user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPAIGN\"\n"; $o=0; $s=0; @@ -338,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -380,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALS</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -429,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK LOGIN/LOGOUT ZEIT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; +$MAIN.="<B>TIMECLOCK LOGIN/LOGOUT ZEIT:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -459,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -478,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -501,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -520,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_de/user_group_bulk_change.php index dff38a53..a0dd9eb4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Benutzer-Gruppe $old_group Benutzer changed to the $group Benutzer-Gruppe<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Benutzer changed to the $group Benutzer-Gruppe<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_de/user_stats.php index 57619c43..5abcac7d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -20,34 +20,65 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'User-Statistiken'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -62,6 +93,8 @@ 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["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -72,12 +105,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,28 +129,83 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie sind nicht berechtigt, diesen Bericht zu sehen: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -119,17 +213,17 @@ else +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -?> -<html> -<head> +if ($did > 0) + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} +else + {$HEADER.="<title>ADMINISTRATION: $report_name";} -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: User-Statistiken -<?php ##### BEGIN Set variables to make header show properly ##### @@ -148,402 +242,472 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   User-Statistiken for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; +if ($did > 0) + {$MAIN.="<B>   DID Call Stats for $user";} +else + {$MAIN.="<B>   User-Statistiken for $user";} +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -<?php +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="</script>\n"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Montag week start -</script> -<?php - -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Montag week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Montag week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">User Status</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">User multiple day status detail report</a>"; -echo "</center>\n"; - - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; - -echo "<br><center>\n"; - -##### vicidial agent talk time and status ##### - -echo "<B>MITTELGESPRÄCH ZEIT UND STATUS:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>ZÄHLIMPULS</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +$MAIN.="<center>\n"; +if ($did > 0) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ÄndernDID</a>\n"; } - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) +else { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">User Status</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">User multiple day status detail report</a>"; + } +$MAIN.="</center>\n"; + + +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +$MAIN.="<br><center>\n"; + + +if ($did < 1) + { + ##### vicidial agent talk time and status ##### + $MAIN.="<B>MITTELGESPRÄCH ZEIT UND STATUS:     <a href='$download_link&file_download=1'>[DOWNLOAD]</a></B>\n"; + + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>STATUS</td><td align=right><font size=2>ZÄHLIMPULS</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"MITTELGESPRÄCH ZEIT UND STATUS\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>GESAMTANRUFE</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>MITTELLOGIN/LOGOUT ZEIT:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - } - - $total_calls = ($total_calls + $row[0]); + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; $o++; - } + } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + $call_hours_minutes = sec_convert($total_sec,'H'); -echo "<tr><td><font size=2>GESAMTMENGE</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>GESAMTANRUFE</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"GESAMTANRUFE\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; -echo "</TABLE></center>\n"; + + ##### Login and Logout time from vicidial agent interface ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>MITTELLOGIN/LOGOUT ZEIT:     <a href='$download_link&file_download=2'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $CSV_text2.="\"MITTELLOGIN/LOGOUT ZEIT\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPAIGN\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) + { + $event_start_seconds = $row[1]; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; + } + else + { + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + $MAIN.="<tr><td><font size=2>GESAMTMENGE</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; + + $MAIN.="</TABLE></center>\n"; -##### vicidial_timeclock log records for user ##### + ##### vicidial_timeclock log records for user ##### -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; + $MAIN.="<br><br>\n"; -echo "<center>\n"; + $MAIN.="<center>\n"; -echo "<B>TIMECLOCK LOGIN/LOGOUT ZEIT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK LOGIN/LOGOUT ZEIT:     <a href='$download_link&file_download=3'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK LOGIN/LOGOUT ZEIT\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {$MAIN.="|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; + + + + ##### closer in-group selection logs ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> KAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPAIGN\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; + + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) + $MAIN.="</TABLE><BR><BR>\n"; + + + ##### vicidial agent outbound calls for this time period ##### + + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + + if ($LOGadmin_hide_phone_data != '0') { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + if ($DB > 0) {echo "VerbergePHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; + } - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + $MAIN.="</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> KAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### -echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> MITTEL(S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> MITTEL(S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +722,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -565,130 +739,181 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALS</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALS\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>MITTELACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + $MAIN.="<B>Agentenaktivität Für diesen Zeitraum: (10000 record limit)     <a href='$download_link&file_download=7'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>Diese Felder werden in Sekunden </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"Agentenaktivität Für diesen Zeitraum: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPAIGN\",\"PAUSE CODE\"\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; + } + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALS</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALS\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; + + $MAIN.="</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -704,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -717,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -725,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -732,84 +962,234 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; - + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } - -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "VerbergePHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### -echo "</TABLE><BR><BR>\n"; + $MAIN.="<B>LEAD Abfragen Für diesen Zeitraum: (10000 record limit)     <a href='$download_link&file_download=10'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"LEAD Abfragen Für diesen Zeitraum: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2> KAMPAGNE</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPAIGN\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_de/user_status.php index 825ca5a4..6eca5e9a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -98,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -106,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -132,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -154,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -270,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -338,48 +370,114 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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_pe_phone_append = $row[8]; } ##### 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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_de/user_territories.php index 92006655..c9e76806 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/user_territories.php @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: User Gebiete sind nicht aktiv auf diesem System\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Unzulässiges Username/Kennwort:|$USER|$PASS|\n"; exit; } } @@ -138,7 +138,7 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<!-- VERSION: <?php echo $version ?> BAU: <?php echo $build ?> --> <title>ADMINISTRATION: User Territories <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger ändern Territory Besitzer<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Besitzer:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,7 +175,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Besitzer:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Had to user Gebiet hinzufügen: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Territory Besitzer gewechselt: $user $territory<BR>\n"; + echo "Geändert Records: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,9 +299,9 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">US-Territorien</a></TD> <TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Benutzer hinzufügen Territory</a></TD> <? if ($enable_vtiger_integration > 0) { ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"HILFE\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,7 +350,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger ändern Territory Besitzer<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Besitzer:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,7 +387,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Besitzer:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorium und Benutzer müssen ausgefüllt werden<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Had to user Gebiet hinzufügen: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Territory Besitzer gewechselt: $user $territory       Geändert Records: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Benutzer hinzufügen Territory<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territory, Benutzer-und Level müssen ausgefüllt werden<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: dieses Gebiet Benutzer ist bereits im System<BR>\n"; } else { @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territory, Benutzer-und Level müssen ausgefüllt werden<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: dieses Gebiet Benutzer ist nicht im System<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "User Territory Geändert: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorium und Benutzer müssen ausgefüllt werden<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: dieses Gebiet Benutzer ist nicht im System<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "User Territory entfällt: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -710,7 +710,7 @@ if ($action == "ADD_TERRITORY") echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territory Beschreibung: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; echo "</TABLE></center>\n"; } @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorium und Territory Beschreibung müssen ausgefüllt werden<BR>\n"; } else { @@ -731,7 +731,7 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: gibt es bereits ein Gebiet, in das System mit diesem Namen<BR>\n"; } else { @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Territory müssen ausgefüllt werden<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Dieses Gebiet ist nicht in das System mit diesem Namen<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Gebiet entfällt: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorium und Territory Beschreibung müssen ausgefüllt werden<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Dieses Gebiet ist nicht in das System mit diesem Namen<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Geändert Territory: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Ändern Territory<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territory Beschreibung: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -857,7 +857,7 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); $user_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Agents: </td><td align=left><B>$user_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Bevollmächtigte: </td><td align=left><B>$user_count</B></td></tr>"; $owner_count=0; $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; @@ -882,13 +882,13 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rsltV); $vtiger_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger-Konten: </td><td align=left><B>$vtiger_count</B></td></tr>"; } echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Benutzer in this Territory:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">LÖSCHUNG</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Löschen Dieses Gebiet</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Gebiet nicht gefunden: $territory<BR>\n"; } } ### END modify territory page @@ -986,13 +986,13 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Liste alle Gebiete:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TERRITORY</B></TD>"; - echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BESCHREIBUNG</B></TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>AGENTS</TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACCOUNTS</TD>\n"; if ($enable_vtiger_integration > 0) @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BAU: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_de/vdremote.php index 59311a64..531a0645 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_de/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_de/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_de/welcome.php index 3f452ac4..8d809889 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Willkommen\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_de/welcome_demo.php index 238cf5cf..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "   \n"; echo "\n"; +echo "\n"; +echo "
    Willkommen
     
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_de/welcome_languages.php index d53707a9..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "  
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_de/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_de/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSER_service_level.php index a98dae6d..cc722580 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90801-0923 - Added in-group name to pulldown # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,33 +39,57 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Service Level Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -69,6 +99,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -76,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Service Level Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; -echo "
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "
    \n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           ΛΗΨΗ | ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if (!$group)
     	{
    -	echo "\n\n";
    -	echo "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
     	}
     
     else
    @@ -261,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
     	$DURATIONday++;
     	}
     
    -echo "Inbound Service Level Report                      $NOW_TIME\n";
    -echo "\n";
    -echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
    +$MAIN.="\n";
    +$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
     #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
    +$CSV_text.="\n";
    +$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
     
     $d=0;
     while ($d < $DURATIONday)
    @@ -370,7 +457,7 @@ $TOTintervals = $j;
     ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
     $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$MAIN.="$stmt\n";}
     $records_to_grab = mysql_num_rows($rslt);
     $i=0;
     while ($i < $records_to_grab)
    @@ -489,12 +576,40 @@ while ($j < $TOTintervals)
     
     ###################################################
     ### TOTALS SUMMARY SECTION ###
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    -echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    -echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    -echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    +$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    +$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
     
    +
    +$graph_stats=array();
    +$max_drops=1;
    +$max_droppct=1;
    +$max_avgdrops=1;
    +$max_hold=1;
    +$max_holdpct=1;
    +$max_avgholds=1;
    +$max_avgholdstotal=1;
    +$max_calls=1;
    +$max_totalcalltime=1;
    +$max_avgcalltime=1;
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTIME MIN:SECAVG CALLTIME SECONDS

     


    "; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -538,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -551,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -605,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
    INBOUND SERVICE ΕΠΙΠΕΔΟ REPORT
    ΚΑΤΑΣΤΑΣΗDROPS
    DROP %
    AVG DROP(s)
    HOLD
    HOLD %
    AVG HOLD(s) HOLD
    AVG HOLD(s) TOTAL
    CALLS
    TOTAL CALLTIME MIN:SEC
    AVG CALLTIME SECONDS
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    TOTAL:".trim($FtotDROPS)."
    "; + $DROPPCT_graph.="
    TOTAL:".trim($FtotDROPSpct)."%
    "; + $AVGDROPS_graph.="
    TOTAL:".trim($FtotDROPSavg)."
    "; + $HOLD_graph.="
    TOTAL:".trim($FtotQUEUE)."
    "; + $HOLDPCT_graph.="
    TOTAL:".trim($FtotQUEUEpct)."%
    "; + $AVGHOLDS_graph.="
    TOTAL:".trim($FtotQUEUEavg)."
    "; + $AVGHOLDSTOTAL_graph.="
    TOTAL:".trim($FtotQUEUEtot)."
    "; + $CALLS_graph.="
    TOTAL:".trim($FtotCALLS)."
    "; + $TOTALCALLTIME_graph.="
    TOTAL:".trim($totTIME_MS)."
    "; + $AVGCALLTIME_graph.="
    TOTAL:".trim($FtotCALLSavg)."
    "; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -860,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE ΑΠΑΝΤΗΣΗ (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE ΑΠΑΝΤΗΣΗ (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE ΑΠΑΝΤΗΣΗ(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -947,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -973,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERstats.php index 7e8887dd..45f9c644 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -27,6 +27,14 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -47,8 +55,14 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -56,23 +70,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -82,13 +114,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +135,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,19 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -126,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -141,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -156,128 +245,138 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Inbound Stats\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Χρονικό διάστημα:
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Χρονικό διάστημα:
    \n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo "
    \n"; -echo "Εισερχόμενες Ομάδες: \n"; -echo "\n"; -echo "\n"; +if ($DID=='Y') + {$MAIN.="Inbound DIDs: \n";} +else + {$MAIN.="Εισερχόμενες Ομάδες: \n";} +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; -echo "ΤΡΟΠΟΠΟΙΗΣΗ | "; -echo "ΑΝΑΦΟΡΕΣ | "; -echo "IVR REPORT \n"; -echo "\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; +if ($DID!='Y') + { + $MAIN.="ΤΡΟΠΟΠΟΙΗΣΗ | "; + $MAIN.="IVR REPORT | \n"; + } +$MAIN.="ΑΝΑΦΟΡΕΣ | "; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +#$MAIN.="\n";
    +$MAIN.="Shift: \n";
    +$MAIN.="
    Εμφάνιση as:  "; +$MAIN.="\n
    "; +$MAIN.="   \n"; +$MAIN.="
    \n"; +$MAIN.="\n\n"; +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
    -{
    -echo "\n\n";
    -echo "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
    -}
    +	{
    +	$MAIN.="\n\n";
    +	if ($DID=='Y')
    +		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";}
    +	else
    +		{$MAIN.="Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";}
    +	}
     
     else
     {
    @@ -305,38 +404,125 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
    +$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        ΛΗΨΗ\n";
    +
    +$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
     
     
    +if ($DID=='Y')
    +	{
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$dids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $dids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$did_id[$i] = $row[0];
    +		$did_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$did_SQL = eregi_replace(",$",'',$did_SQL);
    +	if (strlen($did_SQL)<3) {$did_SQL="''";}
     
    +	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$unids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $unids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$unid_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
    +	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
     
    +	if ($DB > 0)
    +		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
     
    +	}
     
     if ($group_ct > 1)
     	{
    -	echo "\n";
    -	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    -	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
    +
    +	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
    +
    +	if ($DID=='Y')
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
    +	else
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
     
     	$i=0;
     	while($i < $group_ct)
     		{
    -		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		$did_id[$i]='0';
    +		$DIDunid_SQL='';
    +		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$Sdids_to_print = mysql_num_rows($rslt);
    +		if ($Sdids_to_print > 0)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$did_id[$i] = $row[0];
    +			}
    +
    +		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$DIDunids_to_print = mysql_num_rows($rslt);
    +		$k=0;
    +		while ($k < $DIDunids_to_print)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$DIDunid_SQL .= "'$row[0]',";
    +			$k++;
    +			}
    +		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
    +		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
    +
    +		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    +		if ($row[0]>$max_value) {$max_value=$row[0];}
     
     		$groupDISPLAY =	sprintf("%20s", $group[$i]);
     		$gTOTALcalls =	sprintf("%7s", $row[0]);
    @@ -351,32 +537,94 @@ if ($group_ct > 1)
     			}
     		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
     
    -		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
    +		$graph_data_ary[$i][0]=$groupDISPLAY;
    +		$graph_data_ary[$i][1]=$gTOTALcalls;
    +		$graph_data_ary[$i][2]=$gDROPcalls;
    +		$graph_data_ary[$i][3]=$gDROPpercent;
    +		$graph_data_ary[$i][4]=$gIVRcalls;
    +
     		$i++;
     		}
     
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
     
     	}
     
    +	if ($report_display_type=="HTML") {
    +		$max_value=1;
    +		$graph_height=240;
    +		$scale = 1;
    +		$w=0;
    +		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
    +			if ($graph_data_ary[$i][1]>0) {$w++;}
    +		}
    +		$scale = $graph_height / $max_value;
     
    -echo "\n";
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- TOTALS\n";
    +
    +		$GRAPH_text.="";
    +		for ($d=0; $d0) {
    +				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
    +				$GRAPH_text.="  \n";
    +			}
    +		}
    +		$GRAPH_text.="
    MULTI-GROUP BREAKDOWN
    GROUPIVRS / DROPS / CALLS
    ".$graph_data_ary[$d][0]."
    ".$graph_data_ary[$d][3]."% drops
     
    \n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][1]."
    • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][2]."
    • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][4]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALS\n"; + +$CSV_text1.="\n\"Time range:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; +if ($DID=='Y') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -408,19 +656,30 @@ else } -echo "Σύνολο κλήσεις που λαμβάνονται σε αυτό το In-Ομάδα: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $ΑΠΑΝΤΗΣΗEDcalls $ΑΠΑΝΤΗΣΗEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Ομάδα: $IVRcalls\n"; +$MAIN.="Σύνολο κλήσεις που λαμβάνονται σε αυτό το In-Ομάδα: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $ΑΠΑΝΤΗΣΗEDcalls $ΑΠΑΝΤΗΣΗEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Ομάδα: $IVRcalls\n"; +$CSV_text1.="\"Σύνολο κλήσεις που λαμβάνονται σε αυτό το In-Group:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$ΑΠΑΝΤΗΣΗEDcalls\",\"$ΑΠΑΝΤΗΣΗEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- ΕΓΚΑΤΑΛ\n"; +$MAIN.="\n"; +$MAIN.="---------- ΕΓΚΑΤΑΛ\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -450,56 +709,70 @@ else $DROP_ΑΠΑΝΤΗΣΗEDpercent = round($DROP_ΑΠΑΝΤΗΣΗEDpercent, 0); } -echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls $DROPpercent% drop/answered: $DROP_ΑΠΑΝΤΗΣΗEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls $DROPpercent% drop/answered: $DROP_ΑΠΑΝΤΗΣΗEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_ΑΠΑΝΤΗΣΗEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) { - $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $Sanswer_sec_pct_rt_stat_one = $row[0]; - $Sanswer_sec_pct_rt_stat_two = $row[1]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_one = $row[0]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_two = $row[0]; - - if ( ($ΑΠΑΝΤΗΣΗEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + if ($DID!='Y') { - $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $ΑΠΑΝΤΗΣΗEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); - #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); - $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $ΑΠΑΝΤΗΣΗEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); - #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $Sanswer_sec_pct_rt_stat_one = $row[0]; + $Sanswer_sec_pct_rt_stat_two = $row[1]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_one = $row[0]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_two = $row[0]; + + if ( ($ΑΠΑΝΤΗΣΗEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + { + $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $ΑΠΑΝΤΗΣΗEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); + #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); + $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $ΑΠΑΝΤΗΣΗEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); + #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Συνολικές κλήσεις που διακομίστηκανin to this In-Group): $ΑΠΑΝΤΗΣΗEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_ΑΠΑΝΤΗΣΗEDpercent%\n"; -echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; -echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Συνολικές κλήσεις που διακομίστηκανin to this In-Group): $ΑΠΑΝΤΗΣΗEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_ΑΠΑΝΤΗΣΗEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Συνολικές κλήσεις που διακομίστηκανin to this In-Group):\",\"$ΑΠΑΝΤΗΣΗEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_ΑΠΑΝΤΗΣΗEDpercent%\"\n"; + +if ($DID!='Y') + { + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; + } # GET LIST OF ALL STATUSES and create SQL from human_answered statuses $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -516,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -534,12 +807,18 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -569,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -580,17 +863,27 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS ΛΗΨΗ\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -633,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -643,17 +1008,26 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -696,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -707,15 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL ΑΠΑΝΤΗΣΗED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL ΑΠΑΝΤΗΣΗED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL ΑΠΑΝΤΗΣΗED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -899,31 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- CALL HANGUP REASON STATS\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL HANGUP REASON STATS ΛΗΨΗ\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"CALL HANGUP REASON STATS\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; +if ($DID=='Y') + { + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -932,42 +1465,105 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
    \n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CALL HANGUP REASON STATS
    REASON CALLS
    \"\"".$ct_ary[$i][0]."
    ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ:".trim($TOTALcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     ##############################
     #########  CALL STATUS STATS
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL STATUS STATS\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    -echo "| STATUS | DESCRIPTION          | ΚΑΤΗΓΟΡΙΑ             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL STATUS STATS       ΛΗΨΗ\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text.="| STATUS | DESCRIPTION          | ΚΑΤΗΓΟΡΙΑ             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTOTAL TIMEAVG TIMECALLS/HR

     


    "; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"ΚΑΤΗΓΟΡΙΑ\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;"; +if ($DID=='Y') + { + $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -995,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1015,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1045,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
    CALL STATUS STATS
    ΚΑΤΑΣΤΑΣΗCALLS
    TOTAL TIME
    AVG TIME
    CALLS/HR
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    TOTAL:".trim($TOTALcalls)."
    "; + $TOTALTIME_graph.="
    TOTAL:".trim($TOTALhours)."
    "; + $AVGTIME_graph.="
    TOTAL:".trim($TOTALavg)."
    "; + $CALLSHOUR_graph.="
    TOTAL:".trim($TOTALrate)."
    "; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS ΚΑΤΗΓΟΡΙΑ STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| ΚΑΤΗΓΟΡΙΑ | CALLS | DESCRIPTION |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS ΚΑΤΗΓΟΡΙΑ STATS
    ΛΗΨΗ\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| ΚΑΤΗΓΟΡΙΑ | CALLS | DESCRIPTION |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS ΚΑΤΗΓΟΡΙΑ STATS\"\n"; +$CSV_text5.="\"ΚΑΤΗΓΟΡΙΑ\",\"CALLS\",\"DESCRIPTION\"\n"; $TOTCATcalls=0; $r=0; @@ -1070,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1078,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
    ".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CUSTOM STATUS ΚΑΤΗΓΟΡΙΑ STATS
    ΚΑΤΗΓΟΡΙΑ CALLS
    ".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
    TOTAL:".trim($TOTCATcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else 
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     
     ##############################
    @@ -1088,15 +1793,23 @@ echo "+----------------------+------------+\n";
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    -echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       ΛΗΨΗ\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +
    +$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
    +$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
    +
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
    +	}
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$ASCII_text.="$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
     $i=0;
     while ($i < $positions_to_print)
    @@ -1139,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
     
     $TOTALcalls =		sprintf("%10s", $TOTALcalls);
     
    -echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
     
    +$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
     
    +if ($report_display_type=="HTML") 
    +	{
    +	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
    +	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
    +	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
    +	if ($DID=='Y')
    +		{
    +		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
    +		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
    +		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
    +		}
    +	if ($DB) {$GRAPH_text.=$stmt."\n";}
    +	$ms_rslt=mysql_query($ms_stmt, $link);
    +	$ms_row=mysql_fetch_row($ms_rslt);
    +	$max_position=$ms_row[0];
    +	if ($max_position>25) {$max_position=26;}
    +	for ($i=1; $i<=$max_position; $i++) {
    +		$sec_ary[$i]=0;
    +	}
    +
    +	$mc_rslt=mysql_query($mc_stmt, $link);
    +	$mc_row=mysql_fetch_row($mc_rslt);
    +	$max_calls=$ms_row[0];
    +	if ($max_calls<=10) {
    +		while ($maxcalls%5!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=100) {
    +		while ($maxcalls%10!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=1000) {
    +		while ($maxcalls%50!=0) {
    +			$maxcalls++;
    +		}
    +	} else {
    +		while ($maxcalls%500!=0) {
    +			$maxcalls++;
    +		}
    +	}
    +	$rslt=mysql_query($stmt, $link);
    +	
    +	$GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1152,15 +1935,35 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- ΧΕΙΡΙΣΤΗΣSTATS\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| ΧΕΙΡΙΣΤΗΣ | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- ΧΕΙΡΙΣΤΗΣSTATS ΛΗΨΗ\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| ΧΕΙΡΙΣΤΗΣ | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"ΧΕΙΡΙΣΤΗΣSTATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTIME H:M:SAVERAGE

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +if ($DID=='Y') + { + $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1183,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1210,26 +2022,73 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTAL Πράκτορες: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTAL Πράκτορες: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
    ΧΕΙΡΙΣΤΗΣSTATS
    AGENTCALLS
    TIME H:M:S
    AVERAGE
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    TOTAL:".trim($TOTALcalls)."
    "; +$TIMEHMS_graph.="
    TOTAL:".trim($TOTtime)."
    "; +$AVERAGE_graph.="
    TOTAL:".trim($TOTavg)."
    "; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTAL Πράκτορες: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- ΣΤΑΤ.ΧΡΟΝ.\n"; +$MAIN.="\n"; +$MAIN.="---------- ΣΤΑΤ.ΧΡΟΝ.
    ΛΗΨΗ\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## ######### 15-minute increment breakdowns of total calls and drops, then answered table $BDansweredCALLS = 0; $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1240,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1255,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1313,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1343,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1364,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1378,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1394,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1410,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
    GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
    HOURDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL ΑΠΑΝΤΗΣΗED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL ΑΠΑΝΤΗΣΗED TIME BREAKDOWN IN SECONDS ΛΗΨΗ\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL ΑΠΑΝΤΗΣΗED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1508,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1516,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALS| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALS| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALS\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.=""; +$MAIN.="
    "; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERsummary_hourly.php index 2c5f60dc..659db8c3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 90809-0216 - Added Exclude Outbound Drop Group option # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -40,10 +46,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -52,23 +62,38 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} +$report_name = 'Εισερχόμενο Ωριαία Συνοπτική Έκθεση'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -78,21 +103,70 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -100,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -116,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -124,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -139,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -155,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -168,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Summary Hourly Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Χρονικό διάστημα:
    \n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; + $MAIN.=" \n"; - echo "
      \n"; - echo "\n"; - echo "Inbound Groups:
    \n"; - echo "
      \n"; + $MAIN.="\n"; + $MAIN.="Εισερχόμενες Ομάδες:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "   Exclude Outbound Drop Groups:
    "; - echo "   \n"; - echo "
                          "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="           "; + $MAIN.="ΛΗΨΗ | "; + $MAIN.="ΤΡΟΠΟΠΟΙΗΣΗ | "; + $MAIN.="ΑΝΑΦΟΡΕΣ"; + $MAIN.="\n"; + $MAIN.="
      Εμφάνιση as: "; + $MAIN.="\n
    "; + $MAIN.="   Exclude Outbound Drop Groups:
    "; + $MAIN.="   \n"; + $MAIN.="
                          "; + $MAIN.="\n"; - echo "
    \n"; + $MAIN.="
    \n"; - echo "Call Time:
    \n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
     	}
     
     else
    @@ -309,7 +389,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -352,18 +432,48 @@ else
     	$query_date_END = "$end_date 23:59:59";
     
     
    -	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
    +	$MAIN .= "Εισερχόμενο Ωριαία Συνοπτική Έκθεση: $group_string          $NOW_TIME\n";
    +	$CSV_main.="Εισερχόμενο Ωριαία Συνοπτική Έκθεση:,$NOW_TIME\n";
     
     
    +	$JS_text.="\n";
    +
     	if ($costformat > 0)
     		{
    -		echo "
    \n"; + $ASCII_text.="
    \n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
    "; + + echo ""; + + } + } - - ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_DIDstats.php new file mode 100644 index 00000000..6cfddabd --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; + } + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
    to
    "; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

    "; +$MAIN.="\n"; +$MAIN.="           ΛΗΨΗ | ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +$MAIN.="
    \n"; +$MAIN.="
    \n"; + +$MAIN.="
    ";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +	#	$time_BEGIN=$AM_shift_BEGIN;
    +	#	$time_END=$AM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +	#	$time_BEGIN=$PM_shift_BEGIN;
    +	#	$time_END=$PM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
    +	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
    +	$MAIN.="\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +
    +	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
    +	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
    +
    +	$d=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) );
    +		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
    +
    +		if ($EQsec < $SQsec)
    +			{
    +			$dEQepoch = ($dEQepoch + 86400);
    +			}
    +
    +		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +		$d++;
    +		}
    +
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### ΔΗΜΙΟΥΡΓΙΑ HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $j;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	$extension[0]='';
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$dt[$i] =			0;
    +		$ut[$i] =			($row[0] - $SQepochDAY);
    +		$extension[$i] =	$row[1];
    +		while($ut[$i] >= 86400) 
    +			{
    +			$ut[$i] = ($ut[$i] - 86400);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +
    +		$i++;
    +		}
    +
    +	### Find default route
    +	$default_route='';
    +	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$Drecords_to_grab = mysql_num_rows($rslt);
    +	if ($Drecords_to_grab > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$default_route =	$row[0];
    +		}
    +
    +	###################################################
    +	### TOTALS DID SUMMARY SECTION ###
    +	if (strlen($extension[0]) > 0)
    +		{
    +		$ASCII_text.="DID Summary:\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="| DID                | DESCRIPTION                    | ROUTE      | CALLS      |\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +
    +		$CSV_text1.="\"DID Summary:\"\n";
    +		$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
    +
    +		$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    DID Summary:
    DIDCALLS
    \"\"".$graph_stats[$d][0]."
    ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ:".trim($totCALLS)."
    \n";
    +
    +			$FtotCALLS =	sprintf("%10s", $totCALLS);
    +
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="|                                                           TOTALS | $FtotCALLS |\n";
    +		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
    +		$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
    +		#$MAIN.=$GRAPH;
    +
    +		}
    +
    +
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totCALLSmax=0;
    +	$totCALLSdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
    +				{
    +				$totCALLS++;
    +				$qrtCALLS[$j]++;
    +				$dtt = $dt[$i];
    +				$totCALLSdate[$dtt]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +
    +
    +	###################################################
    +	### TOTALS DATE SUMMARY SECTION ###
    +	$ASCII_text.="\nDate Summary:\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="| SHIFT                                     |        |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +
    +	$CSV_text1.="\n\"Date Summary:\"\n";
    +	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
    +
    +	$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    Date Summary:
    SHIFT DATE-TIME RANGECALLS
    \"\"".$graph_stats[$d][0]."
    ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ:".trim($totCALLS)."
    \n";
    +
    +
    +	$FtotCALLS =	sprintf("%6s", $totCALLS);
    +
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="|                                    TOTALS | $FtotCALLS |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
    +	#$MAIN.=$GRAPH;
    +
    +	if ($report_display_type=="HTML")
    +		{
    +		$MAIN.=$GRAPH_text;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +
    +	## FORMAT OUTPUT ##
    +	$i=0;
    +	$hi_hour_count=0;
    +	$hi_hold_count=0;
    +
    +	while ($i < $TOTintervals)
    +		{
    +		if ($qrtCALLS[$i] > 0)
    +			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
    +
    +		if ($qrtCALLS[$i] > $hi_hour_count) 
    +			{$hi_hour_count = $qrtCALLS[$i];}
    +
    +		$i++;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (70 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (70 / $hi_hold_count);}
    +
    +
    +
    +
    +	###################################################################
    +	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
    +
    +	$MAIN.="\n";
    +	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
    +
    +	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
    +
    +	$ASCII_text.="";
    +
    +	$ASCII_text.="";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
    +
    +	$k=1;
    +	$Mk=0;
    +	$call_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hour_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hour_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hour_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$call_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$call_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$call_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +	$k=1;
    +	$Mk=0;
    +	$hold_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hold_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hold_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hold_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$hold_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$hold_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$hold_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
    +	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
    +
    +
    +
    +	$max_calls=1;
    +	$graph_stats=array();
    +	$GRAPH_text="";
    +
    +
    +	$i=0;
    +	while ($i < $TOTintervals)
    +		{
    +		$char_counter=0;
    +		### BEGIN HOLD TIME TOTALS GRAPH ###
    +			$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count > 0) {$no_lines_yet=0;}
    +
    +		$Gavg_hold = $qrtQUEUEavg[$i];
    +		if ($Gavg_hold < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				$TOT_lines++;
    +				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +				$ASCII_text.="|$HMdisplay[$i]|";
    +				$CSV_text1.="\"$HMdisplay[$i]\",";
    +			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
    +			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +				}
    +			}
    +		else
    +			{
    +			$TOT_lines++;
    +			$no_lines_yet=0;
    +			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
    +			$Yavg_hold = (19 - $Xavg_hold);
    +
    +			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +
    +		#	$ASCII_text.="|$HMdisplay[$i]|";
    +			$ASCII_text.="|$HMdisplay[$i]|";
    +			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
    +		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
    +		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
    +		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
    +		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +			}
    +		### END HOLD TIME TOTALS GRAPH ###
    +
    +		$char_counter=0;
    +		### BEGIN CALLS TOTALS GRAPH ###
    +		$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +			#	$ASCII_text.="  |";
    +				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"0\"\n";
    +				}
    +			}
    +		else
    +			{
    +			$no_lines_yet=0;
    +			$Xhour_count = ($Ghour_count * $hour_multiplier);
    +			$Yhour_count = (69 - $Xhour_count);
    +
    +			$Gdrop_count = $qrtDROPS[$i];
    +			if ($Gdrop_count < 1) 
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
    +				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			else
    +				{
    +				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
    +
    +			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
    +
    +				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
    +
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
    +				$ASCII_text.="D";   $char_counter++;
    +				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				$ASCII_text.="C";   $char_counter++;
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			}
    +		### END CALLS TOTALS GRAPH ###
    +		$graph_stats[$i][0]=$HMdisplay[$i];
    +		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
    +		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
    +		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
    +		$i++;
    +		}
    +
    +
    +	if ($totQUEUEsec > 0)
    +		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
    +	else
    +		{$totQUEUEavgRAW = 0;}
    +	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
    +	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
    +	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
    +	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
    +	$totDROPS =	sprintf("%5s", $totDROPS);
    +	$totCALLS =	sprintf("%5s", $totCALLS);
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +
    +	for ($d=0; $d\n";
    +	}
    +	$GRAPH_text.="
    HOLD TIME, CALL AND DROP STATS
    TIME 15-MIN INTDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
    TOTALS:".trim($totCALLS)."
    "; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRfilter.php index bc35da25..f9920b17 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "\n"; +$HTML_text.="
    \n"; -echo "\n"; -echo "Χρονικό διάστημα:
    \n"; -echo "\n"; -echo " to \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "ΑΝΑΦΟΡΕΣ\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; +$HTML_text.="Χρονικό διάστημα:
    \n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
    \n\n";
    +$HTML_text.="\n";
    +
    +$HTML_text.="
    Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="ΑΝΑΦΟΡΕΣ\n"; +$HTML_text.="\n"; + +$HTML_text.="
    \n"; + +$HTML_text.="   \n"; +$HTML_text.="
    \n"; +$HTML_text.="\n\n"; + +$HTML_text.="
    \n\n";
     
     $shift = 'ALL';
     
    @@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
    +$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [ΛΗΨΗ]\n";
    +
    +$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
    +
    +$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
    +$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
    +
    +$i=0;
    +while($start_date<$end_date) {
    +	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
    +	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
    +	for ($j=0; $j<16; $j++) {
    +		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
    +	}
    +	
    +	$i++;
    +	$start_date+=$date_int;
    +}
    +
    +$total=0;
    +$Utotal=0;
    +$totalstq=0;
    +$Utotalstq=0;
    +$totalnocid=0;
    +$Utotalnocid=0;
    +$totaldnc=0;
    +$Utotaldnc=0;
    +$totalsale=0;
    +$Utotalsale=0;
    +$totalarch=0;
    +$Utotalarch=0;
    +$totaltiq=0;
    +$Utotaltiq=0;
    +$totalsta=0;
    +$Utotalsta=0;
    +
    +	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
    +	$rsltA=mysql_query($stmtA, $link);
    +	if ($DB) {$HTML_text.="$stmtA\n";}
    +	while ($rowA=mysql_fetch_row($rsltA)) {
    +		$count_ary[$rowA[2]][0]+=$rowA[0];
    +		$count_ary[$rowA[2]][1]+=$rowA[1];
    +		$count_ary[$rowA[2]][14]+=$rowA[0];
    +		$count_ary[$rowA[2]][15]+=$rowA[1];
    +		$total+=$rowA[0];
    +		$Utotal+=$rowA[1];
    +		$totalstq+=$rowA[0];
    +		$Utotalstq+=$rowA[1];
    +	}
    +
    +	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
    +	$rsltB=mysql_query($stmtB, $link);
    +	if ($DB) {$HTML_text.="$stmtB\n";}
    +	while ($rowB=mysql_fetch_row($rsltB)) {
    +		$count_ary[$rowB[2]][2]+=$rowB[0];
    +		$count_ary[$rowB[2]][3]+=$rowB[1];
    +		$total+=$rowB[0];
    +		$Utotal+=$rowB[1];
    +		$count_ary[$rowB[2]][14]+=$rowB[0];
    +		$count_ary[$rowB[2]][15]+=$rowB[1];
    +		$totalnocid+=$rowB[0];
    +		$Utotalnocid+=$rowB[1];
    +	}
    +
    +	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
    +	$rsltC=mysql_query($stmtC, $link);
    +	if ($DB) {$HTML_text.="$stmtC\n";}
    +	while ($rowC=mysql_fetch_row($rsltC)) {
    +		$count_ary[$rowC[2]][4]+=$rowC[0];
    +		$count_ary[$rowC[2]][5]+=$rowC[1];
    +		$total+=$rowC[0];
    +		$Utotal+=$rowC[1];
    +		$count_ary[$rowC[2]][14]+=$rowC[0];
    +		$count_ary[$rowC[2]][15]+=$rowC[1];
    +		$totaldnc+=$rowC[0];
    +		$Utotaldnc+=$rowC[1];
    +	}
    +
    +	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
    +	$rsltD=mysql_query($stmtD, $link);
    +	if ($DB) {$HTML_text.="$stmtD\n";}
    +	while ($rowD=mysql_fetch_row($rsltD)) {
    +		$count_ary[$rowD[2]][6]+=$rowD[0];
    +		$count_ary[$rowD[2]][7]+=$rowD[1];
    +		$total+=$rowD[0];
    +		$Utotal+=$rowD[1];
    +		$count_ary[$rowD[2]][14]+=$rowD[0];
    +		$count_ary[$rowD[2]][15]+=$rowD[1];
    +		$totalsale+=$rowD[0];
    +		$Utotalsale+=$rowD[1];
    +	}
    +
    +	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
    +	$rsltE=mysql_query($stmtE, $link);
    +	if ($DB) {$HTML_text.="$stmtE\n";}
    +	while ($rowE=mysql_fetch_row($rsltE)) {
    +		$count_ary[$rowE[2]][8]+=$rowE[0];
    +		$count_ary[$rowE[2]][9]+=$rowE[1];
    +		$total+=$rowE[0];
    +		$Utotal+=$rowE[1];
    +		$count_ary[$rowE[2]][14]+=$rowE[0];
    +		$count_ary[$rowE[2]][15]+=$rowE[1];
    +		$totalarch+=$rowE[0];
    +		$Utotalarch+=$rowE[1];
    +	}
    +
    +	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
    +	$rsltF=mysql_query($stmtF, $link);
    +	if ($DB) {$HTML_text.="$stmtF\n";}
    +	while ($rowF=mysql_fetch_row($rsltF)) {
    +		$count_ary[$rowF[2]][10]+=$rowF[0];
    +		$count_ary[$rowF[2]][11]+=$rowF[1];
    +		$totaltiq+=$rowF[0];
    +		$Utotaltiq+=$rowF[1];
    +	}
    +
    +	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
    +	$rsltG=mysql_query($stmtG, $link);
    +	if ($DB) {$HTML_text.="$stmtG\n";}
    +	while ($rowG=mysql_fetch_row($rsltG)) {
    +		$count_ary[$rowG[2]][12]+=$rowG[0];
    +		$count_ary[$rowG[2]][13]+=$rowG[1];
    +		$totalsta+=$rowG[0];
    +		$Utotalsta+=$rowG[1];
    +	}
     
     
    -echo "\n";
    -echo "+----------------------+---------+---------+---------+\n";
    -echo "| ΚΑΤΗΓΟΡΙΑ             | CALLS   | UNIQUE  |      %  |\n";
    -echo "+----------------------+---------+---------+---------+\n";
    +	$HTML_text.="\n";
    +	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
    +	$HTML_text.="|                              |          TOTALS         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
    +	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
    +	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	
    +	$CSV_text.="\n";
    +	$CSV_text.="\"\",\"\",\"TOTALS\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
    +	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
    +
    +	for($i=0; $i
    -
    -
    + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRstats.php index 5d755c81..d523bc91 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -13,6 +13,13 @@ # 91112-0719 - Added in-group names to select list # 100214-1421 - Sort menu alphabetically # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -28,39 +35,71 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} + +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} +$db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "IVR Stats Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Χρονικό διάστημα:
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Χρονικό διάστημα:
    \n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    to
    "; +$MAIN.="
    to
    "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    \n"; -echo "Εισερχόμενες Ομάδες: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Εισερχόμενες Ομάδες: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="ΛΗΨΗ | "; + $MAIN.="ΤΡΟΠΟΠΟΙΗΣΗ | "; + $MAIN.="ΑΝΑΦΟΡΕΣ | "; + $MAIN.="ΑΝΑΦΟΡΑ CLOSER \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Εκστρατείες: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="ΛΗΨΗ | "; + $MAIN.="ΤΡΟΠΟΠΟΙΗΣΗ | "; + $MAIN.="ΑΝΑΦΟΡΕΣ | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "ΤΡΟΠΟΠΟΙΗΣΗ | "; -echo "ΑΝΑΦΟΡΕΣ | "; -echo "ΑΝΑΦΟΡΑ CLOSER \n"; -echo "\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
    Εμφάνιση as:  "; +$MAIN.="\n
    "; +$MAIN.="    \n"; -   -
    \n"; +$MAIN.="\n\n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
     	}
     
     else
     	{
    -	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    -	echo "                  $group_string\n";
    +	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    +	$MAIN.="                  $group_string\n";
    +
    +	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
     
     	$TOTALcalls=0;
     	$NOCALLERIDcalls=0;
    @@ -338,9 +463,16 @@ else
     	$totFLOWtotal_time=0;
     
     	##### Grab all records for the IVR for the specified time period
    -	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +	if ($type == 'inbound')
    +		{
    +		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +		}
    +	else
    +		{
    +		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
    +		}
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$logs_to_print = mysql_num_rows($rslt);
     	$p=0;
     	while ($p < $logs_to_print)
    @@ -365,11 +497,11 @@ else
     	$r=-1;
     	while ($p < $logs_to_print)
     		{
    -		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
    +		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
     		if ($last_uniqueid === "$uniqueid[$p]")
     			{
     			$unique_calls[$r] .= "----------$comment_b[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			$last_epoch[$r]=$epoch[$p];
     			}
     		else
    @@ -391,7 +523,7 @@ else
     			$unique_calls[$r] = $comment_b[$p];
     			$FLOWuniqueid[$r] = "$uniqueid[$p]";
     			$last_uniqueid = "$uniqueid[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			}
     		$p++;
     		}
    @@ -408,7 +540,7 @@ else
     	$s=0;
     	while ($s <= $r)
     		{
    -		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
    +		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
     		if ($last_Suniqueid === "$unique_calls[$s]")
     			{
     			$STunique_calls_count[$p]++;
    @@ -436,11 +568,15 @@ else
     		}
     
     	#### PRINT ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣINTO THIS IVR
    -	echo "\n";
    -	echo "Calls taken into this IVR:   $TOTALcalls\n";
    -	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
    -	echo "Unique Callers:              $UNIQUEcallers\n";
    -	echo "\n";
    +	$MAIN.="\n";
    +	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
    +	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
    +	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
    +	$MAIN.="\n";
    +
    +	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
    +	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
    +	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
     
     	### sort call flows for counting
     	if ($p > 0)
    @@ -475,11 +611,32 @@ else
     	### put call flows and counts together for sorting again
     	$s=0;
     
    -	echo "+--------+--------+--------+--------+------+------+\n";
    -	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    -	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    -	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    -	echo "+--------+--------+--------+--------+------+------+------------\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
    +	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    +	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    +	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
    +
    +	######## GRAPHING #########
    +	$graph_stats=array();
    +	$max_ivr_calls=1;
    +	$max_queue_calls=1;
    +	$max_queue_drops=1;
    +	$max_queue_drops_percent=1;
    +	$max_ivr_avg=1;
    +	$max_total_avg=1;
    +	$GRAPH="";
    +	$GRAPH.="";
    +	$GRAPH.="
    IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

     


    "; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
    IVR STATS
    IVR CALLSCALL PATH
    "; + $QUEUEDROPCALLS_graph="
    IVR STATS
    QUEUE CALLSCALL PATH
    "; + $QUEUEDROPPERCENT_graph="
    IVR STATS
    QUEUE DROP CALLSCALL PATH
    "; + $IVRAVGTIME_graph="
    IVR STATS
    QUEUE DROP PERCENTCALL PATH
    "; + $TOTALAVGTIME_graph="
    IVR STATS
    IVR AVG TIMECALL PATH
    "; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -493,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -528,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -557,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
    IVR STATS
    TOTAL AVG TIMECALL PATH
    ".$graph_stats[$d][0]."
    ".$graph_stats[$d][2]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][3]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
    ".$graph_stats[$d][5]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][6]."".$graph_stats[$d][0]."
    ".trim($TOTALcalls)."ΣΥΝΟΛΙΚΑ
    "; + $QUEUECALLS_graph.="
    ".trim($totFLOWtotal)."ΣΥΝΟΛΙΚΑ
    "; + $QUEUEDROPCALLS_graph.="
    ".trim($totFLOWdrop)."ΣΥΝΟΛΙΚΑ
    "; + $QUEUEDROPPERCENT_graph.="
    ".trim($totFLOWdropPCT)."%ΣΥΝΟΛΙΚΑ
    "; + $IVRAVGTIME_graph.="
    ".trim($TavgFLOWivr_time)."ΣΥΝΟΛΙΚΑ
    "; + $TOTALAVGTIME_graph.="
    ".trim($TavgFLOWtotal_time)."ΣΥΝΟΛΙΚΑ
    "; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- ΣΤΑΤ.ΧΡΟΝ.\n"; + $MAIN.="\n"; + $MAIN.="---------- ΣΤΑΤ.ΧΡΟΝ.\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -576,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -586,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -623,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -653,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -688,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -701,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -715,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..43d3d687 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Λίστες Θέσεις εκστρατείας Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..39b9ca9e --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
    \n"; + echo "$query_date|$end_date\n"; + echo "
    \n"; + } + +echo "
    "; + +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    to
    \n"; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ΑΝΑΦΟΡΕΣ \n"; +echo "
    \n"; +echo "
    \n"; + +echo "
    ";
    +
    +
    +if (!$query_date)
    +{
    +echo "\n\n";
    +echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    +}
    +
    +else
    +{
    +echo "List Update Process Report                      $NOW_TIME\n";
    +echo "\n";
    +echo "Time range $query_date to $end_date\n\n";
    +
    +
    +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +echo "List Update Summary:\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +
    +$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$records_to_grab = mysql_num_rows($rslt);
    +$i=0;
    +while ($i < $records_to_grab)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$TOTcount = ($TOTcount + $row[0]);
    +	$TOTupdated = ($TOTupdated + $row[3]);
    +	$count =	sprintf("%-8s", $row[0]);
    +	$filename =	sprintf("%-50s", trim($row[1]));
    +	$result =	sprintf("%-10s", $row[2]);
    +	$updated =	sprintf("%-8s", $row[3]);
    +	echo "| $filename | $result | $count | $updated |\n";
    +
    +	$i++;
    +	}
    +$TOTcount =	sprintf("%-8s", $TOTcount);
    +$TOTupdated =	sprintf("%-8s", $TOTupdated);
    +
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "                                                                  | $TOTcount | $TOTupdated |\n";
    +echo "                                                                  +----------+----------+\n";
    +echo "\n
    \n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Λεπτομέρειες:
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
    DATE/TIMELEAD_IDVENDOR_IDPHONEΚΑΤΑΣΤΑΣΗOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
    $row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

    \nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_OUTBOUNDsummary_interval.php index 4ce1906b..048c576d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 091129-0017 - Added Sales-type and DNC-type tallies # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,10 +44,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -50,23 +60,40 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Summary Interval Report'; +$db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Outbound Summary Interval Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Χρονικό διάστημα:
    \n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
    Campaigns:
    "; - echo "
    Εκστρατείες:
    "; + $MAIN.="\n"; - echo "
    "; - echo "Include Drop  
    Rollover:
    "; - echo "
    \n"; - echo "Time Interval:
    "; - echo "\n"; + $MAIN.="
    "; + $MAIN.="Include Drop  
    Rollover:
    "; + $MAIN.="
    \n"; + $MAIN.="Time Interval:
    "; + $MAIN.="\n"; - echo "
    \n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "
            "; - echo "\n"; + {$MAIN.="\n";} - echo "
    \n"; - echo "Call Time:
    \n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="         "; + $MAIN.="ΛΗΨΗ | "; + $MAIN.="ΤΡΟΠΟΠΟΙΗΣΗ | "; + $MAIN.="ΑΝΑΦΟΡΕΣ"; + $MAIN.="

    \n"; + $MAIN.="Εμφάνιση as:
    "; + $MAIN.="\n
    "; + $MAIN.="
            "; + $MAIN.="\n"; + + $MAIN.="
    \n"; + + $MAIN.="Call Time:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($group_ct < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
     	}
     
     else
    @@ -483,7 +526,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -553,7 +596,7 @@ else
     			$Hcalltime_HHMM[$h] = "$H_test";
     			}
     		if ($DB)
    -			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
    +			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
     		$h++;
     		}
     
    @@ -563,19 +606,49 @@ else
     
     	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
     
    -
    +	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
     
     
     	##### Loop through each campaign and gether stats
     	if ($group_ct > 0)
     		{
    -		$MAIN .= "\n";
    -		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    -		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    -		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
    -		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "\n";
    +		$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "|                                          |        | SYSTEM | ΧΕΙΡΙΣΤΗΣ |        |        | NO     |        | ΧΕΙΡΙΣΤΗΣ     | ΧΕΙΡΙΣΤΗΣ     |\n";
    +		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ΑΠΑΝΤΗΣΗ | DROP   | LOGIN      | PAUSE      |\n";
    +		$ASCII_text .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +
    +		$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
    +		$CSV_main.="\"CAMPAIGN\",\"ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ\",\"SYSTEM RELEASE CALLS\",\"ΧΕΙΡΙΣΤΗΣRELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ΑΠΑΝΤΗΣΗ PERCENT\",\"DROP PERCENT\",\"ΧΕΙΡΙΣΤΗΣLOGIN TIME(H:M:S)\",\"ΧΕΙΡΙΣΤΗΣPAUSE TIME(H:M:S)\"\n";
    +		$CSV_subreports="";
    +		
    +		######## GRAPHING #########
    +		$max_calls=1;
    +		$max_system_release=1;
    +		$max_agent_release=1;
    +		$max_sales=1;
    +		$max_dncs=1;
    +		$max_nas=1;
    +		$max_drops=1;
    +		$max_login_time=1;
    +		$max_pause_time=1;
    +
    +		$GRAPH="

    "; + $GRAPH.=""; + $GRAPH.="
    CALLSSYSTEM RELEASE CALLSΧΕΙΡΙΣΤΗΣRELEASE CALLSSALE CALLSDNC CALLSNO ΑΠΑΝΤΗΣΗ PERCENTDROP PERCENTΧΕΙΡΙΣΤΗΣLOGIN TIMEΧΕΙΡΙΣΤΗΣPAUSE TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -596,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -614,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -641,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -655,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -732,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hΑΠΑΝΤΗΣΗcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -815,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -823,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -953,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -961,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -978,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1004,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1025,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gΑΠΑΝΤΗΣΗcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1040,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | ΧΕΙΡΙΣΤΗΣ | | | NO | | ΧΕΙΡΙΣΤΗΣ | ΧΕΙΡΙΣΤΗΣ |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ΑΠΑΝΤΗΣΗ | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ\",\"SYSTEM RELEASE CALLS\",\"ΧΕΙΡΙΣΤΗΣRELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ΑΠΑΝΤΗΣΗ PERCENT\",\"DROP PERCENT\",\"ΧΕΙΡΙΣΤΗΣLOGIN TIME (H:M:S)\",\"ΧΕΙΡΙΣΤΗΣPAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

    MULTI-CAMPAIGN BREAKDOWN
    CAMPAIGNSΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ
    SYSTEM RELEASE CALLS
    ΧΕΙΡΙΣΤΗΣRELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO ΑΠΑΝΤΗΣΗ PERCENT
    DROP PERCENT
    ΧΕΙΡΙΣΤΗΣLOGIN TIME (H:M:S)
    ΧΕΙΡΙΣΤΗΣPAUSE TIME (H:M:S)
    "; + $SUBGRAPH.=""; + $SUBGRAPH.="
    CALLSSYSTEM RELEASE CALLSΧΕΙΡΙΣΤΗΣRELEASE CALLSSALE CALLSDNC CALLSNO ΑΠΑΝΤΗΣΗ PERCENTDROP PERCENTΧΕΙΡΙΣΤΗΣLOGIN TIMEΧΕΙΡΙΣΤΗΣPAUSE TIME

     


    "; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1105,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1124,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hΑΠΑΝΤΗΣΗcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1140,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1167,8 +1317,8 @@ else $hTOTcalls_count = sprintf("%6s", $hTOTcalls_count); $hTOTsystem_count = sprintf("%6s", $hTOTsystem_count); $hTOTagent_count = sprintf("%6s", $hTOTagent_count); - $hTOTptp_count = sprintf("%6s", $hTOTrtp_count); - $hTOTrtp_count = sprintf("%6s", $hTOTptp_count); + $hTOTptp_count = sprintf("%6s", $hTOTptp_count); + $hTOTrtp_count = sprintf("%6s", $hTOTrtp_count); if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) ) {$hTOTna_percent=0;} else @@ -1190,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
    $SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
    INTERVALΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ
    SYSTEM RELEASE CALLS
    ΧΕΙΡΙΣΤΗΣRELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO ΑΠΑΝΤΗΣΗ PERCENT
    DROP PERCENT
    ΧΕΙΡΙΣΤΗΣLOGIN TIME (H:M:S)
    ΧΕΙΡΙΣΤΗΣPAUSE TIME (H:M:S)
    ".$SUBgraph_stats[$d][1]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
    TOTAL:".trim($hTOTcalls_count)."
    "; + $SUBSYSTEMRELEASE_graph.="
    TOTAL:".trim($hTOTsystem_count)."
    "; + $SUBAGENTRELEASE_graph.="
    TOTAL:".trim($hTOTagent_count)."
    "; + $SUBSALES_graph.="
    TOTAL:".trim($hTOTptp_count)."
    "; + $SUBDNCS_graph.="
    TOTAL:".trim($hTOTrtp_count)."
    "; + $SUBNAS_graph.="
    TOTAL:".trim($hTOTna_percent)."%
    "; + $SUBDROPS_graph.="
    TOTAL:".trim($hTOTdrop_percent)."%
    "; + $SUBLOGINTIME_graph.="
    TOTAL:".trim($hTOTagent_sec)."
    "; + $SUBPAUSETIME_graph.="
    TOTAL:".trim($hTOTpause_sec)."
    "; + $JS_onload.="\tDraw".$SUBrpt_campaign."ΕκστρατείαGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."ΕκστρατείαGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1244,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALS Εκστρατείες: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALS Εκστρατείες: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H')."
    TOTAL:".trim($TOTcalls_count)."
    "; + $SYSTEMRELEASE_graph.="TOTAL:".trim($TOTsystem_count).""; + $AGENTRELEASE_graph.="TOTAL:".trim($TOTagent_count).""; + $SALES_graph.="TOTAL:".trim($TOTptp_count).""; + $DNCS_graph.="TOTAL:".trim($TOTrtp_count).""; + $NAS_graph.="TOTAL:".trim($TOTna_percent)."%"; + $DROPS_graph.="TOTAL:".trim($TOTdrop_percent)."%"; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiΕκστρατείαGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiΕκστρατείαGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo "
    "; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; } ?> -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_VDADstats.php index d3fe58d1..d2b46ae9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -26,6 +26,12 @@ # 100202-1034 - Added statuses to no-answer section # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100814-2307 - Added display of preset dials if presets are enabled in the campaign +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -73,10 +81,14 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';} if (strlen($carrier_stats)<2) {$carrier_stats='NO';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Calling Report'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; -echo "Outbound Stats\n"; +echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -333,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

    Εμφάνιση as:
    "; +echo "\n
    "; echo "Shift:  
    "; echo "\n"; -#echo "\n"; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           ΤΡΟΠΟΠΟΙΗΣΗ \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    +	}
    +
    +else
    +	{
    +	echo "Live Current Πράκτορες logged in to take calls from $group - $selected_name         $NOW_TIME\n";
    +
    +	echo "\n";
    +
    +	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +
    +	$TOTALagents =	sprintf("%10s", $row[0]);
    +
    +	echo "Total agents:       $TOTALagents\n";
    +
    +
    +	##############################
    +	#########  LIVE ΧΕΙΡΙΣΤΗΣSTATS
    +	$user_list='|';
    +	echo "\n";
    +	echo "---------- LIVE AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +	echo "| #    | ΧΡΗΣΤΗΣ                        | CAMPAIGN             | STATUS | LAST ACTIVITY       |\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$users_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $users_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		$campaign_id =	sprintf("%-8s", $row[2]);
    +		$status =		sprintf("%-6s", $row[3]);
    +		$time =			sprintf("%-19s", $row[4]);
    +		$user_list .=	"$row[0]---$row[3]|";
    +
    +		echo "| $FMT_i | $user | $campaign_id   Real-Time | $status | $time |\n";
    +		}
    +
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	
    +	if ($DB) {echo "\n$user_list\n";}
    +
    +	##############################
    +	#########  ALL ΧΕΙΡΙΣΤΗΣSTATS
    +
    +	echo "\n";
    +	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +	echo "| #    | ΧΡΗΣΤΗΣ                        | LOGGED IN |\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +
    +	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$Xusers_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $Xusers_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		if (preg_match("/\|$row[0]---/",$user_list))
    +			{
    +			$userstatusARY =	explode("|$row[0]---",$user_list);
    +			$userstatus =		explode('|',$userstatusARY[1]);
    +			$status_line =		sprintf("%-9s", $userstatus[0]);
    +
    +			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
    +			}
    +		else
    +			{$status_line = '         ';}
    +
    +		echo "| $FMT_i | $user | $status_line |\n";
    +		}
    +
    +	echo "+------+--------------------------------+-----------+\n";
    +	
    +	}
    +
    +
    +?>
    +
    + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_log_display.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_log_display.php deleted file mode 100644 index 923954a8..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: AGPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "ΔΙΑΧΕΙΡΙΣΗ LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "
    \n\n"; - -echo "
    \n\n";
    -
    -
    -echo "ΔΙΑΧΕΙΡΙΣΗ CHANGE LOG                             $NOW_TIME\n";
    -
    -#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
    -passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
    -
    -
    -?>
    -
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_template_maker.php new file mode 100644 index 00000000..a7e7ff09 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="ΑΠΟΣΤΟΛΗ ΥΠΟΔΕΙΓΜΑ" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
    **NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="Διαγραφή προτύπου" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
    **$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
    ##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"ΒΟΗΘΕΙΑ\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
    + + +
    Προσαρμοσμένη Listloader τσάι προτύπου
    + +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
    $error_msg
    $success_msg
    Δημιουργία νέου προτύπουΔιαγραφή ενός υπάρχοντος προτύπου
    +
    + Δείγμα αρχείου τοποθέτηση πρότυπο:
    ()


    +
    +
    Επιλέξτε το πρότυπο για να διαγράψετε:


    +
            ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ         Go to Lead Loader    
    + +
    + + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_days_detail.php index 033dd003..72ae1eaa 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,6 +11,11 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -39,12 +44,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Ημέρες Status Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -172,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="
    \n";
    +	$GRAPH_text.="
    \n";
     	}
     
     if (strlen($group[0]) < 1)
    @@ -212,10 +314,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Ημέρες Status Report: $user                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n";
    +		$ASCII_text.="Agent Ημέρες Status Report: $user                     $NOW_TIME\n";
    +		$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$ASCII_text.="---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n";
    +		$GRAPH_text.="Agent Ημέρες Status Report: $user                     $NOW_TIME\n";
    +		$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$GRAPH_text.="---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n";
     		}
     	else
     		{
    @@ -235,7 +339,7 @@ else
     	$date_namesARY[0]='';
     	$k=0;
     
    -	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
    +	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$rows_to_print = mysql_num_rows($rslt);
    @@ -271,20 +375,39 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "LEAD STATS BREAKDOWN:\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    -		echo "| DATE       | LEADS  | CIcalls| DNC/CI%|$statusesHTML\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		for ($i=0; $i$SstatusTXT";
    +		}
    +
     		}
     	else
     		{
    -		$file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n";
    +		$file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
     		}
     
     	### BEGIN loop through each user ###
     	$m=0;
     	$CIScountTOT=0;
     	$DNCcountTOT=0;
    +
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_cicalls=1;
    +	$max_dncci=1;
    +	$GRAPH="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -300,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -318,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -357,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -397,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -426,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -445,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -460,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -487,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
    LEAD STATS BREAKDOWN
    ΚΑΤΑΣΤΑΣΗCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="
    TOTAL:".trim($CIScountTOT)."
    "; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n
    "; } else { @@ -522,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
    \n"; echo "
    Ημερομηνίες:
    "; @@ -572,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
    "; +echo "Εμφάνιση as:   
    "; +echo "\n

    "; echo "
    Χρήστης:
    "; echo "\n"; echo "
    Shift:
    "; @@ -596,38 +814,41 @@ else echo "ΑΝΑΦΟΡΕΣ \n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if ($report_display_type=="TEXT" || !$report_display_type) 
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_performance_detail.php
    index 10e5bc67..69b670f5 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_performance_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_performance_detail.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     #
    @@ -23,6 +23,13 @@
     # 100203-1131 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 110703-1739 - Added file download option
    +# 111007-0709 - Changed user and fullname to use non-truncated for output file
    +# 111104-1249 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -49,36 +56,61 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
     	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
     if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))					{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
     	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
    +if (isset($_GET["file_download"]))				{$file_download=$_GET["file_download"];}
    +	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    -$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
    +$report_name = 'Agent Performance Λεπτομέρειες';
    +$db_source = 'M';
    +$JS_text="\n";
    -echo "\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
     
    -echo "\n";
    -echo "Agent Performance Λεπτομέρειες\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="$report_name\n";
     
     	$short_header=1;
     
    -	require("admin_header.php");
    +#	require("admin_header.php");
     
    -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "
    Ημερομηνίες:
    "; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
    Ημερομηνίες:
    "; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$HTML_text.="\n"; -echo "
    to
    "; +$HTML_text.="
    to
    "; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$HTML_text.="\n"; -echo "
    Εκστρατείες:
    "; -echo "
    Εκστρατείες:
    "; +$HTML_text.="\n"; -echo "
    Ομάδες Χρήστη:
    "; -echo "\n"; +$HTML_text.="
    Ομάδες Χρήστη:
    "; +$HTML_text.="\n"; -echo "
    Shift:
    "; -echo "

    \n"; -echo "\n"; -echo "
            "; +$HTML_text.="\n"; +$HTML_text.="Shift:
    "; +$HTML_text.="

    \n"; +$HTML_text.="Εμφάνιση as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; -echo "          \n"; -echo " ΑΝΑΦΟΡΕΣ \n"; -echo "\n"; -echo "
    "; +$HTML_text.="          \n"; +$HTML_text.=" ΑΝΑΦΟΡΕΣ \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; -echo "
    \n\n"; +$HTML_text.="\n\n"; -echo "
    \n";
    +$HTML_text.="
    \n";
     
     
     if (!$group)
     {
    -echo "\n";
    -echo "Επιλέξτε μια καμπάνια ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    -echo " NOTE: stats taken from shift specified\n";
    +$HTML_text.="\n";
    +$HTML_text.="Επιλέξτε μια καμπάνια ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    +$HTML_text.=" NOTE: stats taken from shift specified\n";
     }
     
     else
    @@ -300,10 +403,10 @@ $query_date_END = "$end_date $time_END";
     if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
     else {$ugSQL='';}
     
    -echo "Agent Performance Λεπτομέρειες                        $NOW_TIME\n";
    +$HTML_text.="Agent Performance Λεπτομέρειες                        $NOW_TIME\n";
     
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- AGENTS Λεπτομέρειεςs -------------\n\n";
    +$HTML_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +$HTML_text.="---------- AGENTS Λεπτομέρειεςs -------------\n\n";
     
     
     
    @@ -312,6 +415,12 @@ echo "---------- AGENTS Λεπτομέρειεςs -------------\n\n";
     $statuses='-';
     $statusesTXT='';
     $statusesHEAD='';
    +
    +$CSV_header="\"Agent Performance Λεπτομέρειες                        $NOW_TIME\"\n";
    +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
    +$CSV_header.="\"---------- AGENTS Λεπτομέρειεςs -------------\"\n";
    +$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
    +
     $statusesHTML='';
     $statusesARY[0]='';
     $j=0;
    @@ -320,10 +429,44 @@ $usersARY[0]='';
     $user_namesARY[0]='';
     $k=0;
     
    -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
    +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $rows_to_print = mysql_num_rows($rslt);
    +
    +$graph_stats=array();
    +$max_calls=1;
    +$max_time=1;
    +$max_pause=1;
    +$max_pauseavg=1;
    +$max_wait=1;
    +$max_waitavg=1;
    +$max_talk=1;
    +$max_talkavg=1;
    +$max_dispo=1;
    +$max_dispoavg=1;
    +$max_dead=1;
    +$max_deadavg=1;
    +$max_customer=1;
    +$max_customeravg=1;
    +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
    "; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -340,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -347,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -362,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [ΛΗΨΗ]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -383,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -390,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -405,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -412,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -443,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -459,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -490,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -499,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -521,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -532,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -553,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -622,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
    CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
    USERCALLS
    TIME
    PAUSE
    PAUSE AVG
    WAIT
    WAIT AVG
    TALK
    TALK AVG
    DISPO
    DISPO AVG
    DEAD
    DEAD AVG
    CUST
    CUST AVG
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
    TOTAL:".trim($TOTcalls)."
    "; +$TIME_graph.="
    TOTAL:".trim($TOTtime_MS)."
    "; +$PAUSE_graph.="
    TOTAL:".trim($TOTtotPAUSE_MS)."
    "; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -646,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    ΣΥΝΟΛΙΚΑNONPAUSEPAUSE
    "; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -665,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -675,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -688,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [ΛΗΨΗ]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Λεπτομέρειες $NOW_TIME\"\n"; +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -715,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -722,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -737,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -744,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -769,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -781,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -807,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -814,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -829,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -859,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
    PAUSE CODE BREAKDOWN
    ΚΑΤΑΣΤΑΣΗTOTAL
    NONPAUSE
    PAUSE
    $Sstatus
    ".sec_convert($graph_stats[$d][1], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".sec_convert($graph_stats[$d][($e+4)], 'H')."
    TOTAL:".trim($TOTtotTOTAL_MS)."
    "; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
    $db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_status_detail.php index 10c508a7..9a814d89 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,11 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -40,12 +45,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Λεπτομέρειες'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Status Λεπτομέρειες Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -218,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="\n\n\n
    \n";
    +	$GRAPH.="
    \n";
     	}
     
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
    -	echo "\n";
    +	echo "
    \n\n\n";
     	echo "Επιλέξτε μια καμπάνια ή ομάδα χρηστών ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
    @@ -258,10 +359,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Status Λεπτομέρειες Report                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n";
    +		$ASCII_text.="

    Agent Status Λεπτομέρειες Report $NOW_TIME\n"; + $ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n"; + $GRAPH.="

    Agent Status Λεπτομέρειες Report $NOW_TIME\n"; + $GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------"; } else { @@ -285,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -304,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -319,14 +428,22 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } @@ -334,11 +451,23 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; $Sfull_name=$user_namesARY[$m]; - $Scalls=$calls[$m]; + $Scalls=0; $SstatusesHTML=''; $SstatusesFILE=''; $CIScount=0; @@ -350,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -367,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -376,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -420,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -459,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -487,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -506,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -521,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -550,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    CALL STATS BREAKDOWN
    ΚΑΤΑΣΤΑΣΗCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -583,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Ημερομηνίες:
    "; @@ -654,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

    \n"; +echo "Εμφάνιση as:
    "; +echo "\n

    "; echo "\n"; echo "
            "; @@ -663,38 +888,41 @@ echo " ΑΝΑΦΟΡΕΣ \n"; echo "\n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if (!$report_display_type || $report_display_type=="TEXT")
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "                              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "                              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "                              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "                              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    \ No newline at end of file
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_detail.php
    index 3f3edb50..253462dd 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_detail.php
    @@ -4,7 +4,7 @@
     # Pulls time stats per agent selectable by campaign or user group
     # should be most accurate agent stats of all of the reports
     #
    -# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     # 90522-0723 - First build
    @@ -12,6 +12,17 @@
     # 100203-1147 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
    +# 101207-1719 - Fixed download file formatting bugs(issue 394)
    +# 101208-0320 - Fixed issue 404
    +# 110307-1057 - Added user_case setting in options.php
    +# 110623-0728 - Fixed user group selection bug
    +# 110708-1727 - Added options.php setting for time precision
    +# 111104-1248 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -38,15 +49,37 @@ if (isset($_GET["DB"]))						{$DB=$_GET["DB"];}
     	elseif (isset($_POST["DB"]))			{$DB=$_POST["DB"];}
     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["ΕΠΙΒΕΒΑΙΩΣΗ"]))					{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
    +	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($stage)<2) {$stage='NAME';}
     
    +$report_name = 'Agent Ωρα Λεπτομέρειες';
    +$db_source = 'M';
    +$JS_text="\n";
     	echo "\n";
    +	echo "\n";
     
     	echo "\n";
    -	echo "Agent Time Detail\n";
    +	echo "$report_name\n";
     	echo "";
     
     	$short_header=1;
    @@ -198,7 +321,7 @@ if ($file_download < 1)
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
     	echo "\n";
    -	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
    +	echo "Επιλέξτε μια καμπάνια ή ομάδα χρηστών ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
     
    @@ -236,13 +359,13 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Time Detail                     $NOW_TIME\n";
    +		echo "Agent Ωρα Λεπτομέρειες                     $NOW_TIME\n";
     
     		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     	else
     		{
    -		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
    +		$file_output .= "Agent Ωρα Λεπτομέρειες                     $NOW_TIME\n";
     		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     
    @@ -253,11 +376,34 @@ else
     	############################################################################
     
     	### BEGIN gather user IDs and names for matching up later
    -	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
    +	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$users_to_print = mysql_num_rows($rslt);
     	$i=0;
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_timeclock=1;
    +	$max_agenttime=1;
    +	$max_wait=1;
    +	$max_talk=1;
    +	$max_dispo=1;
    +	$max_pause=1;
    +	$max_dead=1;
    +	$max_customer=1;
    +	$GRAPH="";
    +	$GRAPH2="";
    +	$graph_header="
    CALLSTIME CLOCKΧΕΙΡΙΣΤΗΣTIMEWAITTALKDISPOPAUSEDEADCUSTOMER
    "; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -269,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -296,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -317,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -331,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -350,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -419,14 +568,16 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="ΧΕΙΡΙΣΤΗΣTIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | ΧΕΙΡΙΣΤΗΣTIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,ΧΕΙΡΙΣΤΗΣTIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -450,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -493,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -502,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -529,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -582,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -618,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -630,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -653,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -680,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -695,53 +899,132 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
    ΧΕΙΡΙΣΤΗΣTIME BREAKDOWN
    ΚΑΤΑΣΤΑΣΗCALLS
    TIME CLOCK
    ΧΕΙΡΙΣΤΗΣTIME
    WAIT
    TALK
    DISPO
    PAUSE
    DEAD
    CUSTOMER
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
    TOTAL:".trim($hTOTcalls)."
    "; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -782,8 +1065,22 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Ημερομηνίες:
    "; echo "\n"; echo ""; @@ -796,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start
    Campaigns:
    "; +echo "
    Εκστρατείες:
    "; echo "\n"; -echo "
    User Groups:
    "; +echo "
    Ομάδες Χρήστη:
    "; echo "

    \n"; -echo "\n"; +echo "Εμφάνιση as:
    "; +echo "\n

    "; +echo "\n"; echo "
            "; echo "          \n"; -echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " ΛΗΨΗ | \n"; +echo " ΑΝΑΦΟΡΕΣ \n"; echo "\n"; echo "
    "; -echo "\n\n"; +echo "\n\n
    $db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_sheet.php index 4d26daed..a7943e8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,46 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); require("functions.php"); +$report_name = 'Χρήστης Ώρα Φύλλο'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -45,20 +64,28 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,27 +93,70 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "Agent Ώρα Φύλλο"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -107,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentΏρα Φύλλοfor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "Χρήστης ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentΏρα Φύλλοfor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="Χρήστης ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN ΧΕΙΡΙΣΤΗΣID AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN ΧΕΙΡΙΣΤΗΣID AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -136,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentΏρα Φύλλο $NOW_TIME\n"; +$MAIN.="AgentΏρα Φύλλο $NOW_TIME\n"; + +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- ΧΕΙΡΙΣΤΗΣTIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentΏρα Φύλλο- $NOW_TIME\"\n"; +$CSV_text_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"ΧΕΙΡΙΣΤΗΣTIME SHEET: $agent - $full_name\"\n\n"; -echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- ΧΕΙΡΙΣΤΗΣTIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -176,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣTAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE ΧΕΙΡΙΣΤΗΣTIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣTAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[ΛΗΨΗ]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE ΧΕΙΡΙΣΤΗΣTIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣTAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE ΧΕΙΡΙΣΤΗΣTIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -227,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; +$MAIN.="<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[ΛΗΨΗ]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"ΩΡΕΣ:ΛΕΠΤΑ\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -255,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -269,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -285,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE>\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_timeclock_detail.php index e8d0b8b8..1cf53f5c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_agent_timeclock_detail.php @@ -3,11 +3,16 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -35,15 +40,19 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'ΧρήστηΏρα ρολόι Λεπτομέρειες Έκθεση'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,28 +60,100 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -90,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -101,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -145,6 +226,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -185,10 +267,11 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -203,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "Επιλέξτε μια καμπάνια ή ομάδα χρηστών ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -241,13 +324,13 @@ else if ($file_download < 1) { - echo "User Time-Clock Detail $NOW_TIME\n"; + echo "Χρήστης Time-Clock Λεπτομέρειες $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; } else { - $file_output .= "User Time-Clock Detail $NOW_TIME\n"; + $file_output .= "Χρήστης Time-Clock Λεπτομέρειες $NOW_TIME\n"; $file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n"; } @@ -258,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -300,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| USER NAME | ID | USER GROUP | TIME CLOCK | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="ΧΕΙΡΙΣΤΗΣTIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| USER NAME | ID | ΟΜΑΔΑ ΧΡΗΣΤΩΝ | TIME CLOCK | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } else { @@ -322,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -359,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -375,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -428,7 +524,12 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -460,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -470,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i".$graph_stats[$i][0]."\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### @@ -497,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -526,12 +636,22 @@ else if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.="
    ΧΕΙΡΙΣΤΗΣTIME-CLOCK DETAIL
    USER/ΟΜΑΔΑ ΧΡΗΣΤΩΝTIME CLOCK TIME CLOCK PUNCHES
    \"\"".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."".$graph_stats[$i][3]."
    TOTALSAGENTS: $TOT_AGENTS$TOTtimeTC
    \n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.=""; + $GRAPH.=""; } else { @@ -568,12 +688,20 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section ############################################################################ echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Ημερομηνίες:
    "; echo "\n"; echo "\n"; echo "\n"; @@ -588,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start \n"; -echo "
    User Groups:
    "; +echo "
    Ομάδες Χρήστη:
    "; echo "\n"; +echo "
    "; +echo "Εμφάνιση as:   
    "; +echo "\n

    "; echo "
    Shift:
    "; echo " +
            "; echo "          \n"; -echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " ΛΗΨΗ | \n"; +echo " ΑΝΑΦΟΡΕΣ \n"; echo "\n"; echo "
    "; @@ -684,7 +817,7 @@ echo "\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "$RUNtime\n"; +echo "$RUNtime|$db_source\n"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_campaign_status_list_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_campaign_status_list_report.php new file mode 100644 index 00000000..324b6310 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_campaign_status_list_report.php @@ -0,0 +1,471 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110815-2138 - First build +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$report_name="Εκστρατεία Status List Report"; +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;} +if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;} +if (!isset($query_date_T)) {$query_date_T="00:00:00";} +if (!isset($end_date_T)) {$end_date_T="23:59:59";} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $HTML_text.="\n"; + } + +$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER); +$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (preg_match("/-ALL/",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = preg_replace("/,\$/",'',$group_SQL); + $group_SQL_str=$group_SQL; + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$query_date="$query_date_D $query_date_T"; +$end_date="$end_date_D $end_date_T"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; +$short_header=1; + +# require("admin_header.php"); + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="
    Ημερομηνίες:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Εκστρατείες:
    "; +$HTML_text.="\n"; + +$HTML_text.="
     \n"; +$HTML_text.="\n"; +$HTML_text.="Εμφάνιση as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="ΛΗΨΗ |"; +$HTML_text.=" ΑΝΑΦΟΡΕΣ \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +$HTML_text.="
    ";
    +$i=0;
    +$group_string='|';
    +$group_ct = count($group);
    +$JS_text.="\n";
    +
    +if ($report_display_type=="HTML")
    +	{
    +	$HTML_text.=$JS_text.$GRAPH;
    +	}
    +else
    +	{
    +	$HTML_text.=$ASCII_text;
    +	}
    +
    +$HTML_text.="
    "; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_carrier_log_report.php new file mode 100644 index 00000000..6e1016a6 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Διακομιστή:
    \n"; +$MAIN.="
    \n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($ΕΠΙΒΕΒΑΙΩΣΗ && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [ΛΗΨΗ]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | ΔΙΑΚΟΜΙΣΤΗΣ IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ΑΠΑΝΤΗΣΗED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"ΔΙΑΚΟΜΙΣΤΗΣ IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ΑΠΑΝΤΗΣΗED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="
    \n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_dialer_inventory_report.php new file mode 100644 index 00000000..242ceef4 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Έκθεση απογραφής'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Εκστρατείες:
    "; +$campaign_span_txt.=""; + +$list_span_txt="Λίστες:
    "; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
    "; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
    \n";
    +
    +$rpt_header="";
    +####### STAT GENERATION #######
    +require("count_functions.inc");
    +function GetListCount($list_id, $inventory_ptnstr) 
    +	{
    +	global $list_start_inv;
    +	global $new_count;
    +	global $link;
    +	global $total_calls;
    +	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
    +	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
    +	$ct_rslt=mysql_query($ct_stmt, $link);
    +	$new_count=0; $total_calls=0;
    +	while ($ct_row=mysql_fetch_row($ct_rslt)) 
    +		{
    +		$list_start_inv+=$ct_row[2];
    +		$total_calls+=($ct_row[1]*$ct_row[2]);
    +		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
    +		}
    +	}
    +
    +if ($ΕΠΙΒΕΒΑΙΩΣΗ) 
    +	{
    +
    +	$total_list_start_inv=0;
    +	$total_dialable_count=0;
    +	$total_dialable_count_nofilter=0;
    +	$total_dialable_count_oneoff=0;
    +	$total_dialable_count_inactive=0;
    +	$total_total_calls=0;
    +	$total_average_call_count=0;
    +	$total_penetration=0;
    +
    +	if ($snapshot_time && $report_source=="SNAPSHOT") 
    +		{
    +		$rpt_header="SNAPSHOT from $snapshot_time\n";
    +		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
    +		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
    +		$rslt=mysql_query($stmt, $link);
    +		$shift_SQL_str="";
    +		while ($shift_row=mysql_fetch_array($rslt)) 
    +			{
    +			$shift_data1=explode("|", $shift_row["shift_data"]);
    +			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
    +		$shift_rslt=mysql_query($shift_stmt, $link);
    +		$c=0;
    +		while($shift_row=mysql_fetch_array($shift_rslt)) 
    +			{
    +			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
    +			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
    +			$rpt_header_SHIFTS_lower.="          |";
    +			$rpt_header_Border.="----------+";
    +			$shift_ary[$c]=$shift_row["shift_id"];
    +			$total_varname="total_".$shift_row["shift_id"];
    +			$$total_varname=0;
    +			if ($DB > 0) {echo "
    -$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
    -$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
    \n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_Border.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPAIGNS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN ΤΗΛΕΦΩΝΕΙΣΤΕ καθεστώτων: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN ΤΗΛΕΦΩΝΕΙΣΤΕ καθεστώτων: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " ΤΗΛΕΦΩΝΕΙΣΤΕ καθεστώτων: |$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + $rpt_header.="| Call list | List description | Εκστρατεία | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Εκστρατεία\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + #### PRINT TOTALS #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + } +$HTML_header.="
    \n"; +############################### + +$HTML_text="
    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Report type:
    Εκστρατείες
    List
    \n"; +$HTML_text.="
     \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Time setting:
    Server
    Local
    Ignore local campaign call time
    (default to 24 hours)
    \n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
    Report source:
    Snapshot
    Real-time
     
    $snapshot_span_txt\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n"; +$HTML_text.="           ΛΗΨΗ | ΑΝΑΦΟΡΕΣ

    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n\n";
    +
    +$HTML_text.="$rpt_header";
    +$HTML_text.="$rpt_body";
    +$HTML_text.="$rpt_footer";
    +
    +$time_end = microtime(true);
    +$ENDtime = date("U");
    +$time = $ENDtime - $STARTtime;
    +
    +$HTML_text.="Executed in $time seconds\n";
    +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_hangup_cause_report.php new file mode 100644 index 00000000..9fb4abeb --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Διακομιστή:
    \n"; +$MAIN.="
    Hangup Cause/Dial Status:
    "; +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($ΕΠΙΒΕΒΑΙΩΣΗ && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [ΛΗΨΗ]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | ΔΙΑΚΟΜΙΣΤΗΣ IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ΑΠΑΝΤΗΣΗED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"ΔΙΑΚΟΜΙΣΤΗΣ IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ΑΠΑΝΤΗΣΗED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_inbound_daily_report.php new file mode 100644 index 00000000..63cc25ec --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           ΛΗΨΗ | ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ
    Show hourly results
    \n"; +$MAIN.="
    \n\n"; + +$MAIN.="
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$time1 = strtotime($time_BEGIN);
    +	$time2 = strtotime($time_END)+1;
    +
    +	$hpd = ceil(($time2 - $time1) / 3600);
    +	if ($hpd<0) {$hpd+=24;}
    +
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
    +	$MAIN.="Selected in-group: $group\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
    +	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
    +	$CSV_text.="Selected in-group: $group\n";
    +	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
    +
    +	$d=0; $q=0; $hr=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
    +
    +		if ($hourly_breakdown) 
    +			{
    +			$dEQepoch = $dSQepoch+3599;
    +			}
    +			else
    +			{
    +			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
    +			if ($EQsec < $SQsec)
    +				{
    +				$dEQepoch = ($dEQepoch + 86400);
    +				}
    +			}
    +
    +		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +	#  || $time_END<=date("H:i:s", $dEQepoch)
    +		if ($hr>=($hpd-1) || !$hourly_breakdown) 
    +			{
    +			$d++;
    +			$hr=0;
    +			if (date("H:i:s", $dEQepoch)>$time_END) 
    +				{
    +				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
    +				}
    +			}
    +			else
    +			{
    +			$hr++;
    +			}
    +		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
    +		$q++;
    +
    +		}
    +	$prev_week=$daySTART[0];
    +	$prev_month=$daySTART[0];
    +	$prev_qtr=$daySTART[0];
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### ΔΗΜΙΟΥΡΓΙΑ HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $q;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$ASCII_text.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$qs[$i] = $row[0];
    +		$dt[$i] = 0;
    +		$ut[$i] = ($row[1] - $SQepochDAY);
    +		while($ut[$i] >= $epoch_interval) 
    +			{
    +			$ut[$i] = ($ut[$i] - $epoch_interval);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +		$ls[$i] = $row[2];
    +		$st[$i] = $row[3];
    +		$tr[$i] = $row[4];
    +		$at[$i] = $row[5]; # Actual time
    +
    +		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
    +
    +		$i++;
    +		}
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totDROPS=0;
    +	$totQUEUE=0;
    +	$totCALLSsec=0;
    +	$totDROPSsec=0;
    +	$totQUEUEsec=0;
    +	$totCALLSmax=0;
    +	$totDROPSmax=0;
    +	$totQUEUEmax=0;
    +	$totCALLSdate=$MT;
    +	$totDROPSdate=$MT;
    +	$totQUEUEdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtDROPS=$MT;
    +	$qrtQUEUE=$MT;
    +	$qrtCALLSsec=$MT;
    +	$qrtDROPSsec=$MT;
    +	$qrtQUEUEsec=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtDROPSavg=$MT;
    +	$qrtQUEUEavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$qrtDROPSmax=$MT;
    +	$qrtQUEUEmax=$MT;
    +
    +	$totABANDONSdate=$MT;
    +	$totΑΠΑΝΤΗΣΗSdate=$MT;
    +
    +	$totΑΠΑΝΤΗΣΗS=0;
    +	$totABANDONS=0;
    +	$totΑΠΑΝΤΗΣΗSsec=0;
    +	$totABANDONSsec=0;
    +	$totΑΠΑΝΤΗΣΗSspeed=0;
    +
    +	$FtotΑΠΑΝΤΗΣΗS=0;
    +	$FtotABANDONS=0;
    +	$FtotΑΠΑΝΤΗΣΗSsec=0;
    +	$FtotABANDONSsec=0;
    +	$FtotΑΠΑΝΤΗΣΗSspeed=0;
    +
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
    +	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
    +	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
    +		$totABANDONSdate[$j]=0;
    +		$totABANDONSsecdate[$j]=0;
    +		$totΑΠΑΝΤΗΣΗSdate[$j]=0;
    +		$totΑΠΑΝΤΗΣΗSsecdate[$j]=0;
    +		$totΑΠΑΝΤΗΣΗSspeeddate[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
    +				{
    +				$totCALLS++;
    +				$totCALLSsec = ($totCALLSsec + $ls[$i]);
    +				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
    +	#			$qrtCALLS[$j]++;
    +	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
    +	#			$dtt = $dt[$i];
    +				$totCALLSdate[$j]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
    +					{
    +					$totABANDONSdate[$j]++;
    +					$totABANDONSsecdate[$j]+=$ls[$i];
    +					$FtotABANDONS++;
    +					$FtotABANDONSsec+=$ls[$i];
    +					}
    +					else 
    +					{
    +					$totΑΠΑΝΤΗΣΗSdate[$j]++;
    +					$totΑΠΑΝΤΗΣΗSsecdate[$j]+=($ls[$i]-$qs[$i]-15);
    +					$totΑΠΑΝΤΗΣΗSspeeddate[$j]+=$qs[$i];
    +					$FtotΑΠΑΝΤΗΣΗS++;
    +					$FtotΑΠΑΝΤΗΣΗSsec+=($ls[$i]-$qs[$i]-15);
    +					$FtotΑΠΑΝΤΗΣΗSspeeddate+=$qs[$i];
    +					}
    +				if (ereg('DROP',$st[$i])) 
    +					{
    +					$totDROPS++;
    +					$totDROPSsec = ($totDROPSsec + $ls[$i]);
    +					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
    +	#				$qrtDROPS[$j]++;
    +	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
    +					$totDROPSdate[$j]++;
    +	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
    +	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
    +					}
    +				if ($qs[$i] > 0) 
    +					{
    +					$totQUEUE++;
    +					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
    +					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
    +	#				$qrtQUEUE[$j]++;
    +	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
    +					$totQUEUEdate[$j]++;
    +	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
    +	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
    +					}
    +	/*
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +	*/
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +	###################################################
    +	### TOTALS SUMMARY SECTION ###
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
    +	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | ΑΠΑΝΤΗΣΗ | TALK   | TALK       | WRAP       | CALL       |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | ΑΠΑΝΤΗΣΗED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
    +	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"ΑΠΑΝΤΗΣΗ\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
    +	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"ΑΠΑΝΤΗΣΗED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
    +
    +	##########################
    +	$JS_text="\n";
    +
    +	if ($report_display_type=="HTML") 
    +		{
    +		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (20 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (20 / $hi_hold_count);}
    +
    +
    +	$ENDtime = date("U");
    +	$RUNtime = ($ENDtime - $STARTtime);
    +	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
    +	$MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_server_performance.php index 7d962f0d..0a0021fa 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?>
    - +
    + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_team_performance_detail.php new file mode 100644 index 00000000..7fb514e7 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Λεπτομέρειες'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
    Ημερομηνίες:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Χρονικό διάστημα:
    \n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Εκστρατείες:
    "; +$HTML_text.="\n"; + +$HTML_text.="
    Teams/Ομάδες Χρήστη:
    "; +$HTML_text.="\n"; +$HTML_text.="
    Show additional statuses:
    "; +$HTML_text.="
    \n"; +$HTML_text.="Εμφάνιση as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="ΛΗΨΗ |"; +$HTML_text.=" ΑΝΑΦΟΡΕΣ \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +if ($ΕΠΙΒΕΒΑΙΩΣΗ=="ΕΠΙΒΕΒΑΙΩΣΗ") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
    ";
    +	$total_average_sale_time=0;
    +	$total_average_contact_time=0;
    +	$total_talk_time=0; 
    +	$total_system_time=0; 
    +	$total_calls=0;	
    +	$total_leads=0;
    +	$total_contacts=0;
    +	$total_sales=0;
    +	$total_inc_sales=0;
    +	$total_cnc_sales=0;
    +	$total_callbacks=0;
    +	$total_stcall=0;
    +	for ($q=0; $q".$call_status[$q]."";
    +	}
    +	$total_graph_stats[]="";
    +	$max_totalcalls=1;
    +	$max_totalleads=1;
    +	$max_totalcontacts=1;
    +	$max_totalcontactratio=1;
    +	$max_totalsystemtime=1;
    +	$max_totaltalktime=1;
    +	$max_totalsales=1;
    +	$max_totalsalesleadsratio=1;
    +	$max_totalsalescontactsratio=1;
    +	$max_totalsalesperhour=1;
    +	$max_totalincsales=1;
    +	$max_totalcancelledsales=1;
    +	$max_totalcallbacks=1;
    +	$max_totalfirstcall=1;
    +	$max_totalavgsaletime=1;
    +	$max_totalavgcontacttime=1;
    +	$TOTALGRAPH="

    "; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALSALES_graph=$TOTALGRAPH_header.""; + $TOTALSALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

    CALL CENTER TOTAL
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    "; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALS ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    TEAM: $user_group[$i] - $group_name
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    ".$graph_stats[$d][0]."".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][12]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][13]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][14]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
    TOTAL:".trim($group_calls)."
    "; + $LEADS_graph.="
    TOTAL:".trim($group_leads)."
    "; + $CONTACTS_graph.="
    TOTAL:".trim($group_contacts)."
    "; + $CONTACTRATIO_graph.="
    TOTAL:".trim($group_contact_ratio)."%
    "; + $SYSTEMTIME_graph.="
    TOTAL:".sec_convert($group_system_time,'H')."
    "; + $TALKTIME_graph.="
    TOTAL:".sec_convert($group_talk_time,'H')."
    "; + $SALES_graph.="
    TOTAL:".trim($group_sales)."
    "; + $SALESLEADSRATIO_graph.="TOTAL:".trim($group_sales_ratio)."%"; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALSYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALSALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALSALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALSALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALSYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALSALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALSALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALSALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALSALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALSYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALSALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALSALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALSALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALSALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php index f18d161e..f743ef76 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -60,10 +60,26 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -123,11 +139,28 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} +$report_name = 'Real-Time Main Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -136,13 +169,25 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -155,13 +200,13 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -216,9 +261,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -230,13 +284,99 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -247,7 +387,43 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -260,29 +436,58 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -294,9 +499,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -304,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -325,7 +556,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "
    Select Εκστρατείες:
    "; +$select_list = "
    Select Εκστρατείες:
    "; $select_list .= ""; $select_list .= "
    (Για να επιλέξετε περισσότερα από 1 εκστρατείας, κρατήστε πατημένο το πλήκτρο Ctrl και κάντε κλικ)"; + +$select_list .= "

    Select Ομάδες Χρήστη:
    "; +$select_list .= ""; + $select_list .= "
    "; $select_list .= "Κλείστε Panel

    "; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select Ομάδα Χρήστη:
    "; - $select_list .= "

    "; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
    "; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
    "; +$select_list .= "Inbound:
     
    "; + $select_list .= "Select Ομάδα Χρήστη: "; + $select_list .= "
    "; +$select_list .= "Dialable Leads Alert:
    "; + $select_list .= "Εμφάνιση Προεπιλογές Στατιστικά:
    "; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "ΕΚΔΟΣΗ: $version   ΔΗΜΙΟΥΡΓΙΑ: $build"; $select_list .= "
    "; @@ -422,283 +719,303 @@ $open_list = "< - - -\n"; + // function to display in-groups selected for a specific agent + function ingroup_info(agent_user,count) + { + var cursorheight = (document.REALTIMEform.cursorY.value - 0); + var newheight = (cursorheight + 10); + document.getElementById("agent_ingroup_display").style.top = newheight; + // alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user); + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + var monitorQuery = "source=realtime&function=agent_ingroup_info&stage=change&user=" + user + "&pass=" + pass + "&agent_user=" + agent_user; + xmlhttp.open('POST', 'non_agent_api.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(monitorQuery); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var Xoutput = null; + Xoutput = xmlhttp.responseText; + var regXFerr = new RegExp("ERROR","g"); + if (Xoutput.match(regXFerr)) + {alert(xmlhttp.responseText);} + else + { + document.getElementById("agent_ingroup_display").visibility = "visible"; + document.getElementById("agent_ingroup_display").innerHTML = Xoutput; + } + } + } + delete xmlhttp; + } + } + + // function to display in-groups selected for a specific agent + function hide_ingroup_info() + { + document.getElementById("agent_ingroup_display").visibility = "hidden"; + document.getElementById("agent_ingroup_display").innerHTML = ''; + } + + + + + + \n"; + + echo "\n"; + echo"\n"; + echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + + } $stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; $rslt=mysql_query($stmt, $link); @@ -706,57 +1023,55 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; -echo "\n"; -echo"\n"; -echo "Real-Time Report: $group\n"; - $short_header=1; - - require("admin_header.php"); - -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"; -echo "\n"; -echo "\n"; -echo "Real-Time Report                                                                               \n"; -echo "\n"; -echo "
    \n"; -echo "Επιλογές εμφάνισης Επιλέξτε Έκθεση"; -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; - } -else - { - echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; - } -echo "SUMMARY \n"; -echo "\n\n"; + echo ""; + } + + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -974,10 +1483,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1100,11 +1607,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1115,15 +1624,15 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1151,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1187,6 +1697,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1207,7 +1722,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1217,6 +1732,10 @@ else $DIALorder = "Κατάλογος Mix: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Real-Time Report                                                                               \n"; + echo "\n"; + echo "
    \n"; + echo "Επιλογές εμφάνισης Επιλέξτε Έκθεση"; + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "SLOW | "; + echo "GO"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; + } + else + { + echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; + } + echo "SUMMARY \n"; + echo "\n\n"; + } if (!$group) {echo "

    please select a campaign from the pulldown above\n"; exit;} @@ -798,10 +1113,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -936,6 +1250,7 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) $dtp++; } $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; if ($DB > 0) {echo "\n|$stmtB|\n";} @@ -963,6 +1278,200 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
    "; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
    CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
         $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
    no log entries
    "; + $CARRIERstatsHTML .= "
    "; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
      ΧΕΙΡΙΣΤΗΣDIAL PRESETS:     PRESET NAMES                 CALLS  
                $row[0]     $row[1]  
    no log entries
    "; + $PRESETstatsHTML .= "
    "; echo ""; @@ -1228,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1251,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1271,7 +1794,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1290,63 +1861,67 @@ echo ""; echo ""; echo "
    DIAL ΕΠΙΠΕΔΟ:  $DIALlev   
    - min   MAX ΕΠΙΠΕΔΟ:  $maxDIALlev   $min_link  MAX ΕΠΙΠΕΔΟ:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    HOPPER ΕΠΙΠΕΔΟ:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     DROPPED / ΑΠΑΝΤΗΣΗED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses     ORDER:  $DIALorder    
    ΧΕΙΡΙΣΤΗΣAVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; - } -else - { - echo "       VIEW ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; - } -if ($SERVdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; - } -if ($CALLSdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ WAITING CALLS"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; + } + else + { + echo "       VIEW ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; + } + if ($SERVdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; + } + else + { + echo "       ΕΜΦΑΝΙΣΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; + } + if ($CALLSdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ WAITING CALLS"; + } + else + { + echo "       ΕΜΦΑΝΙΣΗ WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       ΑΠΟΚΡΥΨΗ IN-GROUP STATS"; + } + else + { + echo "       ΕΜΦΑΝΙΣΗ IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ PHONES"; + } + else + { + echo "       ΕΜΦΑΝΙΣΗ PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ CUSTPHONES"; + } + else + { + echo "       ΕΜΦΑΝΙΣΗ CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       ΑΠΟΚΡΥΨΗ IN-GROUP STATS"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ PHONES"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ CUSTPHONES"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ CUSTPHONES"; - } echo "
    "; @@ -1390,6 +1965,20 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) ################################################################################### if ($campaign_allow_inbound > 0) { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1422,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1515,15 +2120,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1548,7 +2153,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -1560,6 +2165,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1589,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; +if ($RTajax > 0) + {$HTuser = " USER ";} if ($UidORname>0) { - $HTuser .= "ΕΜΦΑΝΙΣΗ ID "; + if ($RTajax > 0) + {$HTuser .= "ΕΜΦΑΝΙΣΗ ID ";} + else + { + $HTuser .= "ΕΜΦΑΝΙΣΗ ID "; + } } else { - $HTuser .= "ΕΜΦΑΝΙΣΗ NAME"; + if ($RTajax > 0) + {$HTuser .= "ΕΜΦΑΝΙΣΗ NAME";} + else + { + $HTuser .= "ΕΜΦΑΝΙΣΗ NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " ΟΜΑΔΑ ΧΡΗΣΤΩΝ |"; +$HTusergroup = " ΟΜΑΔΑ ΧΡΗΣΤΩΝ |"; +if ($RTajax > 0) + {$HTusergroup = " ΟΜΑΔΑ ΧΡΗΣΤΩΝ |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1621,9 +2243,13 @@ $HTserver_ip = " ΔΙΑΚΟΜΙΣΤΗΣ IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL ΔΙΑΚΟΜΙΣΤΗΣ IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPAIGN |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1672,9 +2298,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1698,12 +2331,16 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -1730,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -1748,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -1928,7 +2594,7 @@ $calls_to_list = mysql_num_rows($rslt); {$CM='A';} else { - if (eregi("Εισερχόμενα",$comments)) + if (eregi("INBOUND",$comments)) {$CM='I';} else {$CM='M';} @@ -1971,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2000,7 +2667,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2011,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2043,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2060,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2088,14 +2763,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load Average: $load_ave\n\n"; + $Aecho .= " System Load Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2110,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2123,6 +2810,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE πράκτορες νεκροί σε κλήσεις      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
    ";
     		echo "";
    @@ -2135,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt);
     	echo "
    $Cecho";
     	}
     
    +echo "
    "; + +if ($RTajax < 1) + { + echo "
    "; + } ?> - -
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php index c0f77c90..1e55cc06 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -16,10 +16,15 @@ # 80525-1040 - Added IVR status summary display for inbound calls # 90310-2119 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100709-1806 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -31,24 +36,64 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='ΕΜΦΑΝΙΣΗ ALL ΕΚΣΤΡΑΤΕΙΕΣ';} + +$report_name = 'Real-Time Εκστρατεία Summary'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -56,13 +101,49 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -74,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "Real-Time All Εκστρατείες Summary\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; +$MAIN.=""; +$MAIN.="
    "; -echo "Real-Time All Εκστρατείες Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; +$MAIN.="Real-Time All Εκστρατείες Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="SLOW | "; +$MAIN.="GO "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + $MAIN.="+ VIEW MORE SETTINGS"; } else { - echo "- VIEW LESS SETTINGS"; + $MAIN.="- VIEW LESS SETTINGS"; } -echo "       ΑΝΑΦΟΡΕΣ"; -echo "

    \n\n"; +$MAIN.="      ΛΗΨΗ | ΑΝΑΦΟΡΕΣ"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
    DIAL ΕΠΙΠΕΔΟ:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"DIAL ΕΠΙΠΕΔΟ:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTER:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX ΕΠΙΠΕΔΟ:\",\"$maxDIALlev\",\"DROPPED MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"DIAL TIMEOUT:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"DIALABLE LEADS:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"AVG AGENTS:\",\"$agentsONEMIN\",\"ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"HOPPER ΕΠΙΠΕΔΟ:\",\"$HOPlev\",\"DROPPED / ΑΠΑΝΤΗΣΗED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"STATUSES:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDER:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"ΧΕΙΡΙΣΤΗΣAVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
    DIAL ΕΠΙΠΕΔΟ:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
      MAX ΕΠΙΠΕΔΟ:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
      MAX ΕΠΙΠΕΔΟ:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ:  $DIALmethod    
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ:  $DIALmethod    
    HOPPER ΕΠΙΠΕΔΟ:  $HOPlev     DROPPED / ΑΠΑΝΤΗΣΗED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    HOPPER ΕΠΙΠΕΔΟ:  $HOPlev     DROPPED / ΑΠΑΝΤΗΣΗED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +$MAIN.="
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    "; +$MAIN.="
    "; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
    "; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
    ΧΕΙΡΙΣΤΗΣAVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; ### Header finish @@ -307,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -341,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo "ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ \n"; + $MAIN.="ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ \n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -366,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -419,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
    \n"; + $MAIN.="\n
    \n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
    ";
    -		echo "";
    +		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
    +		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
    +		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
    +		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
    +		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
    +				
    +		$MAIN.="
    ";
    +		$MAIN.="";
     	}
     	else
     	{
    -	echo " NO AGENTS ON CALLS
    \n"; + $MAIN.=" NO AGENTS ON CALLS
    \n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -442,16 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
    "; +$MAIN.="
    \n\n
    "; -echo "
    \n\n"; $k++; } +$MAIN.="\n\n
    "; +$MAIN.="\n"; +$MAIN.="
    \n"; + +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } ?> - -
    - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonpark.php index c373de42..d6b458d4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Πράκτορες Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Πράκτορες Time On  εισερχόμενοςCalls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin.php index f1134ef6..afab20ee 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,6 +103,13 @@ $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 Εκστρατεία Summary ,  εισερχόμενοςReport,  εισερχόμενοςService Level Report, Εισερχόμενο Ωριαία Συνοπτική Έκθεση,  εισερχόμενοςDaily Report,  εισερχόμενοςDID Report,  εισερχόμενοςIVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Κατάλογοι Θέσεις εκστρατείας Report, Εκστρατεία Status List Report, Εξαγωγή ζητεί έκθεση, Εξαγωγή οδηγεί Έκθεση , Agent Ωρα Λεπτομέρειες, Agent Status Λεπτομέρειες, Agent Performance Λεπτομέρειες, Team Performance Λεπτομέρειες, Single Agent Daily , ΧρήστηςΏρα ρολόι Report, Ομάδα ΧρήστηΏρα ρολόι Status Report, ΧρήστηΏρα ρολόι Λεπτομέρειες Έκθεση , Server Performance Report, Administration Change Log, List Update Stats, Στατιστικά Χρήστη, Χρήστης Ώρα Φύλλο, Download List, Dialer Έκθεση απογραφής, Maximum System Stats, Maximum Stats Λεπτομέρειες, Search Leads Logs'; + +$UGreports = 'ALL ΑΝΑΦΟΡΕΣ, NONE, Real-Time Main Report, Real-Time Εκστρατεία Summary ,  εισερχόμενοςReport,  εισερχόμενοςService Level Report, Εισερχόμενο Ωριαία Συνοπτική Έκθεση,  εισερχόμενοςDaily Report,  εισερχόμενοςDID Report,  εισερχόμενοςIVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Κατάλογοι Θέσεις εκστρατείας Report, Εκστρατεία Status List Report, Εξαγωγή ζητεί έκθεση , Εξαγωγή οδηγεί Έκθεση , Agent Ωρα Λεπτομέρειες, Agent Status Λεπτομέρειες, Agent Performance Λεπτομέρειες, Team Performance Λεπτομέρειες, Single Agent Daily , ΧρήστηςΏρα ρολόι Report, Ομάδα ΧρήστηΏρα ρολόι Status Report, ΧρήστηΏρα ρολόι Λεπτομέρειες Έκθεση , Server Performance Report, Administration Change Log, List Update Stats, Στατιστικά Χρήστη, Χρήστης Ώρα Φύλλο, Download List, Dialer Έκθεση απογραφής, Custom Εκθέσεις Links, CallCard Search, Maximum System Stats, Maximum Stats Λεπτομέρειες, Search Leads Logs'; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -321,16 +338,16 @@ 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_fast_ανανέωσης"])) {$enable_fast_ανανέωσης=$_GET["enable_fast_ανανέωσης"];} + elseif (isset($_POST["enable_fast_ανανέωσης"])) {$enable_fast_ανανέωσης=$_POST["enable_fast_ανανέωσης"];} 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["fast_ανανέωσης_rate"])) {$fast_ανανέωσης_rate=$_GET["fast_ανανέωσης_rate"];} + elseif (isset($_POST["fast_ανανέωσης_rate"])) {$fast_ανανέωσης_rate=$_POST["fast_ανανέωσης_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"];} @@ -595,8 +612,8 @@ 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["campaign_stats_ανανέωσης"])) {$campaign_stats_ανανέωσης=$_GET["campaign_stats_ανανέωσης"];} + elseif (isset($_POST["campaign_stats_ανανέωσης"])){$campaign_stats_ανανέωσης=$_POST["campaign_stats_ανανέωσης"];} 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"];} @@ -687,6 +704,8 @@ 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"];} @@ -1167,9 +1186,553 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n 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_ανανέωσης"])) {$admin_modify_ανανέωσης=$_GET["admin_modify_ανανέωσης"];} + elseif (isset($_POST["admin_modify_ανανέωσης"])) {$admin_modify_ανανέωσης=$_POST["admin_modify_ανανέωσης"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + + +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) { @@ -1179,25 +1742,49 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1265,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_ανανέωσης = ereg_replace("[^0-9]","",$enable_fast_ανανέωσης); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_ανανέωσης_rate = ereg_replace("[^0-9]","",$fast_ανανέωσης_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1299,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1307,7 +1893,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1951,70 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_ανανέωσης = ereg_replace("[^0-9]","",$admin_modify_ανανέωσης); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1397,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_ανανέωσης = ereg_replace("[^NY]","",$campaign_stats_ανανέωσης); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1433,6 +2083,37 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +2161,24 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +2193,8 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +2206,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1582,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1610,11 +2310,10 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -1632,6 +2331,78 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2416,47 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,53 +2465,96 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -1716,7 +2562,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,8 +2578,19 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); + ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -1761,7 +2617,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,8 +2627,14 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -1783,6 +2645,11 @@ if ($non_latin < 1) # $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 @@ -2046,44 +2913,187 @@ else # 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 # + # 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.2.0-234'; -$build = '100116-0718'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_ανανέωσης_set=0; +$modify_footer_ανανέωσης=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2098,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_ανανέωσης,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2109,6 +3119,10 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; + $SSadmin_modify_ανανέωσης = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2120,84 +3134,189 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_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 ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($SSwebroot_writable > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2206,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_ανανέωσης > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_ανανέωσης_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2219,13 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Πρόσθεσε Νέα Ε if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Εκστρατεία αντιγράφων";} if ($ADD==111) {$hh='lists'; echo "Πρόσθεσε Νέα Λίστα";} if ($ADD==121) {$hh='lists'; echo "Προσθέστε νέο DNC";} +if ($ADD==171) {$hh='ingroups'; echo "Φιλτράρισμα αριθμών τηλεφώνου Ομίλου";} if ($ADD==1111) {$hh='ingroups'; echo "Πρόσθεσε Νέα Εισ-Ομάδα";} if ($ADD==1211) {$hh='ingroups'; echo "$$$-ΟΜΑΔΑ αντιγράφων";} if ($ADD==1311) {$hh='ingroups'; echo "Προσθήκη νέουDID";} if ($ADD==1411) {$hh='ingroups'; echo "ΑντιγραφήDID";} if ($ADD==1511) {$hh='ingroups'; echo "Προσθήκη Call Μενού";} if ($ADD==1611) {$hh='ingroups'; echo "Αντιγραφή Call Μενού";} +if ($ADD==1711) {$hh='ingroups'; echo "Προσθήκη φίλτρου Ομίλου Τηλ.";} if ($ADD==11111) {$hh='remoteagent'; echo "Πρόσθεσε Νέους Απομακρυσμένους Χειριστές";} +if ($ADD==12111) {$hh='remoteagent'; echo "Προσθέστε την ομάδα επέκτασης";} if ($ADD==111111) {$hh='usergroups'; echo "Πρόσθεσε Νέα Ομάδα Χρηστών";} if ($ADD==1111111) {$hh='scripts'; echo "Πρόσθεσε Νέο Βοηθό";} if ($ADD==11111111) {$hh='filters'; echo "Πρόσθεσε Φίλτρο";} @@ -2238,9 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "Προσθήκη νέο if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΣΕ ΝΕΟ ΔΙΑΚΟΜΙΣΤΗ";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Προσθήκη νέου ΠΙΣΤ TEMPLATE";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Προσθήκη νέου ΘΑΛΑΜΙΣΚΟ";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ΠΡΟΣΘΕΣΤΕ ΤΟΝ ΑΝΤΙΓΡΑΜΜΕΝΟ ΜΕΤΑΦΟΡΕΑ";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "Προσθήκη νέου TTS ΕΙΣΟΔΟΣ";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "Προσθήκη νέουMusic on Hold ΕΙΣΟΔΟΥ";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "Προσθήκη νέου ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "Προσθήκη νέου ΕΤΙΚΕΤΑ ΟΘΟΝΗ";} +if ($ADD==191111111111) {$hh='admin'; $sh='cts'; echo "Προσθήκη νέας επαφής";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΕΣΕ ΝΕΑ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} @@ -2254,6 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Νέα αυτόματη if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Νέος κώδικας μικρής διακοπής πρακτόρων";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Θέση πινάκων εκστρατείας προστιθέμενη";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγων εκστρατείας προστιθέμενο";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Προκαθορισμένη Εκστρατεία προσθήκης";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Εκστρατεία Areacode CID Τροποποίηση";} if ($ADD==211) {$hh='lists'; echo "Προσθήκη Νέας Λίστας";} if ($ADD==2111) {$hh='ingroups'; echo "Προσθήκη Νέας Εισ-Ομάδας";} if ($ADD==2011) {$hh='ingroups'; echo "Νέα αντιγραμμένη προσθήκη-ΟΜΑΔΑΣ";} @@ -2261,7 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Νέα προσθήκη DID";} if ($ADD==2411) {$hh='ingroups'; echo "Νέα προσθήκη αντιγραφή DID";} if ($ADD==2511) {$hh='ingroups'; echo "Νέα Πρόσκληση Μενού";} if ($ADD==2611) {$hh='ingroups'; echo "Νέα Πρόσκληση Μενού";} +if ($ADD==2711) {$hh='ingroups'; echo "Νέο φίλτρο Ομίλου Τηλ.";} if ($ADD==21111) {$hh='remoteagent'; echo "Προσθήκη Νέων Απομακρυσμένων Χειριστών";} +if ($ADD==22111) {$hh='remoteagent'; echo "Νέα προσθήκη επέκτασης ομάδας";} if ($ADD==211111) {$hh='usergroups'; echo "Προσθήκη Νέας Ομάδας Χρηστών";} if ($ADD==2111111) {$hh='scripts'; echo "Νέα προσθήκη Βοηθού";} if ($ADD==21111111) {$hh='filters'; echo "Προσθήκη Νέου Φίλτρου";} @@ -2275,9 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΗΚΗ ΝΕ if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΤΕΙ ΝΕΑ ΕΓΓΡΑΦΗ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΡΜΟΥ";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Την προσθήκη νέων ΠΙΣΤ TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Την προσθήκη νέων ΘΑΛΑΜΙΣΚΟ";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ΠΡΟΣΘΗΚΗ ΤΟΥ ΑΝΤΙΓΡΑΜΜΕΝΟΥ ΜΕΤΑΦΟΡΕΑ";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "Adding New TTS ΕΙΣΟΔΟΣ";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "Adding New Music on Hold ΕΙΣΟΔΟΥ";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "Adding New ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "Προσθήκη νέων ΕΤΙΚΕΤΑ ΟΘΟΝΗ";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "ΠΡΟΣΘΗΚΗ ΝΕΑ ΕΠΙΚΟΙΝΩΝΙΑ";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΣΥΝΔΙΑΛΕΞΗΣ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ΠΡΟΣΘΗΚΗ ΤΩΝ ΘΈΣΕΩΝ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} @@ -2296,6 +3448,8 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Κατάλογος Mixes";} if ($SUB=='20A') {echo " - Έρευνα";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2308,6 +3462,8 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Κατάλογος Mixes";} if ($SUB=='20A') {echo " - Έρευνα";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Θέσεις εκστρατείας";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Εκστρατεία HotKeys";} @@ -2316,11 +3472,16 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Αυτόματες ALT θ if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Κώδικες μικρής διακοπής πρακτόρων εκστρατείας";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Θέσεις πινάκων εκστρατείας";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Μίγματα καταλόγων εκστρατείας";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Προεπιλογές Εκστρατεία";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Εκστρατεία Areacode CID";} if ($ADD==311) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==3111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} if ($ADD==3311) {$hh='ingroups'; echo "ModifyDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Τροποποίηση DID, RA Επέκταση Παρακάμπτει";} if ($ADD==3511) {$hh='ingroups'; echo "Τροποποίηση Call Μενού";} +if ($ADD==3711) {$hh='ingroups'; echo "Τροποποίηση φίλτρου Ομίλου Τηλ.";} if ($ADD==31111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} +if ($ADD==32111) {$hh='remoteagent'; echo "Τροποποιήστε την ομάδα επέκτασης";} if ($ADD==311111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} if ($ADD==3111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} if ($ADD==31111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} @@ -2337,6 +3498,8 @@ if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY ΘΑΛΑΜΙ if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFY TTS ΕΙΣΟΔΟΥ";} if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFY Music on Hold ΕΙΣΟΔΟΥ";} if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFY ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "ΤΡΟΠΟΠΟΙΗΣΗ ΕΤΙΚΕΤΑ ΟΘΟΝΗ";} +if ($ADD==391111111111) {$hh='admin'; $sh='cts'; echo "ΤΡΟΠΟΠΟΙΗΣΗ ΕΠΙΚΟΙΝΩΝΙΑ";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} @@ -2354,12 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Τροποποιήστε if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Τροποποιήστε τον κώδικα μικρής διακοπής πρακτόρων";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Τροποποίηση Ρυθμίσεων Καμπάνιας QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Τροποποιήστε το μίγμα καταλόγων εκστρατείας";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Τροποποίηση Προκαθορισμένη Εκστρατεία";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Τροποποίηση Καμπάνιας Έρευνα";} if ($ADD==411) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==4111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} if ($ADD==4311) {$hh='ingroups'; echo "ModifyDID";} if ($ADD==4511) {$hh='ingroups'; echo "Τροποποίηση Call Μενού";} +if ($ADD==4711) {$hh='ingroups'; echo "Τροποποίηση φίλτρου Ομίλου Τηλ.";} if ($ADD==41111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} +if ($ADD==42111) {$hh='remoteagent'; echo "Τροποποιήστε την ομάδα επέκτασης";} if ($ADD==411111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} if ($ADD==4111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} if ($ADD==41111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} @@ -2376,6 +3542,8 @@ if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY ΘΑΛΑΜΙ if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFY TTS ΕΙΣΟΔΟΥ";} if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFY Music on Hold ΕΙΣΟΔΟΥ";} if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFY ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "ΤΡΟΠΟΠΟΙΗΣΗ ΕΤΙΚΕΤΑ ΟΘΟΝΗ";} +if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo "ΤΡΟΠΟΠΟΙΗΣΗ ΕΠΙΚΟΙΝΩΝΙΑ";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} @@ -2390,7 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "ΔιαγράφωList";} if ($ADD==5111) {$hh='ingroups'; echo "ΔιαγράφωIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "ΔιαγράφωDID";} if ($ADD==5511) {$hh='ingroups'; echo "Διαγραφή Call Μενού";} +if ($ADD==5711) {$hh='ingroups'; echo "Διαγραφή φίλτρου Τηλέφωνο Ομίλου";} if ($ADD==51111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} +if ($ADD==52111) {$hh='remoteagent'; echo "Διαγράψτε την ομάδα επέκτασης";} if ($ADD==511111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} if ($ADD==5111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} if ($ADD==51111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} @@ -2406,6 +3576,8 @@ if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "DELETE ΘΑΛΑΜΙ if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ΕΙΣΟΔΟΥ";} if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE Music on Hold ΕΙΣΟΔΟΥ";} if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "Διαγραφή ετικέτας ΟΘΟΝΗ";} +if ($ADD==591111111111) {$hh='admin'; $sh='cts'; echo "Διαγραφή επαφής";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "ΔιαγράφωΧρήστης";} @@ -2417,11 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Διαγράψτε την if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Διαγράψτε τον κώδικα μικρής διακοπής πρακτόρων";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Θέση πινάκων εκστρατείας αφαιρούμενη";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγων εκστρατείας αφαιρούμενο";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Προκαθορισμένη εκστρατεία απομάκρυνε";} if ($ADD==611) {$hh='lists'; echo "ΔιαγράφωList";} if ($ADD==6111) {$hh='ingroups'; echo "ΔιαγράφωIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "ΔιαγράφωDID";} if ($ADD==6511) {$hh='ingroups'; echo "Διαγραφή Call Μενού";} +if ($ADD==6711) {$hh='ingroups'; echo "Διαγραφή φίλτρου Τηλέφωνο Ομίλου";} if ($ADD==61111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} +if ($ADD==62111) {$hh='remoteagent'; echo "Διαγράψτε την ομάδα επέκτασης";} if ($ADD==611111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} if ($ADD==6111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} if ($ADD==61111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} @@ -2438,6 +3613,8 @@ if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "DELETE ΘΑΛΑΜΙ if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ΕΙΣΟΔΟΥ";} if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE Music on Hold ΕΙΣΟΔΟΥ";} if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX";} +if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "Διαγραφή ετικέτας ΟΘΟΝΗ";} +if ($ADD==691111111111) {$hh='admin'; $sh='cts'; echo "Διαγραφή επαφής";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Μετρητής Κληθέντων Οδηγών";} @@ -2455,8 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Εκστρατείες";} if ($ADD==100) {$hh='lists'; echo "Λίστες";} if ($ADD==1000) {$hh='ingroups'; echo "Εισ-Ομάδες";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Τροποποίηση DID, RA Επέκταση Παρακάμπτει";} if ($ADD==1500) {$hh='ingroups'; echo "Καλέστε Menus";} +if ($ADD==1700) {$hh='ingroups'; echo "Φίλτρο Ομάδες Τηλέφωνο";} if ($ADD==10000) {$hh='remoteagent'; echo "Απομακρυσμένοι Χειριστές";} +if ($ADD==12000) {$hh='remoteagent'; echo "Ομάδες επέκτασης";} if ($ADD==100000) {$hh='usergroups'; echo "Ομάδες Χρήστη";} if ($ADD==1000000) {$hh='scripts'; echo "Βοηθοί";} if ($ADD==10000000) {$hh='filters'; echo "Φίλτρα";} @@ -2472,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "ΘΑΛΑΜΙΣΚΟ if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS Συμμετοχές";} if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "Music on Hold Συμμετοχές";} if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ πλαίσια λίστας";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "ΟΘΟΝΗ ΚΑΤΑΛΟΓΟΣ ΕΤΙΚΕΤΕΣ";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "ΚΑΤΑΛΟΓΟΣ ΕΠΙΚΟΙΝΩΝΙΑ";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "ΛΙΣΤΑ ΣΥΝΔΙΑΛΕΞΕΩΝ";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL ΛΙΣΤΑ ΣΥΝΔΙΑΛΕΞΕΩΝ";} if ($ADD==550) {$hh='users'; echo "Φόρμα Αναζήτησης";} @@ -2480,11 +3662,19 @@ if ($ADD==660) {$hh='users'; echo "Αποτελέσματα Αναζήτησ if ($ADD==661) {$hh='users'; echo "ΑΝΑΖΗΤΗΣΗ ΑΠΟΤΕΛΕΣΜΑΤΩΝ ΤΗΛΕΦΩΝΩΝ";} if ($ADD==99999) {$hh='users'; echo "ΒΟΗΘΕΙΑ";} if ($ADD==999999) {$hh='reports'; echo "ΑΝΑΦΟΡΕΣ";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "Αλλαγή κωδικού πρόσβασης";} +if ($ADD==999996) {$hh='reports'; echo "Αρχική εγκατάσταση ΚΑΛΩΣ ΗΡΘΑΤΕ";} +if ($ADD==999995) {$hh='reports'; echo "ΠΝΕΥΜΑΤΙΚΑ ΔΙΚΑΙΩΜΑΤΑ άδεια εκμετάλλευσης σήματος";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "ΣΤΑΤΙΣΤΙΚΑ ΠΕΡΙΛΗΨΗ";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM ΣΤΑΤΙΣΤΙΚΑ ΠΕΡΙΛΗΨΗ";} -if ( ($ADD>9) && ($ADD < 99998) ) + +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; @@ -2499,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; @@ -2515,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -2529,30 +3719,17 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2569,45 +3746,57 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; } - else {$campaign_rank = $SELECT_campaign_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2615,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -2645,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -2658,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2669,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2708,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2716,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>Εισερχόμενα GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2739,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -2748,37 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; } - else {$group_rank = $SELECT_group_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2811,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -2819,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -2832,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2847,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -2862,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; + if ( (eregi("-ALL",$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=''; @@ -2872,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPAIGNS-"; + } } if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) { @@ -2887,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPAIGNS - ΟΙ ΧΡΗΣΤΕΣ ΜΠΟΡΟΥΝ ΝΑ ΔΟΥΝ ΟΠΟΙΑΔΗΠΟΤΕ ΕΚΣΤΡΑΤΕΙΑ</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPAIGNS - ΟΙ ΧΡΗΣΤΕΣ ΜΠΟΡΟΥΝ ΝΑ ΔΟΥΝ ΟΠΟΙΑΔΗΠΟΤΕ ΕΚΣΤΡΑΤΕΙΑ</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPAIGNS - Οι χρήστες μπορούν να QC οποιαδήποτε καμπάνια</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - Οι χρήστες μπορούν να ANY QC εισερχόμενα ΟΜΑΔΑ</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2925,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -2957,10 +4188,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +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 from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2969,7 +4200,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n"; $o++; } } @@ -3008,7 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Κωδικός -</B> Σε αυτό το πεδίο τοποθετείται ο κωδικός του χρήστη στο VICIDIAL. Πρέπει να είναι τουλάχιστον 2 χαρακτήρες. + <B>Κωδικός -</B> Σε αυτό το πεδίο τοποθετείται ο κωδικός του χρήστη στο VICIDIAL. Πρέπει να είναι τουλάχιστον 2 χαρακτήρες. Ένας ισχυρός κωδικός πρόσβασης χρήστη θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. + + <BR> + <A NAME="vicidial_users-force_change_password"> + <BR> + <B>Δύναμη Αλλαγή κωδικού πρόσβασης -</B> Εάν αυτή η επιλογή έχει οριστεί σε y και στη συνέχεια ο χρήστης θα σας ζητηθεί να αλλάξετε τον κωδικό πρόσβασης τους την επόμενη φορά που θα συνδεθείτε με την ιστοσελίδα διοίκηση. Προεπιλογή είναι N. <BR> <A NAME="vicidial_users-full_name"> @@ -3040,6 +4276,11 @@ if ($ADD==99999) <BR> <B>Ενεργή - </B> Το πεδίο αυτό καθορίζει αν ο χρήστης είναι ενεργός στο σύστημα και μπορεί να χρησιμοποιήσει VICIDIAL πόρων. Προεπιλεγμένο είναι Y + <BR> + <A NAME="vicidial_users-voicemail_id"> + <BR> + <B>Ταυτότητα φωνητικού ταχυδρομείου -</B> Αυτό είναι το κιβώτιο φωνητικού ταχυδρομείου που καλεί θα κατευθυνθεί σε μια -ομάδα AGENTDIRECT στο χρόνο πτώσης εάν η -ομάδα θέτει τη μέθοδο πτώσης καθορισμένη το ΦΩΝΗΤΙΚΌ ΤΑΧΥΔΡΟΜΕΊΟ και τον τομέα φωνητικού ταχυδρομείου AGENTVMAIL. + <BR> <A NAME="vicidial_users-optional"> <BR> @@ -3055,10 +4296,15 @@ if ($ADD==99999) <BR> <B>Ο πράκτορας επιλέγει Ingroups -</B> εάν θέσετε σε 1 αυτή την επιλογή επιτρέπει στο χρήστη να επιλέξει τις εισ-ομάδες που θα λάβουν τις κλήσεις. Διαφορετικά ο Manager θα πρέπει να το θέσει αυτό στην σελίδα διαχείρισης. + <BR> + <A NAME="vicidial_users-agent_choose_blended"> + <BR> + <B>Ο πράκτορας επιλέγει συνδυασμένος -</B> Αυτή η επιλογή εάν θέστε 1 επιτρέπει στο χρήστη για να επιλέξει εάν ο πράκτορας θέτει την εκστρατεία τους συνδυασμένη ή όχι, και εάν όχι έπειτα η συνδυασμένη προεπιλογή ρύθμιση θα χρησιμοποιηθεί. Η προεπιλογή είναι 1 για επιτρεμμένος. + <BR> <A NAME="vicidial_users-agent_choose_territories"> <BR> - <B>Agent Επιλέξτε Εδάφη -</B> Αυτή η επιλογή αν οριστεί σε 1 επιτρέπει στο χρήστη να επιλέξει τις περιοχές που θα λάβουν κλήσεις από όταν συνδεθείτε με ένα εγχειρίδιο ή Εισερχόμενα_MAN καμπάνια. Αντίθετη περίπτωση ο χρήστης θα πρέπει να ρυθμιστεί να χρησιμοποιεί όλα τα εδάφη που έχουν οριστεί σε ανήκουν στο χρήστη Εδάφη διοικητική ενότητα. + <B>Agent Επιλέξτε Εδάφη -</B> Αυτή η επιλογή αν οριστεί σε 1 επιτρέπει στο χρήστη να επιλέξει τις περιοχές που θα λάβουν κλήσεις από όταν συνδεθείτε με ένα εγχειρίδιο ή INBOUND_MAN καμπάνια. Αντίθετη περίπτωση ο χρήστης θα πρέπει να ρυθμιστεί να χρησιμοποιεί όλα τα εδάφη που έχουν οριστεί σε ανήκουν στο χρήστη Εδάφη διοικητική ενότητα. <BR> <A NAME="vicidial_users-scheduled_callbacks"> @@ -3107,6 +4353,16 @@ if ($ADD==99999) <BR> <B>Agent Shift Επιβολή Override -</B> Η ρύθμιση αυτή θα αντικαταστήσει τους χρήστες ανεξάρτητα από την ομάδα χρηστών που έχει για την εκτέλεση Shift. DISABLED θα χρησιμοποιήσει ο χρήστης ομάδα ρύθμιση. OFF δεν θα επιβάλει σε όλες τις βάρδιες. START θα επιβάλει μόνο το χρόνο σύνδεσης, αλλά δεν θα επηρεάσει έναν πράκτορα που εκτελεί τους πάνω μετατόπιση του χρόνου και αν είναι ήδη συνδεδεμένος in. ALL θα επιβάλλει μετατόπιση χρόνος έναρξης και θα συνδεθείτε ορίζονται μετά από έναν πράκτορα που τρέχουν πάνω από το τέλος του χρόνου τους βάρδια. Η προεπιλογή είναι άτομα με ειδικές ανάγκες. + <BR> + <A NAME="vicidial_users-agent_call_log_view_override"> + <BR> + <B>Συμπληρωματική προμήθεια άποψης κούτσουρων κλήσης πρακτόρων -</B> Αυτή η ρύθμιση θα αγνοήσει οποιου δήποτε η ομάδα χρηστών χρηστών έχει θέσει για την άποψη κούτσουρων κλήσης πρακτόρων. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΆΓΚΕΣ θα χρησιμοποιήσουν τη ρύθμιση ομάδας χρηστών. Το Ν δεν θα επιτρέψει κούτσουρο κλήσης χρηστών. Το Υ θα επιτρέψει κούτσουρο κλήσης χρηστών. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Πράκτορας Παράκαμψη Αναζήτηση μόλυβδο -</B> Αυτή η ρύθμιση θα αντικαταστήσει ό, τι η καμπάνια έχει οριστεί για αναζήτηση μολύβδου γραφείο. NOT_ACTIVE θα χρησιμοποιήσει τη ρύθμιση της καμπάνιας. Έδωσε τη δυνατότητα θα επιτρέπει την αναζήτηση και μολύβδου ΑΝΑΠΗΡΙΑ δεν θα επιτρέψει σε μόλυβδο αναζήτηση. Η προεπιλογή είναι NOT_ACTIVE. + <BR> <A NAME="vicidial_users-alert_enabled"> <BR> @@ -3118,9 +4374,14 @@ if ($ADD==99999) <B>Επιτρέψτε Alerts -</B> Αυτό το πεδίο σας δίνει τη δυνατότητα να επιτρέψει browser πράκτορα ειδοποιήσεις για να ενεργοποιηθεί από το πρακτορείο για κλήσεις όταν έρχονται σε vicidial.php συνεδρία τους. Προεπιλογή είναι 0 για το NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων campaign_rank. Επίσης σε αυτό το τμήμα της WEB VARs για κάθε καμπάνια. Αυτά επιτρέπουν κάθε παράγοντα να έχει μια διαφορετική μεταβλητή συμβολοσειρά που μπορεί να προστεθεί στην ηλεκτρονική φόρμα ή SCRIPT καρτέλα URLs από απλά θέτοντας - Α - web_vars - Β - όπως θα την κάθε άλλο τομέα. + <B>Προκαθορισμένη Αναζήτηση Επικοινωνία -</B> Αν ο χρήστης έχει συνδεθεί σε μια καμπάνια που έχει Προεπιλογές μεταφοράς που να ΕΠΙΚΟΙΝΩΝΙΑ, τότε αυτή η ρύθμιση μπορεί να απενεργοποιήσετε την αναζήτηση επαφών για αυτόν τον χρήστη μόνο. Προεπιλογή είναι NOT_ACTIVE που θα χρησιμοποιήσει ό, τι η ρύθμιση της καμπάνιας είναι. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων campaign_rank. Επίσης σε αυτό το τμήμα της WEB VARs για κάθε καμπάνια. Αυτά επιτρέπουν κάθε παράγοντα να έχει μια διαφορετική μεταβλητή συμβολοσειρά που μπορεί να προστεθεί στην ηλεκτρονική φόρμα ή SCRIPT καρτέλα URLs από απλά θέτοντας - Α - web_vars - Β - όπως θα την κάθε άλλο τομέα. Ένας άλλος τομέας σε αυτή την ενότητα είναι η ποιότητα, η οποία επιτρέπει την campaign_grade_random Επόμενη πάρε τηλέφωνο ρύθμιση που πρέπει να χρησιμοποιούνται. Ο βαθμός αυτός ρύθμιση θα αυξήσετε ή να μειώσετε την πιθανότητα ότι ο πράκτορας θα λάβει την κλήση. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3140,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Custom χρήστη Κενά -</B> Αυτές οι πέντε τομείς που μπορούν να χρησιμοποιηθούν για διάφορους σκοπούς, και μπορούν να κατοικείται σε διευθύνσεις φόρμα και σενάρια ως user_custom_one και ούτω καθεξής. + <B>Custom χρήστη Κενά -</B> Αυτές οι πέντε τομείς που μπορούν να χρησιμοποιηθούν για διάφορους σκοπούς, και μπορούν να κατοικείται σε διευθύνσεις φόρμα και σενάρια ως user_custom_one και ούτω καθεξής. Η Προσαρμοσμένη 5 πεδίο μπορεί να χρησιμοποιηθεί ως ένα πεδίο για να καθορίσει μια σειρά dialplan να στείλετε μια κλήση σε ένα από AGENTDIRECT στην ομάδα, αν ο χρήστης δεν είναι διαθέσιμη, το μόνο που χρειάζεται να βάλετε AGENTEXT στον τομέα ΜΗΝΥΜΑ ή παράταση της AGENTDIRECT στην ομάδα και το σύστημα θα κοιτάξει το έθιμο των πέντε τομέων και να στείλει την κλήση σε αυτό τον αριθμό dialplan. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3187,6 +4448,15 @@ if ($ADD==99999) <B>Εισαγωγή Οδηγών -</B> εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να εισάγει τους οδηγούς στον πίνακα vicidial_list μέσω του βασισμένου σε Ιστοσελίδα Εισαγωγέα οδηγών. <?php } + if ($SScustom_fields_enabled > 0) + { + ?> + <BR> + <A NAME="vicidial_users-custom_fields_modify"> + <BR> + <B>Οι τομείς συνήθειας τροποποιούν -</B> Αυτή η επιλογή εάν θέστε 1 επιτρέπει στο χρήστη για να τροποποιήσει τους τομείς καταλόγων συνήθειας. + <?php + } ?> <BR> @@ -3323,13 +4593,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Εξαγωγή Εκθέσεις -</B> Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει την πρόσβαση του διευθυντή της εξαγωγής κλήση εκθέσεις σχετικά με τις εκθέσεις της οθόνης. Η προεπιλογή είναι 0. Για την εξαγωγή ζητεί έκθεση, ώστε τα ακόλουθα τομέα χρησιμοποιείται για τις εξαγωγές: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Εξαγωγή Εκθέσεις -</B> Η ρύθμιση αυτή εφόσον έχει καθοριστεί στο 1 θα επιτρέψει σε έναν διαχειριστή να έχουν πρόσβαση στην κλήση των εξαγωγών και των εκθέσεων οδηγούν στην οθόνη ΕΚΘΕΣΕΙΣ. Η προεπιλογή είναι 0. Για την εξαγωγή κλήσεις και οδηγεί εκθέσεις, η ακόλουθη σειρά πεδίο χρησιμοποιείται για τις εξαγωγές: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> <BR> <B>Διαγραφή DNC Από Λίστες -</B> Αυτή η ρύθμιση, εάν οριστεί σε 1 θα επιτρέψει έναν διευθυντή για την άρση των αριθμούς τηλεφώνου από τους καταλόγους DNC στο VICIDIAL σύστημα. + <BR> + <A NAME="vicidial_users-realtime_block_user_info"> + <BR> + <B>Σε πραγματικό χρόνο πληροφορίες χρηστών φραγμών -</B> Αυτή η ρύθμιση εάν θέστε 1 θα εμποδίσει τις πληροφορίες χρηστών και σταθμών από την επίδειξη στη σε πραγματικό χρόνο έκθεση. Η προεπιλογή είναι 0 για τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Τροποποίηση ίδιο επίπεδο χρήστη -</B> Αυτή η ρύθμιση ισχύει μόνο για τους χρήστες Επίπεδο 9. Αν ενεργοποιηθεί επιτρέπει το επίπεδο 9 στο χρήστη να τροποποιήσει τις δικές τους ρυθμίσεις, καθώς και άλλες επίπεδο 9 χρήστες. Η προεπιλογή είναι 1 για ενεργοποίηση. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Διαχειριστής Απόκρυψη μολύβδου Δεδομένων -</B> Αυτή η ρύθμιση ισχύει μόνο για το επίπεδο 7, 8 και 9 χρήστες. Αν είναι ενεργοποιημένο το αντικαθιστά τα δεδομένα των πελατών οδηγούν σε πολλές εκθέσεις και τις οθόνες του συστήματος με Xs. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Διαχειριστής Απόκρυψη Στοιχεία Τηλεφώνου -</B> Αυτή η ρύθμιση ισχύει μόνο για το επίπεδο 7, 8 και 9 χρήστες. Αν είναι ενεργοποιημένο αντικαθιστά τους αριθμούς τηλεφώνου των πελατών σε πολλές εκθέσεις και τις οθόνες του συστήματος με Xs. Οι ρυθμίσεις ΨΗΦΙΑ θα παρουσιάσει μόνο τα τελευταία ψηφία Χ του αριθμού τηλεφώνου. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + @@ -3352,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Περιγραφή εκστρατείας -</B> αυτό είναι ένας τομέας υπομνημάτων γιατην εκστρατεία, είναι προαιρετικό και μπορεί να είναι έναμέγιστο 255 χαρακτήρων στο μήκος. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για την εκστρατεία αυτή, αυτό επιτρέπει την προβολή του διαχειριστή αυτής της εκστρατείας, καθώς και οι λίστες έχουν ανατεθεί σε αυτήν την εκστρατεία που θα περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε διαχειριστή χρήστη με δικαιώματα εκστρατεία ομάδα χρηστών για να δείτε αυτήν την εκστρατεία. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -3368,10 +4663,20 @@ if ($ADD==99999) <B>Ημερομηνία τελευταίας Καμπάνια Call -</B> Αυτή είναι η τελευταία φορά που μια κλήση αυτή γίνεται από έναν πράκτορα συνδεθεί σε αυτή την καμπάνια. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Μέγιστη Ημερήσια Στατιστικά -</B> Αυτές είναι οι στατιστικές που παράγονται από το σύστημα κάθε μέρα όλη την ημέρα μέχρι το τέλος χρονομέτρησης της ημέρας, όπως έχει οριστεί στις ρυθμίσεις συστήματος. Οι αριθμοί αυτοί προκύπτουν από τα αρχεία στο σύστημα να καταστεί δυνατή η εμφάνιση πολύ πιο γρήγορα. Περιλαμβάνονται τα στατιστικά είναι - Σύνολο καλεί, Μέγιστο Πράκτορες, Μέγιστη εισερχόμενες κλήσεις, εξερχόμενες κλήσεις Μέγιστη. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_ανανέωσης"> <BR> <B>Η εκστρατεία Stats αναζωογονεί -</B> αυτό το τετραγωνίδιο θαεπιτρέψει ότι για να αναγκάσετε τα vicidial statsαναζωογονείτε, ακόμα κι αν η εκστρατεία δεν είναι ενεργός. + <BR> + <A NAME="vicidial_campaigns-realtime_agent_time_stats"> + <BR> + <B>Real-Time Χρονικά Στατιστικά γραφείο -</B> Ορίζοντας αυτό σε τίποτα, όμως είναι απενεργοποιημένα θα επιτρέψει τη συλλογή των στατιστικών στοιχείων χρόνο παράγοντα για σήμερα για την εκστρατεία αυτή, που είναι ορατά μέσα από το Real-Time έκθεση. ΚΑΛΕΙ είναι ο μέσος όρος καλεί διακινούνται ανά πράκτορα, ΑΝΑΜΟΝΗ είναι ο μέσος χρόνος αναμονής πράκτορα, CUST είναι ο μέσος χρόνος ομιλίας των πελατών, ACW είναι ο μέσος χρόνος εργασίας Μετά από πρόσκληση, PAUSE είναι ο μέσος χρόνος παύσης. Προεπιλογή είναι απενεργοποιημένη. + <BR> <A NAME="vicidial_campaigns-active"> <BR> @@ -3380,17 +4685,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Τηλ.Σύνδεση Στάθμευσης -</B> Εδώ μπορείτε να ορίσετε την μουσική αναμονής για το VICIDIAL. Επιβεβαιώστε, ότι η εσωτ.σύνδεση βρίσκεται στο extensions.conf και ότι δείχνει το αρχείο παρακάτω. + <B>Πάρκο Μουσική-on-Hold -</B> Αυτό είναι όπου μπορείτε να ορίσετε την on-hold πλαίσιο μουσική για αυτή την καμπάνια. Βεβαιωθείτε ότι έχετε επιλέξει μια έγκυρη μουσική σε αναμονή πλαίσιο από την λίστα επιλογής και ότι το πλαίσιο που έχετε επιλέξει έχει έγκυρη αρχεία σε αυτό. Προεπιλογή είναι προεπιλογή. <BR> <A NAME="vicidial_campaigns-park_file_name"> <BR> - <B>ν Αρχείου Στάθμευσης -</B> Εδώ μπορείτε να προσαρμόσετε την μουσική αναμονής για το VICIDIAL. Επιβεβαιώστε ότι το αρχείο έχει 10 χαρακτήρες ή λιγότερους και ότι το αρχείο βρίσκεται στον κατάλογο /var/lib/asterisk/sounds. + <B>Park File Name -</B> NOT USED. <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Ιστοσελίδα -</B> Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυτήν την ομάδα. Για να προσαρμόσετε το ερώτημα string μετά την ηλεκτρονική φόρμα, απλά αρχίζει την ηλεκτρονική φόρμα με VAR και στη συνέχεια τη διεύθυνση URL που θέλετε να χρησιμοποιήσετε, σε αντικατάσταση των μεταβλητών με τις ονομασίες των μεταβλητών που θέλετε να χρησιμοποιήσετε - Α - phone_number - Β -- όπως ακριβώς και στην καρτέλα scripts τμήμα. + <B>Ιστοσελίδα -</B> Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυτήν την ομάδα. Για να προσαρμόσετε το ερώτημα string μετά την ηλεκτρονική φόρμα, απλά αρχίζει την ηλεκτρονική φόρμα με VAR και στη συνέχεια τη διεύθυνση URL που θέλετε να χρησιμοποιήσετε, σε αντικατάσταση των μεταβλητών με τις ονομασίες των μεταβλητών που θέλετε να χρησιμοποιήσετε - Α - phone_number - Β -- όπως ακριβώς και στην καρτέλα scripts τμήμα. Αν θέλετε να χρησιμοποιήσετε προσαρμοσμένα πεδία σε μια διεύθυνση ιστού μορφή, θα πρέπει να προσθέσετε &CF_uses_custom_fields=Y ως μέρος του URL σας. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -3451,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Ξεκινά με την Ανατολική χρονικών ζωνών και έργα Δύση <BR>   - DOWN TIMEZONE: Ξεκινά με τα δυτικά χρονικών ζωνών και των έργων Ανατολή + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Παραγγελία Λίστα Τυχαία -</B> Αυτή η επιλογή σας επιτρέπει να τυχαιοποιήσουμε τη σειρά των οδηγεί στη χοάνη του φορτίου εντός των αποτελεσμάτων καθορίζονται από τα ανωτέρω κριτήρια. Για παράδειγμα, η σειρά των ονομάτων θα πρέπει να διατηρηθεί, αλλά τα αποτελέσματα θα είναι τυχαία εντός της εν λόγω ταξινόμησης. Η ρύθμιση αυτής της επιλογής στο Y θα επιτρέψει αυτή τη δυνατότητα. Προεπιλογή N για άτομα με ειδικές ανάγκες. ΣΗΜΕΙΩΣΗ, εάν έχετε έναν μεγάλο αριθμό οδηγεί αυτή η επιλογή μπορεί να επιβραδύνει την ταχύτητα του σεναρίου χοάνη φόρτωσης. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Παραγγελία Λίστα Δευτεροβάθμια -</B> Αυτή η επιλογή σας επιτρέπει να επιλέξετε τη δεύτερη σειρά ταξινόμησης των οδηγεί στο φορτίο χοάνη μετά τη σειρά των ονομάτων και εντός των αποτελεσμάτων καθορίζονται από τα ανωτέρω κριτήρια. Για παράδειγμα, η σειρά των ονομάτων θα χρησιμοποιηθεί για την πρώτη του είδους των αγωγών, αλλά τα αποτελέσματα θα ταξινομούνται για δεύτερη φορά εντός του εν λόγω ταξινόμηση σε ολόκληρη την ίδια σειρά της πρώτης Τάξης λίστα. Για παράδειγμα, εάν έχετε Παραγγελία Λίστα που να ΚΑΤΩ COUNT και έχετε μόνο τους μολύβδους που έχουν επιχειρήσει 1 και 2 φορές, στη συνέχεια, αν έχετε τη σειρά των ονομάτων Δευτεροβάθμια σύνολο LEAD_ASCEND σε όλες τις οδηγεί απόπειρα 1 θα ταξινομηθούν από τα παλαιότερα καλώδια πρώτο και θα τεθεί στη χοάνη με αυτόν τον τρόπο. Προεπιλογή LEAD_ASCEND. ΣΗΜΕΙΩΣΗ, εάν έχετε έναν μεγάλο αριθμό οδηγεί χρησιμοποιώντας μία από τις επιλογές μπορεί να CALLTIME επιβραδύνει την ταχύτητα του σεναρίου χοάνη φόρτωσης. Αν Παραγγελία Λίστα Τυχαία είναι ενεργοποιημένη, η επιλογή αυτή θα πρέπει να αγνοηθεί. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Επίπεδο Hopper -</B> Αυτό είναι το πόσους οδηγούς η διαδικασία VDhopper, προσπαθεί να διατηρήσει στον πίνακα vicidial_hopper για αυτήν την εκστρατεία. Εάν η διαδικασία VDhopper τρέχει κάθε λεπτό, ρυθμίστε αυτό λίγο περισσότερο από τον αριθμό των οδηγών που περνούν σε ένα λεπτό. + <B>Ελάχιστο Επίπεδο Χόπερ -</B> Αυτός είναι ο ελάχιστος αριθμός των οδηγεί το σενάριο VDhopper προσπαθεί να κρατήσει στον πίνακα vicidial_hopper για αυτή την καμπάνια. Εάν η εκτέλεση του σεναρίου VDhopper κάθε λεπτό, κάνουν αυτό το ελαφρώς μεγαλύτερο από τον αριθμό των οδηγεί περνάτε σε ένα λεπτό. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Αυτόματη Επίπεδο Χόπερ -</B> Ρύθμιση αυτό θα επιτρέψει Υ Vicidial να προσαρμόζει αυτόματα τη χοάνη που βασίζονται στα ανοικτά τις ρυθμίσεις που έχετε στην καμπάνια σας. Ο τύπος χρησιμοποιεί για να γίνει αυτό είναι:<BR>Number of Ενεργό Πράκτορες * ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ * ( 60 seconds / Κλήση εκτός χρόνου ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Αυτόματη Πολλαπλασιαστής Χόπερ -</B> Αυτό είναι πολλαπλασιαστής για τον Χόπερ Auto. Η ρύθμιση αυτής της λιγότερο από το 1 θα προκαλέσει ο αλγόριθμος Χόπερ Αυτόματη να φορτώσει οδηγεί λιγότερο από ό, τι συνήθως. Ρύθμιση αυτό υπερβαίνει το 1 θα προκαλέσει ο αλγόριθμος Χόπερ Αυτόματη να φορτώσει περισσότερο από ό, τι οδηγεί κανονικά. Προεπιλογή είναι 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Αυτόματη Περικοπή Χόπερ -</B> Ρύθμιση αυτό θα επιτρέψει Υ Vicidial να αφαιρέσετε αυτόματα επιπλέον οδηγεί από τη χοάνη. Προεπιλογή είναι Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Χόπερ VLC Dup Έλεγχος -</B> Ρύθμιση αυτό Υ θα έχει ως αποτέλεσμα σε κάθε μόλυβδο που ενσωματώνεται στην χοάνη που ελέγχονται από vendor_lead_code να βεβαιωθείτε ότι δεν υπάρχει εις διπλούν οδηγεί εισάγεται με την ίδια vendor_lead_code. Αυτό είναι πολύ χρήσιμο όταν Auto-Alt-Κλήση με MULTI_LEAD. Προεπιλογή είναι N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Φίλτρο Οδηγοιύ -</B> αυτή είναι μία μέθοδος για να δημιουργήτε φίλτρα για την SQL ερώτηση. Χρησιμοποιήστε αυτό το χαρακτηριστικό με προσοχή, είναι εύκολο να σταματήσει το σύστημα με μία μικρή αλλαγή στη δήλωση SQL. Η προεπιλογή είναι ΚΑΜΙΑ. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Αριθμός Κλήσεων Όριο -</B> Αυτό επιβάλλει ένα όριο στον αριθμό των προσπαθειών κλήσης για τις εξερχόμενες οδηγεί σε αυτή την εκστρατεία. Ο μόλυβδος μπορεί να πάει πέρα ​​από αυτό το όριο, αν ελαφρώς ανακύκλωση μολύβδου ή Auto-Alt-κλήσης είναι ενεργοποιημένη. Η προεπιλογή είναι 0 για χωρίς όριο. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Αριθμός Κλήσεων στόχος -</B> Η επιλογή αυτή χρησιμοποιείται μόνο για σκοπούς αναφοράς και δεν έχει καμία επίδραση στις εξερχόμενες οδηγεί. Προεπιλογή είναι 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -3477,18 +4822,28 @@ if ($ADD==99999) <B>Μέθοδος Κλήσης -</B> This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Μέθοδος Κλήσης is changed. If RATIO then the normal dialing a number of lines for Ενεργό agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. Δεν μπορείτε να αλλάξετε το επίπεδο Αυτόματης Κλήσης, εάν έχετε ορίσει κάποια μέθοδο Προσαρμογής Κλήσεων. Μόνο ο διακομιστής μπορεί να το αλλάξει όταν είναι σε διαδικασία αυτόματων κλήσεων. -. Εισερχόμενα_MAN επιτρέπει στον αντιπρόσωπο να πραγματοποιηθεί χειροκίνητη κλήση κλήσεις από μια εκστρατεία λίστα, ενώ είναι σε θέση να λάβει εισερχόμενη κλήση κλήσεις μεταξύ εγχειρίδιο κλήσεις. +. INBOUND_MAN επιτρέπει στον αντιπρόσωπο να πραγματοποιηθεί χειροκίνητη κλήση κλήσεις από μια εκστρατεία λίστα, ενώ είναι σε θέση να λάβει εισερχόμενη κλήση κλήσεις μεταξύ εγχειρίδιο κλήσεις. <BR> <A NAME="vicidial_campaigns-auto_dial_level"> <BR> <B>Επίπεδο Αυτόματης Κλήσης -</B> Εδώ είναι που καθορίζεται πόσες γραμμές θα χρησιμοποιούνται ανά ενεργό χρήστη. Μηδέν (0) σημαίνει ότι η αυτόματη κλήση είναι μη ενεργή και οι χρήστες πατούν το πλήκτρο για την κλήση κάθε αριθμού. Διαφορετικά, το σύστημα καλεί γραμμές ίσες με τους ενεργούς χρήστες, πολλαπλασιασμένους με το επίπεδο κλήσης και σύμφωνα με το πόσες γραμμές η εκστρτεία σε κάθε διακομιστή επιτρέπει. Το ADAPT τετραγωνίδιο ΣΥΜΠΛΗΡΩΜΑΤΙΚΗΣ ΠΡΟΜΉΘΕΙΑΣ επιτρέπει σεσας για να αναγκάσει ένα νέο επίπεδο πινάκων ακόμα κι αν ημέθοδος πινάκων είναι σε έναν ADAPT τρόπο. Αυτό είναιχρήσιμο εάν υπάρχει μια δραματική μετατόπιση στην ποιότητα τωνμολύβδων και θέλετε να αλλάξετε δραστικά το dial_level με τοχέρι. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Αυτόματη Κατώφλι Επίπεδο Dial -</B> Αυτή η ρύθμιση λειτουργεί μόνο με μία προσαρμογή ή ΑΝΑΛΟΓΙΑ Μέθοδος κλήσης, και πρέπει να ρυθμιστεί σε κάτι άλλο εκτός από ειδικές ανάγκες και ο αριθμός των πρακτόρων ρύθμιση πρέπει να είναι πάνω από 0. Αυτό το χαρακτηριστικό σας επιτρέπει να ορίσετε ένα ελάχιστο αριθμό παραγόντων ότι ο αλγόριθμος πρόβλεψης θα δουλέψει σε. Εάν ο αριθμός των αντιπροσώπων δεν εμπίπτει κάτω από τον αριθμό που έχετε ορίσει, τότε το επίπεδο καντράν θα πάει στο 1,0 μέχρι περισσότερους πράκτορες ή συνδεθείτε μεταβεί στην επιλεγμένη κατάσταση. Καταγράφηκε-IN_AGENTS θα μετράνε όλα τα παράγοντες συνδεδεμένοι με την εκστρατεία, ΜΗ PAUSED_AGENTS θα υπολογίζονται μόνον οι παράγοντες που είναι σε αναμονή ή να μιλάει, και WAITING_AGENTS θα μετρήσει μόνο παράγοντες που περιμένουν για μια κλήση. Προεπιλογή είναι απενεργοποιημένη. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Διαθέσιμα μόνο ετικέτες -</B> Εάν θέσετε σε Ν αυτό το πεδίο, θα αφήσει εκτός τις καταστάσεις των χειριστών out INCALL και QUEUE, καθώς υπολογίζεται ο αριθμός των κλήσεων όταν δεν είναι σε κατάσταση κλήσης MANUAL. Προκαθορισμένα είναι Ο. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Διαθέσιμο μόνο Κατώφλι Tally -</B> Αυτή η ρύθμιση λειτουργεί μόνο με μία προσαρμογή ή ΑΝΑΛΟΓΙΑ Μέθοδος κλήσης, Διαθέσιμο μόνο Tally πρέπει να οριστεί σε Ν, η ρύθμιση αυτή πρέπει να ρυθμιστεί σε κάτι άλλο εκτός από ειδικές ανάγκες και ο αριθμός των πρακτόρων ρύθμιση πρέπει να είναι πάνω από 0. Αυτό το χαρακτηριστικό σας επιτρέπει να ορίσετε τον αριθμό των πρακτόρων κάτω από το οποίο Διαθέσιμο μόνο Tally θα ενεργοποιηθεί. Εάν ο αριθμός των αντιπροσώπων δεν εμπίπτει κάτω από τον αριθμό που έχετε ορίσει, τότε η ρύθμιση Διαθέσιμο μόνο Tally με πάει σε Y προσωρινά μέχρι περισσότερους πράκτορες ή συνδεθείτε μεταβεί στην επιλεγμένη κατάσταση. Καταγράφηκε-IN_AGENTS θα μετράνε όλα τα παράγοντες συνδεδεμένοι με την εκστρατεία, ΜΗ PAUSED_AGENTS θα υπολογίζονται μόνον οι παράγοντες που είναι σε αναμονή ή να μιλάει, και WAITING_AGENTS θα μετρήσει μόνο παράγοντες που περιμένουν για μια κλήση. Προεπιλογή είναι απενεργοποιημένη. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -3512,7 +4867,13 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Επίπεδο Κλήσεων Μεταβολής Στόχου -</B> Αυτό το πεδίο χρησιμοποιείτε για να έχει στόχο ένα συγκεκριμένο αριθμό χειριστών να περιμένουν κλήσεις ή κλήσεις να περιμένουν για χειριστές. Π.χ. εάν θέλετε πάντα να έχετε κατά μέσο όρο έναν χειριστή ελεύθερο για ν παίρνει τις κλήσεις, τότε πρέπει να το θέσετε σε -1. Εάν στόχος είναι να έχετε πάντα μία κλήση σε αναμονή για ένα χειριστή, τότε πρέπει να το θέσετε σε 1. Προκαθορισμένα είναι 0. Αυτό το πεδίο δεν χρησιμοποιείται από τις μεθόδους MANUAL ή RATIO. + <B>Επίπεδο Κλήσεων Μεταβολής Στόχου + -</B> Το πεδίο αυτό χρησιμοποιείται για να καθορίσει αν θέλετε να στοχεύσετε με ένα συγκεκριμένο αριθμό παραγόντων περιμένει κλήσεις ή κλήσεις σε αναμονή για τους πράκτορες. Για παράδειγμα, αν θα αρέσει πάντα να έχουν κατά μέσο όρο ένα παράγοντα να λάβει δωρεάν καλεί αμέσως θα ορίσετε σε -1, αν θα θέλατε να στοχεύσετε έχοντας πάντα μία κλήση σε αναμονή περιμένοντας για έναν παράγοντα που θα οριστεί στο 1. Η προεπιλογή είναι 0. Το πεδίο αυτό δεν χρησιμοποιείται από το εγχειρίδιο ή INBOUND_MAN μεθόδους κλήσης. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Πληκτρολογήστε Επίπεδο Μέθοδος στόχος Διαφορά -</B> Αυτή η επιλογή σας επιτρέπει να ορίσετε αν το επίπεδο καντράν διαφορά στοχοθέτησης εφαρμόζεται μόνο για τον υπολογισμό του επιπέδου κλήσης ή επίσης με την πραγματική κλήση σε κάθε διακομιστή κλήση. Εάν εκτελείτε μια μικρή εκστρατεία με παράγοντες συνδεδεμένοι σε πολλούς servers μπορεί να θέλετε να χρησιμοποιήσετε την επιλογή ADAPT_CALC_ONLY, επειδή η CALLS_PLACED επιλογή μπορεί να οδηγήσει σε λιγότερες κλήσεις που τοποθετούνται από deisred. Αυτή η επιλογή είναι ενεργή μόνο όταν κλήσης στόχος Διαφορά επιπέδου έχει οριστεί σε κάτι άλλο από 0. Η προεπιλογή είναι ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -3522,17 +4883,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>Κοτσίδας Προτεραιότητα - </B> Αυτή η ρύθμιση χρησιμοποιείται για να καθορίσει τη σειρά με την οποία οι εξερχόμενες κλήσεις από αυτή την εκστρατεία θα πρέπει να απαντηθούν σε σχέση με τις εισερχόμενες κλήσεις αν η συγκεκριμένη καμπάνια είναι αναμεμειγμένο σε λειτουργία. + <B>Κοτσίδας Προτεραιότητα - </B> Αυτή η ρύθμιση χρησιμοποιείται για να καθορίσει τη σειρά με την οποία οι εξερχόμενες κλήσεις από αυτή την εκστρατεία θα πρέπει να απαντηθούν σε σχέση με τις εισερχόμενες κλήσεις αν η συγκεκριμένη καμπάνια είναι αναμεμειγμένο σε λειτουργία. Δεν συνιστάται η ρύθμιση εισερχόμενες κλήσεις σε υψηλότερη προτεραιότητα από τις εξερχόμενες κλήσεις, επειδή οι άνθρωποι της εκστρατείας καλώντας σε περιμένουν να περιμένουν και οι άνθρωποι που καλούνται να περιμένετε για κάποιον να είναι εκεί στο τηλέφωνο. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> <BR> <B>Πολλαπλές Καμπάνια Drop Rate Ομάδα -</B> Αυτό το χαρακτηριστικό σας επιτρέπει να ορίσετε μια καμπάνια ως μέλος μιας καμπάνιας Drop Τιμή Ομάδα, ή μια ομάδα από τις καμπάνιες του Ανθρώπου Απαντήθηκε οποίων κλήσεις και κλήσεις Πτώση για όλες τις καμπάνιες της ομάδας θα πρέπει να συνδυαστούν σε ένα κοινό ποσοστό πτώσης, ή να εγκαταλείψει ρυθμό. Αυτό σας επιτρέπει να εκτελέσετε με πολλαπλές καμπάνιες ταυτόχρονα και πιο εύκολα τον έλεγχο ποσοστού πτώση σας. Αυτό είναι ιδιαίτερα χρήσιμο στο Ηνωμένο Βασίλειο, όπου κανονισμοί επιτρέπουν μείωση του ποσοστού αυτού με τη μέθοδο υπολογισμού της καμπάνιας ομάδα για την ίδια εταιρεία, ακόμη και αν υπάρχουν διάφορες καμπάνιες της εταιρείας που εκτελεί κατά τη διάρκεια της ίδιας ημέρας. Για να ενεργοποιήσετε αυτή για μια καμπάνια, απλά επιλέξτε μια ομάδα από τη λίστα. Υπάρχουν 10 ομάδες που ορίζονται στο σύστημα από προεπιλογή, μπορείτε να επικοινωνήσετε με το διαχειριστή του συστήματος για να προσθέσετε περισσότερο. Προεπιλογή είναι ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΕΣ ΑΝΑΓΚΕΣ. + <BR> + <A NAME="vicidial_campaigns-inbound_queue_no_dial"> + <BR> + <B>Εισερχόμενη σειρά αναμονής κανένας πίνακας -</B> Αυτό το χαρακτηριστικό γνώρισμα εάν θέστε επιτρέπει σε σας για να αποτρέψει τον εξερχόμενο αυτόματος-σχηματισμό αυτής της εκστρατείας εάν υπάρχουν οποιεσδήποτε εισερχόμενες κλήσεις που περιμένουν στη σειρά αναμονής που είναι μέρος των εισερχόμενων ομάδων που τίθενται σε αυτήν την εκστρατεία. Η ρύθμιση αυτού σε ALL_SERVERS θα αλλάξει τον αλγόριθμο για να υπολογίσει όλες τις εισερχόμενες κλήσεις όπως ενεργές κλήσεις σε αυτόν τον κεντρικό υπολογιστή ακόμα κι αν είναι σε έναν άλλο κεντρικό υπολογιστή που θα μειώσει την πιθανότητα τις περιττές εξερχόμενες κλήσεις εάν να έχοντας τις κλήσεις που μπαίνουν σε έναν άλλο κεντρικό υπολογιστή. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ. + <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Αυτόματος ALT-ARJCMO'S που σχηματίζει -</B> αυτή η ρύθμισηχρησιμοποιείται για να σχηματίσει αυτόματα τους εναλλάσσομαιτομείς αριθμού σχηματίζοντας σε ΑΝΑΛΟΓΙΑ και ΝΑ ΠΡΟΣΑΡΜΟΣΕΙ τιςμεθόδους πινάκων όταν δεν υπάρχει καμία επαφή στον κύριοτηλεφωνικό αριθμό για έναν μόλυβδο, τις θέσεις NA, β,συνεχούς ρεύματος και ν. Αυτή η ρύθμιση δεν χρησιμοποιείται με τηΧΕΙΡΩΝΑΚΤΙΚΗ μέθοδο πινάκων. EXTENDED αναπληρωματικών αριθμοί είναι αριθμοί που φορτώνονται στο σύστημα εκτός του κανονικού οδηγήσει πληροφορίες οθόνης. Χρησιμοποιώντας EXTENDED σας μπορεί να έχει εκατοντάδες αριθμούς τηλεφώνου για ένα μόνο πελάτη ρεκόρ. + <B>Αυτόματος ALT-ARJCMO'S που σχηματίζει -</B> αυτή η ρύθμισηχρησιμοποιείται για να σχηματίσει αυτόματα τους εναλλάσσομαιτομείς αριθμού σχηματίζοντας σε ΑΝΑΛΟΓΙΑ και ΝΑ ΠΡΟΣΑΡΜΟΣΕΙ τιςμεθόδους πινάκων όταν δεν υπάρχει καμία επαφή στον κύριοτηλεφωνικό αριθμό για έναν μόλυβδο, τις θέσεις NA, β,συνεχούς ρεύματος και ν. Αυτή η ρύθμιση δεν χρησιμοποιείται με τηΧΕΙΡΩΝΑΚΤΙΚΗ μέθοδο πινάκων. EXTENDED αναπληρωματικών αριθμοί είναι αριθμοί που φορτώνονται στο σύστημα εκτός του κανονικού οδηγήσει πληροφορίες οθόνης. Χρησιμοποιώντας EXTENDED σας μπορεί να έχει εκατοντάδες αριθμούς τηλεφώνου για ένα μόνο πελάτη ρεκόρ. Χρησιμοποιώντας MULTI_LEAD σας επιτρέπει να χρησιμοποιήσετε ένα ξεχωριστό αγωγό για κάθε αριθμό σε λογαριασμό πελάτη ότι όλοι μοιράζονται μια κοινή vendor_lead_code, και ο τύπος του αριθμού τηλεφώνου για κάθε ορίζεται με μια ετικέτα στον τομέα ιδιοκτήτη. Αυτή η επιλογή θα απενεργοποιήσετε μερικές επιλογές στην οθόνη Εκστρατεία Τροποποίηση και δείχνουν μια σύνδεση με το Multi-Alt σελίδα Ρυθμίσεις που σας επιτρέπει να ορίσετε τους τύπους αριθμό τηλεφώνου, που ορίζεται από την ετικέτα του κάθε μόλυβδο, θα κληθεί και με ποια σειρά. Αυτό θα δημιουργήσει ένα ειδικό φίλτρο για το μόλυβδο και θα αλλάξει το πεδίο Κατάταξη όλων των οδηγεί στο εσωτερικό των καταλόγων που σε αυτήν την εκστρατεία, προκειμένου να τους καλέσει στη σειρά που έχετε καθορίσει. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -3542,14 +4908,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Καμπάνια VDAD επέκταση -</B> Το πεδίο αυτό επιτρέπει για μια προσαρμοσμένη VDAD μεταφορά επέκταση. Αυτό σας επιτρέπει να χρησιμοποιήσετε διάφορες μεθόδους χειρισμού κλήσεων, ανάλογα με την καμπάνια σας. - - 8364 - 8368 ως ίδια - - 8365 - Θα στείλετε την πρόσκληση σε ένα μόνο παράγοντα στον ίδιο διακομιστή, όπως είναι η πρόσκληση για - - 8366 - Χρησιμοποιείται για Τύπο-1 εκστρατείες και έρευνα - - 8367 - Θα προσπαθήσουμε πρώτα να στείλετε την πρόσκληση σε έναν πράκτορα για τον τοπικό διακομιστή, τότε θα ψάξει για άλλους servers - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση ότι μετά, ίδια συμπεριφορά ως 8368 - - 8373 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση μετά την ίδια συμπεριφορά ως 8366 + <B>Παράταση δρομολόγησης -</B> Το πεδίο αυτό επιτρέπει μια προσαρμοσμένη εξερχόμενες επέκταση δρομολόγησης. Αυτό σας επιτρέπει να χρησιμοποιούν διαφορετικές μεθόδους για τον χειρισμό των κλήσεων ανάλογα με το πώς θέλετε να δρομολόγησης κλήσεων μέσω εξερχόμενων την καμπάνια σας. Παλαιότερα ονομαζόταν επέκταση VDAD Εκστρατεία. + <BR>- 8364 - ίδιο 8368 + <BR>- 8365 - Θα στείλετε την κλήση μόνο σε έναν πράκτορα στον ίδιο διακομιστή, όπως η κλήση τίθεται σε + <BR>- 8366 - Χρησιμοποιείται για Τύπου-1, εκπομπής και έρευνα εκστρατείες + <BR>- 8367 - Θα προσπαθήσει να στείλει για πρώτη φορά την κλήση σε έναν πράκτορα στον τοπικό υπολογιστή, τότε θα δούμε σε άλλους servers + <BR>- 8368 - DEFAULT - θα στείλει την κλήση στον επόμενο διαθέσιμο πράκτορα δεν έχει σημασία τι server στον οποίο είναι + <BR>- 8369 - Χρησιμοποιείται για την ανίχνευση Απάντηση Machine μετά από αυτό, ίδια συμπεριφορά όπως 8368 + <BR>- 8373 - Χρησιμοποιείται για την ανίχνευση Απάντηση μηχανή μετά από αυτή την ίδια συμπεριφορά όπως 8366 + <BR>- 8374 - Χρησιμοποιείται για Τύπου-1, εκπομπής και έρευνα εκστρατείες με σαφματικός κειμένου σε ομιλία + <BR>- 8375 - Χρησιμοποιείται για την ανίχνευση Machine Απάντηση στη συνέχεια πατήστε-1, εκπομπής και έρευνα εκστρατείες με σαφματικός κειμένου σε ομιλία <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -3584,13 +4952,23 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-drop_action"> <BR> - <B>Drop δράσης - </B> Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα Inbound που καθορίζονται κατωτέρω + <B>Drop δράσης - </B> Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα  εισερχόμενοςπου καθορίζονται κατωτέρω <BR> <A NAME="vicidial_campaigns-safe_harbor_exten"> <BR> <B>Εσωτ.σύνδεση Ασφαλούς Φύλαξης -</B> Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Ασφαλής Φύλαξης στον διακομιστή. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Ασφαλής ήχου Harbor -</B> Αυτή είναι η προτροπή ήχου αρχείο που παίζεται εάν η πτώση δράσης αναμένεται να AUDIO. Η προεπιλογή είναι buzz. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Ασφαλής Μενού κλήσεων Harbor -</B> Αυτό είναι το μενού κλήση ότι μια κλήση στέλνεται εάν η πτώση δράσης αναμένεται να CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -3609,12 +4987,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-no_hopper_dialing"> <BR> - <B>Δεν Hopper Κλήση -</B> Αν αυτή είναι ενεργοποιημένη, η χοάνη δεν θα ισχύσει για αυτή την καμπάνια. Αυτή η επιλογή είναι διαθέσιμη μόνο όταν η μέθοδος κλήσης έχει οριστεί σε Manual ή Εισερχόμενα_MAN. Συνιστάται να μην επιτρέψει αυτή την επιλογή εάν έχετε μια πολύ μεγάλη βάση δεδομένων μολύβδου, πάνω από 100.000 οδηγεί. Δεν με Hopper κλήσης, τα ακόλουθα χαρακτηριστικά δεν λειτουργούν: οδηγήσουν ανακύκλωση, auto-alt-κλήσης, μείγμα κατάλογο, λίστα παραγγελιών με XTH ΝΕΑ. Αν θέλετε να χρησιμοποιήσετε Ιδιοκτήτης Μόνο κλήσης θα πρέπει να έχετε Δεν Hopper Κλήση ενεργοποιημένη. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες. + <B>Δεν Hopper Κλήση -</B> Αν αυτή είναι ενεργοποιημένη, η χοάνη δεν θα ισχύσει για αυτή την καμπάνια. Αυτή η επιλογή είναι διαθέσιμη μόνο όταν η μέθοδος κλήσης έχει οριστεί σε Manual ή INBOUND_MAN. Συνιστάται να μην επιτρέψει αυτή την επιλογή εάν έχετε μια πολύ μεγάλη βάση δεδομένων μολύβδου, πάνω από 100.000 οδηγεί. Δεν με Hopper κλήσης, τα ακόλουθα χαρακτηριστικά δεν λειτουργούν: οδηγήσουν ανακύκλωση, auto-alt-κλήσης, μείγμα κατάλογο, λίστα παραγγελιών με XTH ΝΕΑ. Αν θέλετε να χρησιμοποιήσετε Ιδιοκτήτης Μόνο κλήσης θα πρέπει να έχετε Δεν Hopper Κλήση ενεργοποιημένη. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες. <BR> <A NAME="vicidial_campaigns-agent_dial_owner_only"> <BR> - <B>Ιδιοκτήτης Μόνο Κλήση -</B> Αν αυτή είναι ενεργοποιημένη, ο αντιπρόσωπος θα λάβουν μόνο οδηγεί ότι είναι εντός των παραμέτρων για την ιδιοκτησία. Εάν αυτό έχει οριστεί στην ΧΡΗΣΤΗ τότε ο πράκτορας πρέπει να καθορίζει ο χρήστης στη βάση δεδομένων, όπως ο ιδιοκτήτης αυτού του μολύβδου. Αν τεθεί στο έδαφος τότε ο ιδιοκτήτης του μολύβδου πρέπει να ταιριάζει με το έδαφος που περιλαμβάνεται στην οθόνη του χρήστη Τροποποίηση για αυτό παράγοντα. Εάν αυτό έχει οριστεί στην USER_GROUP τότε ο ιδιοκτήτης του μολύβδου πρέπει να ταιριάζει με την ομάδα χρηστών ότι ο αντιπρόσωπος είναι μέλος της. Για αυτήν τη δυνατότητα να εργαστεί με τη μέθοδο τηλεφωνικής σύνδεσης πρέπει να οριστεί σε Manual ή Εισερχόμενα_MAN και αριθ Χόπερ κλήσης πρέπει να είναι ενεργοποιημένα. Προεπιλογή είναι ΚΑΝΕΝΑ για άτομα με ειδικές ανάγκες. + <B>Ιδιοκτήτης Μόνο Κλήση -</B> Αν αυτή είναι ενεργοποιημένη, ο αντιπρόσωπος θα λάβουν μόνο οδηγεί ότι είναι εντός των παραμέτρων για την ιδιοκτησία. Εάν αυτό έχει οριστεί στην ΧΡΗΣΤΗ τότε ο πράκτορας πρέπει να καθορίζει ο χρήστης στη βάση δεδομένων, όπως ο ιδιοκτήτης αυτού του μολύβδου. Αν τεθεί στο έδαφος τότε ο ιδιοκτήτης του μολύβδου πρέπει να ταιριάζει με το έδαφος που περιλαμβάνεται στην οθόνη του χρήστη Τροποποίηση για αυτό παράγοντα. Εάν αυτό έχει οριστεί στην USER_GROUP τότε ο ιδιοκτήτης του μολύβδου πρέπει να ταιριάζει με την ομάδα χρηστών ότι ο αντιπρόσωπος είναι μέλος της. Για αυτήν τη δυνατότητα να εργαστεί με τη μέθοδο τηλεφωνικής σύνδεσης πρέπει να οριστεί σε Manual ή INBOUND_MAN και αριθ Χόπερ κλήσης πρέπει να είναι ενεργοποιημένα. Προεπιλογή είναι ΚΑΝΕΝΑ για άτομα με ειδικές ανάγκες. <?php if ($SSuser_territories_active > 0) @@ -3691,7 +5069,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Μέθοδος Έρευνα - </B> Αυτή η επιλογή καθορίζει τι θα συμβεί σε μια κλήση μετά ο πελάτης επέλεξε-in. AGENT_XFER θα αποστείλει την πρόσκληση για το επόμενο διαθέσιμο πράκτορα. Τηλεφωνητής θα αποστείλει την πρόσκληση προς το τηλεφωνητή θέση που καθορίζεται στο Τηλεφωνητής τομέα. ΕΠΕΚΤΑΣΗ θα στείλει ο πελάτης με την παράταση που ορίζεται στην έκθεση Xfer Επέκταση τομέα. HANGUP θα κλείσεις τον πελάτη. CAMPREC_60_WAV θα στείλει ο πελάτης να έχουμε μια καταγραφή που γίνεται με τους απάντηση, η καταγραφή αυτή θα πρέπει να τοποθετούνται σε ένα φάκελο με το όνομα, όπως η εκστρατεία στο εσωτερικό της καμπάνιας Έρευνα Καταγραφή Directory. + <B>Μέθοδος Έρευνα - </B> Αυτή η επιλογή καθορίζει τι θα συμβεί σε μια κλήση μετά ο πελάτης επέλεξε-in. AGENT_XFER θα αποστείλει την πρόσκληση για το επόμενο διαθέσιμο πράκτορα. Τηλεφωνητής θα αποστείλει την πρόσκληση προς το τηλεφωνητή θέση που καθορίζεται στο Τηλεφωνητής τομέα. ΕΠΕΚΤΑΣΗ θα στείλει ο πελάτης με την παράταση που ορίζεται στην έκθεση Xfer Επέκταση τομέα. HANGUP θα κλείσεις τον πελάτη. CAMPREC_60_WAV θα στείλει ο πελάτης να έχουμε μια καταγραφή που γίνεται με τους απάντηση, η καταγραφή αυτή θα πρέπει να τοποθετούνται σε ένα φάκελο με το όνομα, όπως η εκστρατεία στο εσωτερικό της καμπάνιας Έρευνα Καταγραφή Directory. CALLMENU θα στείλει τον πελάτη στο μενού Κλήση ορίζεται στην παρακάτω λίστα επιλέξτε. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -3726,7 +5104,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_third_audio_file"> <BR> - <B>Έρευνα Τρίτη Audio File -</B> Αυτό είναι το τρίτο αρχείο ήχου που πρέπει να διαδραματίζουν κατά την επιλογή από τον πελάτη της δυνατότητας τρίτο ψηφίο. + <B>Έρευνα Τρίτη αρχείου ήχου -</B> Αυτό είναι το τρίτο αρχείο ήχου που πρέπει να διαδραματίζουν κατά την επιλογή από τον πελάτη της δυνατότητας τρίτο ψηφίο. <BR> <A NAME="vicidial_campaigns-survey_third_status"> @@ -3743,6 +5121,16 @@ if ($ADD==99999) <BR> <B>Agent Εμφάνιση Dialable Leads -</B> Αυτή η επιλογή, αν ενεργοποιηθεί, θα δείτε τον αριθμό των διαθέσιμων dialable οδηγεί στην εκστρατεία στην οθόνη παράγοντα. Ο αριθμός αυτός είναι ενημερωμένο στο σύστημα μόλις ένα λεπτό και θα ανανεώνονται στην οθόνη αντιπρόσωπος κάθε λίγα δευτερόλεπτα. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Έρευνα Μενού κλήσεων -</B> Εάν η μέθοδος έχει οριστεί σε CALLMENU, αυτό είναι το μενού Κλήση ότι ο πελάτης έχει σταλεί αν opt-in. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Εγγραφή Έρευνα -</B> Αν ενεργοποιηθεί, αυτό θα ξεκινήσει να καταγράφει όταν η κλήση απαντηθεί. Συνιστάται μόνο εάν η μέθοδος δεν έχει οριστεί να μεταβεί σε άλλον παράγοντα. Προεπιλογή N για άτομα με ειδικές ανάγκες. Εάν πρόκειται να Y_WITH_AMD ακόμη τηλεφωνητή ανιχνευθεί κλήσεις μήνυμα θα πρέπει να καταγράφονται. + <?php } ?> @@ -3756,6 +5144,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. <BR>   - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. <BR>   - campaign_rank: διαταγές από την τάξη που δίνεται στον πράκτοραγια την εκστρατεία. Ο υψηλότερος σε χαμηλότερο. + <BR>   - campaign_grade_random: δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων υπαλλήλων. <BR>   - fewest_calls: διαταγές από τον αριθμό κλήσεων πουπαραλαμβάνονται από έναν πράκτορα για εκείνη την συγκεκριμένηεισερχόμενη ομάδα. Λιγότερες κλήσεις πρώτα. <BR>   - longest_wait_time: παραγγελίες από το ποσό του χρόνου πράκτορας έχει ενεργά περιμένει μια κλήση. @@ -3769,6 +5158,11 @@ if ($ADD==99999) <BR> <B>Πρόθεμα Κλήσης -</B> Αυτό το ο επιτρέπει την πιο εύκολη αλλαγή της διαδρομής της κλήσης να βγει έξω μέσω διαφορετικής μεθόδου, χωρίς να γίνει επαναφόρτωση στο Asterisk. Προκαθορισμένο είναι το 9 βασισμένο σύμφωνα με το 91NXXNXXXXXX στο σχέδιο κλήσεων - extensions.conf. + <BR> + <A NAME="vicidial_campaigns-manual_dial_prefix"> + <BR> + <B>Εγχειρίδιο Πρόθεμα κλήσης -</B> Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε το πρόθεμα κλήσης που πρέπει να χρησιμοποιούνται μόνο όταν τοποθετείτε το εγχειρίδιο κλήσεις μέσω τηλεφώνου από τη διεπαφή πράκτορα, όπως η χρήση της μη αυτόματης κλήσης ή Καλέστε τον επόμενο αριθμό, όταν στο εγχειρίδιο μέθοδο κλήσης, ή χειροκίνητη κλήση αριθμού alt, ή προγραμματισμένα από το χρήστη μόνο επιστροφές κλήσεων. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες, οι οποίες θα χρησιμοποιούν το πρόθεμα κλήσης που ορίζεται στο παραπάνω πεδίο. Αυτή η επιλογή δεν έρχεται σε αντίθεση με το 3way επιλογή Πρόθεμα κλήσης. + <BR> <A NAME="vicidial_campaigns-omit_phone_code"> <BR> @@ -3779,6 +5173,11 @@ if ($ADD==99999) <BR> <B>CallerID Εκστρατείας -</B> Αυτός ο τομέας επιτρέπει την αποστολή ενός αριθμού συνήθειας callerid στις εξερχόμενες κλήσεις. Αυτό είναι ο αριθμός που θα παρουσίαζε στο callerid του προσώπου που καλείτε. Η προεπιλογή είναι ΑΓΝΩΣΤΗ. Εάν χρησιμοποιείτε το T1 ή Eί να σχηματίσει έξω αυτήν την επιλογή είναι μόνο διαθέσιμος εάν χρησιμοποιετε PRIs - ISDN Tί ή Eί - που ανοίγουν το χαρακτηριστικό γνώρισμα συνήθειας callerid, αυτό δεν θα λειτουργήσει με την υπηρεσία ληστεύω-κομματιών - RBS - κυκλώματα. Αυτό θα λειτουργήσει επίσης μέσω του περισσότερου VOIP - ΓΟΥΛΙΑ ή κορμοί IAX - προμηθευτές που επιτρέπουν δυναμικό εξερχόμενο callerID. Η σνήθεια callerID ισχύει μόνο για τις κλήσεις που τοποθετούνται για την εκστρατεία VICIDIAL άμεσα, οποιεσδήποτε κλήσεις ή μεταφορές 3$ων συμβαλλόμενων μερών δεν θα στείλουν τη συνήθεια callerID. ΣΗΜΕΙΩΣΗ: Μερικές φορές να βάλει ΑΓΝΩΣΤΗ ή ΙΔΙΩΤΙΚΗ στον τομέα θα παραγάγει την αποστολή του αριθμού προεπιλογής σας callerID από το μεταφορέα σας με τις κλήσεις. Μπορείτε να θελήσετε να εξετάσετε αυτό και να υποβάλετε 0000000000 ο τομέας callerid αντ' αυτού εάν δεν θέλετε να σας στείλετε CallerID. + <BR> + <A NAME="vicidial_campaigns-use_custom_cid"> + <BR> + <B>Συνήθεια CallerID -</B> Όταν θέστε το Υ, αυτή η το επιλογή επιτρέπει σε σας για να χρησιμοποιήσει τον τομέα security_phrase στον πίνακα vicidial_list ως CallerID για να στείλει κατά τοποθέτηση για κάθε συγκεκριμένο μόλυβδο. Εάν αυτός ο τομέας να μην έχε κανένα CID σε το έπειτα η εκστρατεία CallerID που καθορίζεται ανωτέρω θα χρησιμοποιηθεί αντ' αυτού. Αυτή η επιλογή θα θέσει εκτός λειτουργίας τη συμπληρωματική προμήθεια CallerID καταλόγων εάν υπάρχει ένα CID παρόν στον τομέα security_phrase. Η προεπιλογή είναι Ν. Όταν πρόκειται να AREACODE έχετε τη δυνατότητα να πάει σε AC-CID υπομενού και να ορίσετε πολλαπλά callerids να χρησιμοποιηθεί ανά areacode. + <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -3792,13 +5191,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Όνομα αρχείου ηχογρ εκστρατείας -</B> αυτό το πεδίο επιτρέπει να προσαρμόσετε το όνομα της ηχογράφησης, όταν η ηχογράφηση της εκστρατείας είναι ONDEMAND ή ALLCALLS. Οι μεταβλητές είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζει με το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με το TESTCAMP_51020103108_3125551212. 50 char max. + <B>Όνομα αρχείου εκστρατείας Ηχογρ -</B> Αυτό το πεδίο σας επιτρέπει να προσαρμόσετε το όνομα της εγγραφής κατά την ηχογράφηση της εκστρατείας είναι OnDemand ή ALLCALLS. Οι επιτρεπόμενες μεταβλητές CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH ΧΕΙΡΙΣΤΗΣVENDORLEADCODE LEADID. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζουν με αυτό το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με αυτό TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>Καθυστέρηση Ηχογράφησης -</B> Μόνο για ηχογραφήσεις ALLCALLS και ALLFORCE. Προκαθορισμένα είναι 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Καλέστε Σημειώσεις ανά κλήση -</B> Με την επιλογή αυτή έδωσε τη δυνατότητα να θα επιτρέψει στα πρακτορεία να εισέλθουν στις σημειώσεις για κάθε κλήση που χειρίζονται στο περιβάλλον μέσο. Το πεδίο καταχώρησης σημειώσεων θα εμφανίζεται κάτω από το πεδίο Σχόλια στο περιβάλλον μέσο. Επίσης, αν η ομάδα του πράκτορα χρήστη τη δυνατότητα να προβάλλω τα αρχεία καταγραφής κλήσεων τότε ο πράκτορας θα είναι σε θέση να δείτε τις σημειώσεις παρελθόν έκκληση για μια μολύβδου ανά πάσα στιγμή. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Πράκτορας Αναζήτηση μόλυβδο -</B> Η ρύθμιση αυτής της επιλογής να ΕΝΕΡΓΟΠΟΙΗΜΈΝΗ θα επιτρέψει στα πρακτορεία για να αναζητήσετε και να δείτε οδηγεί μολύβδου πληροφορίες, ενώ σταμάτησε στο περιβάλλον παράγοντα. Επίσης, αν η ομάδα του πράκτορα χρήστη τη δυνατότητα να προβάλλω τα αρχεία καταγραφής κλήσεων τότε ο πράκτορας θα είναι σε θέση να δείτε το παρελθόν σημειώσεις κλήσεων για να καταλήξει ότι οι πληροφορίες σχετικά με την προβολή. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Πράκτορας Μέθοδος Αναζήτηση μόλυβδο -</B> Εάν ο Αντιπρόσωπος Αναζήτηση μόλυβδος είναι ενεργοποιημένη, η ρύθμιση αυτή ορίζει όταν ο αντιπρόσωπος θα πρέπει να επιτρέπεται να οδηγεί την αναζήτηση. Σύστημα θα αναζητήσει το σύνολο του συστήματος, CAMPAIGNLISTS θα ψάξει μέσα σε όλα τα ενεργά καταλόγους στο πλαίσιο της εκστρατείας, CAMPLISTS_ALL θα ψάξουμε μέσα όλες τις ενεργές και ανενεργές λίστες στο πλαίσιο της εκστρατείας, ΚΑΤΑΛΟΓΟΣ θα ψάξει μόνο στο Εγχειρίδιο ID της λίστας κλήσης, όπως ορίζεται στην εκστρατεία . Η προεπιλογή είναι CAMPLISTS_ALL. Μία από αυτές τις επιλογές με USER_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη ταιριάζει με το αναγνωριστικό χρήστη του φορέα, οι επιλογές με GROUP_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη που ταιριάζουν στην ομάδα χρηστών ότι ο χρήστης είναι ένα μέλος της, με τις επιλογές TERRITORY_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη ταιριάζουν με τα εδάφη που ο πράκτορας έχει επιλέξει. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -3807,7 +5221,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Κατά την έναρξη κλήσης -</B> αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μεάβαση στον Βοηθό ή τίποτα. + <B>Κατά την έναρξη κλήσης -</B> αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μεάβαση στον Βοηθό ή τίποτα. Αν είναι προσαρμοσμένα πεδία λίστας ενεργοποιημένη στο σύστημά σας, θα ΕΝΤΥΠΟ ανοίξτε την καρτέλα ΕΝΤΥΠΟ κατά τη σύνδεση μιας κλήσης σε έναν πράκτορα. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -3817,17 +5231,47 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Γρήγορη Μεταφορά Button -</B> Η επιλογή αυτή θα προσθέσει ένα κουμπί Γρήγορη Μεταφορά στην οθόνη πράκτορα κάτω από το κουμπί Μεταφορά-Conf που θα επιτρέψουν ένα κλικ τυφλή μεταφορά των κλήσεων προς την επιλεγμένη ομάδα της ή τον αριθμό. IN_GROUP θα αποστείλει κλήσεις προς την Προεπιλογή xfer ομάδας για αυτή την καμπάνια, ή την ομάδα της, αν υπήρχε μια εισερχόμενη κλήση. Οι επιλογές PRESET θα αποστείλει τις προσκλήσεις για το προκαθορισμένο επιλεγεί. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες. + <B>Γρήγορη Μεταφορά Button -</B> Η επιλογή αυτή θα προσθέσει ένα κουμπί Γρήγορη Μεταφορά στην οθόνη πράκτορα κάτω από το κουμπί Μεταφορά-Conf που θα επιτρέψουν ένα κλικ τυφλή μεταφορά των κλήσεων προς την επιλεγμένη ομάδα της ή τον αριθμό. IN_GROUP θα αποστείλει κλήσεις προς την Προεπιλογή xfer ομάδας για αυτή την καμπάνια, ή την ομάδα της, αν υπήρχε μια εισερχόμενη κλήση. Οι επιλογές PRESET θα αποστείλει τις προσκλήσεις για το προκαθορισμένο επιλεγεί. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες. Οι ΑΣΦΑΛΙΣΜΕΝΗ επιλογές που χρησιμοποιείται για να κλειδώσει την τιμή στο κουμπί γρήγορης μεταφοράς, ακόμη και αν ο αντιπρόσωπος χρησιμοποιεί τις δυνατότητες μεταφοράς συνέδριο κατά τη διάρκεια μιας κλήσης πριν χρησιμοποιήσετε το κουμπί γρήγορης μεταφοράς. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Προσαρμοσμένη 3-Way Μεταφορά Κουμπί -</B> Αυτή η επιλογή θα προσθέσετε ένα κουμπί Μεταφορά στην οθόνη του πράκτορα κάτω από το κουμπί Μεταβίβαση-Conf που θα επιτρέψει ένα κλικ τριών δρόμων κλήσεις χρησιμοποιώντας το επιλεγμένο Preset ή τομέα. Οι επιλογές PRESET_ θα πραγματοποιείτε κλήσεις χρησιμοποιώντας την προκαθορισμένη τιμή. Οι επιλογές FIELD_ θα πραγματοποιείτε κλήσεις χρησιμοποιώντας τον αριθμό του επιλεγμένου πεδίου από το μόλυβδο. ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΕΣ ΑΝΑΓΚΕΣ δεν θα εμφανιστεί το κουμπί στην οθόνη παράγοντα. Οι επιλογές που θα παρκάρετε PARK_ τον πελάτη πριν από την κλήση. Προεπιλογή είναι απενεργοποιημένη. Η επιλογή VIEW_PRESET θα ανοίξει απλά το πλαίσιο μεταφοράς και το προκαθορισμένο πλαίσιο. Η επιλογή VIEW_CONTACTS θα ανοίξει ένα παράθυρο αναζήτησης επαφών, αυτό θα λειτουργήσει μόνο αν Προεπιλογές Ενεργοποίηση έχει οριστεί σε ΕΠΙΚΟΙΝΩΝΙΑ. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> <BR> <B>Μεταφορά PrePopulate Preset -</B> Η επιλογή αυτή θα αναγράψει τον αριθμό κλήσης με τον τομέα στο πλαίσιο διάσκεψης Μεταφορά στην οθόνη παράγοντα εάν ορίζεται. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες. + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Ενεργοποίηση Προεπιλογές Μεταφορά -</B> Η επιλογή αυτή θα επιτρέψει στις Προεπιλογές υπομενού να εμφανίζονται στην κορυφή της σελίδας Τροποποίηση Καμπάνιας, και επίσης θα έχετε τη δυνατότητα να καθορίσετε προεπιλεγμένους αριθμούς κλήσης για πράκτορες να χρησιμοποιούν στο πλαίσιο μεταφοράς της Διάσκεψης της διεπαφής πράκτορα. Προεπιλογή είναι απενεργοποιημένη. Επικοινωνία είναι μια επιλογή μόνο αν contact_information είναι ενεργοποιημένη στο σύστημά σας, αυτό είναι ένα χαρακτηριστικό έθιμο. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Ενεργοποίηση Προεπιλογές Μεταφορά -</B> Η επιλογή αυτή θα επιτρέψει στις Προεπιλογές υπομενού να εμφανίζονται στην κορυφή της σελίδας Τροποποίηση Καμπάνιας, και επίσης θα έχετε τη δυνατότητα να καθορίσετε προεπιλεγμένους αριθμούς κλήσης για πράκτορες να χρησιμοποιούν στο πλαίσιο μεταφοράς της Διάσκεψης της διεπαφής πράκτορα. Προεπιλογή είναι απενεργοποιημένη. Επικοινωνία είναι μια επιλογή μόνο αν contact_information είναι ενεργοποιημένη στο σύστημά σας, αυτό είναι ένα χαρακτηριστικό έθιμο. + + <BR> + <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> + <BR> + <B>Απόκρυψη Μεταφορά Αριθμός για κλήση -</B> Αυτή η επιλογή θα κρύψει το αριθμό πρέπει να καλέσετε τον τομέα στο πλαίσιο μεταφοράς της Διάσκεψης της διεπαφής πράκτορα. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call"> + <BR> + <B>Πάρκο κλήσεων IVR -</B> Η επιλογή αυτή θα επιτρέψει σε έναν πράκτορα να σταθμεύσετε μια κλήση με ένα ξεχωριστό πλήκτρο CALL IVR ΠΑΡΚΟ για την διασύνδεση του πράκτορά τους, αν αυτό είναι ενεργοποιημένο ή ENABLED_PARK_ONLY. Η επιλογή ENABLED_PARK_ONLY θα επιτρέπουν στον πράκτορα να στείλει την κλήση στο πάρκο, αλλά όχι κάντε κλικ για να ανακτήσετε την κλήση, όπως το έδωσε τη δυνατότητα επιλογής. Η επιλογή ENABLED_BUTTON_HIDDEN επιτρέπει τη λειτουργία μέσω του API μόνο. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call_agi"> + <BR> + <B>Πάρκο κλήσεων IVR AGI -</B> Εάν η πρόσκληση Πάρκο πεδίο IVR δεν είναι απενεργοποιημένη, τότε το πεδίο αυτό χρησιμοποιείται ως συμβολοσειρά εφαρμογή AGI ότι ο πελάτης έχει αποσταλεί. Αυτή είναι μια ρύθμιση που θα πρέπει να καθορίζεται από το διαχειριστή σας, ει δυνατόν,. + <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Timer Δράση -</B> Αυτό το χαρακτηριστικό σας επιτρέπει να προκαλέσει ενέργειες μετά από ένα ορισμένο χρονικό διάστημα. το Δ1 και Δ2 επιλογές DIAL θα δημοσιεύσει μια πρόσκληση για τη μεταφορά Διάσκεψη προεπιλογές Αριθμός και τους διαβιβάζουν στον πράκτορα της συνόδου, αυτή χρησιμοποιείται συνήθως για απλές εφαρμογές IVR AGI επικύρωση ή απλά να παίξει ένα προ-ηχογραφημένο μήνυμα. WEBFORM θα ανοίξει τη διεύθυνση φόρμα. MESSAGE_ONLY θα εμφανίσει απλά το μήνυμα ότι είναι στο πεδίο παρακάτω. ΚΑΝΕΝΑ θα απενεργοποιήσετε αυτήν τη δυνατότητα και είναι η προεπιλογή. + <B>Timer Δράση -</B> Αυτό το χαρακτηριστικό σας επιτρέπει να προκαλέσει ενέργειες μετά από ένα ορισμένο χρονικό διάστημα. το Δ1 και Δ2 επιλογές DIAL θα δημοσιεύσει μια πρόσκληση για τη μεταφορά Διάσκεψη προεπιλογές Αριθμός και τους διαβιβάζουν στον πράκτορα της συνόδου, αυτή χρησιμοποιείται συνήθως για απλές εφαρμογές IVR AGI επικύρωση ή απλά να παίξει ένα προ-ηχογραφημένο μήνυμα. WEBFORM θα ανοίξει τη διεύθυνση φόρμα. MESSAGE_ONLY θα εμφανίσει απλά το μήνυμα ότι είναι στο πεδίο παρακάτω. ΚΑΝΕΝΑ θα απενεργοποιήσετε αυτήν τη δυνατότητα και είναι η προεπιλογή. Hangup θα τερματίσετε την κλήση, όταν το χρονόμετρο έχει ενεργοποιηθεί, CALLMENU θα στείλει την κλήση στο μενού Κλήση καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, ΕΠΕΚΤΑΣΗ θα στείλει την κλήση της επέκτασης που καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, θα στείλει IN_GROUP την κλήση στο In-ομάδα που προσδιορίζεται στο πεδίο της δράσης Προορισμός χρονοδιακόπτη. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -3839,11 +5283,46 @@ if ($ADD==99999) <BR> <B>Timer Δευτερόλεπτα Δράση -</B> Αυτό είναι το χρονικό διάστημα μετά την κλήση συνδέεται με τον πελάτη ότι το χρονόμετρο δράσης ενεργοποιείται. Προεπιλογή είναι -1 που είναι και ανενεργός. + <BR> + <A NAME="vicidial_campaigns-timer_action_destination"> + <BR> + <B>Χρονοδιακόπτης Προορισμός δράσης -</B> Αυτό το πεδίο είναι όπου μπορείτε να καθορίσετε το μενού Κλήση, επέκταση ή-Στην ομάδα που θέλετε να αποσταλεί κλήση αν ο χρόνος δράσης της έχει οριστεί σε CALLMENU, την επέκταση ή IN_GROUP. Προεπιλογή είναι άδειο. + <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Προγραμματισμένες Επανακλήσεις -</B> Αυτή η επιλογή επιτρέπει στον χειριστή να τερματίσει μία κλήση ως CALLBK και να επιλέξει τα δεδομένα και την ώρα κατά την οποία ο οδηγός θα ξανα-ενεργοποιηθεί. + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> + <BR> + <B>Σχέδισσα επιφυλακή επανακλήσεων -</B> Αυτή η επιλογή επιτρέπει στη γραμμή θέσης επανακλήσεων στη διεπαφή πρακτόρων για να είναι κόκκινη, αναβοσβήνει ή αναβοσβήνει το κόκκινο όταν υπάρχουν σχεδιασμένες AGENTONLY επανακλήσεις που έχουν χτυπήσει το χρόνο και την ημερομηνία ώθησής τους. Η προεπιλογή δεν είναι ΚΑΜΙΑ για την τυποποιημένη γραμμή θέσης. Οι επιλογές Αναβολή θα σταματήσει να αναβοσβήνει και ή εμφάνιση στο κόκκινο, όταν ελέγχετε τις callbacks, έως ότου ο αριθμός των αλλαγών callbacks. + + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_count"> + <BR> + <B>Σχέδισσα αρίθμηση επανακλήσεων -</B> Αυτή η επιλογή επιτρέπει σε σας για να θέσει εάν μόνο ΖΩΝΤΑΝΕΣ επανακλήσεις, χρήστης-μόνο οι σχεδιασμένες επανακλήσεις που έχουν χτυπήσει την ημερομηνία και το χρόνο ώθησής τους, ή επανακλήσεις ALL_ACTIVE, χρήστης-μόνο επανακλήσεις που είναι ενεργές στο σύστημα καθώς επίσης και τις ΖΩΝΤΑΝΈΣ επανακλήσεις, πρέπει be3 μέτρησαν το INT αυτός άγρυπνο τμήμα επανάκλησης πρακτόρων οθόνης πρακτόρων. Η προεπιλογή είναι ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Προγραμματισμένη Όριο επιστροφές κλήσεις Ημέρες -</B> Αυτή η επιλογή σας επιτρέπει να μειώσει το πρακτορείο προγραμματιστεί callbacks ημερολογίου με δυνατότητα επιλογής αριθμού των ημερών από σήμερα, την πλήρη ημερολογιακό μήνα 12 θα εξακολουθήσουν να εμφανίζονται, αλλά μόνο ο αριθμός σύνολο των ημερών θα επιλεγούν. Η προεπιλογή είναι 0 για απεριόριστο. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Προγραμματισμένη Μπλοκ επιστροφές κλήσεις Ώρες -</B> Αυτή η επιλογή σας επιτρέπει να περιορίσετε την προγραμματισμένη USERONLY επανάκλησης από το να εμφανίζεται στη λίστα επανάκλησης μέχρι παράγοντα Χ ώρες μετά έχει καθοριστεί. Η προεπιλογή είναι 0 για να μην μπλοκ. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Προγραμματισμένη επιστροφές κλήσεις Calltime Μπλοκ -</B> Αυτή η επιλογή αν θα αποτρέψει την ενεργοποίηση της προγραμματισμένης επανάκλησης από τη λίστα επανάκλησης πράκτορα από το να καλέσει, αν είναι έξω από την προγραμματισμένη calltime για την εκστρατεία. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Προεπιλογή επιστροφές κλήσεις μου Checkbox -</B> Αυτή η επιλογή σας επιτρέπει να ρυθμίσετε εκ των προτέρων το κουτάκι μου επανάκλησης την προγραμματισμένη παράγοντα οθόνη επανάκλησης. ΕΛΕΓΧΟΜΕΝΗ θα ελέγξει αυτόματα το πλαίσιο ελέγχου για κάθε κλήση. Προεπιλογή είναι ανεξέλεγκτη. + <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -3854,6 +5333,26 @@ if ($ADD==99999) <BR> <B>Μήνυμα Τυλίγματος -</B> Αυτό είναι ένα συγκεκριμένο μήνυμα εκστρατείας που εμφανίζεται στην οθόνη τυλίγματος όταν έχει οριστεί ο χρόνος τυλίγματος. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Απενεργοποίηση οθόνης DISPO -</B> Αυτή η επιλογή σας επιτρέπει να απενεργοποιήσετε την οθόνη διάθεση στο περιβάλλον μέσο. Η Απενεργοποίηση DISPO πεδίο Κατάσταση παρακάτω πρέπει να συμπληρωθεί για αυτή την επιλογή να εργαστούν. Η προεπιλογή είναι DISPO_ENABLED. Η DISPO_SELECT_DISABLED επιλογή δεν θα απενεργοποιήσει την οθόνη dispo εντελώς, αλλά θα εμφανιστεί η οθόνη dispo χωρίς διαθέσεις, η επιλογή αυτή πρέπει να χρησιμοποιείται μόνο εάν θέλετε να επιβάλετε πράκτορες σας για να χρησιμοποιήσετε το λογισμικό CRM σας, η οποία θα στείλει την κατάσταση με το σύστημα μέσω του API. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Απενεργοποίηση DISPO Κατάσταση -</B> Εάν η επιλογή Απενεργοποίηση DISPO οθόνης έχει οριστεί σε DISPO_DISABLED, τότε το πεδίο αυτό πρέπει να συμπληρωθεί αυτό το πεδίο, μπορείτε να χρησιμοποιήσετε οποιαδήποτε διάταξη θέλετε για αυτόν τον τομέα όσο είναι 1 προς 6 χαρακτήρες στο μήκος με μόνο γράμματα και αριθμούς. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Ετικέτες οθόνης γραφείο -</B> Μπορείτε να επιλέξετε ένα σύνολο ετικετών οθόνη παράγοντα για χρήση με αυτή την επιλογή. Προεπιλογή είναι - ΣΥΣΤΗΜΑ-ΧΩΡΟΣ - για τις προεπιλεγμένες ετικέτες. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Εμφάνιση Πεδία Κατάσταση -</B> Μπορείτε να επιλέξετε ποιες μεταβλητές για τις κλήσεις που θα εμφανίζεται στη γραμμή κατάστασης της οθόνης πράκτορα. CALLID θα εμφανίσει το 20 μοναδικό αναγνωριστικό χαρακτήρα κλήση, LEADID θα εμφανίσει το ID σύστημα ηλεκτροδίων, LISTID θα εμφανιστεί το ID της λίστας. Η προεπιλογή είναι CALLID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -3874,6 +5373,21 @@ if ($ADD==99999) <BR> <B>Η μικρή διακοπή πρακτόρων κωδικοποιεί ενεργό -</B> επιτρέπει στουςπράκτορες για να επιλέξει έναν κώδικα μικρής διακοπής ότανχτυπούν στο κουμπί ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ στους κώδικες μικρής διακοπήςvicidial.php. είναι ευπροσδιόριστοι ανά εκστρατεία στοκατώτατο σημείο της οθόνης λεπτομέρειας άποψης εκστρατείας καιαποθηκεύονται στον πίνακα vicidial_agent_log. Η προεπιλογήείναι ν. ΙΣΧΥΟΝΤΑ θα ισχύουν οι παράγοντες να επιλέγουν μια παύση κωδικό αν κάντε κλικ στο κουμπί PAUSE. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Αυτόματη Παύση Προ-Call -</B> Στην αυτόματη λειτουργία κλήσης, η ρύθμιση αυτή θα ενεργοποιηθεί εάν το πρακτορείο που να σταματά αυτόματα όταν οι κλικ παράγοντα για οποιαδήποτε από τις ακόλουθες λειτουργίες που απαιτεί από αυτούς να είναι σε παύση, αυτόματη κλήση, το Fast Dial, επικεφαλής Αναζήτηση, Προβολή αρχείου καταγραφής κλήσεων, επιστροφές κλήσεις Έλεγχος, Εισάγετε τον κωδικό Παύση. Προεπιλογή N για ανενεργό. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Αυτόματη Συνέχιση Προ-Call -</B> Στην αυτόματη λειτουργία κλήσης, η ρύθμιση αυτή θα ενεργοποιηθεί εάν ρυθμίσετε τον παράγοντα για ενεργό αυτόματα όταν πατήσει ο πράκτορας από, ή ακυρώνει, σε οποιαδήποτε από τις ακόλουθες λειτουργίες που απαιτεί από αυτούς να είναι σε παύση, αυτόματη κλήση, το Fast Dial, επικεφαλής Αναζήτηση, Κλήση Σύνδεση Προβολή, επιστροφές κλήσεις Ελέγξτε, εισάγετε τον κωδικό Παύση. Προεπιλογή N για ανενεργό. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Αυτόματη Παύση Προ-Call Κώδικα -</B> Εάν η Αυτόματη Παύση Προ-κλήση της συνάρτησης εργασίας παραπάνω είναι ενεργό, και Κώδικες Παύση Agent είναι ενεργή, η ρύθμιση αυτή θα είναι η παύση κωδικό που χρησιμοποιείται όταν ο πράκτορας βρίσκεται σε παύση των δραστηριοτήτων αυτών. Η προεπιλογή είναι PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -3889,6 +5403,11 @@ if ($ADD==99999) <BR> <B>Εμφάνιση Agent Queue Count - </B> Σε περίπτωση που σε Y, σε περίπτωση που ο πελάτης περιμένει για έναν πράκτορα, ο κοτσίδας ζητεί απεικόνιση στο πάνω μέρος της οθόνης πράκτορας θα γίνονται κόκκινα και δείχνουν τον αριθμό των αναμονής κλήσεων. Προεπιλεγμένο είναι Y. + <BR> + <A NAME="vicidial_campaigns-manual_dial_override"> + <BR> + <B>Χειρωνακτική συμπληρωματική προμήθεια πινάκων -</B> Η ρύθμιση μπορεί να αγνοήσει τους χρήστες που θέτουν για τη χειρωνακτική δυνατότητα πινάκων για τους πράκτορες όταν καταγράφονται σε αυτήν την εκστρατεία. ΚΑΝΕΝΑΣ δεν θα ακολουθήσει τη ρύθμιση χρηστών, ALLOW_ALL θα επιτρέψει σε οποιοδήποτε πράκτορα που συνδέεται με αυτήν την εκστρατεία για να τοποθετήσει τις χειρωνακτικές κλήσεις πινάκων, DISABLE_ALL δεν θα επιτρέψει σε καθένα που συνδέεται με αυτήν την εκστρατεία για να τοποθετήσει τις χειρωνακτικές κλήσεις πινάκων. Η προεπιλογή δεν είναι ΚΑΜΙΑ. + <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> <BR> @@ -3897,7 +5416,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Εγχειρίδιο Dial Διηθείται - </B> Αυτό σας επιτρέπει να φιλτράρετε τις κλήσεις που πράκτορες να καλέσετε στο εγχειρίδιο λειτουργίας για την εκστρατεία αυτή με οποιονδήποτε συνδυασμό από τα ακόλουθα: DNC - προβλέπονται για την έναρξη, CAMPAIGNΛΙΣΤΕΣ - ο αριθμός πρέπει να είναι εντός των καταλόγων για την εκστρατεία, ΚΑΝΕΝΑ - δεν υπάρχει φίλτρο για χειροκίνητη κλήση ή γρήγορα dial καταλόγους. + <B>Εγχειρίδιο Dial Διηθείται - </B> Αυτό σας επιτρέπει να φιλτράρετε τις κλήσεις που πράκτορες να καλέσετε στο εγχειρίδιο λειτουργίας για την εκστρατεία αυτή με οποιονδήποτε συνδυασμό από τα ακόλουθα: DNC - προβλέπονται για την έναρξη, CAMPAIGNLISTS - ο αριθμός πρέπει να είναι εντός των καταλόγων για την εκστρατεία, ΚΑΝΕΝΑ - δεν υπάρχει φίλτρο για χειροκίνητη κλήση ή γρήγορα dial καταλόγους. CAMPLISTS_ALL - θα περιλαμβάνει καταλόγους ανενεργά στην αναζήτηση για τον αριθμό. + + <BR> + <A NAME="vicidial_campaigns-manual_preview_dial"> + <BR> + <B>Εγχειρίδιο Ταχείας Προεπισκόπηση -</B> Αυτό επιτρέπει στον πράκτορα στη χειροκίνητη λειτουργία κλήσης για να δείτε το προβάδισμα πληροφορίες όταν κάνουν κλικ στην επιλογή Καλέστε τον επόμενο αριθμό, πριν καλέσετε ενεργά την τηλεφωνική κλήση. Υπάρχει μια προαιρετική σύνδεση για να παρακάμψετε το προβάδισμα και να προχωρήσουμε στο επόμενο, αν επιλεγεί. Η προεπιλογή είναι PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Εγχειρίδιο κλήσης API -</B> Αυτή η επιλογή σας επιτρέπει να ορίσετε το API πράκτορα για να κάνετε είτε μια κλήση σε έναν χρόνο, STANDARD, ή την ικανότητα να περιμένω στην ουρά εγχειρίδιο κλήσεις μέσω τηλεφώνου και να τους καλέσετε αυτόματα μόλις ο πράκτορας συνεχίζει παύση ή είναι διαθέσιμα να πάρετε την επόμενη κλήση τους με το επιλογή για να απενεργοποιήσετε την αυτόματη κλήση αυτών των κλήσεων, ουρά, ή QUEUE_AND_AUTOCALL η οποία είναι η ίδια με ουρά, αλλά χωρίς την επιλογή για να απενεργοποιήσετε την αυτόματη κλήση αυτών των κλήσεων. Αν ένας αντιπρόσωπος έχει περισσότερες από μία κλήση σε ουρά για τους θα δουν τον λογαριασμό πόσες εγχειρίδιο κλήσεις μέσω τηλεφώνου είναι στην ουρά ακριβώς κάτω από το κουμπί παύσης, ή μέσω τηλεφώνου στο κουμπί Επόμενο Αριθμός. Προτείνουμε ότι αν χρησιμοποιείται ουρά που στέλνετε API ενέργειες χρησιμοποιώντας την προεπισκόπηση = ΝΑΙ επιλογή ώστε να μην καλείτε επανειλημμένα κλήσεις για τον πράκτορα χωρίς προειδοποίηση. Επίσης, αν χρησιμοποιείτε ουρά και σε μεγάλο βαθμό χρησιμοποιώντας χειροκίνητη κλήσεις μέσω τηλεφώνου σε ένα μη μέθοδο κλήσης ΕΓΧΕΙΡΙΔΙΟ, θα συνιστάται η ρύθμιση του Παύση γραφείο Μετά από κάθε επιλογή Κλήση στον Βήτα Προεπιλογή ΠΡΟΤΥΠΟ. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Εγχειρίδιο Χρόνος κλήσεων Έλεγχος -</B> Εάν αυτή η επιλογή είναι ενεργοποιημένη, θα ελέγξει όλες τις κλήσεις μέσω τηλεφώνου εγχειρίδιο για να βεβαιωθείτε ότι είναι εντός των χρονικών ρυθμίσεων κλήσης για την εκστρατεία. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Εγχειρίδιο Ταχείας CID -</B> Αυτό καθορίζει αν ένας πράκτορας την ιδιόχειρη κλήσεις μέσω τηλεφώνου θα έχουν οι ρυθμίσεις της καμπάνιας CallerID που χρησιμοποιούνται, ή ο πράκτοράς τους τηλέφωνο ρυθμίσεις CallerID χρησιμοποιούνται. Η προεπιλογή είναι ΕΚΣΤΡΑΤΕΙΑ. Εάν η χρήση Προσαρμοσμένη CID επιλογή καμπάνια έχει ενεργοποιηθεί ή η εκστρατεία λίστα CID ρύθμιση παράκαμψης χρησιμοποιείται, αυτή η ρύθμιση θα πρέπει να αγνοηθεί. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Τηλέφωνο Ώρα δημοσίευσης προειδοποίησης Διαφορά -</B> Αυτό το εγχειρίδιο κλήσης μόνο χαρακτηριστικό, εάν ενεργοποιηθεί, θα εμφανιστεί μια ειδοποίηση αν η ζώνη ώρας για το μόλυβδο ταχυδρομικό κώδικα, ή ο ταχυδρομικός κώδικας, είναι διαφορετική από την ζώνη ώρας του κώδικα περιοχής του αριθμού τηλεφώνου για το μόλυβδο. Η επιλογή OUTSIDE_CALLTIME_ONLY θα δείξει μόνο το σήμα, εάν οι δύο ζώνες ώρας είναι διαφορετικές και μία από τις ζώνες ώρας είναι εκτός του χρόνου εφημερίας που έχουν επιλεγεί για την καμπάνια. OUTSIDE_CALLTIME_PHONE θα ελέγχει μόνο τη ζώνη ώρας του αριθμού τηλεφώνου του μολύβδου και ειδοποιεί αν είναι έξω από την τοπική ώρα κλήσης. OUTSIDE_CALLTIME_POSTAL θα ελέγχει μόνο τη ζώνη ώρας του ταχυδρομικού κώδικα του μολύβδου και ειδοποιεί αν είναι έξω από την τοπική ώρα κλήσης. OUTSIDE_CALLTIME_BOTH θα ελέγξει τον ταχυδρομικό κώδικα και τον αριθμό τηλεφώνου για να είναι μέσα στην τοπική ώρα κλήσης, ακόμη και αν βρίσκονται στην ίδια ζώνη ώρας. Οι ειδοποιήσεις αυτές θα εμφανιστούν στο αρχείο κλήσεων πληροφορίες, callbacks λίστες, αναζητήστε πληροφορίες για τα αποτελέσματα, όταν ένας κύριος καλείται και όταν είναι επικεφαλής προεπισκόπηση. Προεπιλογή είναι απενεργοποιημένη. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -3907,13 +5451,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>3-Way Outbound Call CallerID - </B> Αυτό ορίζει τι έστειλε ως εξερχόμενο callerID σειρά από 3 δρόμων κλήσεις που διατίθενται από το γραφείο, η καμπάνια χρησιμοποιεί το έθιμο εκστρατεία callerID, ΠΕΛΑΤΗ χρησιμοποιεί τον αριθμό των πελατών που είναι ενεργή παράγοντες για την οθόνη και AGENT_PHONE χρησιμοποιεί το callerID για το τηλέφωνο ότι ο παράγοντας που είναι συνδεδεμένοι στο. AGENT_CHOOSE επιτρέπει να επιλέγουν τον πράκτορα που callerID να χρησιμοποιήσετε για την 3-way ζητεί από μια λίστα επιλογών. + <B>3-Way Outbound Call CallerID - </B> Αυτό ορίζει τι έστειλε ως εξερχόμενο callerID σειρά από 3 δρόμων κλήσεις που διατίθενται από το γραφείο, η καμπάνια χρησιμοποιεί το έθιμο εκστρατεία callerID, ΠΕΛΑΤΗ χρησιμοποιεί τον αριθμό των πελατών που είναι ενεργή παράγοντες για την οθόνη και AGENT_PHONE χρησιμοποιεί το callerID για το τηλέφωνο ότι ο παράγοντας που είναι συνδεδεμένοι στο. AGENT_CHOOSE επιτρέπει να επιλέγουν τον πράκτορα που callerID να χρησιμοποιήσετε για την 3-way ζητεί από μια λίστα επιλογών. CUSTOM_CID θα χρησιμοποιήσει τη συνήθεια CID που καθορίζεται στον τομέα security_phrase του πίνακα vicidial_list για το μόλυβδο. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> <BR> <B>3-Way Call Πρόθεμα Κλήσης - </B> Αυτό ορίζει τι είναι χρησιμοποιείται ως πρόθεμα κλήσης για 3-way κλήσεις, προεπιλογή είναι άδειο, ώστε η εκστρατεία dial πρόθεμα χρησιμοποιείται, passthru έτσι ώστε να μπορείτε να ακούτε τους ήχους είναι 88. + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> + <BR> + <B>Πελάτης 3-Way καταγραφή Hangup -</B> Εάν αυτή η επιλογή είναι ενεργοποιημένη η user_call_log θα συνδεθείτε όταν ένα hangup πελάτη μέχρι και αν κολλήσει κατά τη διάρκεια μιας κλήσης 3-τρόπο. Επίσης, αυτό μπορεί να επιτρέψει για τον πελάτη 3-τρόπο δράσης hangup αν κάποιος defineed παρακάτω. Προεπιλογή ΔΥΝΑΤΟΤΗΤΑ. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> + <BR> + <B>Πελάτης 3-Way Δευτερόλεπτα Hangup -</B> Εάν ο Πελάτης 3-τρόπο καταγραφής είναι ενεργοποιημένη, η επιλογή αυτή σας επιτρέπει να ορίσετε τον αριθμό των δευτερολέπτων μετά το hangup πελάτης έχει εντοπιστεί πριν από την πραγματική καταγράφεται και η προαιρετική πελάτη 3-τρόπο δράσης hangup εκτελείται. Προεπιλογή είναι 5 δευτερόλεπτα. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_action"> + <BR> + <B>Πελάτης 3-Way δράσης Hangup -</B> Εάν ο Πελάτης 3-τρόπο καταγραφής είναι ενεργοποιημένη, η επιλογή αυτή σας επιτρέπει να έχετε την οθόνη αυτόματα πράκτορα κλείσεις για την πρόσκληση και μεταβείτε στην οθόνη DISPO αν αυτή η επιλογή έχει οριστεί σε DISPO. Η προεπιλογή είναι ΚΑΝΕΝΑ. + <?php if ($SSqc_features_active > 0) { @@ -3986,6 +5545,31 @@ if ($ADD==99999) <BR> <B>Vtiger Κατάσταση Call -</B> Αν vtiger ολοκλήρωση είναι ενεργοποιημένη στις ρυθμίσεις του συστήματος τότε αυτή η ρύθμιση θα καθορίσει κατά πόσον το καθεστώς της vtiger λογαριασμού θα ενημερώνεται με την κατάσταση της κλήσης μετά από VICIDIAL έχει dispositioned. Προεπιλογή είναι N. + <BR> + <A NAME="vicidial_campaigns-queuemetrics_callstatus"> + <BR> + <B>Συμπληρωματική προμήθεια QM CallStatus -</B> Εάν η ολοκλήρωση QueueMetrics επιτρέπεται στις τοποθετήσεις συστημάτων έπειτα αυτήν την ρύθμιση επιτρέψτε την αγνόηση των τοποθετήσεων συστημάτων θέτοντας για queue_log τις καταχωρήσεις CallStatus. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ που θα χρησιμοποιήσει τη ρύθμιση συστημάτων. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>ΜΠ Περιβάλλοντος Τηλέφωνο -</B> Αν QueueMetrics ενσωμάτωση αυτή είναι ενεργοποιημένη στις ρυθμίσεις του συστήματος τότε η ρύθμιση αυτή επιτρέπει την προσθήκη αυτής της αξίας στοιχείων στον τομέα δεδομένων αυτών4 της queue_log για τα αρχεία δραστηριότητα πράκτορα. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_campaigns-extension_appended_cidname"> + <BR> + <B>Η επέκταση επισυνάπτει CID -</B> Εάν επιτρέπονται, οι κλήσεις που τοποθετούνται από αυτήν την εκστρατεία θα έχουν ένα διάστημα και την τηλεφωνική επέκταση του πράκτορα που επισυνάπτεται στο τέλος του ονόματος CallerID για την κλήση προτού να σταλεί στον πράκτορα. Η προεπιλογή είναι Ν για τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>Ομαδοποίηση PLLB -</B> Τηλέφωνο φορτίου Είσοδος Ομαδοποίηση Εξισορρόπησης, επιτρέπεται μόνο αν υπάρχουν πολλοί διακομιστές πράκτορα και τα ψευδώνυμα του τηλεφώνου υπάρχουν στο σύστημα. Εάν πρόκειται να ONE_SERVER_ONLY θα αναγκάσει όλους τους αντιπροσώπους για την εκστρατεία αυτή για να συνδεθείτε στον ίδιο διακομιστή. Εάν οριστεί σε cascading θα ομαδοποιεί συνδεδεμένοι φορείς στον ίδιο διακομιστή μέχρι PLLB αριθμός Όριο Ομαδοποίηση των παραγόντων επιτυγχάνονται, τότε το επόμενο πράκτορα θα συνδεθείτε με το επόμενο server με το μικρότερο αριθμό παραγόντων. Εάν οριστεί σε Απενεργοποιημένη την τυπική συμπεριφορά Τηλέφωνο Ψευδώνυμα κάθε παράγοντα την εύρεση του διακομιστή με τον μικρότερο αριθμό μη απομακρυσμένες παράγοντες συνδεδεμένοι σε αυτό θα χρησιμοποιηθεί. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>Όριο PLLB Ομαδοποίηση -</B> Τηλέφωνο φορτίου Είσοδος Εξισορρόπηση Όριο Όμιλο. Αν PLLB Όμιλος έχει οριστεί σε cascading τότε η ρύθμιση αυτή θα καθορίσει τον αριθμό των πρακτόρων αποδεκτή σε κάθε διακομιστή για τη συγκεκριμένη καμπάνια. Η προεπιλογή είναι 50. + <BR> <A NAME="vicidial_campaigns-crm_popup_login"> <BR> @@ -4006,6 +5590,11 @@ if ($ADD==99999) <BR> <B>Καλέστε dispo URL -</B> Αυτό το web διεύθυνση URL δεν θεωρείται από το πρακτορείο, αλλά καλείται κάθε φορά που μια κλήση είναι dispositioned από έναν πράκτορα αν είναι πυκνοκατοικημένη. Χρησιμοποιεί τις ίδιες μεταβλητές όπως τα πεδία scripts φόρμα και. dispo και talk_time είναι οι μεταβλητές που μπορείτε να χρησιμοποιήσετε για να ανακτήσετε το πρακτορείο καθορισμένες διάταξη για την πρόσκληση και τον πραγματικό χρόνο ομιλίας σε δευτερόλεπτα της κλήσης. Αυτή η διεύθυνση URL δεν μπορεί να αποτελέσει σχετική διαδρομή. Προεπιλογή είναι κενό. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>Δεν URL Καλέστε τον πράκτορα -</B> Αυτή η διεύθυνση URL ιστοσελίδας δεν θεωρείται από τον πράκτορα, αλλά αν έχει συμπληρωθεί καλείται κάθε φορά που μια κλήση που δεν γίνεται από έναν πράκτορα είναι κρεμασμένα επάνω ή μεταφέρθηκαν. Χρησιμοποιεί τις ίδιες μεταβλητές όπως τα πεδία σενάρια διαδικτυακή φόρμα και. dispo μπορεί να χρησιμοποιηθεί για να ανακτήσει το σύστημα-που ορίζεται διάθεση για την κλήση. Αυτό το URL δεν μπορεί να είναι μια σχετική διαδρομή. Η προεπιλογή είναι κενό. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4041,13 +5630,28 @@ if ($ADD==99999) <BR> <B>Agent Παύση Μετά από κάθε πρόσκληση -</B> Αυτή η επιλογή αν ρυθμιστεί σε Ναι, θα διακόψετε το πρακτορείο μετά από κάθε κλήση αυτόματα. Προεπιλογή είναι N. + <BR> + <A NAME="vicidial_campaigns-blind_monitor_warning"> + <BR> + <B>Τυφλή προειδοποίηση οργάνων ελέγχου -</B> Αυτή η επιλογή εάν επιτρέπεται θα ενημερώσει τον πράκτορα με τους διάφορους προαιρετικούς τρόπους εάν είναι τυφλοί που ελέγχονται από κάποιο. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΆΓΚΕΣ σημαίνουν ότι αυτό το χαρακτηριστικό γνώρισμα δεν είναι ενεργό, η ΕΠΙΦΥΛΑΚΗ θα σκάσει μόνο μια επιφυλακή επάνω στην οθόνη πρακτόρων, η ΕΙΔΟΠΟΙΗΣΗ θα ταχυδρομήσει μια σημείωση που μένει επάνω στην οθόνη πρακτόρων εφ' όσον θα παίξει το theya σχετικά με τον έλεγχο, ΗΧΟΣ το όνομα αρχείου που καθορίζεται κατωτέρω όταν αρχίζει να ελέγχεται ένας πράκτορας και οι άλλες επιλογές είναι combibnations των ανωτέρω επιλογών. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_message"> + <BR> + <B>Τυφλή ειδοποίηση οργάνων ελέγχου -</B> Αυτό είναι το μήνυμα που θα παρουσιάσει στην οθόνη πρακτόρων ενώ ελέγχονται εάν η επιλογή ΕΙΔΟΠΟΙΗΣΗΣ επιλέγεται. Η προεπιλογή είναι -Someone is blind monitoring your session-. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_filename"> + <BR> + <B>Τυφλό όνομα αρχείου οργάνων ελέγχου -</B> Αυτό είναι το ακουστικό αρχείο που θα παίξει στη σύνοδο πρακτόρων στην έναρξη κάποιου τυφλού που ελέγχει τους. Αυτή η υπαγόρευση θα παιχτεί για την καθεμία στη σύνοδο συμπεριλαμβανομένου του πελάτη εάν οποιοσδήποτε είναι παρών. Η προεπιλογή είναι κενή. + <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_ΛΙΣΤΕΣ ΠΙΝΑΚΑΣ</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>ID Λίστας -</B> Αυτό είναι το αριθμητικό όνομα της λίστας, δεν μπορεί να διορθωθεί μετά από την αρχική εισαγωγή, πρέπει να περιέχει μόνο αριθμούς και πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες. Must be a number greater than 100. @@ -4109,13 +5713,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_lists-drop_inbound_group_override"> <BR> - <B>Drop Inbound Ομάδα Παράκαμψη -</B> Αν αυτό το πεδίο έχει οριστεί, αυτή η ομάδα της θα χρησιμοποιηθεί για εξερχόμενες κλήσεις μέσα στη λίστα που πτώση από το εξερχόμενο εκστρατεία αντί για την πτώση της ομάδας που στην οθόνη λεπτομερώς εκστρατεία. Προεπιλογή δεν έχει οριστεί. + <B>Drop  εισερχόμενοςΟμάδα Παράκαμψη -</B> Αν αυτό το πεδίο έχει οριστεί, αυτή η ομάδα της θα χρησιμοποιηθεί για εξερχόμενες κλήσεις μέσα στη λίστα που πτώση από το εξερχόμενο εκστρατεία αντί για την πτώση της ομάδας που στην οθόνη λεπτομερώς εκστρατεία. Προεπιλογή δεν έχει οριστεί. + + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Web Παράκαμψη Έντυπο - </ B> Αυτό είναι το έθιμο διεύθυνση ότι κάνοντας κλικ στο κουμπί ΦΟΡΜΑ σε VICIDIAL θα σας μεταφέρει σε κλήσεις που έρχονται σε αυτόν τον κατάλογο. Αν θέλετε να χρησιμοποιήσετε προσαρμοσμένα πεδία σε μια διεύθυνση ιστού μορφή, θα πρέπει να προσθέσετε &CF_uses_custom_fields=Y ως μέρος του URL σας. <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>Xfer-Conf Αριθμός Παράκαμψη -</B> Αυτά τα πέντε πεδία επιτρέπουν για να παρακάμψετε τις προεπιλογές αριθμό Μεταφορά Διάσκεψη όταν το αποτέλεσμα είναι από αυτή τη λίστα. Προεπιλογή είναι κενό. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Έκθεση απογραφής -</B> Εάν η έκθεση απογραφής είναι ενεργοποιημένη στο σύστημά σας, η επιλογή αυτή θα καθορίσει αν ο κατάλογος αυτός περιλαμβάνεται στην έκθεση ή όχι. Προεπιλογή είναι ναι Υ για. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Ζώνη ώρας -</B> Αυτή η επιλογή σας επιτρέπει να ορίσετε τη μέθοδο της διατήρησης του σημερινού αναζήτησης ζώνη ώρας για τα καλώδια μέσα σε αυτή τη λίστα. Αυτή η διαδικασία γίνεται μόνο τη νύχτα, ώστε οι όποιες αλλαγές κάνετε, δεν θα είναι άμεση. COUNTRY_AND_AREA_CODE είναι η προεπιλογή, και θα χρησιμοποιήσει τον κωδικό της χώρας και τον κωδικό περιοχής του αριθμού τηλεφώνου για να καθορίσει τη ζώνη ώρας του μολύβδου. Postal_code θα χρησιμοποιήσει τον ταχυδρομικό κώδικα εάν είναι διαθέσιμη για να καθορίσει τη ζώνη ώρας του μολύβδου. NANPA_PREFIX λειτουργεί μόνο στις ΗΠΑ και θα χρησιμοποιήσει τον κωδικό της περιοχής και πρόθεμα του αριθμού τηλεφώνου για να καθορίσει τη ζώνη ώρας του μολύβδου, αλλά αυτό δεν είναι ενεργοποιημένη από προεπιλογή στο σύστημα, γι 'αυτό παρακαλώ να είστε βέβαιος ότι έχετε τα δεδομένα πρόθεμα NANPA φορτώνονται συστήματός σας πριν από την επιλογή αυτή την επιλογή. OWNER_TIME_ZONE_CODE θα χρησιμοποιήσετε το πρότυπο abbraviation ζώνη ώρας φορτωθεί στο πεδίο ιδιοκτήτη του μολύβδου να καθορίσει τη ζώνη ώρας, στα παραδείγματα ΗΠΑ είναι η AST, EST, CST, MST, PST, AKST, TGV. Αυτή η λειτουργία πρέπει να ενεργοποιηθεί από το διαχειριστή του συστήματος σας για να τεθεί σε ισχύ. + <BR> <A NAME="vicidial_list-dnc"> @@ -4126,7 +5745,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_Εισερχόμενα_GROUPS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_GROUPS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_inbound_groups-group_id"> <BR> <B>ID Ομάδας -</B> Αυτό είναι το σύντομο όνομα της εισερχόμενης ομάδας, δεν μπορεί να διορθωθεί μετά από την αρχική παράδοση, δεν μπορεί να περιέχει κενά και πρέπει να είναι μεταξύ 2 και 20χαρακτήρες. @@ -4146,10 +5765,20 @@ if ($ADD==99999) <BR> <B>Ενεργοποίηση -</B> Αυτό καθορίζει κατά πόσον αυτή η ομάδα εμφανίζεται στο κουτί επιλογής όταν ένας χρήστης συνδέεται. + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το εισερχόμενο ομάδα, αυτό επιτρέπει την προβολή του διαχειριστή αυτής στην ομάδα περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό σε ομάδα. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>Στην ομάδα-Calldate -</B> Αυτή είναι η τελευταία ημερομηνία και την ώρα που μια πρόσκληση απευθυνόταν σε αυτό το εισερχόμενο ομάδα. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Ιστοσελίδα -</B> Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυ την ομάδα. + <B>Ιστοσελίδα -</B> Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυ την ομάδα. Αν θέλετε να χρησιμοποιήσετε προσαρμοσμένα πεδία σε μια διεύθυνση ιστού μορφή, θα πρέπει να προσθέσετε &CF_uses_custom_fields=Y ως μέρος του URL σας. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4158,14 +5787,30 @@ if ($ADD==99999) <BR>   - random: ταξινομημένο με τυχαία τιμή ενημέρωσης στον πίνακα vicidial_live_agents <BR>   - oldest_call_start: ταξινομημένο με την τελευταία φορά που σε ένα χρήστη στάλθηκε μία κλήση. Με αποτέλεσμα, ο χρήστης να λαμβάνει συνολικά το ίδιο αριθό κλήσεων. <BR>   - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. + <BR>   - oldest_inbound_call_start: παραγγελιών από την τελευταία φορά που ένας πράκτορας στάλθηκε μια εισερχόμενη κλήση. Αποτελέσματα σε παράγοντες που λαμβάνουν για τον ίδιο αριθμό καλεί συνολικής. + <BR>   - oldest_inbound_call_finish: παραγγελιών από την τελευταία φορά που ένας πράκτορας τελειώσει μια εισερχόμενη κλήση. AKA πράκτορα περιμένει μεγαλύτερη λαμβάνει την πρώτη κλήση. <BR>   - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. <BR>   - inbound_group_rank: διαταγές από την τάξη που δίνεται στονπράκτορα για τη συγκεκριμένη εισερχόμενη ομάδα. Ο υψηλότερος σεχαμηλότερο. - <BR>   - fewest_calls: διαταγές από τον αριθμό κλήσεων πουπαραλαμβάνονται από έναν πράκτορα για εκείνη την συγκεκριμένηεισερχόμενη ομάδα. Λιγότερες κλήσεις πρώτα. <BR>   - campaign_rank: διαταγές από την τάξη που δίνεται στον πράκτοραγια την εκστρατεία. Ο υψηλότερος σε χαμηλότερο. + <BR>   - ingroup_grade_random: δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων υπαλλήλων από ομάδα σε. + <BR>   - campaign_grade_random: δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων παραγόντων από την εκστρατεία. + <BR>   - fewest_calls: διαταγές από τον αριθμό κλήσεων πουπαραλαμβάνονται από έναν πράκτορα για εκείνη την συγκεκριμένηεισερχόμενη ομάδα. Λιγότερες κλήσεις πρώτα. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: παραγγελίες από το ποσό του χρόνου πράκτορας έχει ενεργά περιμένει μια κλήση. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> ΣΗΜΕΙΩΣΕΙΣ: Για ring_all, οι παράγοντες που χρησιμοποιούν τα κινητά τηλέφωνα που έχουν την δυνατότητα γραφείο Hook θα έχει τα τηλέφωνα τους δαχτυλίδι και το πρώτο για να απαντήσετε θα λάβει την κλήση και τις πληροφορίες που εμφανίζονται στην οθόνη παράγοντα. Από ring_all αγνοεί παράγοντας χρόνος αναμονής και η σειρά κατάταξης και θα καλέσει κάθε παράγοντα που είναι διαθέσιμες για την ουρά, δεν συνιστούμε τη χρήση αυτής της μεθόδου για τις μεγάλες ουρές. Όταν χρησιμοποιείτε ring_all, παράγοντες συνδεδεμένοι με τηλέφωνα που έχουν το γραφείο Στις απενεργοποιηθεί Άγκιστρο θα πρέπει να χρησιμοποιούν τις καλεί Στην ουρά του πίνακα και κάντε κλικ στο σύνδεσμο ΠΑΡΑΛΑΒΗ ΠΡΟΣΚΛΗΣΗΣ να αναλάβουν τις κλήσεις στην ουρά. Το ποσό του χρόνου, το τηλέφωνο θα χτυπήσει παράγοντες για ring_all έχει οριστεί στη ρύθμιση Ring On-Hook ώρα ή στο συντομότερο χρονικό διάστημα δακτύλιο από τα τηλέφωνα που θα ονομάζεται. Δεν συνιστάται η χρήση ring_all την υψηλή ένταση του ήχου κλήσης ουρές, ουρές ή με πολλούς παράγοντες. Η μέθοδος ring_all προορίζεται να χρησιμοποιείται μόνο με λίγα μέσα και από το χαμηλό όγκο κλήσεων σε ομάδες. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>On-Hook Ώρα δαχτυλίδι -</B> Η επιλογή αυτή χρησιμοποιείται μόνο για τους πράκτορες που είναι συνδεδεμένοι με τηλέφωνα που έχουν το πρακτορείο-on-γάντζο ενεργοποιημένη τη λειτουργία. Αυτός είναι ο αριθμός των δευτερολέπτων που κάθε απόπειρα κλήσης του πράκτορα θα χτυπήσει για μέχρι το σύστημα θα περιμένει ένα δευτερόλεπτο και ήχο αρχίσουν τα διαθέσιμα τηλέφωνα πράκτορα και πάλι. Το πεδίο αυτό μπορεί να παρακαμφθεί εάν τα τηλέφωνα παράγοντας που σε χαμηλότερο χρόνο δαχτυλίδι που μπορεί να είναι απαραίτητες για την αποτροπή κλήσεων από το να στείλει ένα φωνητικό ταχυδρομείο τηλέφωνα. Η προεπιλογή είναι 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>On-Hook CID -</B> Η επιλογή αυτή χρησιμοποιείται μόνο για τους πράκτορες που είναι συνδεδεμένοι με τηλέφωνα που έχουν το πρακτορείο-on-γάντζο ενεργοποιημένη τη λειτουργία. Αυτή είναι η ταυτότητα του καλούντος που θα εμφανιστούν στα τηλέφωνα πράκτορά τους, όταν οι κλήσεις χτυπούν. ΓΕΝΙΚΗ είναι ένας γενικός RINGAGENT00000000001 τύπο της κοινοποίησης. INGROUP θα δείξει μόνο την ομάδα-σε η κλήση προήλθε από. CUSTOMER_PHONE θα δείχνουν μόνο τον αριθμό τηλεφώνου του πελάτη. CUSTOMER_PHONE_RINGΧΕΙΡΙΣΤΗΣθα δείξει RINGAGENT_3125551212 με την RINGΧΕΙΡΙΣΤΗΣως μέρος του CID με τον αριθμό τηλεφώνου του πελάτη. CUSTOMER_PHONE_INGROUP θα δείξει τα πρώτα 10 χαρακτήρες του σε ομάδα που ακολουθείται από τον αριθμό τηλεφώνου του πελάτη. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4180,10 +5825,15 @@ if ($ADD==99999) <BR> <B>Βοηθός εκστρατείας -</B> αυτές οι επιλογές επιτρέπουν να επιλέξετε τον Βοηθό που θα εμφανιστεί στην οθόνη των χειριστών για αυτήν την εκστρατεία. Επιλέξτε NONE για να μην παρουσιάσετε κανένα χειρόγραφο για αυτήν την εκστρατεία. + <BR> + <A NAME="vicidial_inbound_groups-ignore_list_script_override"> + <BR> + <B>Αγνοήστε τη συμπληρωματική προμήθεια χειρογράφων καταλόγων-</B> Αυτή η επιλογή επιτρέπει σε σας για να αγνοήσει την επιλογή συμπληρωματικής προμήθειας χειρογράφων ταυτότητας καταλόγων για τις κλήσεις που μπαίνουν σε αυτήν την -ομάδα. Η ρύθμιση αυτού στο Υ θα αγνοήσει οποιεσδήποτε τοποθετήσεις χειρογράφων καταλόγων ταυτότητα. Η προεπιλογή είναι Ν. + <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Κατά την έναρξη κλήσης -</B> αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μεάβαση στον Βοηθό ή τίποτα. + <B>Κατά την έναρξη κλήσης -</B> αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μεάβαση στον Βοηθό ή τίποτα. Αν είναι προσαρμοσμένα πεδία λίστας ενεργοποιημένη στο σύστημά σας, θα ΕΝΤΥΠΟ ανοίξτε την καρτέλα ΕΝΤΥΠΟ κατά τη σύνδεση μιας κλήσης σε έναν πράκτορα. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4193,7 +5843,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Timer Δράση -</B> Αυτό το χαρακτηριστικό σας επιτρέπει να προκαλέσει ενέργειες μετά από ένα ορισμένο χρονικό διάστημα. το Δ1 και Δ2 επιλογές DIAL θα δημοσιεύσει μια πρόσκληση για τη μεταφορά Διάσκεψη προεπιλογές Αριθμός και τους διαβιβάζουν στον πράκτορα της συνόδου, αυτή χρησιμοποιείται συνήθως για απλές εφαρμογές IVR AGI επικύρωση ή απλά να παίξει ένα προ-ηχογραφημένο μήνυμα. WEBFORM θα ανοίξει τη διεύθυνση φόρμα. MESSAGE_ONLY θα εμφανίσει απλά το μήνυμα ότι είναι στο πεδίο παρακάτω. ΚΑΝΕΝΑ θα απενεργοποιήσετε αυτήν τη δυνατότητα και είναι η προεπιλογή. Αυτή η ρύθμιση θα παρακάμπτουν τις ρυθμίσεις καμπάνιας. + <B>Timer Δράση -</B> Αυτό το χαρακτηριστικό σας επιτρέπει να προκαλέσει ενέργειες μετά από ένα ορισμένο χρονικό διάστημα. το Δ1 και Δ2 επιλογές DIAL θα δημοσιεύσει μια πρόσκληση για τη μεταφορά Διάσκεψη προεπιλογές Αριθμός και τους διαβιβάζουν στον πράκτορα της συνόδου, αυτή χρησιμοποιείται συνήθως για απλές εφαρμογές IVR AGI επικύρωση ή απλά να παίξει ένα προ-ηχογραφημένο μήνυμα. WEBFORM θα ανοίξει τη διεύθυνση φόρμα. MESSAGE_ONLY θα εμφανίσει απλά το μήνυμα ότι είναι στο πεδίο παρακάτω. ΚΑΝΕΝΑ θα απενεργοποιήσετε αυτήν τη δυνατότητα και είναι η προεπιλογή. Αυτή η ρύθμιση θα παρακάμπτουν τις ρυθμίσεις καμπάνιας. Hangup θα τερματίσετε την κλήση, όταν το χρονόμετρο έχει ενεργοποιηθεί, CALLMENU θα στείλει την κλήση στο μενού Κλήση καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, ΕΠΕΚΤΑΣΗ θα στείλει την κλήση της επέκτασης που καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, θα στείλει IN_GROUP την κλήση στο In-ομάδα που προσδιορίζεται στο πεδίο της δράσης Προορισμός χρονοδιακόπτη. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4205,6 +5855,11 @@ if ($ADD==99999) <BR> <B>Timer Δευτερόλεπτα Δράση -</B> Αυτό είναι το χρονικό διάστημα μετά την κλήση συνδέεται με τον πελάτη ότι το χρονόμετρο δράσης ενεργοποιείται. Προεπιλογή είναι -1 που είναι και ανενεργός. + <BR> + <A NAME="vicidial_inbound_groups-timer_action_destination"> + <BR> + <B>Χρονοδιακόπτης Προορισμός δράσης -</B> Αυτό το πεδίο είναι όπου μπορείτε να καθορίσετε το μενού Κλήση, επέκταση ή-Στην ομάδα που θέλετε να αποσταλεί κλήση αν ο χρόνος δράσης της έχει οριστεί σε CALLMENU, την επέκταση ή IN_GROUP. Προεπιλογή είναι άδειο. + <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> @@ -4213,23 +5868,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_action"> <BR> - <B>Drop δράσης - </B> Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα Inbound που καθορίζονται κατωτέρω. + <B>Drop δράσης - </B> Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα  εισερχόμενοςπου καθορίζονται κατωτέρω. <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Drop παράταση - </B> Αν Drop δράση που να είναι μήνυμα, αυτό είναι η κλήση σχέδιο επέκτασης ότι η πρόσκληση θα σταλεί στο εάν ανέρχεται Drop Call Δευτερόλεπτα. + <B>Drop παράταση - </B> Αν Drop δράση που να είναι μήνυμα, αυτό είναι η κλήση σχέδιο επέκτασης ότι η πρόσκληση θα σταλεί στο εάν ανέρχεται Drop Call Δευτερόλεπτα. Για AGENTDIRECT σε ομάδες, αν ο χρήστης δεν είναι διαθέσιμη, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + <B>ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. Σε μια -ομάδα AGENTDIRECT, που θέτει αυτό σε AGENTVMAIL θα επιλέξει την ταυτότητα φωνητικού ταχυδρομείου χρηστών στη χρήση. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Drop Μεταφορά Όμιλος - </B> Αν Drop Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα εάν ανέρχεται Drop Call Δευτερόλεπτα. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Πτώση Μενού κλήσεων -</B> Εάν δράσης Drop έχει οριστεί σε CALLMENU, η κλήση θα αποσταλεί σε αυτό το μενού κλήση αν φτάσει δευτερόλεπτα κλήσης Drop. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Μεταφορά δράσης CID -</B> Χρησιμοποιείται για την πτώση, μετά από ώρες και No-παράγοντας-δεν-ουρά ενέργειες. Αυτός είναι ο αριθμός ταυτότητας καλούντα ότι η κλήση χρησιμοποιεί προτού μεταφερθούν σε επεκτάσεις, μηνύματα, φωνητικό μενού ή κλήσης. Μπορείτε να χρησιμοποιήσετε ΠΕΛΑΤΗ σε αυτόν τον τομέα για να χρησιμοποιήσετε τον αριθμό τηλεφώνου του πελάτη, ή μια καμπάνια να χρησιμοποιεί το πρώτο επιτρέπεται καλούντος εκστρατεία αριθμό ταυτότητας. Προεπιλογή είναι ο πελάτης. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4248,22 +5913,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Μετά από την παράταση ωρών - η dialplan επέκταση για ναστείλει την πρόσκληση εάν η δράση τίθεται την ΕΠΕΚΤΑΣΗ. Ηπροεπιλογή είναι 8300. + <B>Μετά από την παράταση ωρών - η dialplan επέκταση για ναστείλει την πρόσκληση εάν η δράση τίθεται την ΕΠΕΚΤΑΣΗ. Ηπροεπιλογή είναι 8300. Για AGENTDIRECT σε ομάδες, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Μετά από το φωνητικό ταχυδρομείο ωρών - το κιβώτιο φωνητικούταχυδρομείου για να στείλει την πρόσκληση εάν η δράση τίθεται τοΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΊΟ. + <B>Μετά από το φωνητικό ταχυδρομείο ωρών - το κιβώτιο φωνητικούταχυδρομείου για να στείλει την πρόσκληση εάν η δράση τίθεται τοΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΊΟ. Σε μια -ομάδα AGENTDIRECT, που θέτει αυτό σε AGENTVMAIL θα επιλέξει την ταυτότητα φωνητικού ταχυδρομείου χρηστών στη χρήση. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>Μετά από ώρες Μεταφορά Όμιλος - </B> Εάν Μετά Ώρες Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα, αν αυτή τεθεί σε-η ομάδα εκτός από τη διάρκεια των κλήσεων για το καθεστώς που ορίζεται στην ομάδα. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>After Hours Καλέστε Μενού -</B> Αν After Hours δράσης αναμένεται να CALLMENU, η κλήση θα αποσταλεί σε αυτό το μενού Κλήση, αν αυτή τεθεί το σε ομάδα εκτός του συστήματος χρόνου εφημερίας ορίζεται για την ομάδα στην. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>Δεν Πράκτορες Δεν Αναμονής -</B> Αν αυτό το πεδίο έχει οριστεί σε Ναι ή NO_PAUSED τότε δεν θα ζητεί να τεθεί στην ουρά για αυτό στην ομάδα, εφόσον δεν υπάρχουν παράγοντες συνδεδεμένοι και οι κλήσεις θα πάει στο γραφείο Δεν Δεν Queue δράσης. Η NO_PAUSED επιλογή δεν θα στείλει επίσης την καλούντες στην ουρά, εάν υπάρχουν μόνο σε παύση παράγοντες στην ομάδα της. Προεπιλογή είναι N. + <B>Δεν Πράκτορες Δεν Αναμονής -</B> Αν αυτό το πεδίο έχει οριστεί σε Ναι ή NO_PAUSED τότε δεν θα ζητεί να τεθεί στην ουρά για αυτό στην ομάδα, εφόσον δεν υπάρχουν παράγοντες συνδεδεμένοι και οι κλήσεις θα πάει στο γραφείο Δεν Δεν Queue δράσης. Η NO_PAUSED επιλογή δεν θα στείλει επίσης την καλούντες στην ουρά, εάν υπάρχουν μόνο σε παύση παράγοντες στην ομάδα της. Προεπιλογή είναι N. Σε μια -ομάδα AGENTDIRECT, που θέτει αυτό σε AGENTVMAIL θα επιλέξει την ταυτότητα φωνητικού ταχυδρομείου χρηστών στη χρήση. Μπορείτε επίσης να βάλετε AGENTEXT σε αυτόν τον τομέα, εφόσον έχει οριστεί για την παράταση και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -4275,6 +5945,21 @@ if ($ADD==99999) <BR> <B>Δεν Agent Δεν Queue δράσης Αξία -</B> Αυτή είναι η τιμή για την παραπάνω δράση. Προεπιλογή είναι nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Μέγιστη κλήσεις μεθόδων -</B> Αυτή η επιλογή μπορεί να επιτρέψει τη μέγιστη ταυτόχρονη λειτουργία προσκλήσεις για αυτό στην ομάδα. Εάν οριστεί σε ΣΥΝΟΛΟ, τότε ο συνολικός αριθμός των κλήσεων εξετάζονται από πράκτορες και σε ουρά σε αυτό της ομάδας δεν επιτρέπεται να υπερβαίνει τον αριθμό κλήσεις Μέγιστη αρίθμηση των γραμμών, όπως ορίζεται παρακάτω. Εάν οριστεί σε IN_QUEUE, στη συνέχεια, αν ο αριθμός των κλήσεων σε ουρά αναμονής για τους πράκτορες δεν θα επιτρέπεται να υπερβαίνει το Max κλήσεις Μετρήστε ανεξάρτητα από το πόσες κλήσεις με τους πράκτορες για αυτό-ομάδα. Προεπιλογή είναι απενεργοποιημένη. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Μέγιστη Κλήσεις Μετρήστε -</B> Η επιλογή αυτή πρέπει να ρυθμιστεί υψηλότερα από το 0 εάν θέλετε να χρησιμοποιήσετε το χαρακτηριστικό Μέγιστη καλεί τη μέθοδο. Προεπιλογή είναι 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Μέγιστη Κλήσεις δράσης -</B> Αυτή είναι η δράση που πρέπει να ληφθούν αν η Μέγιστη κλήσεις μεθόδων είναι ενεργοποιημένη και ο αριθμός των κλήσεων υπερβαίνει ό, τι βρίσκεται πάνω στο Max κλήσεις Μετρήστε ρύθμιση. Οι προσκλήσεις άνω του ποσού αυτού θα σταλεί είτε τη δράση DROP, τη δράση ή την AFTERHOURS NO_AGENT_NO_QUEUE δράση και θα καταγραφεί ως MAXCAL του καθεστώτος, με λόγο hangup MAXCALLS. Η προεπιλογή είναι NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -4300,6 +5985,16 @@ if ($ADD==99999) <BR> <B>Στο γρήγορο διάστημα λαβής - το χρονικό διάστημα σταδευτερόλεπτα για να περιμένει πρίν παίζει επάνω κρατά γρήγορος.Η προεπιλογή είναι 60. Για να απενεργοποιήσετε την Προτροπή σε αναμονή, που το χρονικό διάστημα έως 0. + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> + <BR> + <B>Στην υπαγόρευση λαβής κανένας φραγμός -</B> Ο καθορισμός αυτής της επιλογής στο Υ θα επιτρέψει τις προσκλήσεις στη γραμμή πίσω από μια πρόσκληση όπου επάνω κρατήστε ότι γρήγορος παίζει για να πάει σε έναν πράκτορα εάν το ένα διατεθεί ενώ το μήνυμα παίζει. Ενώ επάνω κρατήστε ότι το γρήγορο μήνυμα ονομάτων αρχείου παίζει σε έναν πελάτη δεν μπορούν να σταλούν σε έναν πράκτορα. Η προεπιλογή είναι Ν. + + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> + <BR> + <B>Στα γρήγορα δευτερόλεπτα λαβής -</B> Αυτός ο τομέας πρέπει να τεθεί τον αριθμό δευτερολέπτων ότι επάνω κρατήστε ότι η γρήγορη προεπιλογή παιχνιδιών ξέν. ονομάτων αρχείου είναι 10. + <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> <BR> @@ -4310,35 +6005,160 @@ if ($ADD==99999) <BR> <B>Παίξτε Κρατήστε Εκτιμώμενη ώρα - </B> Αυτό καθορίζει αν ο καλών θα ακούσει τον εκτιμώμενο χρόνο κατέχουν προτού μεταφερθούν σε έναν πράκτορα. Προεπιλεγμένο είναι Ν. Εάν ο πελάτης είναι σε αναμονή και ακούει αυτό το μήνυμα εκτιμώμενο χρόνο κατέχουν, ο ελάχιστος χρόνος που θα παίξει είναι 15 δευτερόλεπτα. + <BR> + <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> + <BR> + <B>Υπολογίστε περίπου δευτερόλεπτα Hold -</B> Αυτό καθορίζει τον αριθμό των δευτερολέπτων στην ουρά ότι ο πελάτης θα περιμένει πριν την προβλεπόμενη ώρα Αναμονή θα πρέπει να υπολογίζονται και προαιρετικά έπαιξε. Ελάχιστες είναι 3 δευτερόλεπτα, ακόμα κι αν είναι μικρότερος από 3. Προεπιλογή είναι 0. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> + <BR> + <B>Εκτιμώμενος χρόνος Κρατήστε Όνομα Ελάχιστες -</B> Εάν η Εκτιμώμενος χρόνος Hold είναι ενεργό και υπολογίζεται να είναι σε ή κάτω από το ελάχιστο 15 δευτερόλεπτα, τότε αυτό το αρχείο εντολών θα παίξει αντί της ανακοίνωσης προεπιλογή. Προεπιλογή είναι άδειο για ανενεργό. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> + <BR> + <B>Εκτιμώμενος χρόνο παραμονής τουλάχιστον Ερώτηση αριθ. Μπλοκ -</B> Αν Εκτιμώμενος χρόνος Hold είναι ενεργή και ο προβλεπόμενος χρόνος τήρησης ελάχιστων πεδίο Όνομα αρχείου είναι πάνω από συμπληρωμένη, τότε η επιλογή αυτή να επιτρέπει την πραγματοποίηση κλήσεων στη γραμμή πίσω από μια κλήση όπου η προτροπή να πάει το παιχνίδι σε έναν πράκτορα εάν είναι διαθέσιμο, ενώ το μήνυμα που παίζει . Ενώ η άμεση παίζει σε έναν πελάτη που δεν μπορεί να σταλεί σε έναν πράκτορα. Προεπιλογή είναι N. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> + <BR> + <B>Εκτιμώμενος χρόνος Hold Ελάχιστη εντολών Δευτερόλεπτα -</B> Αυτό το πεδίο πρέπει να ρυθμιστεί με τον αριθμό των δευτερολέπτων που ο εκτιμώμενος χρόνος Hold Όνομα Ελάχιστες προτροπή παίζει. Η προεπιλογή είναι 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option"> + <BR> + <B>Περιμένετε Επιλογή Χρόνος -</B> Αυτό σας επιτρέπει να προσφέρουμε στους πελάτες επιλογές για να αφήσει την ουρά, αν ο χρόνος αναμονής τους είναι πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν μία από τις επιλογές PRESS_ έχει επιλεγεί, θα παίξει το όνομα του αρχείου Τύπου ορίζονται κατωτέρω, και να δώσει στον πελάτη τη δυνατότητα να πατήστε το κουμπί 1 στο τηλέφωνό τους να φύγουν από την ουρά και να εκτελέσετε την επιλεγμένη επιλογή. Η PRESS_STAY επιλογή θα στείλει τον πελάτη πίσω στην ουρά, χωρίς να χάσει τη θέση τους στην γραμμή. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_second_option"> + <BR> + <B>Περιμένετε δεύτερη φορά Επιλογή -</B> Ίδια με την πρώτη φορά στον τομέα Επιλογή Περιμένετε παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 2. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν υπάρχει πρώτη επιλογή χρόνος αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_third_option"> + <BR> + <B>Περιμένετε Ώρα Τρίτη επιλογή -</B> Ίδια με την πρώτη φορά στον τομέα Επιλογή Περιμένετε παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 3. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν Δεύτερη επιλογή χρόνος αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> + <BR> + <B>Περιμένετε Δευτερόλεπτα Επιλογή Χρόνος -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε οτιδήποτε, αλλά ΚΑΝΕΝΑ, αυτός είναι ο αριθμός των δευτερολέπτων που ο πελάτης έχει να περιμένει στην ουρά που θα ενεργοποιήσουν τις επιλογές του χρόνου αναμονής. Προεπιλογή είναι 120 δευτερόλεπτα. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_exten"> + <BR> + <B>Περιμένετε Χρόνος Επέκταση Επιλογή -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_EXTEN, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. Για AGENTDIRECT σε ομάδες, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> + <BR> + <B>Περιμένετε ώρα Callmenu Επιλογή -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_CALLMENU, αυτό είναι το μενού Κλήση ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> + <BR> + <B>Περιμένετε ώρα Τηλεφωνητής Επιλογή -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_VMAIL, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. Σε ένα AGENTDIRECT στην ομάδα, θέτοντας αυτή την AGENTVMAIL θα επιλέξετε το αναγνωριστικό τηλεφωνητή χρήστη να χρησιμοποιεί. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> + <BR> + <B>Περιμένετε Χρόνος Μεταγωγής επιλογή-ομάδα -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_INGROUP, αυτή είναι η εισερχόμενη ομάδα ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> + <BR> + <B>Περιμένετε Ώρα Όνομα Επιλογή Τύπου -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε μία από τις επιλογές PRESS_, αυτή είναι η προτροπή του ονόματος αρχείου που παίζεται αν ο χρόνος αναμονής του πελάτη υπερβαίνει τις Δευτερόλεπτα Επιλογή χρόνος αναμονής για να δώσει στον πελάτη τη δυνατότητα να πιέσει 1, 2 ή 3 στο τηλέφωνό τους για να τρέξει οι επιλεγμένες επιλογές Πατήστε το χρόνο αναμονής. Είναι πολύ σημαντικό να περιλαμβάνει επιλογές από το αρχείο ήχου για όλα τα επιλεγμένα Επιλογές χρόνο αναμονής σας, και ότι το μήκος του αρχείου ήχου σε λίγα δευτερόλεπτα έχει οριστεί σωστά στο πεδίο Όνομα δευτερόλεπτα κάτω ή θα υπάρξουν προβλήματα. Η προεπιλογή είναι να-να-λέγεται-πίσω. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> + <BR> + <B>Περιμένετε ώρα Τύπου επιλογή Χωρίς Κλείδωμα -</B> Η ρύθμιση αυτής της επιλογής στο Y θα επιτρέπει την πραγματοποίηση κλήσεων στη γραμμή πίσω από μια κλήση όπου ο χρόνος αναμονής Επιλογή Όνομα Τύπου προτροπή να πάει το παιχνίδι σε έναν πράκτορα εάν είναι διαθέσιμο, ενώ το μήνυμα που παίζει. Ενώ ο χρόνος αναμονής Επιλογή Τύπου μηνύματος Όνομα παίζει σε έναν πελάτη που δεν μπορεί να σταλεί σε έναν πράκτορα. Προεπιλογή είναι N. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> + <BR> + <B>Περιμένετε δευτερόλεπτα χρόνος Επιλογή Όνομα Τύπου -</B> Αυτό το πεδίο πρέπει να ρυθμιστεί με τον αριθμό των δευτερολέπτων που ο χρόνος αναμονής Επιλογή Όνομα Τύπου παίζει. Η προεπιλογή είναι 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> + <BR> + <B>Περιμένετε Επιλογή ώρα μετά το όνομα αρχείου Τύπου -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε μία από τις επιλογές PRESS_, αυτή είναι η προτροπή του ονόματος αρχείου που παίζεται αφού ο πελάτης έχει πιεστεί 1, 2 ή 3. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> + <BR> + <B>Περιμένετε Χρόνος επανάκλησης Επιλογή ID της λίστας -</B> Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_CID_CALLBACK, αυτό είναι το ID της λίστας η κλήση προστίθεται ως νέο επικεφαλής, αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. + + <BR> + <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> + <BR> + <B>Περιμένετε Κρατήστε Προτεραιότητα Επιλογή -</B> Αν και οι δύο επιλογές Εκτιμώμενος χρόνος συντήρησης και Περιμένετε ώρα επιλογές είναι ενεργές, η ρύθμιση αυτή θα καθορίσει κατά πόσο ένα, το άλλο ή και τα δύο αυτά χαρακτηριστικά είναι ενεργό. Για παράδειγμα, αν ο εκτιμώμενος χρόνος Hold επιλογή έχει οριστεί σε 360, η επιλογή χρόνος αναμονής έχει οριστεί σε 120 και ο πελάτης έχει να περιμένει για 120 δευτερόλεπτα και εξακολουθούν να υπάρχουν 400 δευτερόλεπτα εκτιμάται ότι κατέχουν χρόνο, τότε και οι δύο ενεργές την ίδια στιγμή και αυτή η ρύθμιση θα πρέπει να ελεγχθούν για να δούμε τι επιλογές θα πρέπει να προσφέρονται. Η προεπιλογή είναι μόνο ΑΝΑΜΟΝΗ. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Κρατήστε Ώρα Επιλογή - </B> Αυτό σας επιτρέπει να καθορίσετε την δρομολόγηση των κλήσεων, εάν ο εκτιμώμενος χρόνος κατέχουν πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλεγμένο είναι ΚΑΝΕΝΑ. + <B>Estimated Κρατήστε Ώρα Επιλογή - </B> Αυτό σας επιτρέπει να καθορίσετε την δρομολόγηση των κλήσεων, εάν ο εκτιμώμενος χρόνος κατέχουν πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλεγμένο είναι ΚΑΝΕΝΑ. Εάν μια από τις επιλογές PRESS_ επιλέγεται, θα παίξει το όνομα αρχείου Τύπου που καθορίζεται κατωτέρω και θα δώσει στον πελάτη την επιλογή να πιέσει 1 στο τηλέφωνό τους για να αφήσει τη σειρά αναμονής και να τρέξει την επιλεγμένη επιλογή. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_second_option"> + <BR> + <B>Κρατήστε δεύτερη φορά Επιλογή -</B> Ίδια με την πρώτη φορά στον τομέα επιλογή Hold παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 2. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν υπάρχει πρώτη επιλογή Χρόνος Αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_third_option"> + <BR> + <B>Κρατήστε Ώρα Τρίτη επιλογή -</B> Ίδια με την πρώτη φορά στον τομέα επιλογή Hold παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 3. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν Δεύτερη επιλογή Χρόνος Αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> <BR> <B>Κρατήστε Ώρα Επιλογή δευτερόλεπτα - </B> Αν Κρατήστε Ώρα Επιλογή έχει οριστεί σε οτιδήποτε, αλλά ΚΑΝΕΝΑ, αυτό είναι ο αριθμός των δευτερολέπτων του χρόνου εκτιμάται ότι κατέχουν θα ενεργοποιήσει την αναμονή ώρα της επιλογής. Η προεπιλογή είναι 360 δευτερόλεπτα. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> + <BR> + <B>Ελάχιστο χρονικής επιλογής λαβής -</B> Εάν η χρονική επιλογή λαβής που επιτρέπεται, αυτό είναι ο ελάχιστος αριθμός δευτερολέπτων η κλήση πρέπει προτού να παρουσιαστεί με τη χρονική επιλογή λαβής. Η χρονική επιλογή λαβής θα παρουσιαστεί αμέσως αυτή τη στιγμή εάν ο κατ' εκτίμηση χρόνος λαβής είναι μεγαλύτερος από την αξία δευτερολέπτων χρονικής επιλογής λαβής. Η προεπιλογή είναι 0 δευτερόλεπτα. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Κρατήστε Ώρα Επιλογή Επέκταση - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε ΕΠΕΚΤΑΣΗ, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + <B>Κρατήστε Ώρα Επιλογή Επέκταση - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε ΕΠΕΚΤΑΣΗ, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. Για AGENTDIRECT σε ομάδες, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> + <BR> + <B>Χρονική επιλογή Callmenu λαβής -</B> Εάν η χρονική επιλογή λαβής τίθεται CALL_MENU, αυτά είναι οι επιλογές κλήσης ότι η κλήση θα σταλεί εάν ο κατ' εκτίμηση χρόνος λαβής υπερβεί τα δευτερόλεπτα χρονικής επιλογής λαβής. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>Κρατήστε Ώρα Επιλογή Τηλεφωνητής - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε τηλεφωνητή, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + <B>Κρατήστε Ώρα Επιλογή Τηλεφωνητής - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε τηλεφωνητή, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. Σε μια -ομάδα AGENTDIRECT, που θέτει αυτό σε AGENTVMAIL θα επιλέξει την ταυτότητα φωνητικού ταχυδρομείου χρηστών στη χρήση. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> <BR> <B>Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε IN_GROUP, αυτή είναι η ομάδα που την εισερχόμενη κλήση θα αποσταλεί στο εάν ο εκτιμώμενος χρόνος αναμονή υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> + <BR> + <B>Όνομα αρχείου Τύπου χρονικής επιλογής λαβής -</B> Εάν η χρονική επιλογή λαβής τίθεται μια από τις επιλογές PRESS_, αυτό είναι η υπαγόρευση ονομάτων αρχείου που παίζεται εάν ο κατ' εκτίμηση χρόνος λαβής υπερβαίνει τα δευτερόλεπτα χρονικής επιλογής λαβής για να δώσει στον πελάτη την επιλογή να πιέσει 1 στο τηλέφωνό τους για να τρέξει την επιλεγμένη επιλογή χρονικού Τύπου λαβής. Είναι πολύ σημαντικό ότι αυτό το ακουστικό αρχείο είναι 10 δευτερόλεπτα ή λιγότεροι ή θα υπάρξουν προβλήματα. Η προεπιλογή είναι -είμαι-καλώ-πίσω. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> + <BR> + <B>Κρατήστε τον Τύπο χρονικής επιλογής κανένας φραγμός -</B> Ο καθορισμός αυτής της επιλογής στο Υ θα επιτρέψει τις προσκλήσεις στη γραμμή πίσω από μια πρόσκληση όπου η υπαγόρευση ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής παίζει για να πάει σε έναν πράκτορα εάν το ένα διατεθεί ενώ το μήνυμα παίζει. Ενώ το μήνυμα ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής παίζει σε έναν πελάτη δεν μπορούν να σταλούν σε έναν πράκτορα. Η προεπιλογή είναι Ν. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> + <BR> + <B>Δευτερόλεπτα ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής -</B> Αυτός ο τομέας πρέπει να τεθεί τον αριθμό δευτερολέπτων ότι το όνομα αρχείου Τύπου χρονικής επιλογής λαβής παίζει την προεπιλογή ξέν. είναι 10. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Κρατήστε Ώρα Επιλογή αρχείου Callback - </B> Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε CALLERID_CALLBACK, αυτό είναι το όνομα του αρχείου εντολών που έπαιξε πριν από την κλήση καταγράφεται ως μια νέα πρωτοβουλία στον κατάλογο ID που καθορίζονται κατωτέρω, εάν η εκτιμώμενη κατέχει υπερβαίνει το χρόνο Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + <B>Χρονική επιλογή λαβής μετά από το όνομα αρχείου Τύπου -</B> Εάν η χρονική επιλογή λαβής τίθεται μια από τις επιλογές PRESS_ ή το CALLERID_CALLBACK, αυτό είναι η υπαγόρευση ονομάτων αρχείου που παίζεται αφότου έχει πιέσει ο πελάτης 1 ή η κλήση έχει προστεθεί στον κατάλογο επανάκλησης. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -4368,7 +6188,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>-Στην ομάδα αρχείου Καταγραφή - </B> Το πεδίο αυτό θα αντικαταστήσει το Εκστρατεία Καταγραφή Filenaming σύστημα εάν δεν έχει οριστεί σε ΚΑΝΕΝΑ. Οι μεταβλητές που επιτρέπονται είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH ΠΡΑΚΤΟΡΑ. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζει κάπως έτσι 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει κάπως έτσι TESTCAMP_51020103108_3125551212. 50 char max. Προεπιλεγμένο είναι ΚΑΝΕΝΑ. + <B>In-Group Recording Filename -</B> This field will override the Ηχογράφηση εκστρατείας Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH ΧΕΙΡΙΣΤΗΣVENDORLEADCODE LEADID. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζουν με αυτό το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με αυτό TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -4437,18 +6257,42 @@ if ($ADD==99999) <BR> <B>Καλέστε dispo URL -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. + <BR> + <A NAME="vicidial_inbound_groups-add_lead_url"> + <BR> + <B>Μόλυβδος Προσθήκη URL -</B> Αυτή η διεύθυνση URL ιστοσελίδας δεν θεωρείται από τον πράκτορα, αλλά καλείται κάθε φορά που ένας κύριος προστίθεται στο σύστημα μέσω της διαδικασίας εισερχόμενα. Η προεπιλογή είναι κενό. Θα πρέπει να αρχίσει με αυτή τη διεύθυνση URL VAR αν θέλετε να χρησιμοποιήσετε μεταβλητές, και φυσικά - Α - και - Β - γύρω από την πραγματική μεταβλητή στο URL όπου θέλετε να το χρησιμοποιήσετε. Αυτή είναι η λίστα των μεταβλητών που είναι διαθέσιμες για αυτή τη λειτουργία. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>Δεν URL Καλέστε τον πράκτορα -</B> Αυτή η διεύθυνση URL ιστοσελίδας δεν θεωρείται από τον πράκτορα, αλλά αν έχει συμπληρωθεί καλείται κάθε φορά που μια κλήση που δεν γίνεται από έναν πράκτορα είναι κρεμασμένα επάνω ή μεταφέρθηκαν. Χρησιμοποιεί τις ίδιες μεταβλητές όπως τα πεδία σενάρια διαδικτυακή φόρμα και. dispo μπορεί να χρησιμοποιηθεί για να ανακτήσει το σύστημα-που ορίζεται διάθεση για την κλήση. Αυτό το URL δεν μπορεί να είναι μια σχετική διαδρομή. Η προεπιλογή είναι κενό. + <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> <BR> <B>Προεπιλεγμένη ομάδα Γνωστός - </B> Αν έχετε τη δυνατότητα Ομάδα Γνωστός για την εκστρατεία ότι ο αντιπρόσωπος είναι συνδεδεμένοι στο τότε αυτή είναι η ομάδα που έχει επιλεγεί άλλως πρώτα από προεπιλογή για μια κλήση που προέρχεται από αυτή την ομάδα, όταν ο εισερχόμενος πράκτορας επιλέγει να χρησιμοποιήσετε μια ομάδα Γνωστός για εξερχόμενες κλήσης εγχειρίδιο. Προεπιλεγμένο είναι ΚΑΝΕΝΑ ή κενό. + <BR> + <A NAME="vicidial_inbound_groups-extension_appended_cidname"> + <BR> + <B>Η επέκταση επισυνάπτει CID -</B> Εάν επιτρέπονται, οι κλήσεις που προέρχονται μέσα από αυτήν την -ομάδα θα έχουν ένα διάστημα και την τηλεφωνική επέκταση του πράκτορα που επισυνάπτεται στο τέλος του ονόματος CallerID για την κλήση προτού να σταλεί στον πράκτορα. Η προεπιλογή είναι Ν για τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_display"> + <BR> + <B>Επίδειξη θέσης Uniqueid -</B> Εάν επιτρέπονται, όταν λαμβάνει ένας πράκτορας μια πρόσκληση μέσω αυτής της -ομάδας θα δουν το uniqueid της πρόσκλησης που προστίθεται στη γραμμή θέσης στη διεπαφή πρακτόρων τους. Η επιλογή ΠΡΟΘΕΜΑΤΟΣ θα προσθέσει το καθορισμένο πρόθεμα χτύπημα στην αρχή του uniqueid στην επίδειξη. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ. Εάν υπήρξε ήδη ένα Uniqueid που καθορίστηκε σε μια κλήση που εισάγει αυτήν την -ομάδα, κατόπιν το αρχικό uniqueid θα επιδειχθεί. Εάν η επιλογή ΚΟΝΣΕΡΒΩΝ χρησιμοποιείται και η κλήση στέλνεται σε έναν δεύτερο πράκτορα, το uniqueid και το πρόθεμα που επιδεικνύονται στον πρώτο πράκτορα θα επιδειχθούν επίσης στο δεύτερο πράκτορα. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> + <BR> + <B>Πρόθεμα θέσης Uniqueid -</B> Εάν η επιλογή ΠΡΟΘΕΜΑΤΟΣ επιλέγεται ανωτέρω έπειτα αυτό είναι η αξία εκείνου του προθέματος. Η προεπιλογή είναι κενή. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_Εισερχόμενα_DIDS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_DIDS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <BR> <A NAME="vicidial_inbound_dids-did_pattern"> <BR> @@ -4464,11 +6308,21 @@ if ($ADD==99999) <BR> <B>DID Ενεργό - </B> Αυτό το πεδίο όπου το σύνολο DID εισόδου σε ενεργό ή μη. Προεπιλεγμένο είναι Y. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το έκανε, αυτό επιτρέπει το admin προβολή αυτή δεν περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το έκανε. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> <B>DID Route - </B> Αυτό το είδος της διαδρομής που μπορείτε να ρυθμίσετε το DID χρήση. Παράταση θα αποστείλει τις κλήσεις προς την επέκταση τέθηκε κάτω, τηλεφωνητή θα αποστείλει κλήσεις απευθείας στον τηλεφωνητή τέθηκε κάτω από το πλαίσιο, ο πράκτορας θα αποστείλει κλήσεις σε VICIDIAL παράγοντα όταν είναι συνδεδεμένοι, τηλέφωνο θα στείλει την κλήση σε τηλέφωνα εισόδου επιλεγεί στη συνέχεια, θα IN_GROUP αποστέλλουν κλήσεις απευθείας από την καθορισμένη εισερχόμενα ομάδα. Προεπιλεγμένο είναι παράταση. CALLMENU θα αποστείλει την πρόσκληση προς την πρόσκληση που ορίζεται Μενού. + <BR> + <A NAME="vicidial_inbound_dids-record_call"> + <BR> + <B>Κλήση αρχείων -</B> Αυτή η επιλογή επιτρέπει ότι για να θέσετε τις κλήσεις που μπαίνουν σε αυτό ΚΑΝΑΤΕ για να καταγραφείτε. Το Υ θα καταγράψει την ολόκληρη κλήση, Y_QUEUESTOP θα καταγράψει την κλήση έως ότου είναι η κλήση hungup ή εισάγει μια σειρά αναμονής -ομάδας, το Ν δεν θα καταγράψει την κλήση. Η προεπιλογή είναι Ν. + <BR> <A NAME="vicidial_inbound_dids-extension"> <BR> @@ -4522,7 +6376,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> Αν IN_GROUP έχει επιλεγεί ως η DID διαδρομής, τότε αυτή είναι η επεξεργασία κλήσεων μέθοδος που χρησιμοποιείται για αυτές τις κλήσεις. CID θα προσθέσει ένα νέο ρεκόρ με αποτέλεσμα κάθε κλήση με το CallerID όπως ο αριθμός τηλεφώνου, CIDLOOKUP θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε ολόκληρο το σύστημα, CIDLOOKUPRL θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε μία μόνο που περιλαμβάνεται στον κατάλογο , CIDLOOKUPRC θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε όλες τις λίστες που ανήκουν στη συγκεκριμένη εκστρατεία, ΠΙΟ ΚΟΝΤΑ έχει καθοριστεί για VICIDIAL Closer κλήσεις, ANI θα προσθέσει ένα νέο ρεκόρ με αποτέλεσμα κάθε κλήση με την ANI όπως ο αριθμός τηλεφώνου, ANILOOKUP θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από την ANI σε ολόκληρο το σύστημα, ANILOOKUPRL θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από την ANI σε μία μόνο που περιλαμβάνεται στον κατάλογο, θα XDIGITID προτροπή του καλούντος για ένα Χ οκταψήφιο κωδικό πριν από την κλήση θα τεθεί σε την ουρά, VIDPROMPT θα οδηγήσουν το καλούντος για τον αριθμό ταυτότητας τους και θα δημιουργήσει ένα νέο ρεκόρ με αποτέλεσμα η CallerID όπως τον αριθμό τηλεφώνου και το αναγνωριστικό ως Vendor ID, VIDPROMPTLOOKUP θα προσπαθήσει να την αναζήτηση ταυτότητας σε ολόκληρο το σύστημα, VIDPROMPTLOOKUPRL θα επιχειρήσει να αναζήτησης του προμηθευτή, το αναγνωριστικό της ταυτότητας σε ένα μόνο που περιλαμβάνεται στον κατάλογο, VIDPROMPTLOOKUPRC θα προσπαθήσουν να τον πωλητή αναζήτηση ταυτότητας από το αναγνωριστικό σε όλες τις λίστες που ανήκουν στη συγκεκριμένη καμπάνια. Προεπιλογή είναι CID. + <B>In-Group Call Χειριστείτε Μέθοδος -</B> Αν IN_GROUP έχει επιλεγεί ως η DID διαδρομής, τότε αυτή είναι η επεξεργασία κλήσεων μέθοδος που χρησιμοποιείται για αυτές τις κλήσεις. CID θα προσθέσει ένα νέο ρεκόρ με αποτέλεσμα κάθε κλήση με το CallerID όπως ο αριθμός τηλεφώνου, CIDLOOKUP θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε ολόκληρο το σύστημα, CIDLOOKUPRL θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε μία μόνο που περιλαμβάνεται στον κατάλογο , CIDLOOKUPRC θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από το CallerID σε όλες τις λίστες που ανήκουν στη συγκεκριμένη εκστρατεία, ΠΙΟ ΚΟΝΤΑ έχει καθοριστεί για VICIDIAL Closer κλήσεις, ANI θα προσθέσει ένα νέο ρεκόρ με αποτέλεσμα κάθε κλήση με την ANI όπως ο αριθμός τηλεφώνου, ANILOOKUP θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από την ANI σε ολόκληρο το σύστημα, ANILOOKUPRL θα προσπαθήσει να συμβούλευση τον αριθμό τηλεφώνου από την ANI σε μία μόνο που περιλαμβάνεται στον κατάλογο, θα XDIGITID προτροπή του καλούντος για ένα Χ οκταψήφιο κωδικό πριν από την κλήση θα τεθεί σε την ουρά, VIDPROMPT θα οδηγήσουν το καλούντος για τον αριθμό ταυτότητας τους και θα δημιουργήσει ένα νέο ρεκόρ με αποτέλεσμα η CallerID όπως τον αριθμό τηλεφώνου και το αναγνωριστικό ως Vendor ID, VIDPROMPTLOOKUP θα προσπαθήσει να την αναζήτηση ταυτότητας σε ολόκληρο το σύστημα, VIDPROMPTLOOKUPRL θα επιχειρήσει να αναζήτησης του προμηθευτή, το αναγνωριστικό της ταυτότητας σε ένα μόνο που περιλαμβάνεται στον κατάλογο, VIDPROMPTLOOKUPRC θα προσπαθήσουν να τον πωλητή αναζήτηση ταυτότητας από το αναγνωριστικό σε όλες τις λίστες που ανήκουν στη συγκεκριμένη καμπάνια. Προεπιλογή είναι CID. Εάν μια μέθοδος CIDLOOKUP χρησιμοποιείται με το πλήκτρο ALT, θα αναζητήσει το alt_phone πεδίο για τον αριθμό τηλεφώνου, εάν δεν βρεθεί αγώνες για τον κύριο αριθμό τηλεφώνου. Εάν μια μέθοδος CIDLOOKUP χρησιμοποιείται με ADDR3, θα αναζητήσει το address3 πεδίο για τον αριθμό τηλεφώνου, εάν δεν βρεθεί αγώνες για τον κύριο αριθμό τηλεφώνου και προαιρετικά το πεδίο alt_phone. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -4544,6 +6398,44 @@ if ($ADD==99999) <BR> <B>-Στην ομάδα Τηλέφωνο κώδικα - </B> IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το τηλέφωνο κώδικα που χρησιμοποιείται εάν μια νέα πρωτοβουλία δημιουργείται. + <BR> + <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> + <BR> + <B>Καθαρίστε CID Αριθμός -</B> Αυτό το πεδίο σας επιτρέπει να ορίσετε ένα αριθμό ψηφίων για να περιορίσεις την εισερχόμενη αριθμό ταυτότητας καλούντος για βάζοντας ένα R μπροστά από τον αριθμό των ψηφίων, για παράδειγμα, να περιορίσει το δικαίωμα των 10 ψηφίων που θα εισάγετε στο R10. Μπορείτε επίσης να χρησιμοποιήσετε αυτή τη δυνατότητα να καταργήσετε μόνο ηγετικό ψηφίο ή ψηφία θέτοντας L μπροστά από τα συγκεκριμένα ψηφία που θέλετε να καταργήσετε, για παράδειγμα, να αφαιρέσετε ένα 1 ως πρώτο ψηφίο θα εισάγετε το L1. Προεπιλογή είναι άδειο. Εάν περισσότεροι από ένας κανόνας και φροντίστε να τις διαχωρίσετε με ένα διάστημα και η έρευνα θα λειτουργήσει πριν από το L. + + <BR> + <A NAME="vicidial_inbound_dids-filter_inbound_number"> + <BR> + <B>Φιλτράρισμα Εισερχόμενων Αριθμός -</B> Αυτή η επιλογή αν δυνατότητα σας επιτρέπει να φιλτράρετε κλήσεις που έρχονται σε αυτό το DID και να τα στείλετε σε μια εναλλακτική δράση και αν ταιριάζει με έναν αριθμό τηλεφώνου που βρίσκεται στην ομάδα φίλτρο τηλέφωνο ή μια διεύθυνση URL απάντηση, εάν έχετε ρυθμίσει ένα. Προεπιλογή είναι απενεργοποιημένη. GROUP θα αναζητήσει σε μια ομάδα Φίλτρο τηλέφωνο. URL θα στείλει μια διεύθυνση URL και θα ταιριάξει εάν ένα 1 αποστέλλεται πίσω. + + <BR> + <A NAME="vicidial_inbound_dids-filter_phone_group_id"> + <BR> + <B>Φίλτρο ID Ομάδας Τηλέφωνο -</B> Αν το φίλτρο εισερχόμενων πεδίο Αριθμός αναμένεται να ΟΜΙΛΟΣ τότε αυτό είναι το αναγνωριστικό της ομάδας Φίλτρο τηλέφωνο που θα έχουν οι αριθμοί του έψαξε ψάχνει για έναν αγώνα με τον αριθμό αναγνώρισης κλήσης της εισερχόμενης κλήσης. + + <BR> + <A NAME="vicidial_inbound_dids-filter_url"> + <BR> + <B>Φίλτρο URL -</B> Αν το φίλτρο εισερχόμενων πεδίο Αριθμός ορίζεται στο URL τότε αυτή είναι η ηλεκτρονική διεύθυνση ενός σεναρίου που θα ψάξει ένα απομακρυσμένο σύστημα και να επιστρέψει ένα 1 για έναν αγώνα και σε 0 για κανένα αγώνα. Μόνο δύο μεταβλητές είναι διαθέσιμες στη διεύθυνση, αν χρησιμοποιείτε το πρόθεμα VAR όπως διευθύνσεις με έλθουν σε εκστρατείες, - Α - PHONE_NUMBER - Β - και - Α - did_pattern - Β - μπορεί να χρησιμοποιηθεί στο URL να αναφέρει την ταυτότητα του καλούντος καλούντος και η DID, ότι ο πελάτης καλείται μέσα σε. + + <BR> + <A NAME="vicidial_inbound_dids-filter_action"> + <BR> + <B>Φίλτρο δράσης -</B> Αν φίλτρου εισερχόμενων Αριθμός ενεργοποιείται και ένας αγώνας που βρέθηκαν, τότε αυτό είναι η δράση που πρόκειται να ληφθούν. Αυτή είναι η ίδια με την διαδρομή που θα επιλέξετε για ένα DID, και οι παρακάτω ρυθμίσεις λειτουργούν όπως ακριβώς κάνουν για ένα πρότυπο δρομολόγησης. + + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>Προσαρμοσμένα Πεδία DID, - </ B> Αυτά τα πέντε πεδία μπορούν να χρησιμοποιηθούν για διάφορους σκοπούς, κυρίως όσον αφορά τον προγραμματισμό συνήθειας και εκθέσεις. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID, Απομακρυσμένη παρακάμψεων Επέκταση γραφείο -</B><BR>Αυτό το τμήμα σάς επιτρέπει να ενεργοποιήσετε DIDs να παρακάμπτει επέκταση δρομολογείται για απομακρυσμένες κλήσεις μέσω αντιπροσώπου σε ομάδες. Η Έναρξη χρηστών πρέπει να είναι έγκυρο Εκκίνηση Χρήστης Agent ή αν θέλετε η επέκταση Παράκαμψη πρόσβασης στην εργασία για όλες τις κλήσεις, τότε μπορείτε να χρησιμοποιήσετε --- Όλες --- στον τομέα Έναρξη χρήστη. Εάν υπάρχουν πολλαπλές καταχωρίσεις για το ίδιο έκαναν και στη συνέχεια ο χρήστης αρχίζει οι ενεργές συμμετοχές θα χρησιμοποιηθεί σε ένα γύρο μέθοδο robin. + @@ -4552,7 +6444,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENU ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>Μενού ID -</B> Αυτό είναι το αναγνωριστικό για αυτό το βήμα του μενού κλήση. Αυτό επίσης θα εμφανίζεται ως το πλαίσιο που χρησιμοποιείται στην dialplan για την παρούσα πρόσκληση μενού. + <B>Μενού ID -</B> Αυτό είναι το αναγνωριστικό για αυτό το βήμα του μενού κλήση. Αυτό επίσης θα εμφανίζεται ως το πλαίσιο που χρησιμοποιείται στην dialplan για την παρούσα πρόσκληση μενού. Εδώ είναι μια λίστα των προστατευόμενων φράσεις που δεν μπορούν να χρησιμοποιηθούν ως αναγνωριστικά μενού: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -4564,6 +6456,11 @@ if ($ADD==99999) <BR> <B>Μενού Προτροπή -</B> Αυτό το πεδίο περιέχει το όνομα αρχείου του ήχου εντολών για να παίξει στην αρχή αυτού του μενού. Μπορείτε να εισαγάγετε πολλές propmts σε αυτόν τον τομέα και το άλλο από την άμεση τομείς χωρίζοντάς τους με ένα χαρακτήρα σωλήνα. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -4604,10 +6501,20 @@ if ($ADD==99999) <BR> <B>Tracking Group -</B> Αυτή είναι η ταυτότητα που μπορείτε να χρησιμοποιήσετε για να παρακολουθείτε τις κλήσεις προς την παρούσα πρόσκληση Μενού όταν εξετάζεται η IVR έκθεση. Ο κατάλογος περιλαμβάνει CALLMENU ως προεπιλογή, καθώς και όλων των In-Ομάδες. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>Σύνδεση πλήκτρων -</B> Αυτή η επιλογή, αν ενεργοποιηθεί θα καταγράψει το DTMF πλήκτρων από τον καλούντα σε αυτό το μενού Κλήση. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Σύνδεση Πεδίο -</B> Εάν το κλειδί επιλογή Σύνδεση Τύπου είναι ενεργοποιημένη, η προαιρετική αυτή ρύθμιση μπορεί να επιτρέψει η απάντηση επίσης να αποθηκευτούν σε αυτόν τον τομέα λίστα. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. Προεπιλογή είναι ΚΑΝΕΝΑ για άτομα με ειδικές. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Επιλογή Value -</B> Αυτό το πεδίο όπου θα καθορίσει την επιλογή μενού, είναι δυνατές επιλογές: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Η ειδική TIMECHECK επιλογή μπορεί να χρησιμοποιηθεί μόνο αν έχετε Μενού Ώρα Check ενεργοποιημένη και υπάρχει μια πρόσκληση που έχει ορισθεί για το μενού. Για να διαγράψετε μια επιλογή, μόνο που η διαδρομή για να αφαιρέσετε και η επιλογή θα διαγραφεί όταν κάνετε κλικ στο κουμπί ΑΠΟΣΤΟΛΗ. + <B>Επιλογή Value -</B> Αυτό το πεδίο όπου θα καθορίσει την επιλογή μενού, είναι δυνατές επιλογές: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Η ειδική TIMECHECK επιλογή μπορεί να χρησιμοποιηθεί μόνο αν έχετε Μενού Ώρα Check ενεργοποιημένη και υπάρχει μια πρόσκληση που έχει ορισθεί για το μενού. Για να διαγράψετε μια επιλογή, μόνο που η διαδρομή για να αφαιρέσετε και η επιλογή θα διαγραφεί όταν κάνετε κλικ στο κουμπί ΑΠΟΣΤΟΛΗ. TIMEOUT θα σας επιτρέψει να ρυθμίσετε το τι συμβαίνει στην κλήση όταν φορές έξω με καμία εισαγωγή από τον καλούντα. ΑΚΥΡΟ θα σας επιτρέψει να επιλέξετε τι συμβαίνει όταν ο επισκέπτης εισέρχεται σε μια μη έγκυρη επιλογή. INVALID_2ND και 3ου μπορεί να είναι ενεργό μόνο εάν ΑΚΥΡΟ δεν χρησιμοποιείται, θα περιμένουν μέχρι το δεύτερο ή τρίτο έγκυρη καταχώρηση από τον καλούντα πριν να εκτελέσει την επιλογή. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -4617,7 +6524,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_call_menu-option_route"> <BR> - <B>Επιλογή διαδρομής -</B> Αυτό το μενού περιέχει επιλογές για το πού να στείλει την κλήση, εφόσον επιλέγεται αυτή η δυνατότητα: CALLMENU, ingroup, DID, hangup, ΕΠΕΚΤΑΣΗ, ΤΗΛΕΦΩΝΟ. Για CALLMENU, η Route Αξία θα πρέπει να είναι το μενού αναγνωριστικό της πρόσκλησης μενού που θέλετε να αποσταλεί κλήση. Για ingroup, την ομάδα που θέλετε να καλέσετε να αποσταλούν με τις ανάγκες που πρέπει να επιλεγεί, καθώς και τις άλλες 5 επιλογές που πρέπει να τεθούν σε σωστή πορεία μιας κλήσης προς έναν Inbound ομάδα. Για DID, η Route Αξία πρέπει να είναι η DID πρότυπο που θέλετε να στείλετε την πρόσκληση με. Για hangup, η Route αξία μπορεί να είναι το όνομα ενός αρχείου ήχου για να παίξει πριν από την ανάρτηση της πρόσκλησης. Για την επέκταση, την αξία διαδρομής, πρέπει να το dialplan επέκταση που θέλετε να στείλετε την πρόσκληση προς, και η Route Αξία πλαίσιο είναι το πλαίσιο ότι η επέκταση βρίσκεται σε, αν μείνει κενό το πλαίσιο θα προεπιλογή για προεπιλογή. Για PHONE, η Route Αξία πρέπει να είναι η τιμή σύνδεσης του τηλεφώνου για την έναρξη τηλέφωνα που θέλετε να στείλετε την πρόσκληση με. Για ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ, η Route Αξία πρέπει να είναι η τηλεφωνητή αριθμό κουτί, το διαθέσιμο mesage θα παίξει. Για AGI, η Route Αξία πρέπει να είναι το σενάριο AGI και κάθε αξίες που πρέπει να περάσει σε αυτό. + <B>Επιλογή διαδρομής -</B> Αυτό το μενού περιέχει επιλογές για το πού να στείλει την κλήση, εφόσον επιλέγεται αυτή η δυνατότητα: CALLMENU, ingroup, DID, hangup, ΕΠΕΚΤΑΣΗ, ΤΗΛΕΦΩΝΟ. Για CALLMENU, η Route Αξία θα πρέπει να είναι το μενού αναγνωριστικό της πρόσκλησης μενού που θέλετε να αποσταλεί κλήση. Για ingroup, την ομάδα που θέλετε να καλέσετε να αποσταλούν με τις ανάγκες που πρέπει να επιλεγεί, καθώς και τις άλλες 5 επιλογές που πρέπει να τεθούν σε σωστή πορεία μιας κλήσης προς έναν  εισερχόμενοςομάδα. Για DID, η Route Αξία πρέπει να είναι η DID πρότυπο που θέλετε να στείλετε την πρόσκληση με. Για hangup, η Route αξία μπορεί να είναι το όνομα ενός αρχείου ήχου για να παίξει πριν από την ανάρτηση της πρόσκλησης. Για την επέκταση, την αξία διαδρομής, πρέπει να το dialplan επέκταση που θέλετε να στείλετε την πρόσκληση προς, και η Route Αξία πλαίσιο είναι το πλαίσιο ότι η επέκταση βρίσκεται σε, αν μείνει κενό το πλαίσιο θα προεπιλογή για προεπιλογή. Για PHONE, η Route Αξία πρέπει να είναι η τιμή σύνδεσης του τηλεφώνου για την έναρξη τηλέφωνα που θέλετε να στείλετε την πρόσκληση με. Για ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ, η Route Αξία πρέπει να είναι η τηλεφωνητή αριθμό κουτί, το διαθέσιμο mesage θα παίξει. Για AGI, η Route Αξία πρέπει να είναι το σενάριο AGI και κάθε αξίες που πρέπει να περάσει σε αυτό. <BR> <A NAME="vicidial_call_menu-option_route_value"> @@ -4629,15 +6536,45 @@ if ($ADD==99999) <BR> <B>Επιλογή Route Αξία Πλαίσιο -</B> Το πεδίο αυτό είναι προαιρετικό και χρησιμοποιείται μόνο για Διαδρομές δυνατότητα επέκτασης του πεδίου. + <BR> + <A NAME="vicidial_call_menu-ingroup_settings"> + <BR> + <B>Τοποθετήσεις -ομάδας επιλογών κλήσης -</B> Εάν η διαδρομή τίθεται INGROUP έπειτα υπάρχουν πολλές επιλογές που μπορείτε να θέσετε για να καθορίσετε πώς η κλήση στέλνεται στη σειρά αναμονής. Η -ομάδα είναι η εισερχόμενη ομάδα ότι θέλετε την κλήση για να πάτε. Η μέθοδος λαβών είναι ο τρόπος που θέλετε την κλήση για να αντιμετωπιστείτε, <a href="#vicidial_inbound_dids-call_handle_method">Χτυπήστε εδώ για να δείτε έναν κατάλογο των διαθέσιμων μεθόδων λαβών</a>. Μέθοδος αναζήτησης καθορίζει πως η ουρά θα βρείτε το επόμενο πράκτορα, προτείνουμε το αφήσουμε αυτό στην LB. ID της λίστας είναι η λίστα ότι ο νέος επικεφαλής εισάγεται, επίσης, αν η μέθοδος δεν είναι μια αναζήτηση μεθόδου και ο μόλυβδος δεν έχει βρεθεί. ID εκστρατείας είναι η εκστρατεία για την αναζήτηση μέσω καταλόγων, αν μία από τις RC μεθόδων που χρησιμοποιούνται. Κωδικός τηλεφώνου είναι η phone_code πεδίο εισαγωγής για την πρωτοπορία που έχει εισαχθεί με. Πληκτρολογήστε το Όνομα VID χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι ο ήχος άμεση έπαιξε να ζητήσει από τον πελάτη να εισάγετε το ID τους. VID Όνομα Αριθμός Ταυτότητας χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι η άμεση ήχου παίζεται μετά την είσοδο του πελάτη τους ταυτότητα, κάτι σαν έχετε εισάγει. VID Επιβεβαίωση Όνομα χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι ο ήχος άμεση έπαιξε για την επιβεβαίωση της αστυνομικής τους ταυτότητας, κάτι σαν ΤΥΠΟΥ 1 για να επιβεβαιώσετε και να μπει και πάλι 2. VID ψηφία χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, εάν έχει οριστεί σε έναν αριθμό που είναι ο αριθμός των ψηφίων που πρέπει να αναγράφεται από τον πελάτη, όταν σας ζητηθεί για την ταυτότητα τους, αν οριστεί σε κενές ή X, τότε η πελάτης θα πρέπει να πιέσετε κιλό χασίς ή να ολοκληρώσετε την είσοδό τους της ταυτότητας τους. + <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dilplan Έναρξη -</B> Αυτό το πεδίο σας επιτρέπει να εισέρχονται σε κάθε dialplan στοιχεία που θέλετε για την πρόσκληση Μενού. + <B>Είσοδος Dialplan συνήθειας -</B> Αυτό το πεδίο σας επιτρέπει να εισέρχονται σε κάθε dialplan στοιχεία που θέλετε για την πρόσκληση Μενού. + <BR><BR><BR><BR> + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> + <BR> + <B>Φίλτρο ID Ομάδας Τηλέφωνο -</B> Αυτό είναι το αναγνωριστικό της ομάδας Φίλτρο τηλέφωνο που είναι το εμπορευματοκιβώτιο για μια ομάδα αριθμών τηλεφώνου που μπορείτε να έχετε ψάξει αυτόματα μέσα από μια κλήση όταν έρχεται σε μια DID, και να το στείλετε σε μια εναλλακτική διαδρομή, αν υπάρχει ένας αγώνας. Αυτό το πεδίο πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες και δεν έχουν σημεία στίξης εκτός υπογράμμισης. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> + <BR> + <B>Όνομα φίλτρου ομάδας Τηλέφωνο -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> + <BR> + <B>Φίλτρο Περιγραφή ομάδας Τηλέφωνο -</B> Αυτή είναι η περιγραφή του φίλτρου ομάδας τηλέφωνο, είναι καθαρά για σκοπούς σημειογραφία μόνο και δεν είναι υποχρεωτικό πεδίο. + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_REMOTE_AGENTS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> @@ -4660,6 +6597,11 @@ if ($ADD==99999) <BR> <B>Εξωτερική Τηλ.Σύνδεση -</B> Αυτός είναι ο αριθμός που θέλετε οι κλήσεις να προωθούνται. Επιβεβαιώστε ότι είναι ένας πλήρης αριθμός από το σχέδιο κλήεων και εάν θέλετε ένα 9 στην αρχή το βάζετε εδώ. Κάντε μία δοκιμή καλώντας αυτόν τον αριθμό από ένα τηλέφωνο του συστήματος. + <BR> + <A NAME="vicidial_remote_agents-extension_group"> + <BR> + <B>Ομάδα επέκτασης -</B> Εάν θέστε κάτι εκτός από ΚΑΝΕΝΑΝ ή κενός αυτό θα αγνοήσει τον εξωτερικό τομέα επέκτασης και θα χρησιμοποιήσει τις καταχωρήσεις ομάδας επέκτασης που δεν έχουν την ίδια προεπιλογή ταυτότητας ομάδας επέκτασης είναι ΚΑΜΊΑ για απενεργοποιημένος. + <BR> <A NAME="vicidial_remote_agents-status"> <BR> @@ -4670,6 +6612,16 @@ if ($ADD==99999) <BR> <B>Εκστρατεία -</B> Εδώ μπορείτε να επιλέξετε την εκστρατεία όπου οι απομακρυσμένοι χρήστες θα συνδεθούν. Για εισερχόμενες πρέπει να χρησιμοποιηθεί η εκστρατεία CLOSER και επιλέξτε τις εισερχόμενες εκστρατείες παρακάτω, από που θέλετε να λαμβάνεται τις κλήσεις. + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>On-Hook γραφείο -</B> Η επιλογή αυτή χρησιμοποιείται μόνο για εισερχόμενες κλήσεις πηγαίνουν σε αυτήν την απομακρυσμένη παράγοντα. Αυτό το χαρακτηριστικό θα καλέσει την απομακρυσμένη πράκτορα και δεν θα στείλει τον πελάτη στον απομακρυσμένο πράκτορα έως ότου η γραμμή απαντηθεί. Προεπιλογή N για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>On-Hook Ώρα δαχτυλίδι -</B> Η επιλογή αυτή χρησιμοποιείται μόνο όταν η On-Hook πεδίο Agent παραπάνω αναμένεται να Y και στη συνέχεια μόνο για εισερχόμενες κλήσεις που προέρχονται σε αυτό το απομακρυσμένο πράκτορα. Αυτός είναι ο αριθμός των δευτερολέπτων που κάθε απόπειρα κλήσης θα χτυπήσει για να προσπαθήσει να πάρει μια απάντηση. Συνιστάται να ορίσετε αυτό σε μερικά δευτερόλεπτα λιγότερο από ό, τι χρειάζεται για μια κλήση που θα αποσταλεί στον τηλεφωνητή. Η προεπιλογή είναι 15. + <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> <BR> @@ -4678,7 +6630,30 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_ΛΙΣΤΕΣ</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> + <A NAME="vicidial_extension_groups-extension_group_id"> + <BR> + <B>Ομάδα επέκτασης -</B> Αυτός ο απαραίτητος τομέας είναι όπου εισάγετε την ταυτότητα ομάδας ότι θέλετε αυτήν την επέκταση για να τεθείτε. Κανένας διάστημα ή πρόσθετος χαρακτήρας εκτός από τα γράμματα και τους αριθμούς κάτω παυλών. + + <BR> + <A NAME="vicidial_extension_groups-extension"> + <BR> + <B>Extension -</B> Αυτός ο απαραίτητος τομέας είναι όπου βάζετε τη dialplan επέκταση ότι θέλετε τις μακρινές κλήσεις πρακτόρων για να σταλείτε για αυτήν την είσοδο ομάδας επέκτασης. + + <BR> + <A NAME="vicidial_extension_groups-rank"> + <BR> + <B>Rank -</B> Αυτός ο τομέας επιτρέπει σε σας για να ταξινομήσει τις καταχωρήσεις ομάδας επέκτασης που μοιράζονται την ίδια ομάδα επέκτασης. Η προεπιλογή είναι 0. + + <BR> + <A NAME="vicidial_extension_groups-campaign_groups"> + <BR> + <B>Ομάδες εκστρατειών -</B> Σε αυτόν τον τομέα μπορείτε να βάλετε έναν κατάλογο εκστρατείας IDs και ή η εισερχόμενη ομάδα IDs που θέλετε να περιορίσετε τη χρήση του καταλόγου ομάδας ξέν. επέκτασης πρέπει να είναι χωριστή από τους σωλήνες και να έχει έναν σωλήνα στην αρχή και στο τέλος της σειράς. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>Οι λίστες της εκστρατείας παρουσιάζονται εδώ, και εάν είναι ενεργές (Υ ή Ν) μπορείτε να πάτε στην οθόνη λίστας με το να πατήσετε στο ID λίστας, στην πρώτη στήλη.</B> @@ -4702,7 +6677,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_campaign_hotkeys"> <BR> - <B>Με την χρήση προσαρμοσμένων κλειδιών εκστρατείας, οι χρήστες που χρησιμοποιούν την εφαρμογή vicidial μπορούν να κλείσουν και να τερματίσουν την κλήση, με ένα μόνο πάτημα πλήκτρου.</B> There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead. + <B>Με την χρήση προσαρμοσμένων κλειδιών εκστρατείας, οι χρήστες που χρησιμοποιούν την εφαρμογή vicidial μπορούν να κλείσουν και να τερματίσουν την κλήση, με ένα μόνο πάτημα πλήκτρου.</B> Υπάρχουν two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead. @@ -4743,6 +6718,28 @@ if ($ADD==99999) + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR> + <A NAME="vicidial_xfer_presets"> + <BR> + <B>Εάν η ρύθμιση καμπάνιας για προεπιλογές έχει οριστεί σε ΕΝΕΡΓΟΠΟΙΗΜΈΝΗ τότε έχετε τη δυνατότητα να καθορίσουν Μεταφορά της Διάσκεψης προκαθορισμένες ρυθμίσεις που θα είναι διαθέσιμες στον πράκτορα που τους επιτρέπει να 3-way ονομάσουμε αυτές τις προκαθορισμένες ρυθμίσεις ή τυφλή κλήσεις προς αυτά προεπιλεγμένους αριθμούς. Αυτές οι προκαθορισμένες ρυθμίσεις έχουν επίσης μια επιλογή για να κρύψει τον αριθμό που σχετίζεται με κάθε προκαθορισμένο από τον πράκτορα.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN CID AREACODES</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Αν η ρύθμιση του συστήματος για Areacode CIDs είναι ενεργοποιημένη και η ρύθμιση Εκστρατεία για τη χρήση προσαρμοσμένων CallerID έχει οριστεί σε AREACODE τότε έχετε τη δυνατότητα να καθορίσει CIDs Areacode που θα χρησιμοποιηθούν όταν εξερχόμενη κλήση σε οδηγεί στη συγκεκριμένη καμπάνια. Μπορείτε να προσθέσετε πολλαπλές callerIDs ανά areacode και μπορείτε να ενεργοποιήσετε και να απενεργοποιήσετε κάθε τους σε πραγματικό χρόνο. Εάν περισσότερα από ένα CallerID είναι ενεργό για ένα συγκεκριμένο areacode τότε το σύστημα θα χρησιμοποιήσει το CallerID που έχει χρησιμοποιηθεί τουλάχιστον το πόσες φορές σήμερα. Εάν δεν callerIDs είναι ενεργά για την areacode τότε το CallerID εκστρατεία ή λίστα παράκαμψης CallerID θα χρησιμοποιηθεί.</B> + + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_USER_GROUPS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> @@ -4778,14 +6775,66 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Agent Κατάσταση θέασης Ομάδες -</B> Αυτή είναι μια λίστα επιλογής των χρηστών Ομάδες και τις λειτουργίες του χρήστη με το οποίο τα μέλη της ομάδας αυτής ο χρήστης μπορεί να δείτε την κατάσταση καθώς και κλήσεις προς τη μεταφορά στο εσωτερικό της οθόνης πράκτορα. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και τη μεταφορά κλήσεων για κάθε χρήστη του συστήματος. Η ΕΚΣΤΡΑΤΕΙΑ-ΠΡΑΚΤΟΡΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και να μεταβιβάσει τις κλήσεις σε κάθε χρήστη στην εκστρατεία που είναι συνδεδεμένοι στο. + <B>Agent Κατάσταση θέασης Ομάδες -</B> Αυτή είναι μια λίστα επιλογής των χρηστών Ομάδες και τις λειτουργίες του χρήστη με το οποίο τα μέλη της ομάδας αυτής ο χρήστης μπορεί να δείτε την κατάσταση καθώς και κλήσεις προς τη μεταφορά στο εσωτερικό της οθόνης πράκτορα. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και τη μεταφορά κλήσεων για κάθε χρήστη του συστήματος. Η ΕΚΣΤΡΑΤΕΙΑ-ΠΡΑΚΤΟΡΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και να μεταβιβάσει τις κλήσεις σε κάθε χρήστη στην εκστρατεία που είναι συνδεδεμένοι στο. Η επιλογή όχι-κατα:γράφω--ΠΡΑΚΤΟΡΩΝ επιτρέπει σε όλους τους χρήστες στο σύστημα για να επιδειχθεί, ακόμα κι αν δεν είναι κατα:γράφω-curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> <BR> <B>Agent Κατάσταση Προβολή Ώρα -</B> Αυτή η επιλογή καθορίζει αν ο αντιπρόσωπος θα δείτε το ποσό του χρόνου που οι χρήστες στην πλαϊνή μπάρα πράκτορας τους έχουν στην τρέχουσα κατάστασή τους. Προεπιλογή είναι Ν για άτομα με ειδικές ανάγκες ή δεν. + <BR> + <A NAME="vicidial_user_groups-agent_call_log_view"> + <BR> + <B>Άποψη κούτσουρων κλήσης πρακτόρων -</B> Αυτή η επιλογή καθορίζει εάν ο πράκτορας θα είναι σε θέση να δει το κούτσουρο κλήσης τους για τις κλήσεις που αντιμετωπίζονται μέσω της οθόνης πρακτόρων ViciDial. Η προεπιλογή είναι Ν για το αριθ. ή τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_user_groups-agent_xfer_options"> + <BR> + <B>Επιλογές μεταφοράς πρακτόρων -</B> Αυτές οι επιλογές επιτρέπουν να θέσουν εκτός λειτουργίας των συγκεκριμένων κουμπιών στο τμήμα διασκέψεων μεταφοράς της διεπαφής πρακτόρων. Η προεπιλογή είναι Υ για ναι ή επιτρεμμένος. + + <BR> + <A NAME="vicidial_user_groups-agent_fullscreen"> + <BR> + <B>Πράκτορας Fullscreen -</B> Αυτή η επιλογή εάν θέστε το Υ θα θέσει το ύψος και το πλάτος της οθόνης πρακτόρων ViciDial στο μέγεθος του παραθύρου μηχανών αναζήτησης Ιστού χωρίς οποιοδήποτε επίδομα για την άποψη πρακτόρων, τις κλήσεις κατά την άποψη σειρών αναμονής ή κλήσεις κατά την άποψη συνόδου. Η προεπιλογή είναι Ν για το αριθ. ή τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="vicidial_user_groups-allowed_reports"> + <BR> + <B>Επιτρέπονται Εκθέσεις -</B> Αν ένας χρήστης σε αυτήν την ομάδα έχει οριστεί σε επίπεδο χρήστη 7 ή νεότερη έκδοση, τότε αυτό το χαρακτηριστικό μπορεί να χρησιμοποιηθεί για να περιορίσει τις εκθέσεις ότι οι χρήστες μπορούν να δουν. Η προεπιλογή είναι το ALL. Εάν θέλετε να επιλέξετε περισσότερες από μία έκθεση και στη συνέχεια πατήστε το πλήκτρο Ctrl στο πληκτρολόγιό σας, όπως εσείς επιλέξετε τις εκθέσεις. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Επιτρέπονται Ομάδες Χρηστών -</B> Αυτή είναι μια επιλογή λίστα με ομάδες χρηστών στις οποίες τα μέλη αυτής της ομάδας χρήστης μπορεί να δει και ενδεχομένως να επεξεργαστείτε. Ομάδες χρήστης μπορεί να περιορίσει την πρόσβαση σε όλες σχεδόν τις πτυχές του συστήματος, από εισερχόμενα τηλέφωνα για να DIDs τις θέσεις τηλεφωνητή. Η - ALL - επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και να συνδεθείτε σε οποιαδήποτε εγγραφή στο σύστημα, εάν τα δικαιώματα των χρηστών για τους επιτρέπουν να. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Επιτρέπονται χρόνους κλήσης -</B> Αυτή είναι μια επιλογή λίστα των Times Πρόσκληση στην οποία τα μέλη αυτής της ομάδας χρήστης μπορεί να χρησιμοποιήσει σε καμπάνιες, σε ομάδες και μενού κλήσης. Η - ALL - επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να χρησιμοποιήσεις όλες τις φορές κλήση στο σύστημα. + + <?php + if (strlen($SSwebphone_url) > 5) + { + ?> + <BR> + <A NAME="vicidial_user_groups-webphone_url_override"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο Παράκαμψη URL -</B> Η ρύθμιση αυτή σας επιτρέπει να ορίσετε μια εναλλακτική διεύθυνση URL Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι άδειο. + + <BR> + <A NAME="vicidial_user_groups-webphone_systemkey_override"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο Σύστημα Βασικά Παράκαμψη -</B> Η ρύθμιση αυτή σας επιτρέπει να ορίσετε μια εναλλακτική Key System Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι άδειο. + + <BR> + <A NAME="vicidial_user_groups-webphone_dialpad_override"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad Παράκαμψη -</B> Η ρύθμιση αυτή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε το dialpad στο Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι απενεργοποιημένη. TOGGLE θα επιτρέψει στο χρήστη να βλέπει και να κρύψει το dialpad κάνοντας κλικ σε ένα σύνδεσμο. TOGGLE_OFF προεπιλογή να μην δείχνουν την dialpad στο πρώτο φορτίο, αλλά θα επιτρέψει στο χρήστη να δείξει την dialpad κάνοντας κλικ στο σύνδεσμο dialpad. + + <?php + } + if ($SSqc_features_active > 0) { ?> @@ -4797,7 +6846,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> <BR> - <B>QC Επιτρέπονται Inbound Ομάδες - </B> Αυτό είναι ένα επιλέξιμο λίστα των εισερχόμενων ομάδες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα χρηστών να QC οποιαδήποτε εισερχόμενα ομάδας για το σύστημα. + <B>QC Επιτρέπονται  εισερχόμενοςΟμάδες - </B> Αυτό είναι ένα επιλέξιμο λίστα των εισερχόμενων ομάδες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα χρηστών να QC οποιαδήποτε εισερχόμενα ομάδας για το σύστημα. <?php } ?> @@ -4820,14 +6869,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Σχόλια Βοηθού -</B> εδώ μπορείτε να τοποθετήσετε τα σχόλια για έναν Βοηθό. 2-255 χαρακτήρες . + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Κείμενο χειρόγραφου -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Κείμενο χειρόγραφου -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + Μπορείτε επίσης να χρησιμοποιήσετε μια ειδική μεταβλητή IGNORENOSCROLL να αναγκάσει κύλισης στην καρτέλα σενάριο, ακόμη και αν χρησιμοποιείτε ένα iframe μέσα σε αυτό. <BR> <A NAME="vicidial_scripts-active"> @@ -4857,6 +6913,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>Σχόλια Φίλτρου -</B> Εδώ μπορείτε σχολιάσετε το φίλτρο. Χαρακτήρες 2 με 255. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>SQL Φίλτρου -</B> Εδώ μπορείτε να ορίσετε SQL ερώτημα για το φίλτρο. Μην ξεκινήσετε ή τελειώσετε με ένα AND, αυτό θα γίνει αυτόματα από το hopper. Ένα παράδειγμα είναι- called_count > 4 and called_count < 8 -. @@ -4882,15 +6943,24 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>Σχόλια Χρόνου Κλήσης -</B> This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_call_times-ct_default_start"> <B>Προκαθορισμένοι Χρόνοι Εκκίνησης και Παύσης -</B> Αυτός είναι ο προκαορισμένος χρόνος όπου θα επιτρέπετε οι κλήσεις εάν δεν έχει οριστεί ο χρόνος εκκίνησης της ημέρας-της-εβδομάδας. 0 είναι μεσάνυχτα. Εάν δεν θέλετε καμία κλήση θέστε αυτό το πεδίο σε 2400 και το προκαθορισμένο χρόνο Παύσης σε 2400. Για να επιτρέψετε την 24ωρη κλήση την ημέρα θέστε σε 0 τον χρόνο εκκίνησης και σε 2400 τον χρόνο παύσης -. +. Για τα εισερχόμενα μόνο, μπορείτε επίσης να ρυθμίσετε τη διάρκεια των κλήσεων στάση υψηλότερες από 2400 αν θέλετε η ώρα κλήση για να πάει πέρα ​​από τα μεσάνυχτα. Έτσι, εάν θέλετε ο χρόνος κλήση σας θα διαρκέσει από τις 6 το πρωί έως τις 2 π.μ. της επόμενης ημέρας, που θα τεθεί 0600 ως την ώρα έναρξης και 2600 ως το χρονικό διάστημα διακοπής. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> <B>Εβδομαδιαίοι Χρόνοι Εκκίνησης και Παύσης -</B> Αυτοί είναι προσαρμόσιμοι χρόνοι ανά ημέρα για τον ορισμό χρόνων κλήσεων. + <BR> + <A NAME="vicidial_call_times-default_afterhours_filename_override"> + <B>Μετά από τη συμπληρωματική προμήθεια ονομάτων αρχείου ωρών -</B> Αυτοί οι τομείς επιτρέπουν σε σας για να αγνοήσουν το μετέπειτα μήνυμα ωρών για τις εισερχόμενες ομάδες εάν τίθεται κάτι. Η προεπιλογή είναι κενή. + <BR> <A NAME="vicidial_call_times-ct_state_call_times"> <B>Ορισμοί Χρόνων Κλήσεων Καταστάσεων -</B> Είναι η λίστα συγκεκριμένων Ορισμών Χρόνων Κλήσεων Καταστάσεων. @@ -4913,6 +6983,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Shift Όνομα - </B> Αυτό είναι ένα πιο περιγραφικό όνομα του Shift Ορισμός. Αυτή είναι μια σύντομη περίληψη του Shift ορισμό. το πολύ 50 χαρακτήρες, τουλάχιστον 2 χαρακτήρες. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Start Time Shift - </B> Αυτή είναι η στιγμή που αρχίζει η εκστρατεία στροφή. Πρέπει να είναι μόνο αριθμοί, 9.30 π.μ. και 0930 θα είναι 5:00 μμ θα είναι 1.700. @@ -4925,13 +7000,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Shift Καθημερινά - </B> Στην ενότητα αυτή θα πρέπει να επιλέξετε τις μέρες την εβδομάδα ότι αυτή η στροφή είναι ενεργή. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Επιλογή Έκθεση -</B> Αυτή η επιλογή επιτρέπει η συγκεκριμένη αλλαγή για να εμφανιστούν σε επιλεγμένες εκθέσεις που υποστηρίζουν αυτή την επιλογή. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Έκθεση Κατάταξη -</B> Αυτή η επιλογή σας επιτρέπει να κατατάξουν αλλαγές σε επιλεγμένες εκθέσεις που υποστηρίζουν αυτή την επιλογή. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio Store -</B> Αυτό το βοηθητικό πρόγραμμα σας επιτρέπει να ανεβάσετε αρχεία ήχου με τον web server έτσι ώστε να μπορούν να διανέμονται σε όλες τις ViciDial διακομιστές σε ένα πολυ-cluster server. Μια σημαντική σημείωση, μόνο δύο τύπους αρχείων ήχου θα λειτουργήσει,. Wav τα αρχεία που είναι PCM 16bit και 8k. Αρχείων GSM που είναι 8bit 8k. Παρακαλώ βεβαιωθείτε ότι τα αρχεία σας μορφοποιηθεί σωστά πριν από την αποστολή τους εδώ. + <B>Audio Store -</B> Αυτό το βοηθητικό πρόγραμμα σας επιτρέπει να ανεβάσετε τα αρχεία ήχου στον web server, έτσι ώστε να μπορεί να διανεμηθεί σε όλα τα ViciDial διακομιστές σε ένα πολυ-διακομιστή συμπλέγματος. Μια σημαντική σημείωση, μόνο δύο τύπους αρχείων ήχου θα δουλέψει,. Wav που είναι PCM Mono 16bit και 8k. GSM αρχεία που είναι 8bit 8K. Παρακαλώ βεβαιωθείτε ότι τα αρχεία σας σωστά διαμορφωθεί πριν ανεβάσετε εδώ. @@ -4950,6 +7032,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Ενεργό -</B> Αυτή η επιλογή σας επιτρέπει να ρυθμίσετε το Music On Hold είσοδο στην ενεργό ή ανενεργό. Ανενεργό θα αφαιρέσει την είσοδο από το conf αρχεία. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Τυχαία σειρά -</B> Αυτή η επιλογή σας επιτρέπει να ορίσετε την αναπαραγωγή των αρχείων ήχου σε τυχαία σειρά. Αν οριστεί σε Ν τότε ορίζεται η διάταξη θα πρέπει να χρησιμοποιείται. @@ -4976,9 +7063,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Ενεργό -</B> Αυτή η επιλογή σας επιτρέπει να ρυθμίσετε την είσοδο TTS με ενεργές ή αδρανείς. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + + <BR> + <A NAME="vicidial_tts_prompts-tts_voice"> + <B>TTS φωνή -</B> Αυτό είναι όπου μπορείτε να ορίσετε τη φωνή που πρέπει να χρησιμοποιούνται στην παραγωγή TTS. Προεπιλογή είναι Allison-8kHz. + <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Κείμενο -</B> Αυτό είναι το πραγματικό πεδίο Κείμενο Ομιλία δεδομένα τα οποία αποστέλλονται σε Cepstral για τη δημιουργία του αρχείου ήχου που μπορεί να διαδραματίσει στον πελάτη. μπορείτε να χρησιμοποιήσετε Σύνθεση Ομιλίας Markup Language-SSML-στον τομέα αυτό, για παράδειγμα,, <break time='1000ms'/> για δεύτερη 1 διάλειμμα. Μπορείτε επίσης να χρησιμοποιήσετε διάφορες μεταβλητές, όπως όνομα, επώνυμο και τίτλο που ViciDial μεταβλητές όπως κάνετε σε ένα Σενάριο: - Α - first_name - Β -. Εδώ είναι μια λίστα με τις διαθέσιμες μεταβλητές:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Κείμενο -</B> Αυτό είναι το πραγματικό πεδίο Κείμενο Ομιλία δεδομένα τα οποία αποστέλλονται σε Cepstral για τη δημιουργία του αρχείου ήχου που μπορεί να διαδραματίσει στον πελάτη. μπορείτε να χρησιμοποιήσετε Σύνθεση Ομιλίας Markup Language-SSML-στον τομέα αυτό, για παράδειγμα,, <break time='1000ms'/> για 1 δεύτερο διάλειμμα. Μπορείτε επίσης να χρησιμοποιήσετε πολλές μεταβλητές όπως το όνομα, το επώνυμο και τον τίτλο του ως ViciDial μεταβλητές ακριβώς όπως κάνετε σε ένα Σενάριο: - Α - FIRST_NAME - Β -. Αν έχετε στατική αρχεία ήχου που θέλετε να χρησιμοποιήσετε με βάση την αξία του ένα από τα πεδία που μπορείτε να χρησιμοποιήσετε αυτούς καθώς και με Γ και Δ ετικέτες. Τα ονόματα των αρχείων πρέπει να είναι όλα τα πεζά και πρέπει να είναι 8k 16bit PCM WAV. Το όνομα τομέα πρέπει να είναι το ίδιο, αλλά χωρίς το. Wav με το όνομα του αρχείου. Για παράδειγμα - Γ ---- Α - address3 - Β ---- Δ - θα βρει πρώτα την τιμή για address3, τότε θα προσπαθήσουμε να βρούμε ένα αρχείο ήχου που ταιριάζουν ότι η αξία για να το θέσω στην έγκαιρη. Εδώ είναι μια λίστα των διαθέσιμων μεταβλητών: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -4988,7 +7084,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_VOICEMAIL ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_voicemail-voicemail_id"> <BR> - <B>ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID -</B> Αυτό είναι το αναγνωριστικό αριθμό όλων των αυτήν την ταχυδρομική θυρίδα. Αυτό δεν πρέπει να είναι ένα αντίγραφο μιας υπάρχουσας τηλεφωνητή ταυτότητας ή το φωνητικό ταχυδρομείο αναγνωριστικό του τηλεφώνου για το σύστημα, τουλάχιστον 2 χαρακτήρες. + <B>Ταυτότητα φωνητικού ταχυδρομείου -</B> Αυτό είναι το αναγνωριστικό αριθμό όλων των αυτήν την ταχυδρομική θυρίδα. Αυτό δεν πρέπει να είναι ένα αντίγραφο μιας υπάρχουσας τηλεφωνητή ταυτότητας ή το φωνητικό ταχυδρομείο αναγνωριστικό του τηλεφώνου για το σύστημα, τουλάχιστον 2 χαρακτήρες. <BR> <A NAME="vicidial_voicemail-fullname"> @@ -5006,12 +7102,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <BΗλεκτρονικό ταχυδρομείο-</B> Αυτή η προαιρετική ρύθμιση επιτρέπει να έχετε το τηλεφωνητή μηνύματα που αποστέλλονται σε ένα λογαριασμό ηλεκτρονικού ταχυδρομείου, αν το σύστημά σας έχει ρυθμιστεί ώστε να στείλει email. Αν αυτό το πεδίο είναι κενό τότε δεν θα είναι τα μηνύματα που αποστέλλονται. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Διαγραφή ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ Μετά Email -</B> Αυτή η προαιρετική ρύθμιση επιτρέπει να έχετε το τηλεφωνητή μηνύματα διαγράφονται από το σύστημα αφού έχουν ήδη αποσταλεί έξω. Προεπιλογή είναι N. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Ζώνη Τηλεφωνητής -</B> Η ρύθμιση αυτή σας επιτρέπει να ορίσετε τη ζώνη ότι αυτό το πλαίσιο θα τηλεφωνητή που να όταν έρθει η ώρα καταγράφεται για ένα μήνυμα. Προεπιλογή έχει οριστεί στις ρυθμίσεις συστήματος. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Επιλογές Τηλεφωνητής -</B> Αυτή η προαιρετική ρύθμιση σας επιτρέπει να ορίσετε πρόσθετες ρυθμίσεις τηλεφωνητή. Συνιστάται να αφήσετε κενό αυτό, εκτός αν ξέρετε τι κάνετε. <?php if ($SSoutbound_autodial_active > 0) @@ -5028,7 +7134,7 @@ if ($ADD==99999) <LI>Κωδικός Οδηγού Προμηθευτού <LI>Πηγαίος Κώδικας - εσωτερική χρήση μόνο από διαχειριστές και DBAs <LI>ID λίστας - ο αριθμός λίστας που οι οδηγοί θα παρουσιαστούν κάτω από - <LI>Κωδικός τηλεφώνου - το πρόθεμα του τηλεφωνικού αριθμού (1 για ΗΠΑ, 01144 για Βρετανία κλπ) + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Ο αριθμός τηλεφώνου - πρέπει να είναι τουλάχιστον 8 ψηφία <LI>Τίτλος - ο τίτλος του πελάτη (κος. κα. κλπ) <LI>Ονομα @@ -5052,6 +7158,15 @@ if ($ADD==99999) <BR>ΣΗΜΕΙΩΣΕΙΣ: Η λειτουργία φορτωτών μολύβδου Excel επιτρέπεταιαπό μια σειρά χειρογράφων perl και πρέπει να έχει κατάλληλαδιαμορφωμένη/ένα αρχείο κ.λπ.../astguiclient.conf σε ισχύ στονκεντρικό υπολογιστή δικτύου. Επίσης, οι ενότητες ζευγών perlπρέπει να φορτωθούν για το για να εργαστούν επίσης - ολε-Storage_Lite και υπολογισμός με λογιστικό φύλλο(spreadsheet)- ParseExcel. Μπορείτε να ελέγξετε για τα λάθηχρόνου εκτέλεσης σε αυτοί με την εξέταση το αρχείο apache σαςerror_log. Επίσης, για τους ελέγχους διπλασιασμού ενάντια στουςκαταλόγους gampaign, ο κατάλογος που έχει τα νέα προβαδίσματαπου πηγαίνουν σε το πρέπει να δημιουργηθεί στο σύστημα προτού νααρχίσετε να φορτώνετε τους μολύβδους. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Εμφάνιση συνήθειας" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>Πρότυπο ID -</B> If the user has selected "Εμφάνιση συνήθειας" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -5067,7 +7182,7 @@ if ($ADD==99999) <B><FONT SIZE=3>ΠΙΝΑΚΑΣ ΤΗΛΕΦΩΝΩΝ</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Εωτ.Σύνδεση Τηλεφώνου -</B> Αυτό το πεδίο είναι για την καταχώρηση του ονόματος του τηλεφώνου, όπως αυτό εμφανίζεται στο Asterisk, χωρίς να συμπεριλαμβάνει το πρωτόκολλο ή slash στην αρχή. Για παράδειγμα: για SIP τηλέφωνο SIPVtest101 η Εσω.Γραμμή Τηλεφώνου θα είναι test101. Επίσης, για IAX2 τηλέφωνα χρησιμοποιείστε τα πλήρης ονόματα: IAX2/IAXphone1@IAXphone1 θα είναι IAXphone1@IAXphone1. Για Zap τηλέφωνα καταχωρήστε το πλήρες κανάλι: Zap/25-1 θα είναι 25-1. Αλλη σημείωση, ορίστε το πρωτόκολλο παρακάτω σωστά για τον τύπο του τηλεφώνου. + <B>Παράταση Τηλέφωνο -</B> Αυτό το πεδίο είναι όπου μπορείτε να βάλετε το όνομα τηλεφώνων, όπως φαίνεται και με το Asterisk δεν συμπεριλαμβανομένου του πρωτοκόλλου ή κάθετος στην αρχή. Για παράδειγμα: για το τηλέφωνο SIP SIP/test101 η επέκταση τηλέφωνο θα test101. Επίσης, για IAX2 τηλέφωνα: IAX2/IAXphone1 @ IAXphone1 θα IAXphone1. Για Zap και Dahdi συνημμένο channelbank ή FXS τηλέφωνα βεβαιωθείτε ότι έχετε θέσει τον πλήρη αριθμό καναλιού χωρίς το πρόθεμα: Zap/25-1 θα είναι 25-1. Ένα άλλο σημείωμα, βεβαιωθείτε ότι έχετε ορίσει το πεδίο πρωτόκολλο παρακάτω σωστά για τον τύπο του τηλεφώνου σας. <BR> <A NAME="phones-dialplan_number"> @@ -5079,11 +7194,24 @@ if ($ADD==99999) <BR> <B>Περιεχόμενο Φωνητικού Ταχυδρομείου -</B> Αυτό το πεδίο είναι για το περιεχόμενο του φωνητικού ταχυδρομείου, όπου πηγαίνουν τα μηνύματα του τηλεφώνου του χρήστη. Το χρησιμοποιούμαι για να ελέγξουμε τα φωνητικά μηνύματα και για να μπορεί ο χρήστης να χρησιμοποιήσει το πλήκτρο VOICEMAIL. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Ζώνη Τηλεφωνητής -</B> Η ρύθμιση αυτή σας επιτρέπει να ορίσετε τη ζώνη ότι αυτό το πλαίσιο θα τηλεφωνητή που να όταν έρθει η ώρα καταγράφεται για ένα μήνυμα. Προεπιλογή έχει οριστεί στις ρυθμίσεις συστήματος. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Επιλογές Τηλεφωνητής -</B> Αυτή η προαιρετική ρύθμιση σας επιτρέπει να ορίσετε πρόσθετες ρυθμίσεις τηλεφωνητή. Συνιστάται να αφήσετε κενό αυτό, εκτός αν ξέρετε τι κάνετε. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>CallerID Εξερχομένων -</B> Αυτό το πεδίο είναι για την καταχώριση του αριθμού callerID που θα θέλατε να εμφανίζεται στις εξερχόμενες κλήσεις. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -5102,12 +7230,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>Σύνδεση -</B> η σύνδεση που χρησιμοποιείται για τον τηλεφωνικό χρήστηστη σύνδεση στις εφαρμογές πελατών. + <B>Πράκτορας Είσοδος οθόνης -</B> Η σύνδεση που χρησιμοποιείται για τον χρήστη του τηλεφώνου για να συνδεθείτε με τις εφαρμογές πελάτη, όπως η οθόνη ViciDial πράκτορα. <BR> <A NAME="phones-pass"> <BR> - <B>Κωδικός πρόσβασης -</B> ο κωδικός πρόσβασης που χρησιμοποιείται γιατον τηλεφωνικό χρήστη στη σύνδεση στις εφαρμογές πελατών. ΣΗΜΑΝΤΙΚΟ, αυτό είναι το κωδικό πρόσβασης μόνο για το web interface πράκτορα σύνδεση τηλεφώνου, για να αλλάξετε τον κωδικό πρόσβασης sip.conf ή iax.conf, ή μυστική, για την εν λόγω τηλεφωνική συσκευή θα πρέπει να τροποποιήσετε το αρχείο Conf μυστικό χώρο πιο κάτω σε αυτή τη σελίδα. + <B>Υποσελίδες -</B> Ο κωδικός που χρησιμοποιείται για τον χρήστη του τηλεφώνου για να συνδεθείτε με τα web-based εφαρμογές πελάτη. ΣΗΜΑΝΤΙΚΟ, αυτός είναι ο κωδικός πρόσβασης μόνο για το web παράγοντα σύνδεσης του τηλεφώνου interface, να αλλάξετε τον κωδικό πρόσβασης ή sip.conf iax.conf, ή μυστικό, για τη συγκεκριμένη συσκευή τηλεφώνου θα πρέπει να τροποποιήσετε τον κωδικό πρόσβασης Εγγραφή στο επόμενο πεδίο. + + <BR> + <A NAME="phones-conf_secret"> + <BR> + <B>Κωδικός Εγγραφή -</B> Αυτό είναι το μυστικό, ή τον κωδικό πρόσβασης, για το τηλέφωνο στο IAX ή auto γουλιά-generated conf αρχείο για αυτό το τηλέφωνο. Όριο είναι 20 χαρακτήρες αλφαριθμητικό παύλα και υπογράμμισης δεκτή. Προεπιλογή είναι δοκιμή. Παλαιότερα ονομαζόταν Conf Μυστικό Αρχείο. Ένας ισχυρός κωδικός πρόσβασης εγγραφή θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. + + <BR> + <A NAME="phones-is_webphone"> + <BR> + <B>Σύνολο ως Webphone -</B> Ο καθορισμός αυτής της επιλογής στο Υ θα προσπαθήσει να φορτώσει ένα βασισμένο στο WEB τηλέφωνο όταν τα κούτσουρα πρακτόρων στην οθόνη πρακτόρων τους. Η προεπιλογή είναι Ν. + + <BR> + <A NAME="phones-webphone_dialpad"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad -</B> Η ρύθμιση αυτή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε το dialpad για αυτό το Διαδικτυακό κοινόχρηστο τηλέφωνο. Η προεπιλογή είναι ενεργοποιημένη για το Υ. TOGGLE θα επιτρέψει στο χρήστη να βλέπει και να κρύψει το dialpad κάνοντας κλικ σε ένα σύνδεσμο. Αυτή η δυνατότητα δεν είναι διαθέσιμη σε όλες τις εκδόσεις Διαδικτυακό κοινόχρηστο τηλέφωνο. TOGGLE_OFF προεπιλογή να μην δείχνουν την dialpad στο πρώτο φορτίο, αλλά θα επιτρέψει στο χρήστη να δείξει την dialpad κάνοντας κλικ στο σύνδεσμο dialpad. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο Αυτόματη Απάντηση -</B> Αυτή η ρύθμιση επιτρέπει το τηλέφωνο στο Internet που θα οριστεί απαντά αυτόματα στις κλήσεις που έρχονται σε αυτό θέτοντας σε Y, ή να έχουν κλήσεις δαχτυλίδι από τη ρύθμιση του Ν. Προεπιλογή να είναι Υ. + + <BR> + <A NAME="phones-use_external_server_ip"> + <BR> + <B>Εξωτερικός κεντρικός υπολογιστής IP χρήσης -</B> Εάν χρησιμοποιώντας ως τηλέφωνο Ιστού, μπορείτε να θέσετε αυτό στο Υ για να χρησιμοποιήσετε τους κεντρικούς υπολογιστές εξωτερική IP για να καταχωρήσετε αντί του κεντρικού υπολογιστή IP. Η προεπιλογή είναι κενή. <BR> <A NAME="phones-status"> @@ -5173,6 +7326,11 @@ if ($ADD==99999) <BR> <B>Τηλέφωνο Ring Timeout -</B> Αυτό είναι το χρονικό διάστημα, σε δευτερόλεπτα, ότι το τηλέφωνο θα χτυπήσει στο dialplan πριν από την αποστολή της πρόσκλησης στον τηλεφωνητή. Προεπιλογή είναι 60 δευτερόλεπτα. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>On-Hook Είσοδος Πράκτορας -</B> Η επιλογή αυτή χρησιμοποιείται μόνο για εισερχόμενες κλήσεις θα πράκτορα συνδεδεμένοι με αυτό το τηλέφωνο. Αυτό το χαρακτηριστικό θα καλέσει τον αντιπρόσωπο, και δεν θα στείλει τον πελάτη για τη σύνοδο παράγοντες μέχρι η γραμμή απαντηθεί. Προεπιλογή N για άτομα με ειδικές ανάγκες. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -5249,9 +7407,14 @@ if ($ADD==99999) <B>Τηλέφωνο Πλαίσιο -</B> Αυτό είναι το πλαίσιο σχέδιο dial ότι αυτό το τηλέφωνο θα χρησιμοποιήσει η κλήση. Εάν εκτελείτε ένα τηλεφωνικό κέντρο και δεν θέλετε να σας παράγοντες είναι σε θέση να καλέσετε από έξω από την ViciDial αίτηση για παράδειγμα, τότε θα δημιουργούσε αυτόν τον τομέα σε ένα πλαίσιο dialplan που δεν υπάρχει, κάτι σαν πράκτορας-nodial. προεπιλογή είναι προεπιλογή. <BR> - <A NAME="phones-conf_secret"> + <A NAME="phones-codecs_list"> <BR> - <B>Conf Φάκελος Secret -</B> Αυτό είναι το μυστικό, ή τον κωδικό πρόσβασης, για το τηλέφωνο στο IAX ή auto γουλιά-generated conf αρχείο για αυτό το τηλέφωνο. Όριο είναι 20 χαρακτήρες αλφαριθμητικό παύλα και υπογράμμισης δεκτή. Προεπιλογή είναι δοκιμή. + <B>Codecs -</B> Μπορείτε να καθορίσετε έναν οριοθετημένο κόμμα κατάλογο codecs που τίθενται ως προεπιλογή codecs για αυτό το τηλέφωνο. Οι επιλογές για τα codecs περιλαμβάνουν ulaw, alaw, GSM, g729, speex, g722, g723, g726, ilbc,… Μερικά από αυτά τα codecs να μην είναι διαθέσιμα στο σύστημά σας, όπως g729 ή g726. Εάν ο τομέας είναι κενός, κατόπιν η προεπιλογή συστημάτων codecs ή η τηλεφωνική είσοδος επάνω από αυτήν θα χρησιμοποιηθεί για τα επιτρεπόμενα codecs. Η προεπιλογή είναι κενή. + + <BR> + <A NAME="phones-codecs_with_template"> + <BR> + <B>Codecs με το πρότυπο-</B> Ο καθορισμός αυτής της επιλογής σε 1 θα περιλάβει τα codecs που καθορίζονται ανωτέρω ακόμα κι αν ένα πρότυπο αρχείων conf χρησιμοποιείται. Η προεπιλογή είναι 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -5344,12 +7507,12 @@ if ($ADD==99999) <B>VMail Πλήκτρο -</B> Εάν το θέσετε σε αληθές θα εμφανιστεί το πλήκτρο VOICEMAIL και τα μηνύματα μπορούν να εμφανίζονται στο astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_ανανέωσης"> <BR> <B>Ταχύτητα Ανανέωσης -</B> Εάν το θέσετε σε αληθές ενεργοποιείται ένα νέο ρυθμό ανανέωσης πληροφοριών κλήσης για το astGUIclient. Προκαθορισμένος απενεργοποιημένος ρυθμός είναι 1000 ms (1 δευτερόλεπτο). <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_ανανέωσης_rate"> <BR> <B>Ρυθμός Ανανέωσης Ταχύτητας -</B> σε χιλιοστά δευτερολέπτου. Χρημοποιείται μόνο εάν η Ταχύτητα Ανανέωσης είναι ενεργοποιημένη. Προκαθορισμένος απενεργοποιημένος ρυθμός είναι 1000 ms (1 δευερόλεπτο). @@ -5493,6 +7656,11 @@ if ($ADD==99999) <BR> <B>Ενεργός -</B> Ορίζει κατά πόσον ο διακομιστής Asterisk είναι ενεργός ή μη ενεργός. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="servers-sysload"> <BR> @@ -5561,7 +7729,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf Φάκελος Secret -</B> Αυτό είναι το μυστικό, ή τον κωδικό πρόσβασης για το διακομιστή στο IAX που δημιουργείται αυτόματα conf αρχείο για αυτό το διακομιστή σε άλλους servers. Όριο είναι 20 χαρακτήρες αλφαριθμητικό παύλα και υπογράμμισης δεκτή. Προεπιλογή είναι δοκιμή. + <B>Conf Φάκελος Secret -</B> Αυτό είναι το μυστικό, ή τον κωδικό πρόσβασης για το διακομιστή στο IAX που δημιουργείται αυτόματα conf αρχείο για αυτό το διακομιστή σε άλλους servers. Όριο είναι 20 χαρακτήρες αλφαριθμητικό παύλα και υπογράμμισης δεκτή. Προεπιλογή είναι δοκιμή. Ένα ισχυρό μυστικό αρχείο ρυθμίσεων θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. <BR> <A NAME="servers-local_gmt"> @@ -5623,6 +7791,16 @@ if ($ADD==99999) <BR> <B>Αναπληρωματικό Καταγραφή IP Διακομιστή - </B> Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε ένα διακομιστή IP ή άλλο μηχάνημα το όνομα που μπορεί να χρησιμοποιηθεί στη θέση του server_ip στις συνδέσεις με ηχογραφήσεις εντός του admin ιστοσελίδες. Προεπιλεγμένο είναι άδειο. + <BR> + <A NAME="servers-external_server_ip"> + <BR> + <B>Εξωτερικός κεντρικός υπολογιστής IP -</B> Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε έναν κεντρικό υπολογιστή IP ή άλλο όνομα μηχανών που μπορούν να χρησιμοποιηθούν αντί του server_ip κατά το χρησιμοποίηση ενός webphone στη διεπαφή πρακτόρων. Για αυτό για να εργαστεί πρέπει επίσης να τεθείτε ως στόχος την τηλεφωνική είσοδο να χρησιμοποιήσετε τον εξωτερικό κεντρικό υπολογιστή IP. Η προεπιλογή είναι κενή. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>Ενεργός Twin IP του διακομιστή -</B> Μερικά συστήματα απαιτούν vicidial σύσταση vicidial διακομιστές σε ζεύγη. Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε την IP του διακομιστή του άλλου διακομιστή vicidial ότι αυτός ο server έχει αδελφοποιηθεί με. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες. + <BR> <A NAME="servers-active_asterisk_server"> <BR> @@ -5663,6 +7841,11 @@ if ($ADD==99999) <BR> <B>Carrier Logging Ενεργό -</B> Η ρύθμιση αυτή σας επιτρέπει να συνδεθείτε όλες hangup κωδικούς επιστροφής για κάθε εξερχόμενη κλήση λίστα κλήσεων που σας διάθεση. Προεπιλογή είναι Ν. + <BR> + <A NAME="servers-custom_dialplan_entry"> + <BR> + <B>Είσοδος Dialplan συνήθειας -</B> Αυτός ο τομέας επιτρέπει σε σας για να εισαγάγει σε οποιαδήποτε dialplan στοιχεία που θέλετε για τον κεντρικό υπολογιστή, οι γραμμές θα προστεθούν στο πλαίσιο προεπιλογής. + @@ -5680,6 +7863,11 @@ if ($ADD==99999) <BR> <B>Όνομα - </B> Αυτό είναι το όνομα του αρχείου conf πρότυπο εισόδου. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -5706,6 +7894,11 @@ if ($ADD==99999) <BR> <B>Περιγραφή Carrier -</B> Αυτό είναι που στα σχόλια του αστερίσκο αρχεία conf πάνω από το dialplan και εγγραφές λογαριασμό. Μέγιστο 255 χαρακτήρες. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -5814,16 +8007,46 @@ if ($ADD==99999) <BR> <B>Σπίτι URL Admin -</B> αυτό είναι η διεύθυνση URL ήιστοχώρων ότι θα πάτε εάν χτυπήσετε στην ΕΓΧΏΡΙΑ σύνδεση στηνκορυφή της σελίδας admin.php. + <BR> + <A NAME="settings-admin_modify_ανανέωσης"> + <BR> + <B>Διαχειριστής Τροποποίηση Αυτόματη Ανανέωση -</B> Αυτό είναι το χρονικό διάστημα ανανέωσης σε δευτερόλεπτα από τις οθόνες τροποποιήσετε σε αυτό το περιβάλλον του διαχειριστή. Ρύθμιση στο 0 θα απενεργοποιήσει την τοποθετεί κάτω από το 5 θα κάνουν ως επί το πλείστον οι οθόνες Τροποποίηση άχρηστα γιατί θα ανανεωθεί πολύ γρήγορα να αλλάξετε τα πεδία. Αυτή η επιλογή είναι χρήσιμη σε καταστάσεις όπου περισσότερα από ένα διαχειριστή ελέγχει τις ρυθμίσεις σε μια ενεργή εκστρατεία ή σε ομάδα, έτσι ώστε οι ρυθμίσεις ανανεώνονται συχνά. Προεπιλογή είναι 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Διαχειριστής No-Cache -</B> Ρύθμιση αυτό 1 θα καθορίζονται όλα τα admin σελίδες του πλοηγού του no-cache, έτσι ώστε κάθε οθόνη πρέπει να ξαναφορτωθεί κάθε φορά που προβάλλεται, ακόμη και αν κάνετε κλικ πίσω στον browser. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> <B>Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων - αυτή ηεπιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στοwebserver κάθε φορά που μεταφέρεται μια κλήση σε ένανπράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες. + <BR> + <A NAME="settings-enable_agc_dispo_log"> + <BR> + <B>Επιτρέψτε το αρχείο ημερολογίου διάθεσης πρακτόρων -</B> Αυτή η επιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στο webserver κάθε φορά που είναι μια κλήση από έναν πράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες. + <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Ώρα ρολόι Τέλος της ημέρας - </B> Αυτή η ρύθμιση καθορίζει, όταν όλοι οι χρήστες θα πρέπει να συνδεθεί αυτόματα από το σύστημα timeclock. Μόνο εκτελείται μία φορά την ημέρα. πρέπει να είναι μόνο 4 ψηφία ψηφίο 2 ώρες και 2 λεπτά ψηφίο στο 24ωρο διάστημα. Η προεπιλογή είναι 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Προεπιλογή τοπική ώρα GMT -</B> Αυτή η ρύθμιση ορίζει τι θα πρέπει να χρησιμοποιείται από προεπιλογή όταν τα νέα κινητά τηλέφωνα και servers χρησιμοποιώντας αυτή προστίθεται το admin web interface. Η προεπιλογή είναι -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Προεπιλογή Ζώνη Τηλεφωνητής -</B> Αυτή η ρύθμιση καθορίζει ποια ζώνη θα πρέπει να χρησιμοποιείται από προεπιλογή όταν δημιουργούνται νέα κινητά τηλέφωνα και κουτιά τηλεφωνητή. Η λίστα των διαθέσιμων ζωνών λαμβάνονται απευθείας από την voicemail.conf αρχείο. Προεπιλογή είναι η ανατολική. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Πράκτορες Κλήσεις Επαναφορά -</B> Αυτή η ρύθμιση καθορίζει αν η συνδεδεμένων αντιπροσώπων και ενεργό τηλεφωνήματα αρχεία είναι να μηδενιστεί στο τέλος της ημέρας χρονομέτρησης. Η προεπιλογή είναι 1 για ενεργοποίηση. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -5892,6 +8115,11 @@ if ($ADD==99999) <BR> <B>Ήχοι Web Directory -</B> Αυτό που δημιουργείται αυτόματα για όνομα καταλόγου δημιουργείται τυχαία από το σύστημα ως το μέρος που η ακουστική κατάστημα θα διατηρηθεί. Όλα τα μουσικά αρχεία θα διαμένουν σε αυτόν τον κατάλογο. + <BR> + <A NAME="settings-admin_web_directory"> + <BR> + <B>Διαχειριστής Web Directory -</B> Αυτό είναι ο κατάλογος Διοίκησης ότι το περιεχόμενό σας ιστοσελίδα, όπως admin.php, είναι μέσα Προεπιλογή vicidial. Για να καταλάβω Διαχειριστής της ιστοσελίδα σας, είναι ό, τι είναι μεταξύ του domain name και το admin.php στη διεύθυνση URL αυτής της σελίδας, χωρίς τις καθέτους που αρχίζουν και τελειώνουν. + <BR> <A NAME="settings-active_voicemail_server"> <BR> @@ -5915,7 +8143,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Επιτρέψτε Custom dialplan Καταχωρήσεις -</B> Αυτή η επιλογή σας επιτρέπει να εισάγετε έθιμο dialplan γραμμές στο Call μενού. Προεπιλογή είναι 0 για το ανενεργό. + <B>Επιτρέψτε Custom dialplan Καταχωρήσεις -</B> Αυτή η επιλογή επιτρέπει σε σας για να εισαγάγει τις dialplan γραμμές συνήθειας στις επιλογές πρόσκλησης, τους κεντρικούς υπολογιστές και τις τοποθετήσεις συστημάτων. Η προεπιλογή είναι 0 για ανενεργό. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>Όριο PLLB Ομαδοποίηση -</B> Τηλέφωνο φορτίου Είσοδος Εξισορρόπηση Όριο Όμιλο. Αν PLLB Όμιλος έχει οριστεί σε cascading σε επίπεδο καμπάνιας τότε η ρύθμιση αυτή θα καθορίσει τον αριθμό των πρακτόρων αποδεκτή σε κάθε διακομιστή σε όλες τις καμπάνιες. Η προεπιλογή είναι 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Δημιουργία Σταυρού-Server Extensions Τηλέφωνο -</B> Αυτή η επιλογή αν ρυθμιστεί στο 1, θα δημιουργήσει dialplan καταχωρήσεις για κάθε τηλέφωνο σε ένα πολυ-server του συστήματος. Η προεπιλογή είναι 0 για ανενεργή. <BR> <A NAME="settings-user_territories_active"> @@ -5932,11 +8170,142 @@ if ($ADD==99999) <BR> <B>Ενεργοποίηση TTS Ολοκλήρωσης -</B> Η ρύθμιση αυτή σας επιτρέπει να ενεργοποιήσετε Κείμενο Προς ολοκλήρωση Ομιλία με Cepstral. Αυτό είναι προς το παρόν διαθέσιμο μόνο για το εξερχόμενο εκστρατειών τύπου Έρευνα. Προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + <BR> + <A NAME="settings-callcard_enabled"> + <BR> + <B>Επιτρέψτε CallCard -</B> Αυτή η ρύθμιση επιτρέπει στα χαρακτηριστικά γνωρίσματα CallCard με ViciDial για να επιτρέψει τους επισκέπτες να χρησιμοποιήσει τους αριθμούς καρφιτσών και card_ids που έχουν μια ισορροπία των πρακτικών και εκείνων των ισορροπιών μπορεί να έχει το χρόνο συζήτησης πρακτόρων στις κλήσεις πελατών στις -ομάδες που αφαιρούνται. Η προεπιλογή είναι 0 για τα άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-custom_fields_enabled"> + <BR> + <B>Ενεργοποίηση προσαρμοσμένων πεδίων λίστας -</B> Αυτή η ρύθμιση επιτρέπει την προσαρμοσμένη λίστα χαρακτηριστικό πεδία που επιτρέπει για προσαρμοσμένα πεδία δεδομένων που θα καθοριστούν το web interface διαχείρισης με βάση την ανά-λίστα και στη συνέχεια να έχουν τα πεδία που είναι διαθέσιμα σε μια καρτέλα ΕΝΤΥΠΟ στον πράκτορα στο περιβάλλον web πράκτορα. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Ενεργοποίηση καλεί δοκιμής Εκστρατεία -</B> Αυτή η ρύθμιση επιτρέπει τη δυνατότητα να εισαγάγετε έναν κωδικό τηλεφώνου και τον αριθμό τηλεφώνου σε πεδία στο κάτω μέρος της οθόνης Λεπτομέρειες καμπάνιας και τοποθετήστε μια τηλεφωνική κλήση προς τον αριθμό αυτό σαν να ήταν ένας κύριος που αυτόματη κλήση στο σύστημα. Ο αριθμός τηλεφώνου θα αποθηκευτεί ως νέο επικεφαλής στο εγχειρίδιο λίστα λίστα αναγνώρισης κλήσης. Η καμπάνια πρέπει να είναι ενεργή η λειτουργία αυτή για να ενεργοποιηθεί, και συνιστάται ότι οι κατάλογοι που ανατίθενται στην εκστρατεία όλα να ρυθμιστεί σε ανενεργά. Το πρόθεμα κλήσης, χρονικό όριο κλήσης και όλα τα άλλα χαρακτηριστικά που σχετίζονται με κλήση, εκτός από το DNC και καλούν τις επιλογές του χρόνου, θα επηρεάσουν την κλήση του αριθμού δοκιμών. Το τηλεφώνημα θα τοποθετηθεί στο διακομιστή επιλεγεί ως το διακομιστή φωνητικού ταχυδρομείου στις ρυθμίσεις του συστήματος. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Ενεργοποίηση Διευρυμένη Στατιστικά Λίστα -</B> Αυτή η ρύθμιση δίνει τη δυνατότητα δύο επιπλέον στήλες που θα εμφανίζονται στις περισσότερες των πινάκων κατανομής Λίστα κατάσταση σχετικά με την τροποποίηση λίστα και σελίδες τροποποίηση εκστρατεία. Διείσδυση ορίζεται ως το ποσοστό των αγωγών οι οποίοι είναι επί ή υπεράνω του ορίου κλήσεων Count εκστρατεία και-ή η κατάσταση χαρακτηρίζεται ως Ολοκληρώθηκε. Η προεπιλογή είναι 1 για ενεργοποίηση. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Ενεργοποίηση Areacode Εκστρατεία CID -</B> Αυτή η ρύθμιση επιτρέπει τη δυνατότητα να καθορίσει συγκεκριμένες εξερχόμενες CallerID αριθμοί που θα χρησιμοποιηθούν ανά καμπάνια. Η προεπιλογή είναι 1 για ενεργοποίηση. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Ενεργοποίηση απομακρυσμένης παρακάμψεων Επέκταση γραφείο -</B> Αυτή η ρύθμιση δίνει τη δυνατότητα να έχουν DIDs παρακάμπτει επέκταση δρομολογείται για απομακρυσμένες κλήσεις μέσω αντιπροσώπου σε ομάδες. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Επαφές Ενεργοποιήθηκε -</B> Αυτή η ρύθμιση δίνει τη δυνατότητα στους Επαφές υπο-ενότητα του διαχειριστή που επιτρέπει σε ένα διαχειριστή να προσθέσει τροποποιήσετε ή να διαγράψετε επαφές στο σύστημα που μπορεί να χρησιμοποιηθεί ως μέρος μιας προσαρμοσμένης μεταφοράς σε μια εκστρατεία όπου ένας πράκτορας μπορεί να ψάξει για τις επαφές με το πρώτο όνομα το επώνυμο ή το γραφείο αριθμό και στη συνέχεια επιλέξτε μία από τις πολλές αριθμούς που σχετίζονται με αυτή την επαφή. Αυτή η δυνατότητα χρησιμοποιείται συχνά από τους φορείς εκμετάλλευσης ή σε λειτουργίες τηλεφωνικού κέντρου, όπου ο χρήστης θα χρειαστεί να μεταφέρετε μια κλήση σε μια μη-πράκτορα τηλέφωνο. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-first_login_trigger"> + <BR> + <B>Πρώτη Trigger Είσοδος -</B> Αυτή η ρύθμιση δίνει τη δυνατότητα για την αρχική διαμόρφωση του διακομιστή οθόνης να εμφανίζεται στο διαχειριστή, όταν συνδέεστε για πρώτη φορά στο σύστημα. + + <BR> + <A NAME="settings-default_phone_registration_password"> + <BR> + <B>Προεπιλεγμένος κωδικός πρόσβασης Εγγραφή Τηλέφωνο -</B> Αυτός είναι ο κωδικός εγγραφής προεπιλογή χρησιμοποιούνται όταν νέα τηλέφωνα προστεθούν στο σύστημα. Η προεπιλογή είναι δοκιμή. + + <BR> + <A NAME="settings-default_phone_login_password"> + <BR> + <B>Προεπιλογή Κωδικός Είσοδος Τηλέφωνο -</B> Αυτό είναι το προεπιλεγμένο τηλέφωνο διαδίκτυο κωδικό πρόσβασης χρησιμοποιείται όταν τα νέα κινητά τηλέφωνα προστίθεται στο σύστημα. Η προεπιλογή είναι δοκιμή. + + <BR> + <A NAME="settings-default_server_password"> + <BR> + <B>Προεπιλεγμένος κωδικός πρόσβασης διακομιστή -</B> Αυτός είναι ο κωδικός προεπιλεγμένο διακομιστή που χρησιμοποιείται όταν οι νέοι διακομιστές προστεθούν στο σύστημα. Η προεπιλογή είναι δοκιμή. + + <BR> + <A NAME="settings-slave_db_server"> + <BR> + <B>Slave διακομιστή βάσης δεδομένων -</B> Εάν έχετε έναν σκλάβο MySQL server της βάσης δεδομένων και στη συνέχεια πληκτρολογήστε την τοπική διεύθυνση IP για το διακομιστή εδώ. Η επιλογή αυτή τη στιγμή χρησιμοποιούνται μόνο από τις επιλεγμένες αναφορές στην επόμενη επιλογή και δεν έχει τίποτα να κάνει με την αυτόματη ρύθμιση παραμέτρων MySQL κυρίου-υποτελούς αναπαραγωγή. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-reports_use_slave_db"> + <BR> + <B>Εκθέσεις για την χρήση της DB Slave -</B> Αυτή η επιλογή σας επιτρέπει να επιλέξετε τις αναφορές που θέλετε να χρησιμοποιήσετε τη βάση δεδομένων MySQL σκλάβων, όπως ορίζεται στην παραπάνω επιλογή αντί της βάσης δεδομένων master ότι τα ζωντανά ViciDial σύστημά σας τρέχει σε. Θα πρέπει να συσταθεί η αναπαραγωγή σκλάβος της MySQL για να μπορέσετε να ενεργοποιήσετε αυτή την επιλογή. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-default_field_labels"> + <BR> + <B>Ετικέτες Πεδίο Προεπιλογή -</B> Αυτά τα 19 πεδία σας επιτρέπουν να ορίσετε το όνομα, όπως θα εμφανίζεται στο περιβάλλον ViciDial παράγοντα καθώς και τη διοικητική σελίδα μολύβδου τροποποιήσετε. Προεπιλογή είναι άδειο το οποίο θα χρησιμοποιεί τα σκληρά-κωδικοποιημένα προεπιλογές στη διεπαφή πράκτορα. Μπορείτε επίσης να ορίσετε μια ετικέτα για να ΑΠΟΚΡΥΨΗ --- --- να κρύψουν τόσο την ετικέτα και το πεδίο. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Απόκρυψη ετικετών στα αρχεία καταγραφής κλήσεων -</B> Αν η ετικέτα έχει οριστεί σε ΑΠΟΚΡΥΨΗ --- --- τότε τα αρχεία καταγραφής κλήσεων πράκτορα, εφόσον είναι ενεργοποιημένη για την καμπάνια, θα εξακολουθούν να δείχνουν το πεδίο και τα δεδομένα, εκτός αν αυτή η επιλογή έχει οριστεί σε ΚΕ Προεπιλογή είναι N. + <BR> <A NAME="settings-qc_features_active"> <BR> <B>QC Χαρακτηριστικά Ενεργό - </B> Αυτή η επιλογή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε τη QC ή Ποιοτικός Έλεγχος χαρακτηριστικά. Η προεπιλογή είναι 0 για το ανενεργό. + <BR> + <A NAME="settings-default_webphone"> + <BR> + <B>Προεπιλογή Webphone -</B> Εάν θέστε 1, αυτή η επιλογή θα καταστήσει όλα τα νέα τηλέφωνα δημιουργημένα να έχει θέσει δεδομένου ότι καθορισμένο Webphone Υ. Default είναι 0. + + <BR> + <A NAME="settings-webphone_systemkey"> + <BR> + <B>Διαδικτυακό κοινόχρηστο τηλέφωνο Key System -</B> Αν το σύστημά σας ή το φορέα παροχής απαιτεί, αυτό είναι όπου το βασικό σύστημα για το Διαδικτυακό κοινόχρηστο τηλέφωνο θα πρέπει να εγγραφεί μέσα Προεπιλογή είναι άδειο. + + <BR> + <A NAME="settings-default_codecs"> + <BR> + <B>Προεπιλογή Codecs -</B> Μπορείτε να καθορίσετε έναν οριοθετημένο κόμμα κατάλογο codecs που τίθενται ως προεπιλογή codecs για όλα τα συστήματα. Οι επιλογές για τα codecs περιλαμβάνουν ulaw, alaw, GSM, g729, speex, g722, g723, g726, ilbc,… η προεπιλογή είναι κενή. + + <BR> + <A NAME="settings-custom_dialplan_entry"> + <BR> + <B>Είσοδος Dialplan συνήθειας -</B> Αυτός ο τομέας επιτρέπει σε σας για να εισαγάγει σε οποιαδήποτε dialplan στοιχεία που θέλετε για όλους τους κεντρικούς υπολογιστές αστερίσκων, οι γραμμές θα προστεθούν στο πλαίσιο προεπιλογής. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Ανανέωση Dialplan Στις Διακομιστές -</B> Αυτή η επιλογή σας επιτρέπει να αναγκάσει ένα επαναφορτώσετε του dialplan σε όλες τις Asterisk διακομιστές του συμπλέγματος. Αν έχετε κάνει αλλαγές στην Προσαρμοσμένη Dialplan Έναρξη παραπάνω θα πρέπει να ορίσετε στο 1 και να υποβάλει αυτές τις αλλαγές έχουν τεθεί σε ισχύ στις διακομιστές. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Όχι-Απάντηση Σύνδεση -</B> Αυτή η επιλογή θα καταγράψει το auto-dial κλήσεις που δεν απαντώνται σε έναν ξεχωριστό πίνακα. Προεπιλογή είναι N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>Σύνδεση DID, γραφείο -</B> Αυτή η επιλογή θα καταγράψει τα εισερχόμενα κλήσεις DID, μαζί με μια ομάδα-σε και κωδικός ταυτότητας χρήστη, κατά περίπτωση, σε έναν ξεχωριστό πίνακα. Προεπιλογή είναι N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt-Σύνδεση διακομιστή DB -</B> Αυτή είναι η εναλλακτική server της βάσης δεδομένων καταγραφής. Αυτό είναι προαιρετικό, και επιτρέπει σε ορισμένα αρχεία καταγραφής για να γραφτεί σε μια ξεχωριστή βάση δεδομένων. Προεπιλογή είναι άδειο. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Alt-Πίνακες Σύνδεση -</B> Αυτές είναι οι πίνακες που είναι διαθέσιμες για τη σύνδεση του εναλλακτικού διακομιστή της βάσης δεδομένων καταγραφής. Η προεπιλογή είναι κενό. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>Εξωτερικός κεντρικός υπολογιστής IP προεπιλογής -</B> Εάν θέστε 1, αυτή η επιλογή θα καταστήσει όλα τα νέα τηλέφωνα δημιουργημένα να έχει τη χρήση που ο εξωτερικός κεντρικός υπολογιστής IP καθορισμένος Υ. Default είναι 0. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>Webphone URL -</B> Αυτό είναι το URL του webphone που θα χρησιμοποιηθεί με αυτό το σύστημα εάν επιτρέπεται στο τηλεφωνικό αρχείο που ένας πράκτορας χρησιμοποιεί. Η προεπιλογή είναι κενή. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -5977,6 +8346,31 @@ if ($ADD==99999) <BR> <B>QueueMetrics EnterQueue Prepend -</B> αυτός ο τομέαςχρησιμοποιείται για να επιτρέψει ένας από τους τομείς στοιχείωνvicidial_list μπροστά από τον τηλεφωνικό αριθμό του πελάτη γιατις προσαρμοσμένες εκθέσεις QueueMetrics. Η προεπιλογή δενείναι ΚΑΜΙΑ για να μην εποικήσει τίποτα. + <BR> + <A NAME="settings-queuemetrics_loginout"> + <BR> + <B>QueueMetrics σύνδεση-έξω -</B> Αυτή η επιλογή έχει επιπτώσεις σπόσο vicidial θα καταγράψει τα logins και τις αποσυνδέσεις ενός πράκτορα στο queue_log. Η προεπιλογή είναι ΤΥΠΟΠΟΙΗΜΕΝΗ για να χρησιμοποιήσει τυποποιημένο AGENTLOGIN AGENTLOGOFF, η ΕΠΑΝΆΚΛΗΣΗ θα χρησιμοποιήσει AGENTCALLBACKLOGIN και AGENTCALLBACKLOGOFF που QM θα αναλύσει διαφορετικά, ΚΑΝΕΝΑ δεν θα καταγράψει τυχόν συνδέσεις και logouts μέσα queue_log. + + <BR> + <A NAME="settings-queuemetrics_callstatus"> + <BR> + <B>QueueMetrics CallStatus -</B> Αυτή η επιλογή εάν θέστε 0 δεν θα υποβάλει την είσοδο CALLSTATUS στο queue_log όταν διαθέσεις πρακτόρων μια κλήση. Η προεπιλογή είναι 1 για επιτρεμμένος. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics Addmember Ενεργοποιήθηκε -</B> Αυτή η επιλογή αν ρυθμιστεί στο 1, θα δημιουργήσει ADDMEMBER2 και REMOVEMEMBER καταχωρήσεις σε queue_log. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>QueueMetrics Κωδικός Παύση DISPO -</B> Αυτή η επιλογή, αν συμπληρωθεί, σας επιτρέπει να ορίσετε αν η παύση dispo κωδικός έχει εισαχθεί queue_log όταν ένας πράκτορας βρίσκεται σε dispo κατάσταση. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>QueueMetrics Τηλέφωνο Περιβάλλοντος Τηλέφωνο Προσάρτηση -</B> Αυτή η επιλογή, εάν ενεργοποιηθεί, θα προσαρτήσει τη σύνδεση του τηλεφώνου παράγοντα στην εγγραφή δεδομένων αυτών4 στον πίνακα καταγραφής ουρά αν το τηλέφωνο εκστρατεία στον τομέα του περιβάλλοντος έχει συμπληρωθεί. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες. + <BR> <A NAME="settings-enable_vtiger_integration"> <BR> @@ -6013,7 +8407,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUSES ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Μέσω της χρήσης των θέσεων συστημάτων, μπορείτε να έχετε τιςθέσεις που υπάρχουν για την εκστρατεία και την-ΟΜΑΔΑ. Η θέσηπρέπει να είναι 1-6 χαρακτήρες στο μήκος, η περιγραφή πρέπεινα είναι 2-30 χαρακτήρες στο μήκος και επιλέξιμος καθορίζειεάν παρουσιάζει σε VICIDIAL ως διάθεση πρακτόρων. Ο τομέαςχρησιμοποιείται κατά τον υπολογισμό του ποσοστού πτώσης, ήεγκαταλείπει το ποσοστό. Η ρύθμιση την στο Υ θα χρησιμοποιήσειαυτήν την θέση κατά υπολογισμό των ανθρώπινος-απαντημένωνκλήσεων. Η επιλογή κατηγορίας επιτρέπει σε σας για ναομαδοποιήσει διάφορες θέσεις σε ένα catogy που μπορεί ναχρησιμοποιηθεί για τη στατιστική ανάλυση. Υπάρχουν επίσης 5 επιπλέον ρυθμίσεις που θα καθορίσει το είδος της κατάστασης: πώληση, DNC, επικοινωνήστε με τον πελάτη, δεν ενδιαφέρονται, ανεφάρμοστη.</B> + <B>Μέσω της χρήσης των θέσεων συστημάτων, μπορείτε να έχετε τιςθέσεις που υπάρχουν για την εκστρατεία και την-ΟΜΑΔΑ. Η θέσηπρέπει να είναι 1-6 χαρακτήρες στο μήκος, η περιγραφή πρέπεινα είναι 2-30 χαρακτήρες στο μήκος και επιλέξιμος καθορίζειεάν παρουσιάζει σε VICIDIAL ως διάθεση πρακτόρων. Ο τομέαςχρησιμοποιείται κατά τον υπολογισμό του ποσοστού πτώσης, ήεγκαταλείπει το ποσοστό. Η ρύθμιση την στο Υ θα χρησιμοποιήσειαυτήν την θέση κατά υπολογισμό των ανθρώπινος-απαντημένωνκλήσεων. Η επιλογή κατηγορίας επιτρέπει σε σας για ναομαδοποιήσει διάφορες θέσεις σε ένα catogy που μπορεί ναχρησιμοποιηθεί για τη στατιστική ανάλυση. Υπάρχουν επίσης 5 επιπλέον ρυθμίσεις που θα καθορίσει το είδος της κατάστασης: πώληση, DNC, επικοινωνήστε με τον πελάτη, δεν ενδιαφέρονται, ανεφάρμοστη, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS ΠΙΝΑΚΑΣ</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a ανά εκστρατεία basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Οθόνη ID ετικέτας -</B> Αυτό το πεδίο πρέπει να είναι τουλάχιστον 2 χαρακτήρες σε μήκος και δεν υπερβαίνει τους 20 χαρακτήρες, χωρίς κενά ή ειδικούς χαρακτήρες. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για να προσδιορίσει την ετικέτα οθόνη όλο το σύστημα. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Οθόνη Ονομασία ετικέτας -</B> Αυτό είναι το περιγραφικό όνομα του την ετικέτα της οθόνης. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Διαχειριστής Ομάδα Χρηστών -</B> Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Απόκρυψη ετικετών στα αρχεία καταγραφής κλήσεων -</B> Αν η ετικέτα έχει οριστεί σε ΑΠΟΚΡΥΨΗ --- --- τότε τα αρχεία καταγραφής κλήσεων πράκτορα, εφόσον είναι ενεργοποιημένη για την καμπάνια, θα εξακολουθούν να δείχνουν το πεδίο και τα δεδομένα, εκτός αν αυτή η επιλογή έχει οριστεί σε ΚΕ Προεπιλογή είναι N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Ετικέτες Πεδίο Προεπιλογή -</B> Αυτά τα 19 πεδία σας επιτρέπουν να ορίσετε το όνομα, όπως θα εμφανίζεται στο περιβάλλον ViciDial παράγοντα καθώς και τη διοικητική σελίδα μολύβδου τροποποιήσετε. Προεπιλογή είναι άδειο το οποίο θα χρησιμοποιεί τα σκληρά-κωδικοποιημένα προεπιλογές στη διεπαφή πράκτορα. Μπορείτε επίσης να ορίσετε μια ετικέτα για να ΑΠΟΚΡΥΨΗ --- --- να κρύψουν τόσο την ετικέτα και το πεδίο. @@ -6025,6 +8452,58 @@ if ($ADD==99999) <B>Μέσω της χρήσης των κατηγοριών θέσης συστημάτων, μπορείτε νασυγκεντρώσετε τις θέσεις για να επιτρέψετε τη στατιστική ανάλυσησε μια ομάδα θέσεων. Η ταυτότητα κατηγορίας πρέπει να είναι2-20 χαρακτήρες στο μήκος χωρίς τα διαστήματα, το όνομαπρέπει να είναι 2-50 χαρακτήρες στο μήκος, η περιγραφή είναιπροαιρετική και η επίδειξη TimeonVDAD καθορίζει εάν εκείνη ηθέση θα είναι ενός θέσης από μέχρι 4 θέσεις που μπορούν ναυπολογιστούν και να επιδειχθούν στο χρόνο στη σε πραγματικό χρόνοέκθεση VDAD.</B> Η Πώληση Κατηγορία και Dead επικεφαλής της κατηγορίας είναι και οι δύο που χρησιμοποιούνται από το σύστημα όταν Κατάλογος Πρόταση αναλύοντας κατάλογο στατιστικών. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Δημιουργία νέου προτύπου - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Διαγράφωtemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "Διαγραφή προτύπου". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>Πρότυπο ID -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Όνομα -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>Περιγραφή Πρότυπο -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>ID Λίστας -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Στήληs highlighted in blue are standard columns from the vicidial_list table. Στήληs highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "ΑΠΟΣΤΟΛΗ ΥΠΟΔΕΙΓΜΑ" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Μέγιστη Σύστημα Εκθέσεις Στατιστικά</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Αυτά τα στατιστικά στοιχεία που αποθηκεύονται προσωρινά σύνολα που έχουν αποθηκευτεί στη διάρκεια κάθε ημέρας σε πραγματικό χρόνο μέσω του back-end διαδικασίες. Για τις εισερχόμενες κλήσεις, οι συνολικές κλήσεις ανά-σε ομάδα υπολογίζεται για κάθε κλήση που εισέρχεται στη διαδικασία που υπολογίζει. Για το σύνολο του συστήματος μετράει, είναι τα σύνολα που προέρχονται από τις καταχωρήσεις ημερολογίου, καθώς και άλλα σύνολα στην ομάδα και εκστρατεία. Αυτά τα σύνολα ενδέχεται να μην αθροίζονται λόγω των ρυθμίσεων που έχετε στο σύστημά σας, καθώς και όταν η κλήση κρέμασε. + + <?php if ($SSqc_features_active > 0) { @@ -6034,7 +8513,7 @@ if ($ADD==99999) <B><FONT SIZE=3>QC VICIDIAL κωδικοί</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>Ο Ποιοτικός Έλεγχος-QC σύστημα εντός VICIDIAL έχει τους δικούς της κωδικοί χωριστά από εκείνα που, κατά την κλήση των λειτουργιών χειρισμού VICIDIAL. QC statuse κωδικοί πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες και δεν περιέχουν ειδικούς χαρακτήρες όπως ένα χώρο ή παχέος εντέρου. Ο κωδικός QC περιγραφή πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες.</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -6074,12 +8553,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -6089,7 +8569,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -6114,13 +8594,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Εμφάνιση Μετρητή Κληθέντων Οδηγών</B> -<BR><BR>\n"; echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n"; - echo "<B>ΛΙΣΤΕΣ:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>STATUSES:</B> $dial_statuses<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -6144,6 +8626,8 @@ 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'; @@ -6202,13 +8686,22 @@ if ($ADD==7111111) $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'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -6218,6 +8711,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6276,10 +8771,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6339,6 +8837,15 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -6359,8 +8866,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_ανανέωσης > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
    "; + } ###################################################################################################### @@ -6402,34 +8911,25 @@ if ($ADD=="1") } else { - echo "Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE\n"; + echo "Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE\n"; } - echo "Κωδικός:$NWB#vicidial_users-pass$NWE\n"; + + echo "Κωδικός:$NWB#vicidial_users-pass$NWE     Δύναμη: \n"; + echo "Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE\n"; echo "Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE\n"; echo "Ομάδα Χρήστη: $NWB#vicidial_users-phone_login$NWE\n"; echo "Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -6476,9 +8976,11 @@ if ($ADD=="1A") } else { - echo "Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE\n"; + echo "Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE\n"; } - echo "Κωδικός:$NWB#vicidial_users-pass$NWE\n"; + + echo "Κωδικός:$NWB#vicidial_users-pass$NWE     Δύναμη: \n"; + echo "Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6486,7 +8988,7 @@ if ($ADD=="1A") echo "Source Χρήστης: \n"; + echo "\n"; echo "
    \n"; if ($voi_count > 0) { @@ -6546,15 +9049,18 @@ if ($ADD==11) } 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"; @@ -6623,10 +9129,12 @@ if ($ADD==11) echo "$scripts_list"; echo "$NWB#vicidial_campaigns-campaign_script$NWE\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
    Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
    Περιγραφή εκστρατείας: $NWB#vicidial_campaigns-campaign_description$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_campaigns-user_group$NWE
    Ενεργή:$NWB#vicidial_campaigns-active$NWE
    Τηλ.σύνδ. Στάθμευσης: $NWB#vicidial_campaigns-park_ext$NWE
    Ονομα Αρχείου Στάθμευσης: $NWB#vicidial_campaigns-park_file_name$NWE
    Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
    Πάρκο Μουσική-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
    Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ:
    Ελάχιστο Επίπεδο Χόπερ: $NWB#vicidial_campaigns-hopper_level$NWE
    ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
    Χρόνος Τοπικής Κλήσης: $NWB#vicidial_campaigns-local_call_time$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
    \n"; } @@ -6675,7 +9183,7 @@ if ($ADD==12) echo "Εκστρατεία πηγής:$NWB#vicidial_lists-list_description$NWE\n"; echo "Εκστρατεία: \n"; } echo "\n"; - echo "\n"; + echo "\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) + { + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; 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_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_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 ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΙΛΟΣ δεν διαγράφεται - Αυτός ο αριθμός τηλεφώνου δεν είναι στην λίστα φίλτρων Ομίλου Τηλ.: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΔΙΑΓΡΑΦΟΝΤΑΙ: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - Αυτός ο αριθμός τηλεφώνου είναι ήδη στη λίστα φίλτρων Ομίλου Τηλ.: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
    ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΠΡΟΣΤΙΘΕΜΕΝΗΣ: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
    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 Ομάδα:
    Τηλέφωνα:

    (έναν αριθμό τηλεφώνου σε κάθε γραμμή μόνο)
    $NWB#vicidial_list-dnc$NWE
    Προσθήκη ή Διαγραφή:
    \n"; + + if ($LOGuser_level >= 9) + { + echo "
    Download numbers in this list to a file:
    \n"; + echo "\n"; + echo "
    \n"; + } + } @@ -6957,17 +9581,23 @@ if ($ADD==1111) echo "
    Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
    Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
    Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
    Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_inbound_groups-user_group$NWE
    Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Βοηθός: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    \n"; } @@ -7016,7 +9646,7 @@ if ($ADD==1211) echo "Source ID Ομάδας: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; echo "DID Περιγραφή:$NWB#vicidial_inbound_dids-did_description$NWE\n"; + echo "Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_inbound_dids-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7088,7 +9722,7 @@ if ($ADD==1411) echo "DID Πηγή: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Όνομα μενού: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7196,7 +9834,7 @@ if ($ADD==1611) echo "Πηγή Μενού: \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Φίλτρο ID Ομάδας Τηλέφωνο: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Όνομα φίλτρου ομάδας Τηλέφωνο: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Φίλτρο Περιγραφή ομάδας Τηλέφωνο: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7236,7 +9906,7 @@ if ($ADD==11111) echo "
    ΠΡΟΣΘΗΚΗ ΝΕΩΝ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ
    \n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7516,6 +10250,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7535,7 +10273,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
    ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented, πρέπει να είναι μια υπάρχουσα vicidial χρήστη)$NWB#vicidial_remote_agents-user_start$NWE
    Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Διακομιστή: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + echo "
    Προσθέστε το λήμμα ομάδας επέκτασης\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Ομάδα επέκτασης: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Παράταση: (μόνο αριθμοί)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Ομάδες εκστρατειών: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -7343,12 +10053,19 @@ if ($ADD==1111111) echo "
    Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
    Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
    Ενεργή:$NWB#vicidial_scripts-active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_scripts-user_group$NWE
    Κείμενο χειρόγραφου: "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -7456,6 +10182,10 @@ if ($ADD==11111111) } echo "
    Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_lead_filters-user_group$NWE
    SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -7485,6 +10215,10 @@ if ($ADD==111111111) echo "
    ID Χρόνου Κλήσης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
    Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
    Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_times-user_group$NWE
    Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
    State Call Time State: (όχι κενά ή στίξη)$NWB#vicidial_call_times-state_call_time_state$NWE
    Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
    Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_times-user_group$NWE
    Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7545,6 +10283,10 @@ if ($ADD==131111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -7558,6 +10300,7 @@ if ($ADD==131111111) echo "Παρασκευή
    \n"; echo "Σάββατο
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Shift ID: (όχι κενά ή στίξη)$NWB#vicidial_shifts-shift_id$NWE
    Shift Όνομα: (σύντομη περιγραφή της μετατόπισης)$NWB#vicidial_shifts-shift_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_shifts-user_group$NWE
    Shift Ώρα έναρξης:\n"; echo "   Shift End Time:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Επιλογή Έκθεση: $NWB#vicidial_shifts-report_option$NWE
    \n"; } @@ -7575,7 +10318,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -7598,32 +10341,36 @@ if ($ADD==11111111111) echo "
    \n"; if ($voi_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"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Τηλ.σύνδεσης τηλεφώνου: Auto-Generated $NWB#phones-extension$NWE
    Παράταση Τηλέφωνο:Auto-Generated $NWB#phones-extension$NWE
    Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
    Παράταση Τηλέφωνο:$NWB#phones-extension$NWE
    Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
    Τηλεφωνητής Box: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
    Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
    Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
    Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
    IP Διακομιστή:
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    IP Διακομιστή: $NWB#phones-server_ip$NWE
    Σύνδεση:$NWB#phones-login$NWE
    Κωδικός:$NWB#phones-pass$NWE
    Πράκτορας Είσοδος οθόνης: $NWB#phones-login$NWE
    Υποσελίδες: $NWB#phones-pass$NWE
    Κωδικός Εγγραφή: $NWB#phones-conf_secret$NWE     Δύναμη:
    Κατάσταση:$NWB#phones-status$NWE
    Ενεργός Λογαριασμός: $NWB#phones-active$NWE
    Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
    Πλήρες Ονομα: $NWB#phones-fullname$NWE
    Εταιρία:$NWB#phones-company$NWE
    Εικόνα:$NWB#phones-picture$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
    Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
    Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
    \n"; } @@ -7641,7 +10388,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7653,6 +10400,10 @@ if ($ADD==12111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7672,7 +10423,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
    Γνωστός ID:$NWB#phones-alias_id$NWE
    Ψευδώνυμο: $NWB#phones-alias_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    Τηλέφωνο logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7687,6 +10438,10 @@ if ($ADD==13111111111) echo "
    CallerID Αριθμός: $NWB#phones-caller_id_number$NWE
    CallerID Όνομα: $NWB#phones-caller_id_name$NWE
    Ενεργή:
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    \n"; @@ -7718,6 +10473,10 @@ if ($ADD==111111111111) echo "
    Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
    Ενεργή:$NWB#servers-active$NWE
    Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#servers-user_group$NWE
    \n"; } @@ -7746,6 +10505,10 @@ if ($ADD==131111111111) echo "
    Αναγνωριστικό: $NWB#vicidial_conf_templates-template_id$NWE
    Όνομα: $NWB#vicidial_conf_templates-template_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_conf_templates-user_group$NWE
    Template Περιεχόμενα: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -7764,7 +10527,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -7828,13 +10581,63 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) + { + echo "
    \n"; echo ""; @@ -7776,10 +10539,14 @@ if ($ADD==141111111111) echo "
    Θαλαμίσκος ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Φέρον Όνομα: $NWB#vicidial_server_carriers-carrier_name$NWE
    Περιγραφή Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_server_carriers-user_group$NWE
    Εγγραφή String: $NWB#vicidial_server_carriers-registration_string$NWE
    Αναγνωριστικό:
    Dialplan Είσοδος: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP Διακομιστή: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; + echo ""; + + echo "
    ΠΡΟΣΘΕΣΤΕ ΤΟΝ ΑΝΤΙΓΡΑΜΜΕΝΟ ΜΕΤΑΦΟΡΕΑ\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
    Θαλαμίσκος ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Φέρον Όνομα: $NWB#vicidial_server_carriers-carrier_name$NWE
    IP Διακομιστή: $NWB#vicidial_server_carriers-server_ip$NWE
    Μεταφορέας πηγής: $NWB#vicidial_server_carriers-carrier_id$NWE
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### if ($ADD==151111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7846,6 +10649,10 @@ if ($ADD==151111111111) echo "
    TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
    TTS Όνομα: $NWB#vicidial_tts_prompts-tts_name$NWE
    Ενεργή:
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_tts_prompts-user_group$NWE
    \n"; @@ -7864,7 +10671,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7876,6 +10683,10 @@ if ($ADD==161111111111) echo "
    Music On Hold ID: $NWB#vicidial_music_on_hold-moh_id$NWE
    Music Hold On Όνομα: $NWB#vicidial_music_on_hold-moh_name$NWE
    Τυχαία σειρά:
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_music_on_hold-user_group$NWE
    \n"; @@ -7894,7 +10705,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "
    \n"; echo ""; @@ -7903,11 +10714,86 @@ if ($ADD==171111111111) echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID: $NWB#vicidial_voicemail-voicemail_id$NWE
    Ταυτότητα φωνητικού ταχυδρομείου: $NWB#vicidial_voicemail-voicemail_id$NWE
    Pass: $NWB#vicidial_voicemail-pass$NWE
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Ενεργή:
    Email:$NWB#vicidial_voicemail-email$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_voicemail-user_group$NWE
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
    Προσθήκη νέου ΕΤΙΚΕΤΑ ΟΘΟΝΗ\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    Οθόνη ID ετικέτας: $NWB#vicidial_screen_labels-label_id$NWE
    Οθόνη Ονομασία ετικέτας: $NWB#vicidial_screen_labels-label_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_screen_labels-user_group$NWE
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
    Προσθήκη νέου ΕΤΙΚΕΤΑ ΟΘΟΝΗ\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Ονομα: $NWB#contact_information$NWE
    Επίθετο: $NWB#contact_information$NWE
    Αριθμός Γραφείου: $NWB#contact_information$NWE
    Αριθμός κυττάρων: $NWB#contact_information$NWE
    Άλλο Αριθμός 1: $NWB#contact_information$NWE
    Άλλο Αριθμός 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Ομάδα:$NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; @@ -7936,9 +10822,7 @@ if ($ADD==1111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
    IP Διακομιστή: $NWB#conferences-server_ip$NWE
    \n"; @@ -7967,9 +10851,7 @@ if ($ADD==11111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
    IP Διακομιστή: $NWB#conferences-server_ip$NWE
    \n"; @@ -8022,10 +10904,10 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
    Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    το πλήρες όνομα και κωδικός πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; echo "
    πρέπει να επιλέξετε μια ομάδα χρηστών\n"; } @@ -8122,6 +11004,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8209,7 +11101,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8300,10 +11192,10 @@ if ($ADD=="2A") {echo "
    Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένας χρήστης με αυτό τον αριθμό\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) { echo "
    Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    το πλήρες όνομα και κωδικός πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; echo "\n"; } @@ -8346,7 +11238,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8404,6 +11296,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8491,7 +11393,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8604,12 +11506,30 @@ if ($ADD==21) { echo "
    ΕΚΣΤΡΑΤΕΙΑ ΠΡΟΣΤΕΘΗΚΕ: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8668,13 +11588,31 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_ανανέωσης,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) 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_ανανέωσης,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -8686,6 +11624,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8730,7 +11674,7 @@ if ($ADD==22) { echo "
    ΚΑΤΑΣΤΑΣΗ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΕΘΗΚΕ: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -8971,6 +11915,176 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PRESET ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - υπάρχει ήδη μια καταχώρηση για την εκστρατεία αυτή με αυτήν την προκαθορισμένη ρύθμιση\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
    PRESET ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    AREACODE ΔΕΝ CID ΠΡΟΣΤΙΘΕΜΕΝΗΣ - υπάρχει ήδη μια καταχώρηση για την εκστρατεία αυτή με αυτό το CID
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    AREACODE ΔΕΝ CID ΠΡΟΣΤΙΘΕΜΕΝΗΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "
    AREACODE CID ΠΡΟΣΤΙΘΕΜΕΝΗΣ: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    AREACODE CID δεν διαγράφεται - Αυτή η καταχώρηση δεν υπάρχει
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    AREACODE CID δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "
    AREACODE CID ΔΙΑΓΡΑΦΟΝΤΑΙ: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "AREACODE CID ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9017,7 +12131,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΛΙΣΤΕΣ', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9070,19 +12184,22 @@ if ($ADD==2111) } 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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    ΟΜΑΔΑ ΠΡΟΣΤΕΘΗΚΕ: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD Εισερχόμενα GROUP', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9135,9 +12252,15 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    ΟΜΑΔΑ ΠΡΟΣΤΕΘΗΚΕ: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -9182,7 +12305,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9227,7 +12350,7 @@ if ($ADD==2411) } 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) 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 from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9275,31 +12398,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + 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 "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
    Καλέστε Μενού ID πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες και δεν περιέχουν ' '.\n"; + echo "
    Καλέστε ID μενού δεν μπορούν να χρησιμοποιήσουν δεσμευμένες λέξεις: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    Καλέστε Μενού ID πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες και δεν περιέχουν ' '.\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_query($stmt, $link); - echo "
    ΠΡΟΣΚΛΗΣΗ MENU ADDED: $menu_id $menu_name\n"; + echo "
    ΠΡΟΣΚΛΗΣΗ MENU ADDED: $menu_id $menu_name\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9328,34 +12465,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + 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 "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
    Καλέστε Μενού ID πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες και δεν περιέχουν ' '.\n"; + echo "
    Καλέστε ID μενού δεν μπορούν να χρησιμοποιήσουν δεσμευμένες λέξεις: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
    ΠΡΟΣΚΛΗΣΗ MENU δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    Καλέστε Μενού ID πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες και δεν περιέχουν ' '.\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
    ΠΡΟΣΚΛΗΣΗ MENU ADDED: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΤΗΛΕΦΩΝΟ ΦΙΛΤΡΟ ΟΜΑΔΑ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - υπάρχει ήδη ένα τηλέφωνο ΦΙΛΤΡΟ GROUP στο σύστημα με αυτό το αναγνωριστικό\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
    PHONE FILTER Η ΟΜΑΔΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    Τηλέφωνο ID Ομάδας φίλτρου πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες και δεν περιέχουν ' '.\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_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
    ΠΡΟΣΚΛΗΣΗ MENU ADDED: $menu_id - $menu_name\n"; + echo "
    ΤΗΛΕΦΩΝΟ ΦΙΛΤΡΟ ΟΜΑΔΑ ΠΡΟΣΤΙΘΕΜΕΝΗΣ: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + $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 ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9373,30 +12563,94 @@ if ($ADD==21111) {echo "
    ΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΑΝ - υπάρχει ήδη καταχώρηση απομακρυσμένων χειριστών που ξεκινάει με αυτό το ID χρήστη\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ NOT ADDED - πρέπει να χρησιμοποιήσετε ένα έγκυρο χρήστη ως user_start για απομακρυσμένη πράκτορες\n";} + else { - echo "
    ΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    Το ID χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ NOT ADDED - αριθμό των γραμμών επικαλύπτεται με άλλο απομακρυσμένο πράκτορα\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    ΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    Το ID χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΠΡΟΣΤΕΘΗΚΑΝ: $user_start\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΡΟΣΤΙΘΕΜΕΝΗ - υπάρχει ήδη μια είσοδος ομάδας επέκτασης με αυτές τις τιμές\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
    ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΡΟΣΤΙΘΕΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΠΡΟΣΤΕΘΗΚΑΝ: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
    ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΡΟΣΤΙΘΕΜΕΝΗ: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9432,9 +12686,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; + $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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
    ΟΜΑΔΑ ΧΡΗΣΤΗ ΠΡΟΣΤΕΘΗΚΕ: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -9560,7 +12839,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
    Ο ΒΟΗΘΟΣ ΠΡΟΣΤΕΘΗΚΕ: $script_id\n"; @@ -9613,7 +12892,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9653,7 +12932,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9693,7 +12972,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9757,7 +13036,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9822,7 +13101,7 @@ if ($ADD==21111111111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    PHONE NOT ADDED - there is already a ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID in the system with this ID\n";} + {echo "
    PHONE NOT ADDED - there is already a Ταυτότητα φωνητικού ταχυδρομείου 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)) @@ -9834,7 +13113,7 @@ if ($ADD==21111111111) { echo "
    ΤΟ ΤΗΛΕΦΩΝΟ ΠΡΟΣΤΕΘΗΚΕ\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9883,7 +13162,7 @@ if ($ADD==22111111111) { echo "
    PHONE ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9924,7 +13203,7 @@ if ($ADD==23111111111) { echo "
    ΟΜΑΔΑ ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9961,7 +13240,7 @@ if ($ADD==211111111111) { echo "
    Ο ΔΙΑΚΟΜΙΣΤΗΣ ΠΡΟΣΤΕΘΗΚΕ\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10058,7 +13337,7 @@ if ($ADD==231111111111) { echo "
    ΠΙΣΤ TEMPLATE ΠΡΟΣΤΙΘΕΜΕΝΗ\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10094,7 +13373,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10113,6 +13392,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΘΑΛΑΜΙΣΚΟ δεν προστίθενται - υπάρχει ήδη ένα μεταφορέα στο σύστημα με αυτό το ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
    ΘΑΛΑΜΙΣΚΟ δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
    ΑΝΤΙΓΡΑΜΜΕΝΟΣ ΜΕΤΑΦΟΡΕΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ\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_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10133,7 +13451,7 @@ if ($ADD==251111111111) { echo "
    TTS ΕΙΣΟΔΟΥ ADDED\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10169,7 +13487,7 @@ if ($ADD==261111111111) { echo "
    Music on Hold ΕΙΣΟΔΟΥ ADDED\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10212,7 +13530,7 @@ if ($ADD==271111111111) { echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX ADDED\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -10237,6 +13555,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - υπάρχει ήδη μια ετικέτα στο σύστημα με αυτό το αναγνωριστικό\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΠΡΟΣΤΙΘΕΜΕΝΗΣ\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Μην έρχεται σε επαφή ΠΡΟΣΘΗΚΗ - υπάρχει ήδη μια επαφή με το σύστημα με αυτό το όνομα και τον αριθμό\n";} + else + { + if (strlen($last_name) < 2) + {echo "
    Μην έρχεται σε επαφή ΠΡΟΣΘΗΚΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
    ΕΠΙΚΟΙΝΩΝΙΑ ΠΡΟΣΘΗΚΗ\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -10300,7 +13698,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -10324,7 +13722,7 @@ if ($ADD==221111111111111) { echo "
    ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΠΡΟΣΤΙΘΕΜΕΝΗ: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10465,11 +13863,11 @@ if ($ADD=="4A") } echo "
    ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -10517,6 +13915,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10604,7 +14012,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10698,7 +14106,7 @@ if ($ADD=="4B") } echo "
    ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10750,6 +14158,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10837,7 +14255,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10925,7 +14343,7 @@ if ($ADD==4) { echo "
    ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10977,6 +14395,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11064,7 +14492,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -11145,6 +14573,7 @@ if ($ADD==41) 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'; @@ -11173,6 +14602,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -11187,32 +14618,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
    ΔΡΑΣΤΙΚΗΣ ΚΑΤΑΛΟΓΟΙ ΜΕΤΑΒΑΛΛΟΜΕΝΩΝ"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Δοκιμάστε εξερχόμενη κλήση';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
    "; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE ΛΙΣΤΕΣ', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
    ΔΡΑΣΤΙΚΗΣ ΚΑΤΑΛΟΓΟΙ ΜΕΤΑΒΑΛΛΟΜΕΝΩΝ"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -11224,77 +14744,124 @@ if ($ADD==41) } else { - echo "
    ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'Εισερχόμενα_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
    CAMPAIGN NOT MODIFIED - Παρακαλώ περιμένετε για την ολόκληρη σελίδα για να φορτώσει πριν από την υποβολή της αίτησης\n"; } else { - if ($dial_level_override > 0) + echo "
    ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
    ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; - echo "
    - Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_ανανέωσης='$campaign_stats_ανανέωσης',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
    ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; + echo "
    - Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -11347,7 +14914,7 @@ if ($ADD==42) { echo "
    ΘΕΣΗ ΕΚΣΤΡΑΤΕΙΑΣ ΣΥΝΗΘΕΙΑΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11454,6 +15021,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -11476,7 +15045,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE ΛΙΣΤΕΣ', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11525,7 +15094,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11716,7 +15285,7 @@ if ($ADD=='40A') { echo "
    ΕΡΕΥΝΑ SETTINGS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11802,7 +15371,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -11836,7 +15405,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -11910,7 +15479,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -12003,56 +15572,128 @@ if ($ADD==49) ###################### -# ADD=411 submit list modifications to the system +# ADD=401 modify campaign preset in the system ###################### -if ($ADD==411) +if ($ADD==401) { - if ($LOGmodify_lists==1) + if ($LOGmodify_campaigns==1) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    Η ΛΙΣΤΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    η λίστα πρέπει να είναι τουλαχιστον 2 χαρακτήρες\n"; + echo "
    PRESET ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 { - if (strlen($reset_time) < 4) {$reset_time='';} + echo "
    PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; - echo "
    ΛΙΣΤΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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' where list_id='$list_id';"; + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΛΙΣΤΕΣ', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } - if ($reset_list == 'Y') + +###################### +# 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) { - echo "
    ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΛΙΣΤΑΣ\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΛΙΣΤΕΣ', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
    ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
    Η ΛΙΣΤΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    η λίστα πρέπει να είναι τουλαχιστον 2 χαρακτήρες\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
    ΛΙΣΤΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
    ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΛΙΣΤΑΣ\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
    ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -12071,84 +15712,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
    Η ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    το όνομα και χρώμα ομάδας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
    ΧΡΗΣΤΕΣ NOT MODIFIED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', 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_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
    ΟΜΑΔΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; } } else { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
    Η ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    το όνομα και χρώμα ομάδας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + } + else + { + if ($form_end != 'END') + { + echo "
    GROUP NOT MODIFIED - Παρακαλώ περιμένετε για την ολόκληρη σελίδα για να φορτώσει πριν από την υποβολή της αίτησης\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
    ΟΜΑΔΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -12173,7 +15914,7 @@ if ($ADD==4311) { echo "
    DID ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12213,12 +15954,12 @@ if ($ADD==4511) { echo "
    ΠΡΟΣΚΛΗΣΗ 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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -12235,27 +15976,35 @@ if ($ADD==4511) 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["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"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -12296,7 +16045,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -12338,32 +16087,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
    Το ID του χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
    FILTER PHONE Η ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    Όνομα φίλτρου ομάδας Τηλέφωνο and ID 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' where remote_agent_id='$remote_agent_id';"; + $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_query($stmt, $link); - echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ\n"; + echo "
    ΦΙΛΤΡΟ ΟΜΙΛΟΣ ΤΡΟΠΟΠΟΙΗΜΕΝΑ ΤΗΛΕΦΩΝΟ\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12373,10 +16122,108 @@ if ($ADD==41111) echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ NOT MODIFIED - πρέπει να χρησιμοποιήσετε ένα έγκυρο χρήστη ως user_start για απομακρυσμένη πράκτορες\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ NOT MODIFIED - αριθμό των γραμμών επικαλύπτεται με άλλο απομακρυσμένο πράκτορα\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
    Το ID του χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
    ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + echo "
    ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12394,117 +16241,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Δεν επιτρέπεται να επεξεργαστούν τα δικά σας ομάδα χρηστών\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - - $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' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - echo "
    ΟΜΑΔΑ ΧΡΗΣΤΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY ΟΜΑΔΑ ΧΡΗΣΤΩΝ', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "
    ΟΜΑΔΑ ΧΡΗΣΤΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY ΟΜΑΔΑ ΧΡΗΣΤΩΝ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -12536,7 +16418,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
    Ο ΒΟΗΘΟΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; @@ -12578,7 +16460,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
    ΤΟ ΦΙΛΤΡΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; @@ -12634,7 +16516,7 @@ if ($ADD==411111111) $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' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ\n"; @@ -12690,7 +16572,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; @@ -12719,7 +16601,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -12741,7 +16623,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
    SHIFT ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ\n"; @@ -12770,14 +16652,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
    ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη ένα τηλέφωνο με αυτή την εσωτ.σύνδεση/διακομιστή\n";} else { @@ -12787,7 +16669,7 @@ if ($ADD==41111111111) { echo "
    ΤΟ ΤΗΛΕΦΩΝΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_ανανέωσης='$enable_fast_ανανέωσης', fast_ανανέωσης_rate='$fast_ανανέωσης_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12818,7 +16700,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12831,7 +16713,7 @@ if ($ADD==42111111111) { echo "
    PHONE ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12858,7 +16740,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12871,7 +16753,7 @@ if ($ADD==43111111111) { echo "
    ΟΜΑΔΑ ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12905,14 +16787,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
    ΔΙΑΚΟΜΙΣΤΗΣ NOT MODIFIED - there is already a server in the system with this server_id\n";} else { $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
    Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη ένας διακομιστής με αυτό το IP\n";} else { @@ -12920,7 +16802,7 @@ if ($ADD==411111111111) {echo "
    Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13023,7 +16905,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
    CONF TEMPLATE MODIFIED: $template_id\n"; @@ -13052,7 +16934,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -13060,7 +16942,7 @@ if ($ADD==441111111111) {echo "
    ΔΕΝ ΘΑΛΑΜΙΣΚΟ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -13092,7 +16974,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -13100,7 +16982,7 @@ if ($ADD==451111111111) {echo "
    TTS ΕΙΣΟΔΟΥ μη τροποποιημένες - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
    TTS ΕΙΣΟΔΟΥ MODIFIED: $tts_id\n"; @@ -13129,7 +17011,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -13162,7 +17044,7 @@ if ($ADD==461111111111) {echo "
    Music on Hold ΕΙΣΟΔΟΥ μη τροποποιημένες - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -13230,7 +17112,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -13238,7 +17120,7 @@ if ($ADD==471111111111) {echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX μη τροποποιημένες - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -13269,6 +17151,87 @@ if ($ADD==471111111111) } +###################### +# 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 "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
    ΕΠΙΚΟΙΝΩΝΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $linkALT); + + echo "
    CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN ΤΡΟΠΟΠΟΙΗΣΗ ΕΠΙΚΟΙΝΩΝΙΑ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -13282,7 +17245,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη μία συνδιάλεξη με αυτή την εσωτ.σύνδεση-διακομιστή\n";} else { @@ -13292,7 +17255,7 @@ if ($ADD==4111111111111) { echo "
    Η ΣΥΝΔΙΑΛΕΞΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13319,7 +17282,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    VICIDIAL Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη μία συνδιάλεξη με αυτή την εσωτ.σύνδεση-διακομιστή\n";} else { @@ -13329,7 +17292,7 @@ if ($ADD==41111111111111) { echo "
    VICIDIAL Η ΣΥΝΔΙΑΛΕΞΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13356,11 +17319,37 @@ if ($ADD==411111111111111) echo "
    VICIDIAL ΤΟΠΟΘΕΤΗΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΕΣ\n"; - $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';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_ανανέωσης='$admin_modify_ανανέωσης',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -13382,7 +17371,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13425,7 +17414,7 @@ if ($ADD==421111111111111) { echo "
    ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13453,7 +17442,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13676,7 +17665,7 @@ if ($ADD==53) else { echo "
    ΕΠΙΒΕΒΑΙΩΣΗ ΚΑΘΑΡΙΣΜΟΥ VDAC: $campaign_id\n"; - echo "

    Επιλέξτε εδώ για να διαγράψετε την παλαιότερη ΖΩΝΤΑΝΗ εγγραφή στο VDAC για $campaign_id


    \n"; + echo "

    Επιλέξτε εδώ για να διαγράψετε την παλαιότερη ΖΩΝΤΑΝΗ εγγραφή στο VDAC για $campaign_id


    \n"; } # go to campaign modification below @@ -13774,6 +17763,28 @@ if ($ADD==5511) $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 "
    ΦΙΛΤΡΟ ΟΜΑΔΑ τηλέφωνο δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
    ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ: $filter_phone_group_id\n"; + echo "

    Κάντε κλικ εδώ για να διαγράψετε ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ $filter_phone_group_id


    \n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13796,6 +17807,28 @@ if ($ADD==51111) $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 "
    ΛΗΜΜΑ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    extension_id be at least 1 characters in length\n"; + } + else + { + echo "
    ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΕΙΣΟΔΩΝ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ: $extension_id\n"; + echo "

    Χτυπήστε εδώ για να διαγράψετε το λήμμα ομάδας επέκτασης $extension_id


    \n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14117,7 +18150,7 @@ if ($ADD==571111111111) if (strlen($voicemail_id) < 2) { echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID be at least 2 characters in length\n"; + echo "
    Ταυτότητα φωνητικού ταχυδρομείου be at least 2 characters in length\n"; } else { @@ -14128,6 +18161,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    Label ID be at least 2 characters in length\n"; + } + else + { + echo "
    Οθόνη επιβεβαίωσης ΔΙΑΓΡΑΦΗ ΕΤΙΚΕΤΑ: $label_id - $label_name\n"; + echo "

    Κάντε κλικ εδώ για να διαγράψετε ετικέτα οθόνη $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 "
    ΕΠΙΚΟΙΝΩΝΙΑ δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
    Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
    ΕΠΙΚΟΙΝΩΝΙΑ ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗ: $contact_id - $first_name - $last_name\n"; + echo "

    Κάντε κλικ εδώ για να διαγράψετεcontact $contact_id - $first_name - $last_name


    \n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -14197,27 +18274,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Δεν επιτρέπεται να επεξεργαστείτε το δικό σας χρήστη\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    ΔΙΑΓΡΑΦΗ ΧΡΗΣΤΗ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user\n"; - echo "

    \n"; + echo "
    ΔΙΑΓΡΑΦΗ ΧΡΗΣΤΗ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user\n"; + echo "

    \n"; + } } - $ADD='0'; # go to user list } @@ -14236,44 +18320,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + echo "
    ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14311,7 +18404,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -14322,6 +18415,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -14361,7 +18455,7 @@ if ($ADD==62) if ($DB) {echo "\n
    VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -14411,7 +18505,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -14422,55 +18516,139 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; - if ($DB) {echo "
    $stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
    $stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
    $stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
    $stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -14518,7 +18696,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14567,7 +18745,7 @@ if ($ADD==65) { echo "
    ΔΙΑΓΡΑΦΗΚΕ Ο ΟΔΗΓΟΣ ΑΝΑΚΥΚΛΩΣΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14598,7 +18776,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14614,12 +18792,12 @@ if ($ADD==66) { echo "
    ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14661,7 +18839,7 @@ if ($ADD==67) { 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';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14692,7 +18870,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14708,12 +18886,12 @@ if ($ADD==68) { echo "
    ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14735,6 +18913,51 @@ if ($ADD==68) $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 "
    PRESET ΕΚΣΤΡΑΤΕΙΑ δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14750,11 +18973,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
    ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    ΑΦΑΙΡΕΣΗ ΤΩΝ ΜΟΛΥΒΔΩΝ ΚΑΤΑΛΟΓΩΝ ΑΠΟ ΤΟΝ ΠΊΝΑΚΑ VICIDIAL_LIST\n"; @@ -14765,7 +18988,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΛΙΣΤΕΣ', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -14791,7 +19014,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -14803,6 +19026,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -14834,7 +19060,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14867,7 +19093,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -14888,6 +19114,42 @@ if ($ADD==6511) $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 "
    ΦΙΛΤΡΟ ΟΜΑΔΑ τηλέφωνο δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    ΦΙΛΤΡΟ ΔΙΑΓΡΑΦΗ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ ΟΛΟΚΛΗΡΩΘΗΚΕ: $filter_phone_group_id\n"; + echo "

    \n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14921,6 +19183,41 @@ if ($ADD==61111) $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 "
    ΛΗΜΜΑ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    ΔΙΑΓΡΑΦΗ ΕΙΣΟΔΩΝ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΟΥ ΟΛΟΚΛΗΡΩΝΕΤΑΙ: $extension_id\n"; + echo "

    \n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -14936,21 +19233,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Δεν επιτρέπεται να επεξεργαστούν τα δικά σας ομάδα χρηστών\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE ΟΜΑΔΑ ΧΡΗΣΤΩΝ', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE ΟΜΑΔΑ ΧΡΗΣΤΩΝ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    ΔΙΑΓΡΑΦΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user_group\n"; - echo "

    \n"; + echo "
    ΔΙΑΓΡΑΦΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user_group\n"; + echo "

    \n"; + } } - $ADD='100000'; # go to user group list } @@ -14969,7 +19273,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15003,7 +19307,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15037,7 +19341,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15071,7 +19375,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -15129,7 +19433,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15164,7 +19468,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -15200,7 +19504,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15233,7 +19537,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15267,7 +19571,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15350,7 +19654,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15388,7 +19692,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -15424,7 +19728,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15460,7 +19764,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -15489,11 +19793,11 @@ if ($ADD==671111111111) if ( (strlen($voicemail_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ BOX δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID be at least 2 characters in length\n"; + echo "
    Ταυτότητα φωνητικού ταχυδρομείου be at least 2 characters in length\n"; } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15519,6 +19823,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
    ΕΤΙΚΕΤΑ ΟΘΟΝΗ δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    ΟΘΟΝΗ ΔΙΑΓΡΑΦΗ ΕΤΙΚΕΤΑ ΟΛΟΚΛΗΡΩΘΗΚΕ: $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 "
    ΕΠΙΚΟΙΝΩΝΙΑ δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Διαγραφή επαφής', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

    \n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -15607,10 +19984,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_ανανέωσης=1; + } + echo ""; + $SYSTEMRELEASE_graph.=" "; + $AGENTRELEASE_graph.=" "; + $SALES_graph.=" "; + $DNCS_graph.=" "; + $NAS_graph.=" "; + $DROPS_graph.=" "; + $LOGINTIME_graph.=" "; + $PAUSETIME_graph.=" "; + } + $CALLS_graph.="
    \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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15687,8 +20070,30 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
    Δεν έχετε τις άδειες να τροποποιήσετε αυτόν τον χρήστη: $user\n"; } @@ -15704,14 +20109,25 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 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"; @@ -15760,6 +20177,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15779,18 +20197,22 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -15812,6 +20234,12 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; #9BB9FB @@ -15834,6 +20262,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15859,6 +20292,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -15866,8 +20312,17 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } - echo "\n"; + echo "\n"; echo "
    Αριθμός Χρήστη: $user$NWB#vicidial_users-user$NWE
    Κωδικός:$NWB#vicidial_users-pass$NWE
    Κωδικός:$NWB#vicidial_users-pass$NWE     Δύναμη:
    Δύναμη Αλλαγή κωδικού πρόσβασης: $NWB#vicidial_users-force_change_password$NWE
    Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
    Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE
    Ομάδα Χρήστη:
    Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
    Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
    Ενεργή:$NWB#vicidial_users-active$NWE
    Ταυτότητα φωνητικού ταχυδρομείου: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
    Email:$NWB#vicidial_users-optional$NWE
    Χρήστης Code: $NWB#vicidial_users-optional$NWE
    Main Επικράτεια: $NWB#vicidial_users-optional$NWE
    ΕΠΙΛΟΓΕΣ ΕΠΙΦΑΝΕΙΑΣ ΕΡΓΑΣΙΑΣ ΧΕΙΡΙΣΤΩΝ:
    Ο χειριστής επιλέγει Εισ.Ομάδες: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Ο πράκτορας επιλέγει συνδυασμένος: $NWB#vicidial_users-agent_choose_blended$NWE
    Agent Επιλέξτε Εδάφη: $NWB#vicidial_users-agent_choose_territories$NWE
    Agent Alter Πελατών Παράκαμψη Τηλέφωνο:$NWB#vicidial_users-alter_custphone_override$NWE
    Agent Shift Επιβολή Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Συμπληρωματική προμήθεια άποψης κούτσουρων κλήσης πρακτόρων: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Πράκτορας Παράκαμψη Αναζήτηση μόλυβδο: $NWB#vicidial_users-agent_lead_search_override$NWE
    Alert Enabled: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    Επιτρέψτε Alerts: $NWB#vicidial_users-allow_alerts$NWE
    Προκαθορισμένη Αναζήτηση Επικοινωνία: $NWB#vicidial_users-preset_contact_search$NWE
    Τάξεις εκστρατείας:$NWB#vicidial_users-campaign_ranks$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKcampaigns_list"; echo "
    \n"; echo "
    Εισερχόμενες Ομάδες: $NWB#vicidial_users-closer_campaigns$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKgroups_list"; echo "
    \n"; echo "
    Τις επιλογές διαχείρισης ΕΚΘΕΣΗ:
    Σε πραγματικό χρόνο πληροφορίες χρηστών φραγμών: $NWB#vicidial_users-realtime_block_user_info$NWE
    Διαχειριστής Απόκρυψη μολύβδου Δεδομένων: $NWB#vicidial_users-admin_hide_lead_data$NWE
    Διαχειριστής Απόκρυψη Στοιχεία Τηλεφώνου: $NWB#vicidial_users-admin_hide_phone_data$NWE
    ΕΠΙΛΟΓΈΣ ΕΠΙΦΑΝΕΙΑΣ ΕΡΓΑΣΙΑΣ ΔΙΑΧ:
    Εξαγωγή Εκθέσεις: $NWB#vicidial_users-export_reports$NWE
    Διαγραφή DNC Από Λίστες: $NWB#vicidial_users-delete_from_dnc$NWE
    Οι τομείς συνήθειας τροποποιούν: $NWB#vicidial_users-custom_fields_modify$NWE
    Τροποποιήστε τις εκστρατείες: $NWB#vicidial_users-modify_sections$NWE
    Λεπτομέρειες εκστρατείας: $NWB#vicidial_users-campaign_detail$NWE
    Διάγραψε τις εκστρατείες: $NWB#vicidial_users-delete_campaigns$NWE
    Τροποποίηση Χρόνου Κλήσηςs: $NWB#vicidial_users-modify_call_times$NWE
    Διαγραφή Χρόνου Κλήσηςs: $NWB#vicidial_users-delete_call_times$NWE
    Τροποποιήστε τους κεντρικούς υπολογιστές: $NWB#vicidial_users-modify_sections$NWE
    Τροποποιήστε Βάρδιες: $NWB#vicidial_users-modify_sections$NWE
    ModifyΤηλέφωνα: $NWB#vicidial_users-modify_sections$NWE
    ModifyCarriers: $NWB#vicidial_users-modify_sections$NWE
    ModifyLabels: $NWB#vicidial_users-modify_sections$NWE
    ModifyΚαθεστώτων: $NWB#vicidial_users-modify_sections$NWE
    ModifyΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_users-modify_sections$NWE
    ModifyAudio Store: $NWB#vicidial_users-modify_sections$NWE
    ModifyMusic On Hold: $NWB#vicidial_users-modify_sections$NWE
    ModifyTTS: $NWB#vicidial_users-modify_sections$NWE
    ModifyContacts: $NWB#vicidial_users-modify_sections$NWE
    Πρόσβαση CallCard: $NWB#vicidial_users-modify_sections$NWE
    Agent API Πρόσβαση:$NWB#vicidial_users-vdc_agent_api_access$NWE
    ΠροσθήκηΏρα ρολόι Εγγραφή Εγγραφή: $NWB#vicidial_users-add_timeclock_log$NWE
    ΔιαγραφήΏρα ρολόι Εγγραφή Εγγραφή: $NWB#vicidial_users-delete_timeclock_log$NWE
    Manager Shift Επιβολή Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    Τροποποίηση ίδιο επίπεδο χρήστη: $NWB#vicidial_users-modify_same_user_level$NWE
    \n"; if ($LOGdelete_users > 0) @@ -15881,7 +20336,7 @@ if ($ADD==3) echo "

    Επιλέξτε εδώ για τις Επανακλήσεις του χρήστη που κρατήθηκαν\n"; if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το αρχείο
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το αρχείο\n"; } } } @@ -15906,6 +20361,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_ανανέωσης=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -15916,6 +20376,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -15923,16 +20393,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -15982,7 +20455,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_ανανέωσης = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -16064,13 +20537,82 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Ρυθμίσεις";} + else + {$ALTmultiDISABLE=0; $ALTmultiLINK='';} + + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -16081,7 +20623,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -16109,7 +20651,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -16153,7 +20695,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -16184,7 +20726,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -16208,9 +20750,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -16233,6 +20777,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -16252,9 +20821,13 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -16267,6 +20840,14 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16275,7 +20856,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
    $row[0]: Βασική   Βασική Λεπτομέρειες ΚαθεστώτωνHotKeysΈρευναΠαύση Κώδικες Προεπιλογές AC-CIDQC Real-Time Real-Time
    \n"; echo "
    \n"; @@ -16288,19 +20869,31 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; @@ -16329,140 +20922,201 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; +: \n"; echo "\n"; + echo "\n"; + echo "\n"; +: \n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + 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"; @@ -16678,24 +21342,32 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + 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"; if ($SSoutbound_autodial_active > 0) { @@ -16740,26 +21424,46 @@ if ($ADD==31) } 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"; @@ -16770,7 +21474,15 @@ if ($ADD==31) echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -16789,6 +21501,11 @@ if ($ADD==31) } 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"; @@ -16802,9 +21519,21 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -16812,16 +21541,22 @@ if ($ADD==31) { echo "\n"; } - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -16870,13 +21605,46 @@ if ($ADD==31) 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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { @@ -16898,6 +21666,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
    ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID Εκστρατείας: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
    Περιγραφή εκστρατείας: $NWB#vicidial_campaigns-campaign_description$NWE
    Εκστρατεία Αλλαγή Ημερομηνία: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Εκστρατεία Σύνδεση Ημερομηνία: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Εκστρατεία Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Ενεργή:$NWB#vicidial_campaigns-active$NWE
    Τηλ.σύνδ. Στάθμευσης: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
    Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
    \n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
    Ενεργή:$NWB#vicidial_campaigns-active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_campaigns-user_group$NWE
    Πάρκο Μουσική-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
    Ιστο-σελίδα Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Ιστο-σελίδα Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Web Μορφή Target: $NWB#vicidial_campaigns-web_form_target$NWE
    Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Add A Dial Κατάσταση:
    Προσθέστε μια κατάσταση Dial για κλήσεων:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
    Κατάλογος Mix:
    Σειρά Λίστας: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Παραγγελία Λίστα Τυχαία: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
    Παραγγελία Λίστα Δευτεροβάθμια: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
    Κατάλογος Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Φίλτρο Οδηγού: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Drop Lockout Ώρα: $NWB#vicidial_campaigns-drop_lockout_time$NWE
    Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Αριθμός Κλήσεων Όριο: $NWB#vicidial_campaigns-call_count_limit$NWE
    Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Αριθμός Κλήσεων στόχος: $NWB#vicidial_campaigns-call_count_target$NWE
    Ελάχιστο Επίπεδο Χόπερ: $NWB#vicidial_campaigns-hopper_level$NWE
    Αυτόματη Επίπεδο Χόπερ: $NWB#vicidial_campaigns-use_auto_hopper$NWE
    Αυτόματη Πολλαπλασιαστής Χόπερ: $NWB#vicidial_campaigns-hopper_level$NWE
    Αυτόματη Περικοπή Χόπερ: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
    Χόπερ VLC Dup Έλεγχος: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
    Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Μέθοδος Κλήσης -: $NWB#vicidial_campaigns-dial_method$NWE
    $NWB#vicidial_campaigns-dial_method$NWE
    ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ΠΡΟΣΑΡΜΟΣΤΕ ΤΗ ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ
    Αυτόματη Κατώφλι Επίπεδο Dial: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
    Διαθέσιμα μόνο ετικέτες -: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Διαθέσιμο μόνο Κατώφλι Tally: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
    Ποσοστό Ορίου Εγκατ.Κλήσεων : $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
    Ταυτόχρονες μεταφορές: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Πληκτρολογήστε Επίπεδο Μέθοδος στόχος Διαφορά: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
    Ταυτόχρονες μεταφορές: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Κοτσίδας Προτεραιότητα:$NWB#vicidial_campaigns-drop_rate_group$NWE
    Εισερχόμενη σειρά αναμονής κανένας πίνακας: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    Αυτόματος σχηματισμός ALT-ARJCMOY: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    Αυτόματος σχηματισμός ALT-ARJCMOY: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
    Χρόνος Τοπικής Κλήσης:
    Πρόθεμα Κλήσης: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Εγχειρίδιο Πρόθεμα κλήσης: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Παράλειψη Κωδικού Τηλεφώνου : $NWB#vicidial_campaigns-omit_phone_code$NWE
    CallerID Εκστρατείας: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Συνήθεια CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Εκστρατείας VDAD εσωτ.σύνδεση: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Παράταση δρομολόγησης: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Επέκταση εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
    Καθυστέρηση Ηχογράφησης : in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
    Καλέστε Σημειώσεις ανά κλήση: $NWB#vicidial_campaigns-per_call_notes$NWE
    Πράκτορας Αναζήτηση μόλυβδο: $NWB#vicidial_campaigns-agent_lead_search$NWE
    Πράκτορας Μέθοδος Αναζήτηση μόλυβδο: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
    Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
    Μήνυμα Αυτόματου Τηλεφωνητή: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
    Μήνυμα Αυτόματου Τηλεφωνητή: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -16724,15 +21396,27 @@ if ($ADD==31) echo "
    Αριθμός Μεταφοράς-Συνδ 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Γρήγορη Μεταφορά Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Ενεργοποίηση Προεπιλογές Μεταφορά: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Απόκρυψη Μεταφορά Αριθμός για κλήση: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Γρήγορη Μεταφορά Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Προσαρμοσμένη 3-Way Μεταφορά Κουμπί: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
    Μεταφορά PrePopulate Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Timer Δράση: $NWB#vicidial_campaigns-timer_action$NWE
    Πάρκο κλήσεων IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Timer Δράση Μήνυμα: $NWB#vicidial_campaigns-timer_action_message$NWE
    Πάρκο κλήσεων IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Timer Δευτερόλεπτα Δράση: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer Δράση: $NWB#vicidial_campaigns-timer_action$NWE
    Timer Δράση Μήνυμα: $NWB#vicidial_campaigns-timer_action_message$NWE
    Timer Δευτερόλεπτα Δράση: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Χρονοδιακόπτης Προορισμός δράσης: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Προγραμματισμένες Επανακλήσεις: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Σχέδισσα επιφυλακή επανακλήσεων: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Σχέδισσα αρίθμηση επανακλήσεων: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Προγραμματισμένη Όριο επιστροφές κλήσεις Ημέρες: $NWB#vicidial_campaigns-callback_days_limit$NWE
    Προγραμματισμένη Μπλοκ επιστροφές κλήσεις Ώρες: $NWB#vicidial_campaigns-callback_hours_block$NWE
    Προγραμματισμένη επιστροφές κλήσεις Calltime Μπλοκ: $NWB#vicidial_campaigns-callback_list_calltime$NWE
    Προεπιλογή επιστροφές κλήσεις μου Checkbox: $NWB#vicidial_campaigns-my_callback_option$NWE
    Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Drop δράσης:$NWB#vicidial_campaigns-drop_action$NWE
    Drop δράσης:$NWB#vicidial_campaigns-drop_action$NWE
    Εσωτ.Σύνδεση Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Ασφαλής ήχου Harbor: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
    Ασφαλής Μενού κλήσεων Harbor: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Drop Μεταφορά Ομάδα:$NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Απενεργοποίηση οθόνης DISPO: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
    Απενεργοποίηση DISPO Κατάσταση: $NWB#vicidial_campaigns-disable_dispo_status$NWE
    Δευτερ Τυλίγματος: $NWB#vicidial_campaigns-wrapup_seconds$NWE
    Μήνυμα Τυλίγματος: $NWB#vicidial_campaigns-wrapup_message$NWE
    AgentΚώδικες μικρής διακοπήςΕνεργή:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
    Εκστρατεία Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Αυτόματη Παύση Προ-Call: $NWB#vicidial_campaigns-auto_pause_precall$NWE
    Αυτόματη Συνέχιση Προ-Call: $NWB#vicidial_campaigns-auto_resume_precall$NWE
    Αυτόματη Παύση Προ-Call Κώδικα: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
    Εκστρατεία Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_ανανέωσης$NWE
    Real-Time Χρονικά Στατιστικά γραφείο: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Θέστε εκτός λειτουργίας αλλάζει τα στοιχεία πελατών: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Απενεργοποίηση Alter Πελατών Τηλέφωνο:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agent Εμφάνιση Dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
    Ετικέτες οθόνης γραφείο: $NWB#vicidial_campaigns-screen_labels$NWE
    Εμφάνιση Πεδία Κατάσταση: $NWB#vicidial_campaigns-status_display_fields$NWE
    Εμφάνιση Agent Queue Count:$NWB#vicidial_campaigns-display_queue_count$NWE
    Agent Παύση Μετά από κάθε πρόσκληση: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Χειρωνακτική συμπληρωματική προμήθεια πινάκων: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Χειρωνακτικός κατάλογος ταυτότητα πινάκων:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Εγχειρίδιο Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Εγχειρίδιο Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Εγχειρίδιο Ταχείας Προεπισκόπηση: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Εγχειρίδιο Χρόνος κλήσεων Έλεγχος: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
    Εγχειρίδιο κλήσης API: $NWB#vicidial_campaigns-api_manual_dial$NWE
    Εγχειρίδιο Ταχείας CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
    Τηλέφωνο Ώρα δημοσίευσης προειδοποίησης Διαφορά: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
    Agent Screen Clipboard Αντιγραφή: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    Agent Screen Εκτεταμένη Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
    3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way Call Πρόθεμα Κλήσης: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Πελάτης 3-Way καταγραφή Hangup: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Πελάτης 3-Way Δευτερόλεπτα Hangup: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Πελάτης 3-Way δράσης Hangup: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Ομάδα Γνωστός Επιτρέπεται: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    Συμπληρωματική προμήθεια QM CallΚατάσταση:$NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    ΜΠ Περιβάλλοντος Τηλέφωνο: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
    Ομαδοποίηση PLLB: $NWB#vicidial_campaigns-pllb_grouping$NWE
    Όριο PLLB Ομαδοποίηση: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
    CRM Popup Σύνδεση: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Popup Διεύθυνση: $NWB#vicidial_campaigns-crm_login_address$NWE
    CRM Popup Διεύθυνση: $NWB#vicidial_campaigns-crm_login_address$NWE
    Ξεκινήστε Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Ξεκινήστε Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Καλέστε dispo URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Καλέστε dispo URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Δεν URL Καλέστε τον πράκτορα: $NWB#vicidial_campaigns-na_call_url$NWE
    Η επέκταση επισυνάπτει CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Τυφλή προειδοποίηση οργάνων ελέγχου: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Τυφλή ειδοποίηση οργάνων ελέγχου: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Τυφλό όνομα αρχείου οργάνων ελέγχου: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    \n"; @@ -16917,6 +21687,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -16924,6 +21695,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -16932,14 +21705,14 @@ if ($ADD==31) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -16984,8 +21757,6 @@ if ($ADD==31) echo "\n"; echo "
    ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟ

    \n"; - echo "
    \n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -16994,13 +21765,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

    \n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
    Αυτή η εκστρατεία έχει$active_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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
    ΚΑΤΑΣΤΑΣΕΙΣ στο ενεργό ΛΙΣΤΕΣ για τη συγκεκριμένη καμπάνια:\n"; + echo " - ΑΠΟΚΡΥΨΗ
    "; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑDIALABLEPENETRATION
    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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 "
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    $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]."
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]    
    ΣΥΝΟΛΙΚΑ$lead_list[count]$dialable_total $total_complete_pct%  
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "ΔΕΙΞΤΕ ΚΑΤΑΣΤΑΣΕΙΣ ΜΟΛΥΒΔΟΥ σε αυτήν την εκστρατεία

    "; + } + + + + echo "
    \n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - ΑΠΟΚΡΥΨΗ

    "; } else @@ -17009,7 +21962,7 @@ if ($ADD==31) echo " - ΕΜΦΑΝΙΣΗ

    "; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -17020,9 +21973,36 @@ if ($ADD==31) echo "Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια

    \n"; } echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

    \n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Δοκιμάστε εξερχόμενη κλήση: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


    \n"; + } + else + { + echo "Δοκιμή καλώντας άτομα με ειδικές ανάγκες

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

    Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την εκστρατεία
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την εκστρατεία\n"; } echo "
    \n"; } @@ -17033,7 +22013,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -17050,17 +22030,45 @@ if ($ADD==31) echo "
    \n"; echo "
    ΠΡΟΣΑΡΜΟΣΜΕΝΕΣ ΚΑΤΑΣΤΑΣΕΙΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_statuses$NWE
    \n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + echo "
    ΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗΕΠΙΛΕΞΙΜΟΑΝΘΡΩΠΙΝΗ ΑΠΑΝΤΗΣΗΚΑΤΗΓΟΡΙΑMODIFY-DELETE
    \n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -17075,42 +22083,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
    S
    T
    A
    T
    U
    S
    ΠΕΡΙΓΡΑΦΗΚΑΤΗΓΟΡΙΑ
    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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "ΔΙΑΓΡΑΦΗ\n"; - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[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 "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Κατηγορία:\n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17176,7 +22194,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -17189,7 +22207,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -17315,7 +22333,7 @@ if ($ADD==31) echo "
    ΚΛΕΙΔΙΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗΔΙΑΓΡΑΦΗ
    \n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -17355,7 +22373,7 @@ if ($ADD==31) ##### 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -17380,7 +22398,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -17393,7 +22411,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -17447,17 +22465,17 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -17466,17 +22484,155 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    ΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣΧΡΕΩΤΕΟΣΤΡΟΠΟΠΟΙΗΣΗΔΙΑΓΡΑΦΗ
    Έρευνα δεν ενδιαφέρεται Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
    Έρευνα Opt-σε αρχείο ήχου: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
    Έρευνα δεν ενδιαφέρεται αρχείο ήχου: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
    Έρευνα Μέθοδος: $NWB#vicidial_campaigns-survey_method$NWE
    Έρευνα Μέθοδος: $NWB#vicidial_campaigns-survey_method$NWE
    Έρευνα της μη αντίδρασης δράσης: $NWB#vicidial_campaigns-survey_no_response_action$NWE
    Έρευνα δεν ενδιαφέρεται Κατάσταση: $NWB#vicidial_campaigns-survey_ni_status$NWE
    Έρευνα τρίτο ψηφίο: $NWB#vicidial_campaigns-survey_third_digit$NWE
    Έρευνα Τρίτη Audio File: audio chooser $NWB#vicidial_campaigns-survey_third_audio_file$NWE
    Έρευνα Τρίτη αρχείου ήχου: audio chooser $NWB#vicidial_campaigns-survey_third_audio_file$NWE
    Έρευνα Τρίτη Κατάσταση: $NWB#vicidial_campaigns-survey_third_status$NWE
    Έρευνα Τρίτη Παράταση: $NWB#vicidial_campaigns-survey_third_exten$NWE
    Έρευνα τέταρτο ψηφίο: $NWB#vicidial_campaigns-survey_fourth_digit$NWE
    Έρευνα Τέταρτη Audio File: audio chooser $NWB#vicidial_campaigns-survey_fourth_audio_file$NWE
    Έρευνα Τέταρτη αρχείου ήχου: audio chooser $NWB#vicidial_campaigns-survey_fourth_audio_file$NWE
    Έρευνα Τέταρτη Κατάσταση: $NWB#vicidial_campaigns-survey_fourth_status$NWE
    Έρευνα Τέταρτη Παράταση: $NWB#vicidial_campaigns-survey_fourth_exten$NWE
    Έρευνα Καμπάνια Καταγραφή Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
    Έρευνα Μενού κλήσεων: $NWB#vicidial_campaigns-survey_menu_id$NWE
    Εγγραφή Έρευνα: $NWB#vicidial_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_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + + echo "

    $presets_to_print PRESETS για τη συγκεκριμένη καμπάνια:   $NWB#vicidial_xfer_presets$NWE
    \n"; + + echo "
    Προσθήκη νέου PRESET -
    \n"; + echo "\n"; + echo "\n"; + echo "Προκαθορισμένο όνομα: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Απόκρυψη αριθμού:  \n"; + echo "
    \n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # PRESET NAMEΑΡΙΘΜΟΣDTMFΑΠΟΚΡΥΨΗΤΡΟΠΟΠΟΙΗΣΗΔΙΑΓΡΑΦΗ
    $o $rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  ΔΙΑΓΡΑΦΗ
    \n"; + } + + + ##### CAMPAIGN AREACODE CID ##### + if ($SUB==202) + { + echo "

    CIDS AREACODE για τη συγκεκριμένη καμπάνια:   $NWB#vicidial_campaign_cid_areacodes$NWE
    \n"; + if ($use_custom_cid != 'AREACODE') + {echo "
    The campaign setting Συνήθεια 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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 "
    #AREACODEΑΡΙΘΜΟΣ CIDΠΕΡΙΓΡΑΦΗΕΝΕΡΓΟCALLSΔΙΑΓΡΑΦΗ
      $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   ΔΙΑΓΡΑΦΗ
    \n"; + echo "

    \n"; + + echo "
    Προσθήκη νέου AREACODE CID
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Areacode: \n"; + echo "Outbound CID:
    \n"; + echo "Περιγραφή:\n"; + echo "
    \n"; + + echo "

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

    \n"; echo "ΑΠΟΣΥΝΔΕΣΗ ΟΛΩΝ ΤΩΝ ΧΕΙΡΙΣΤΩΝ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ

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

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

    \n"; if ($LOGdelete_campaigns > 0) { @@ -17503,6 +22659,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_ανανέωσης=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17513,8 +22674,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -17539,9 +22710,10 @@ if ($ADD==34) $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_stats_ανανέωσης = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -17549,13 +22721,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Ρυθμίσεις";} + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -17573,7 +22752,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -17594,7 +22773,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -17605,7 +22784,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -17635,14 +22814,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -17657,15 +22836,18 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: $campaign_id: Βασική Επισκόπηση Αναλυτική Επισκόπηση Κατάλογος 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"; @@ -17692,138 +22874,165 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; +: \n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
    ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID Εκστρατείας: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
    Περιγραφή εκστρατείας: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
    Εκστρατεία Αλλαγή Ημερομηνία: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Εκστρατεία Σύνδεση Ημερομηνία: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Ενεργή:$NWB#vicidial_campaigns-active$NWE
    Τηλ.σύνδ. Στάθμευσης: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
    Διαχειριστής Ομάδα Χρηστών: $user_group $NWB#vicidial_campaigns-user_group$NWE
    Πάρκο Μουσική-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Ιστο-σελίδα: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Επιτρέπω τους Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Ομάδα μεταφοράς προεπιλογής:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    Add A Dial Κατάσταση:
    Προσθέστε μια κατάσταση Dial για κλήσεων:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
    Κατάλογος Mix:
    Σειρά Λίστας: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Κατάλογος Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Φίλτρο Οδηγού: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Ελάχιστο Επίπεδο Χόπερ: $NWB#vicidial_campaigns-hopper_level$NWE
    Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Μέθοδος Κλήσης -: $NWB#vicidial_campaigns-dial_method$NWE
    $NWB#vicidial_campaigns-dial_method$NWE
    ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
    ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
    ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣΤΡΟΠΟΠΟΙΗΣΗ
    $row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]ΤΡΟΠΟΠΟΙΗΣΗ

    \n"; + echo "
    \n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Αυτή η εκστρατεία έχει$active_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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]ΤΡΟΠΟΠΟΙΗΣΗ

    \n"; - echo "
    \n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

    \n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - ΑΠΟΚΡΥΨΗ

    "; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - ΕΜΦΑΝΙΣΗ

    "; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

    \n"; - echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

    \n"; - echo "Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια

    \n"; + echo "
    ΚΑΤΑΣΤΑΣΕΙΣ στο ενεργό ΛΙΣΤΕΣ για τη συγκεκριμένη καμπάνια:\n"; + echo " - ΑΠΟΚΡΥΨΗ
    "; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    $CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "ΔΕΙΞΤΕ ΚΑΤΑΣΤΑΣΕΙΣ ΜΟΛΥΒΔΟΥ σε αυτήν την εκστρατεία

    "; + } + + + 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 " - ΑΠΟΚΡΥΨΗ

    "; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - ΕΜΦΑΝΙΣΗ

    "; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

    \n"; + echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

    \n"; + echo "Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια

    \n"; } echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

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

    Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την εκστρατεία
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την εκστρατεία\n"; } echo "
    \n"; @@ -18037,24 +23358,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
    \n"; echo "
    ΤΑΞΕΙΣ ΠΡΑΚΤΟΡΩΝ ΓΙΑ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:
    \n"; - echo "\n"; - echo "\n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
    USER     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

    \n"; @@ -18091,7 +23413,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -18110,7 +23432,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
    ΠΡΟΕΙΔΟΠΟΙΗΣΗ, προτείνουμε μόνο Κατάλογος Mix για προχωρημένους χρήστες, Παρακαλώ διαβάστε το ViciDial Manager εγχειριδίου
    \n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -18119,7 +23441,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -18318,341 +23640,403 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
    \n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + 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 ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ΛΙΣΤΕΣ ΘΕΣΕΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΣΥΝΗΘΕΙΑΣ:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΛΙΣΤΕΣ ΘΕΣΕΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΣΥΝΗΘΕΙΑΣ:\n"; + echo "
    CAMPAIGNΟΝΟΜΑSTATUSESΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNΟΝΟΜΑSTATUSESΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY STATUSES
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUSES
    \n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ΛΊΣΤΕΣ ΕΚΣΤΡΑΤΕΙΑΣ HOTKEYS:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΛΊΣΤΕΣ ΕΚΣΤΡΑΤΕΙΑΣ HOTKEYS:\n"; + echo "
    CAMPAIGNΟΝΟΜΑHOTKEYSΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNΟΝΟΜΑHOTKEYSΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY HOTKEYS
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
    \n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ΑΝΑΚΥΚΛΩΣΗΣ ΛΙΣΤΕΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΑΝΑΚΥΚΛΩΣΗΣ ΛΙΣΤΕΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ:\n"; + echo "
    CAMPAIGNΟΝΟΜΑΟ ΜΟΛΥΒΔΟΣ ΑΝΑΚΥΚΛΩΝΕΙΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNΟΝΟΜΑΟ ΜΟΛΥΒΔΟΣ ΑΝΑΚΥΚΛΩΝΕΙΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY Ο ΜΟΛΥΒΔΟΣ ΑΝΑΚΥΚΛΩΝΕΙ
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY Ο ΜΟΛΥΒΔΟΣ ΑΝΑΚΥΚΛΩΝΕΙ
    \n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ΛΊΣΤΕΣ ΠΙΝΑΚΩΝ ΜΟΛΥΒΔΟΥ ΑΥΤΌΜΑΤΟΣ-ALT ΕΚΣΤΡΑΤΕΙΑΣ:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΛΊΣΤΕΣ ΠΙΝΑΚΩΝ ΜΟΛΥΒΔΟΥ ΑΥΤΌΜΑΤΟΣ-ALT ΕΚΣΤΡΑΤΕΙΑΣ:\n"; + echo "
    CAMPAIGNΟΝΟΜΑAUTO-ALT DIALΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNΟΝΟΜΑAUTO-ALT DIALΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NONE";} - echo "MODIFY AUTO-ALT DIAL
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
    \n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ΛΙΣΤΕΣ ΚΩΔΙΚΑ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΠΡΑΚΤΟΡΩΝ ΕΚΣΤΡΑΤΕΙΑΣ:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΛΙΣΤΕΣ ΚΩΔΙΚΑ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΠΡΑΚΤΟΡΩΝ ΕΚΣΤΡΑΤΕΙΑΣ:\n"; + echo "
    CAMPAIGNΟΝΟΜΑΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNΟΝΟΜΑΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY ΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY ΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ
    \n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
    \n"; + { + echo "
    \n"; + echo ""; + + echo "
    ΛΙΣΤΕΣ ΜΙΓΜΑΤΩΝ ΚΑΤΑΛΟΓΩΝ ΕΚΣΤΡΑΤΕΙΑΣ:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    CAMPAIGNΟΝΟΜΑLIST MIXΤΡΟΠΟΠΟΙΗΣΗ
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
    \n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; + + echo "
    \n"; echo ""; -echo "
    ΛΙΣΤΕΣ ΜΙΓΜΑΤΩΝ ΚΑΤΑΛΟΓΩΝ ΕΚΣΤΡΑΤΕΙΑΣ:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ΕΚΣΤΡΑΤΕΙΑ PRESET ΑΚΙΝΗΤΑ:\n"; + echo "
    CAMPAIGNΟΝΟΜΑLIST MIXΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -18660,23 +24044,97 @@ echo "\n"; while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; + $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 (eregi("1$|3$|5$|7$|9$", $o)) + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
    CAMPAIGNΟΝΟΜΑPRESETSΤΡΟΠΟΠΟΙΗΣΗ
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PRESETS
    \n"; + } + + + +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
    \n"; + echo ""; + + echo "
    ΕΚΣΤΡΑΤΕΙΑ AREACODE CID ΑΚΙΝΗΤΑ:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "$row[0] "; $p++; } - if ($p<1) - {echo "NONE";} echo ""; - echo "\n"; + echo "\n"; + + $k++; $o++; } -echo "
    CAMPAIGNΟΝΟΜΑCUSTOM CIDAC-CIDSΤΡΟΠΟΠΟΙΗΣΗ
    $campaigns_id_list[$o]
    $campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -18686,17 +24144,15 @@ echo "
    MODIFY LIST MIX
    MODIFY AC-CIDS
    \n"; -} - - + echo "
    \n"; + } @@ -18708,10 +24164,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_ανανέωσης=1; + } echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -18849,19 +24322,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -18730,9 +24191,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18741,10 +24206,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18753,13 +24219,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -18772,7 +24239,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -18806,7 +24273,7 @@ if ($ADD==311) echo "
    Περιγραφή καταλόγων: $NWB#vicidial_lists-list_description$NWE
    Εκστρατεία:
    Τηλεφωνητής Μήνυμα Παράκαμψη: audio chooser $NWB#vicidial_lists-am_message_exten_override$NWE
    Drop Inbound Ομάδα Παράκαμψη:
    Drop  εισερχόμενοςΟμάδα Παράκαμψη: $NWB#vicidial_lists-drop_inbound_group_override$NWE
    Ιστο-σελίδα: $NWB#vicidial_lists-web_form_address$NWE
    Ιστο-σελίδα Two: $NWB#vicidial_lists-web_form_address$NWE
    Αριθμός Μεταφοράς-Συνδ 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Αριθμός Μεταφοράς-Συνδ 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Αριθμός Μεταφοράς-Συνδ 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Έκθεση απογραφής: $NWB#vicidial_lists-inventory_report$NWE
    Ζώνη ώρας: $NWB#vicidial_lists-time_zone_setting$NWE
    \n"; echo "
    \n"; echo "
    ΚΑΤΑΣΤΑΣΕΙΣ ΣΤΗΝ ΛΙΣΤΑ:
    \n"; - echo "\n"; - echo "\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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑDIALABLEPENETRATION
    \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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18915,15 +24427,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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 "
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    $CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    $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]."
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]    
    ΣΥΝΟΛΙΚΑ$lead_list[count]$dialable_total $total_complete_pct%  
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]

    \n"; unset($lead_list); @@ -18933,7 +24483,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18972,7 +24522,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -18994,67 +24544,142 @@ if ($ADD==311) echo "
    \n"; echo "
    ΙΔΙΟΚΤΗΤΕΣ Στον κατάλογο:
    \n"; - echo "
    GMT OFFSET (τοπικός χρόνος)ΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    \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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
    OWNERΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    \n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
    OWNERΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑRESET
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]
    \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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
    OWNERΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
    ΣΥΝΟΛΙΚΑ$lead_list[count]

    \n"; unset($lead_list); @@ -19067,7 +24692,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -19129,7 +24754,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -19246,7 +24871,16 @@ if ($ADD==311) echo "
    \n"; - echo "

    Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος στον κατάλογο αυτό

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

    Τα προσαρμοσμένα πεδία που ορίζονται για αυτόν τον κατάλογο: $rowx[0]
    \n"; + } + + echo "

    Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος στον κατάλογο αυτό
    \n"; echo "

    Κάντε κλικ εδώ για να κατεβάσετε τον κατάλογο αυτό

    \n"; if ($LOGdelete_lists > 0) @@ -19255,7 +24889,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την λίστα
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής τροποποιήσεις αυτού του καταλόγου\n"; } } else @@ -19275,10 +24909,16 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_ανανέωσης=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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19348,9 +24988,85 @@ if ($ADD==3111) $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]; + + ##### 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_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + $Wmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -19361,6 +25077,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -19371,6 +25089,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -19423,6 +25148,10 @@ if ($ADD==3111) {$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 @@ -19432,17 +25161,29 @@ if ($ADD==3111) echo "
    ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΟΜΑΔΩΝ: $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"; if ($SSenable_second_webform > 0) { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19484,41 +25234,49 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19632,7 +25456,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -19670,23 +25494,33 @@ if ($ADD==3111) 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"; ##### 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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -19710,7 +25544,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19736,7 +25570,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19749,7 +25583,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19782,16 +25616,16 @@ if ($ADD==3111) } echo "
    ID Ομάδας: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
    Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
    Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
    Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
    Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Στην ομάδα-Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
    \n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_inbound_groups-user_group$NWE
    Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Ιστο-σελίδα Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Ιστο-σελίδα Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Κοτσίδας Προτεραιότητα: $NWB#vicidial_inbound_groups-queue_priority$NWE
    On-Hook Ώρα δαχτυλίδι: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
    On-Hook CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
    Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Αγνοήστε τη συμπληρωματική προμήθεια χειρογράφων καταλόγων: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    DTMF Μεταφοράς-Συνδ 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Αριθμός Μεταφοράς-Συνδ 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Timer Δράση: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer Δράση: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer Δράση Μήνυμα: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Timer Δευτερόλεπτα Δράση: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Χρονοδιακόπτης Προορισμός δράσης: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Drop δράσης:$NWB#vicidial_inbound_groups-drop_action$NWE
    Drop δράσης:$NWB#vicidial_inbound_groups-drop_action$NWE
    Εσωτ. Σύνδεση Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_exten$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Drop Μεταφορά Ομάδα:
    Drop Transfer Group: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
    Πτώση Μενού κλήσεων:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
    Χρόνος κλήσης:$NWB#vicidial_inbound_groups-call_time_id$NWE
    Μετά από τη δράση ωρών:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Μεταφορά δράσης CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
    Μετά από το όνομα αρχείου μηνυμάτων ωρών: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Μετά από τη δράση ωρών:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Μετά από το όνομα αρχείου μηνυμάτων ωρών: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Μετά από την παράταση ωρών:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
    Μετά από το φωνητικό ταχυδρομείο ωρών: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Μετά από το φωνητικό ταχυδρομείο ωρών: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Μετά από ώρες Μεταφορά Ομάδα:
    After Hours Transfer Group: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
    After Hours Καλέστε Μενού:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
    Δεν Πράκτορες Δεν Αναμονής: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
    Δεν Agent Δεν Queue δράσης: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -19549,9 +25307,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID Λίστας: "; echo "
    ID Εκστρατείας: audio chooser\n"; + echo "αρχείου ήχου: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -19593,37 +25351,103 @@ if ($ADD==3111) echo "
     
    Ευπρόσδεκτο όνομα αρχείου μηνυμάτων: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Μέγιστη κλήσεις μεθόδων: $NWB#vicidial_inbound_groups-max_calls_method$NWE
    Μέγιστη Κλήσεις Μετρήστε: $NWB#vicidial_inbound_groups-max_calls_count$NWE
    Μέγιστη Κλήσεις δράσης: $NWB#vicidial_inbound_groups-max_calls_action$NWE
    Ευπρόσδεκτο όνομα αρχείου μηνυμάτων: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Παίξτε Καλωσόρισμα:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    Μουσική στο πλαίσιο λαβής: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Μουσική στο πλαίσιο λαβής: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Στο γρήγορο όνομα αρχείου λαβής: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Στο γρήγορο όνομα αρχείου λαβής: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Στο γρήγορο διάστημα λαβής:$NWB#vicidial_inbound_groups-prompt_interval$NWE
    Στην υπαγόρευση λαβής κανένας φραγμός: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    Στα γρήγορα δευτερόλεπτα λαβής: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Παίξτε στο Line Τόπος:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Παίξτε Κρατήστε Εκτιμώμενη Ώρα:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Κρατήστε την επιλογή Ώρα:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Υπολογίστε περίπου δευτερόλεπτα Hold: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Εκτιμώμενος χρόνος Κρατήστε Όνομα Ελάχιστες: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Εκτιμώμενος χρόνο παραμονής τουλάχιστον Ερώτηση αριθ. Μπλοκ: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Εκτιμώμενος χρόνος Hold Ελάχιστη εντολών Δευτερόλεπτα: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Περιμένετε Επιλογή Χρόνος: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Περιμένετε δεύτερη φορά Επιλογή: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Περιμένετε Ώρα Τρίτη επιλογή: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Περιμένετε Δευτερόλεπτα Επιλογή Χρόνος: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Περιμένετε Χρόνος Επέκταση Επιλογή: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Περιμένετε ώρα Callmenu Επιλογή: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Περιμένετε ώρα Τηλεφωνητής Επιλογή: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Περιμένετε Χρόνος Μεταγωγής επιλογή-ομάδα: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Περιμένετε Ώρα Όνομα Επιλογή Τύπου: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Περιμένετε ώρα Τύπου επιλογή Χωρίς Κλείδωμα: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Περιμένετε δευτερόλεπτα χρόνος Επιλογή Όνομα Τύπου: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Περιμένετε Επιλογή ώρα μετά το όνομα αρχείου Τύπου: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Περιμένετε Χρόνος επανάκλησης Επιλογή ID της λίστας: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Περιμένετε Κρατήστε Προτεραιότητα Επιλογή: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Εκτιμώμενος χρόνος επιλογή Αναμονή: $NWB#vicidial_inbound_groups-hold_time_option$NWE
    Κρατήστε δεύτερη φορά Επιλογή: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Κρατήστε Ώρα Τρίτη επιλογή: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Κρατήστε την επιλογή Δευτερόλεπτα Ώρα:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Ελάχιστο χρονικής επιλογής λαβής: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Κρατήστε Ώρα Επιλογή Παράταση:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Κρατήστε Ώρα Επιλογή Τηλεφωνητής: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Χρονική επιλογή Callmenu λαβής: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Κρατήστε Ώρα Επιλογή Τηλεφωνητής: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
    Κρατήστε Ώρα Επιλογή Callback αρχείου: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Όνομα αρχείου Τύπου χρονικής επιλογής λαβής: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Κρατήστε τον Τύπο χρονικής επιλογής κανένας φραγμός: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Δευτερόλεπτα ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Χρονική επιλογή λαβής μετά από το όνομα αρχείου Τύπου: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Κρατήστε Ώρα Επιλογή Callback Κατάλογος ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Agent Alert Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Agent Alert Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Αγρυπνη καθυστέρηση πρακτόρων:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
    Στατιστικά Ποσοστό ζητεί απάντηση εντός δευτερολέπτων X 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
    Ξεκινήστε Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Ξεκινήστε Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Καλέστε dispo URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Καλέστε dispo URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Μόλυβδος Προσθήκη URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Δεν URL Καλέστε τον πράκτορα: $NWB#vicidial_inbound_groups-na_call_url$NWE
    Η επέκταση επισυνάπτει CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Επίδειξη θέσης Uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Πρόθεμα θέσης Uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
     
    Inbound Ομάδα QC Ρυθμίσεις:
      εισερχόμενοςΟμάδα QC Ρυθμίσεις:
    \n"; - echo "

    \n"; + echo "


    \n"; ### list of agent rank or skill-level for this inbound group - echo "
    \n"; - echo "
    ΧΕΙΡΙΣΤΗΣRANKS FOR THIS Εισερχόμενα GROUP:
    \n"; - echo "\n"; - echo "\n"; + echo "
    \n"; + echo "
    ΧΕΙΡΙΣΤΗΣRANKS FOR THIS INBOUND GROUP:
    \n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19801,26 +25635,215 @@ if ($ADD==3111) $rowx=mysql_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_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + $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_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='ΕΠΙΒΕΒΑΙΩΣΗ') + { + $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 = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_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_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ( ($ARIG_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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_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 (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + $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 "
    USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

    \n"; + echo "$users_output"; - echo "

    \n"; + echo "

    \n"; echo "Κάντε κλικ εδώ για να δείτε μια έκθεση για αυτό το εισερχόμενο ομάδα

    \n"; + echo "Χτυπήστε εδώ για να δείτε τους πράκτορες που συνδέονται σε αυτήν την εισερχόμενη ομάδα

    \n"; + echo "
    \n"; - echo "DIDS USING THIS IN-GROUP:
    \n"; + echo "DIDS ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ ΣΤΗΝ ΟΜΑΔΑ-:
    \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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -19832,10 +25855,10 @@ if ($ADD==3111) } echo "

    \n"; - echo "CALL MENUS USING THIS IN-GROUP:
    \n"; + echo "CALL MENUS ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ ΣΤΗΝ ΟΜΑΔΑ-:
    \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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -19850,7 +25873,7 @@ if ($ADD==3111) echo "ΕΚΣΤΡΑΤΕΙΕΣ οποίες καθιστούν δυνατή την ομάδα της:
    \n"; echo "
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19865,12 +25888,12 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; + # echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; echo "

    ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΕΙΣ-ΟΜΑΔΑ\n"; } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages In-Group\n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτή την ομάδα In-\n"; } } else @@ -19878,6 +25901,7 @@ if ($ADD==3111) echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; exit; } + } @@ -19890,13 +25914,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20001,7 +26088,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20023,7 +26110,7 @@ if ($ADD==3311) 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_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $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 "
    \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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19920,9 +25949,36 @@ if ($ADD==3311) $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 order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19935,53 +25991,79 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\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') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\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"; @@ -19991,7 +26073,12 @@ if ($ADD==3311) echo "
    DID Επέκταση:$NWB#vicidial_inbound_dids-did_pattern$NWE
    DID Περιγραφή:$NWB#vicidial_inbound_dids-did_description$NWE
    Ενεργή:$NWB#vicidial_inbound_dids-did_active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_inbound_dids-user_group$NWE
    DID Οδός:$NWB#vicidial_inbound_dids-did_route$NWE
    Κλήση αρχείων: $NWB#vicidial_inbound_dids-record_call$NWE
    Παράταση:$NWB#vicidial_inbound_dids-extension$NWE
    Παράταση Πλαίσιο:$NWB#vicidial_inbound_dids-exten_context$NWE
    Τηλεφωνητής Box: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    In-ID Ομάδας: $NWB#vicidial_inbound_dids-group_id$NWE
    Στην Ομάδα-Call Χειροκίνητος Τρόπος:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Στην Ομάδα-Call Χειροκίνητος Τρόπος:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Στην Ομάδα-Agent Search Μέθοδος:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Στην ομάδα Κατάλογος-ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Στην ομάδα της εκστρατείας-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Στην Ομάδα-τηλέφωνο Κωδικός:$NWB#vicidial_inbound_dids-phone_code$NWE
    Καθαρίστε CID Αριθμός: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Φιλτράρισμα Εισερχόμενων Αριθμός: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Φίλτρο ID Ομάδας Τηλέφωνο: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Φίλτρο URL: $NWB#vicidial_inbound_dids-filter_url$NWE
    Φίλτρο δράσης: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Παράταση:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Παράταση Πλαίσιο:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter Τηλεφωνητής Box: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    Filter Παράταση Τηλέφωνο:$NWB#vicidial_inbound_dids-phone$NWE
    Filter IP Διακομιστή: $NWB#vicidial_inbound_dids-server_ip$NWE
    Filter Καλέστε Μενού: $NWB#vicidial_inbound_dids-menu_id$NWE
    Filter Χρήστης Agent:$NWB#vicidial_inbound_dids-user$NWE
    Filter Χρήστης Unavailable δράσης:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
    Filter Ρυθμίσεις χρήστη Οδός-Στην ομάδα:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
    Filter In-ID Ομάδας: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter Στην Ομάδα-Call Χειροκίνητος Τρόπος:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter Στην Ομάδα-Agent Search Μέθοδος:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter Στην ομάδα Κατάλογος-ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter Στην ομάδα της εκστρατείας-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter Στην Ομάδα-τηλέφωνο Κωδικός:$NWB#vicidial_inbound_dids-phone_code$NWE
    Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
    \n"; echo "

    \n"; echo "
    Κάντε κλικ εδώ για να δείτε μια έκθεση για την κίνηση αυτή DID

    \n"; + echo "
    Χτυπήστε εδώ για να δείτε έναν κατάλογο καταγραφών και οι κλήσεις για αυτό ΕΚΑΝΑΝ
    \n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    ΔΕΙΤΕ DID REMOTE παρακάμψεων ΕΠΕΚΤΑΣΗ Πράκτορες Για αυτό το DID\n"; + } if ($LOGdelete_dids > 0) { echo "

    Διαγραφή αυτής της DID\n"; } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages DID\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές στο διαχειριστή αυτό το DID\n"; } } else @@ -20056,6 +26204,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
    \n"; + echo ""; + + echo "
    ΤΗΛΕΧΕΙΡΙΣΤΗΡΙΟ ΑΓΓΕΛΙΕΣ OVERRIDE παράγοντα επέκτασης:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    DIDΟΝΟΜΑRA-EXTENSΤΡΟΠΟΠΟΙΗΣΗ
    $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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/ModifyDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ΔΕΝ REMOTE OVERRIDE ΕΠΕΚΤΑΣΗ ΠΡΑΚΤΟΡΑΣ ΠΡΟΣΤΙΘΕΜΕΝΗΣ - υπάρχει ήδη μια καταχώρηση για αυτό το DID με την παράταση αυτή ΡΑ
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    ΔΕΝ REMOTE OVERRIDE ΕΠΕΚΤΑΣΗ ΠΡΑΚΤΟΡΑΣ ΠΡΟΣΤΙΘΕΜΕΝΗΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "
    DID REMOTE OVERRIDE ΕΠΕΚΤΑΣΗ ΠΡΑΚΤΟΡΑΣ ΠΡΟΣΤΙΘΕΜΕΝΗΣ: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    DID απομακρυσμένο τηλέφωνο Γραφείο υπερισχύσουν έναντι δεν διαγράφεται - Αυτή η καταχώρηση δεν υπάρχει
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    DID απομακρυσμένο τηλέφωνο Γραφείο υπερισχύσουν έναντι δεν διαγράφεται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "
    DID REMOTE ΧΕΙΡΙΣΤΗΣ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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 ΧΕΙΡΙΣΤΗΣEXTENSION OVERRIDE NOT MODIFIED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε
    \n"; + } + else + { + echo "DID απομακρυσμένο τηλέφωνο ΠΡΑΚΤΟΡΑΣ υπερισχύσουν έναντι ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/ModifyDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_ανανέωσης=1; + } + echo "
    \n"; + echo ""; + echo "

    ΤΗΛΕΧΕΙΡΙΣΤΗΡΙΟ παρακάμψεων ΕΠΕΚΤΑΣΗ Πράκτορες Για αυτό το DID:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTΤΗΛ.ΣΥΝΔΕΣΗΠΕΡΙΓΡΑΦΗΕΝΕΡΓΟCALLSΔΙΑΓΡΑΦΗ
      $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   ΔΙΑΓΡΑΦΗ
    \n"; + echo "

    \n"; + + echo "
    ADD NEW REMOTE ΧΕΙΡΙΣΤΗΣEXTENSION OVERRIDE
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Χρήστης Start: \n"; + echo "Παράταση:
    \n"; + echo "Περιγραφή:\n"; + echo "
    \n"; + + echo "

    \n"; + + echo "

    ΤΡΟΠΟΠΟΙΗΣΗ αυτό το DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές στο διαχειριστή αυτό το DID
    \n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -20064,10 +26512,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_ανανέωσης=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -20081,6 +26534,9 @@ if ($ADD==3511) $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]; echo "
    Τροποποίηση μιας ΠΡΟΣΚΛΗΣΗ MENU RECORD: $menu_id
    \n"; @@ -20089,6 +26545,10 @@ if ($ADD==3511) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20125,6 +26585,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -20156,7 +26628,7 @@ if ($ADD==3511) $dtmf_list = ""; echo " "; - echo "   Handle Method: \n"; - echo "
    Search Method: "; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; + echo "
    Μέθοδος Αναζήτηση: \n"; echo "   ID Λίστας: "; echo "
    ID Εκστρατείας: \n"; echo "   Phone Code: "; + echo "
      VID εισάγει το όνομα αρχείου: audio chooser"; + echo "
      Όνομα αρχείου αριθμού ταυτότητας VID: audio chooser"; + echo "
      VID επιβεβαιώνει το όνομα αρχείου: audio chooser"; + echo "   VID ψηφία: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -20235,7 +26716,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "αρχείου ήχου: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -20259,12 +26740,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
    Μενού ID: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
    Όνομα μενού: $NWB#vicidial_call_menu-menu_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_menu-user_group$NWE
    Μενού Προτροπή: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
    Μενού Timeout: $NWB#vicidial_call_menu-menu_timeout$NWE
    Μενού Timeout Προτροπή: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
    Σύνδεση πλήκτρων: $NWB#vicidial_call_menu-dtmf_log$NWE     Σύνδεση Πεδίο: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
    Καλέστε Μενού Επιλογές:
    Custom Dialplan Είσοδος:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Είσοδος Dialplan συνήθειας:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Custom Dialplan Είσοδος: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Είσοδος Dialplan συνήθειας: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    \n"; echo "

    \n"; - echo "DIDS USING THIS CALL MENU:
    \n"; + echo "DIDS Χρησιμοποιώντας αυτό το μενού ΠΡΟΣΚΛΗΣΗ:
    \n"; echo "\n"; - $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -20327,7 +26808,7 @@ if ($ADD==3511) echo "

    \n"; - echo "CALL MENUS USING THIS CALL MENU:
    \n"; + echo "CALL MENUS Χρησιμοποιώντας αυτό το μενού ΠΡΟΣΚΛΗΣΗ:
    \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';"; @@ -20346,11 +26827,11 @@ if ($ADD==3511) if ($LOGdelete_dids > 0) { - echo "

    DELETE THIS CALL MENU\n"; + echo "

    ΔΙΑΓΡΑΨΕΤΕ αυτό το μενού Κλήση\n"; } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages με την παρούσα πρόσκληση MENU\n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το μενού Κλήση \n"; } } else @@ -20370,10 +26851,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20383,38 +26869,232 @@ if ($ADD==31111) $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]; - echo "
    ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ: $row[0]
    \n"; - echo "\n"; - echo "\n"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; + $rsltx=mysql_query($stmt, $link); + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
    ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ: $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 "
    ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented, πρέπει να είναι μια υπάρχουσα vicidial χρήστη)$NWB#vicidial_remote_agents-user_start$NWE
    Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
    Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
    Ομάδα επέκτασης: $NWB#vicidial_remote_agents-extension_group$NWE
    Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
    Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
    On-Hook γραφείο: $NWB#vicidial_remote_agents-on_hook_agent$NWE
    On-Hook Ώρα δαχτυλίδι: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE
    \n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "
    Εισερχόμενες Ομάδες: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; + echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    ΥΠΑΡΧΟΥΝ $didraext_count DID, REMOTE παρακάμψεων ΠΡΑΚΤΟΡΑ ΓΙΑ ΑΥΤΗΝ ΤΗΝ ΕΠΕΚΤΑΣΗ Remote Agent\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

    ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΧΕΙΡΙΣΤΗ\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το απομακρυσμένο πράκτορα
    \n"; + } + } + else + { + echo "Έναρξη χρήσης για αυτή την απομακρυσμένη παράγοντα δεν υπάρχει: $user_start\n"; + exit; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=3711 modify filter phone group info in the system +###################### + +if ($ADD==3711) + { + if ($LOGmodify_dids==1) + { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_ανανέωσης=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + $user_group = $row[3]; + + echo "
    Τροποποίηση φίλτρου Ομίλου Τηλ.: $filter_phone_group_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 "
    ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
    Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
    Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
    Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
    Εισερχόμενες Ομάδες: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    Φίλτρο ID Ομάδας Τηλέφωνο: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Όνομα φίλτρου ομάδας Τηλέφωνο: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Φίλτρο Περιγραφή ομάδας Τηλέφωνο: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; - echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

    Οι αριθμοί σε αυτό το φίλτρο Ομίλου Τηλ.: $row[0]"; - if ($LOGdelete_remote_agents > 0) + if ($LOGdelete_dids > 0) { - echo "

    ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΧΕΙΡΙΣΤΗ\n"; + echo "

    ΔΙΑΓΡΑΦΗ ΠΑΡΟΥΣΑ ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ\n"; } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το απομακρυσμένο πράκτορα
    \n"; + echo "

    Κάντε κλικ εδώ για να κατεβάσετε τους αριθμούς σε αυτό το φίλτρο της ομάδας τηλέφωνο\n"; + + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το φίλτρο της ομάδας τηλέφωνο\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_ανανέωσης=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
    ΤΡΟΠΟΠΟΙΗΣΤΕ ΜΙΑ ΕΙΣΟΔΟ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ: $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 "
    Ομάδα επέκτασης: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Παράταση: (μόνο αριθμοί)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Ομάδες εκστρατειών: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Καλέστε την αρίθμηση σήμερα: $call_count_today
    Τελευταίος χρόνος κλήσης: $last_call_time
    Τελευταία ταυτότητα κλήσης: $last_callerid
    \n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

    ΔΙΑΓΡΑΨΤΕ ΑΥΤΟ ΤΟ ΛΗΜΜΑ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this extension group entry
    \n"; } } else @@ -20433,158 +27113,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

    Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος σε αυτή την ομάδα χρηστών

    \n"; - echo "

    Κάντε κλικ εδώ για να δείτε την κατάστασηΏρα ρολόι ομάδα για αυτόν τον χρήστη

    \n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - - echo ""; - - echo "
    ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - echo "\n"; + echo "
    Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
    Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
    ΔύναμηΏρα ρολόι Σύνδεση: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift εκτέλεση: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Επιτρεπόμενες Εκστρατείες:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; - echo "$campaigns_list
     "; - echo "
    Ομάδα Βάρδιες:
    $NWB#vicidial_user_groups-group_shifts$NWE
    \n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " 1) and ($modify_ανανέωσης_set < 1) ) { - if (ereg(" $shift_id_value ", $GROUP_shifts)) - { - echo " CHECKED"; - } - $p++; + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_ανανέωσης=1; } - echo "> $shift_id_value - $shift_name_value
    \n"; - $o++; - } - echo "
     
    \n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
    \n"; - echo "
    ΧΡΗΣΤΕΣ ΜΕΣΑ ΣΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ : $users_to_print
    \n"; - 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + 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 "
    Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
    Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
    ΔύναμηΏρα ρολόι Σύνδεση: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift εκτέλεση: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Επιτρεπόμενες Εκστρατείες:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; + echo "$campaigns_list
     "; + echo "
    Agent Κατάσταση θέασης Ομάδες:
    $NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
    \n"; - echo "ALL-GROUPS - All user groups in the system
    \n"; - echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; - - $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo "
    Ομάδα Βάρδιες:
    $NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) { - if (ereg(" $vgroups_id_value ", $VGROUP_vgroups)) + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
    \n"; + $o++; } - echo "> $vgroups_id_value - $vgroups_name_value
    \n"; - $o++; - } - echo "
     
    Agent Κατάσταση Προβολή Ώρα: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    QC Επιτρέπονται Καμπάνιες:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; - echo "$qc_campaigns_list"; echo "
     
    QC Επιτρέπονται Εισερχόμενες Ομάδες:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; - echo "$qc_groups_list"; + + + echo "
    Agent Κατάσταση θέασης Ομάδες:
    $NWB#vicidial_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 - Όλοι οι χρήστες στο σύστημα, ακόμη και όχι κατα:γράφω-στους χρήστες
    \n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } echo "
     
    \n"; + echo "
    Agent Κατάσταση Προβολή Ώρα: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Άποψη κούτσουρων κλήσης πρακτόρων: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Ο πράκτορας επιτρέπει συμβουλευτικό Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Ο πράκτορας επιτρέπει τη συμπληρωματική προμήθεια Xfer πινάκων: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    \n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
    USERΟΝΟΜΑΤΕΠΩΝΥΜΟΕΠΙΠΕΔΟΕΝΕΡΓΟ
    Ο πράκτορας επιτρέπει το μήνυμα Xfer φωνητικού ταχυδρομείου: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Ο πράκτορας επιτρέπει τυφλό Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Ο πράκτορας επιτρέπει τον πίνακα με τον πελάτη Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Ο πράκτορας επιτρέπει τον πίνακα Xfer πελατών πάρκων: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Πράκτορας Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Επιτρέπονται Εκθέσεις: $NWB#vicidial_user_groups-allowed_reports$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο Παράκαμψη URL: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο Σύστημα Βασικά Παράκαμψη: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad Παράκαμψη: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    $rowx[0]$rowx[1]$rowx[2]$rowx[3]

    \n"; + if ($SSqc_features_active > 0) + { + echo "
    QC Επιτρέπονται Καμπάνιες:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; + echo "$qc_campaigns_list"; + echo "
     
    QC Επιτρέπονται Εισερχόμενες Ομάδες:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; + echo "$qc_groups_list"; + echo "
     
    Επιτρέπονται Ομάδες Χρηστών:
    $NWB#vicidial_user_groups-admin_viewable_groups$NWE
    \n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
    \n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

    ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages ομάδα χρηστών\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } + echo "
     
    Επιτρέπονται χρόνους κλήσης:
    $NWB#vicidial_user_groups-admin_viewable_call_times$NWE
    \n"; + echo "ALL-CALLTIMES - Όλοι οι χρόνοι κλήσης στο σύστημα
    \n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
    \n"; + echo "
    ΧΡΗΣΤΕΣ ΜΕΣΑ ΣΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ : $users_to_print
    \n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    USERΟΝΟΜΑΤΕΠΩΝΥΜΟΕΠΙΠΕΔΟΕΝΕΡΓΟ
    $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 "
    Προσθαφαίρεση Στην ομάδα-επιλεγεί για την ενεργό χρηστών σε αυτή την ομάδα χρηστών
    \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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Ομάδα:
    \n"; + echo "
    \n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

    Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος σε αυτή την ομάδα χρηστών

    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε την κατάστασηΏρα ρολόι ομάδα για αυτόν τον χρήστη

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

    ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την ομάδα χρηστών\n"; + } } } else @@ -20603,32 +27455,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    ΤΡΟΠΟΠΟΙΗΣΤΕ ΕΝΑΝ ΒΟΗΘΟ
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Ταυτότητα χειρογράφων:: $script_id$NWB#vicidial_scripts-script_name$NWE
    Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
    Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_scripts-user_group$NWE
    Ενεργή:$NWB#vicidial_scripts-active$NWE
    Κείμενο χειρόγραφου:

    Προεπισκόπιση Βοηθού
    "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -20696,10 +27572,10 @@ if ($ADD==3111111) echo "


    \n"; - echo " ΕΚΣΤΡΑΤΕΙΕΣ USING THIS SCRIPT:
    \n"; + echo " ΕΚΣΤΡΑΤΕΙΕΣ αυτήν τη δέσμη ενεργειών:
    \n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20711,10 +27587,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ USING THIS SCRIPT:
    \n"; + echo " ΣΕ ΟΜΑΔΕΣ-αυτήν τη δέσμη ενεργειών:
    \n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20726,10 +27602,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; + echo " Παρακάμψεων ΚΑΤΑΛΟΓΟΣ αυτήν τη δέσμη ενεργειών:
    \n"; echo "\n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20740,17 +27616,15 @@ if ($ADD==3111111) $o++; } - echo "
    \n"; - - if ($LOGdelete_scripts > 0) { echo "

    ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΒΟΗΘΟ\n"; } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το σενάριο
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το σενάριο
    \n"; } + } else { @@ -20768,30 +27642,42 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    ΤΡΟΠΟΠΟΙΗΣΗ ΕΝΟΣ ΦΙΛΤΡΟΥ\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    ID Φίλτρου: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
    Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_lead_filters-user_group$NWE
    SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20820,7 +27706,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages για αυτό το φίλτρο
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το φίλτρο
    \n"; } } else @@ -20832,13 +27718,18 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_ανανέωσης=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -20884,10 +27775,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_ανανέωσης=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20909,6 +27805,15 @@ if ($ADD==311111111) $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]; echo ""; @@ -20916,17 +27821,22 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - 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; @@ -20946,7 +27856,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20956,10 +27866,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -20985,7 +27895,7 @@ if ($ADD==311111111) echo "ΕΚΣΤΑΤΕΙΕΣ ΠΟΥ ΧΡΗΣΙΜΟΠΟΙΟΥΝ ΑΥΤΟ ΤΟΝ ΧΡΟΝΟ ΚΛΗΣΗΣ:
    \n"; echo "
    ID Χρόνου Κλήσης: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
    Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
    Προκαθορσμένη Εκκίνηση Προκαθορσμένη Παύση: $NWB#vicidial_call_times-ct_default_start$NWE
    Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Τετάρτη Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_times-user_group$NWE
    Προκαθορσμένη Εκκίνηση Προκαθορσμένη Παύση: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Τετάρτη Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20997,10 +27907,10 @@ if ($ADD==311111111) } echo "
    \n"; - echo "Εισερχόμενα GROUPS USING THIS CALL TIME:
    \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';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21020,7 +27930,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages φορά σε αυτή την έκκληση\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this call time\n"; } } else @@ -21039,10 +27949,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_ανανέωσης=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -21064,6 +27979,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -21071,10 +27987,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21089,7 +28010,7 @@ if ($ADD==3111111111) echo "ΧΡΟΝΟΙ ΚΛΗΣΕΩΝ ΠΟΥ ΧΡΗΣΙΜΟΠΟΙΟΥΝ ΑΥΤΟ ΤΟΝ ΧΡΟΝΟ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ:
    \n"; echo "
    ID Χρόνου Κλήσης: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
    Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
    Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_call_times-user_group$NWE
    Προκαθορσμένη Εκκίνηση Προκαθορσμένη Παύση: $NWB#vicidial_call_times-ct_default_start$NWE
    Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
    \n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21121,18 +28042,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -21162,6 +28091,10 @@ if ($ADD==331111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -21189,6 +28122,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Σάββατο
    \n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    Shift ID:$shift_id
    Shift Όνομα: (σύντομη περιγραφή της μετατόπισης)$NWB#vicidial_shifts-shift_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_shifts-user_group$NWE
    Shift Ώρα έναρξης:\n"; echo "   Shift End Time:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Επιλογή Έκθεση: $NWB#vicidial_shifts-report_option$NWE
    Έκθεση Κατάταξη: $NWB#vicidial_shifts-report_rank$NWE
    \n"; @@ -21196,7 +28140,7 @@ if ($ADD==331111111) echo "ΟΜΑΔΕΣ ΧΡΗΣΤΩΝ ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ SHIFT:
    \n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21216,7 +28160,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages την εξέλιξη αυτή\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this shift\n"; } } else @@ -21233,12 +28177,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_ανανέωσης=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21246,11 +28195,18 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21273,6 +28252,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21288,11 +28268,12 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21307,8 +28288,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21325,7 +28306,7 @@ if ($ADD==31111111111) echo "\n"; echo "
    Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE (Agent Screen Τηλέφωνο Σύνδεσης)
    Παράταση Τηλέφωνο:$NWB#phones-extension$NWE
    Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
    Τηλεφωνητής Box: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
    Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
    Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
    IP Διακομιστή: $NWB#phones-server_ip$NWE
    Σύνδεση:$NWB#phones-login$NWE
    Κωδικός:$NWB#phones-pass$NWE
    Πράκτορας Είσοδος οθόνης: $NWB#phones-login$NWE
    Υποσελίδες: $NWB#phones-pass$NWE
    Κωδικός Εγγραφή: $NWB#phones-conf_secret$NWE     Δύναμη:
    Σύνολο ως Webphone: $NWB#phones-is_webphone$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad: $NWB#phones-webphone_dialpad$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο Αυτόματη Απάντηση: $NWB#phones-webphone_auto_answer$NWE
    Εξωτερικός κεντρικός υπολογιστής IP χρήσης: $NWB#phones-use_external_server_ip$NWE
    Κατάσταση:$NWB#phones-status$NWE
    Ενεργός Λογαριασμός: $NWB#phones-active$NWE
    Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
    Πλήρες Ονομα: $NWB#phones-fullname$NWE
    Email: $NWB#phones-email$NWE
    Διαγραφή ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ Μετά Email:$NWB#phones-delete_vm_after_email$NWE
    Ζώνη Τηλεφωνητής: $NWB#phones-voicemail_timezone$NWE
    Επιλογές Τηλεφωνητής: $NWB#phones-voicemail_options$NWE
    Εταιρία:$NWB#phones-company$NWE
    Εικόνα:$NWB#phones-picture$NWE
    Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
    Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
    Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
    Τηλέφωνο Ring Timeout: $NWB#phones-phone_ring_timeout$NWE
    On-Hook γραφείο: $NWB#phones-on_hook_agent$NWE
    Διαχειριστή Σύνδεση: $NWB#phones-ASTmgrUSERNAME$NWE
    Κωδικός Διαχειριστή: $NWB#phones-ASTmgrSECRET$NWE
    VICIDIAL Προκαθορισμένος Χρήστης: $NWB#phones-login_user$NWE
    VMailDump Τηλ.σύνδ.: $NWB#phones-voicemail_dump_exten$NWE
    Περιεχόμενο Τηλ.σύνδ: $NWB#phones-ext_context$NWE
    Τηλέφωνο Πλαίσιο: $NWB#phones-phone_context$NWE
    Conf Φάκελος Secret: $NWB#phones-conf_secret$NWE
    Codecs: $NWB#phones-codecs_list$NWE
    Codecs με το πρότυπο: $NWB#phones-codecs_with_template$NWE
    DTMFSend Κανάλι: $NWB#phones-dtmf_send_extension$NWE
    Ομάδα Εξερχομένων Κλήσεων: $NWB#phones-call_out_number_group$NWE
    Θέση Φυλλομετρητή: $NWB#phones-client_browser$NWE
    Κατάλογος εγκατάστασης: $NWB#phones-install_directory$NWE
    CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
    VICIDIAL Προκαθορισμένο URL: $NWB#phones-VICIDIAL_web_URL$NWE
    Καταγραφή Γεγονότος Κλήσης: $NWB#phones-AGI_call_logging_enabled$NWE
    Ενεργή Ουρά: $NWB#phones-QUEUE_ACTION_enabled$NWE
    Υπερεμφανιζόμενο παραθύρο CallerID: $NWB#phones-CallerID_popup_enabled$NWE
    Πλήκτρο VMail: $NWB#phones-voicemail_button_enabled$NWE
    Ταχύτητα Ανανέωσης: $NWB#phones-enable_fast_refresh$NWE
    Ρυθμός Ανανέωσης Ταχύτητας: (in ms)$NWB#phones-fast_refresh_rate$NWE
    Ταχύτητα Ανανέωσης: $NWB#phones-enable_fast_ανανέωσης$NWE
    Ρυθμός Ανανέωσης Ταχύτητας: (in ms)$NWB#phones-fast_ανανέωσης_rate$NWE
    Συνεχής MySQL: $NWB#phones-enable_persistant_mysql$NWE
    Αυτόματη Κλήση Επόμενου Αριθμού: $NWB#phones-auto_dial_next_number$NWE
    Σταμάτα την ηχογράφηση μετά από κάθε κλήση: $NWB#phones-VDstop_rec_after_each_call$NWE
    DBY Πόρτα: (ΔευτερεύονDB Port)$NWB#phones-DBY_port$NWE
    Πρότυπο ID:
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21381,7 +28373,11 @@ if ($ADD==32111111111) echo "
    \n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Γνωστός ID:$row[0] $NWB#phones-alias_id$NWE
    Ψευδώνυμο: $NWB#phones-alias_name$NWE
    Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    Τηλέφωνα Logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; @@ -21394,15 +28390,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -21420,7 +28417,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages να άλλως αυτό το τηλέφωνο\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this phone alias\n"; } } else @@ -21437,12 +28434,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_ανανέωσης=1; + } echo "
    LOGINΤΗΛ.ΣΥΝΔΕΣΗSERVERPROTOCOLIP
    \n"; echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21452,6 +28454,10 @@ if ($ADD==33111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21465,7 +28471,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages άλλως σε αυτή την ομάδα\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this group alias\n"; } } else @@ -21484,10 +28490,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_ανανέωσης=1; + } echo "
    Ομάδα Γνωστός ID: $row[0] $NWB#phones-group_alias_id$NWE
    Ομάδα ψευδώνυμο: $NWB#phones-group_alias_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#phones-user_group$NWE
    CallerID Αριθμός: $NWB#phones-caller_id_number$NWE
    CallerID Όνομα: $NWB#phones-caller_id_name$NWE
    Ενεργή:
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -21561,7 +28580,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21573,8 +28592,10 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21583,6 +28604,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21529,6 +28540,10 @@ if ($ADD==311111111111) $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]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21547,6 +28562,10 @@ if ($ADD==311111111111) echo "
    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
    Διαχειριστής Ομάδα Χρηστών: $NWB#servers-user_group$NWE
    Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
    Μέγιστος Αριθμός Trunk: $NWB#servers-max_vicidial_trunks$NWE
    Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf Φάκελος Secret: $NWB#servers-conf_secret$NWE
    Conf Φάκελος Secret: $NWB#servers-conf_secret$NWE     Δύναμη:
    Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
    VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
    AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
    Εξοδος AGI : $NWB#servers-agi_output$NWE
    Carrier Logging Ενεργή:$NWB#servers-carrier_logging_active$NWE
    Καταγραφή Σύνδεσμος: $NWB#servers-recording_web_link$NWE
    Καταγραφή Σύνδεσμος: $NWB#servers-recording_web_link$NWE
    Alternate Recording IP Διακομιστή: $NWB#servers-alt_server_ip$NWE
    Εξωτερικός κεντρικός υπολογιστής IP: $NWB#servers-external_server_ip$NWE
    Ενεργός Twin IP του διακομιστή: $NWB#servers-active_twin_server_ip$NWE
    Asterisk Ενεργό Server: $NWB#servers-active_asterisk_server$NWE
    Ενεργή Server Agent: $NWB#servers-active_agent_login_server$NWE
    Δημιουργήστε conf αρχεία: $NWB#servers-generate_vicidial_conf$NWE
    Ήχοι Ενημέρωση: $NWB#servers-sounds_update$NWE
    ViciDial Καταγραφή Όριο: $NWB#servers-vicidial_recording_limit$NWE
    Είσοδος Dialplan συνήθειας: $NWB#servers-custom_dialplan_entry$NWE
    Είσοδος Dialplan συνήθειας: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; @@ -21593,7 +28624,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -21640,7 +28671,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21672,7 +28703,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21770,7 +28801,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτόν τον διακομιστή\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this server\n"; } } else @@ -21789,15 +28820,21 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_ανανέωσης=1; + } echo "
    ΕΚΣΤΡΑΤΕΙΑ ΚΟΡΜΟΙ ΠΕΡΙΟΡΙΣΜΟΣ DELETE
    \n"; echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; + $user_group = $row[3]; echo "
    MODIFY Α ΠΙΣΤ TEMPLATE RECORD: $row[0]
    \n"; echo "\n"; @@ -21806,6 +28843,10 @@ if ($ADD==331111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Αναγνωριστικό: $template_id
    Όνομα: $NWB#vicidial_conf_templates-template_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_conf_templates-user_group$NWE
    Template Περιεχόμενα: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -21820,7 +28861,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21851,7 +28892,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21882,7 +28923,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages conf σε αυτό το πρότυπο
    \n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this conf template\n"; } } else @@ -21899,12 +28940,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_ανανέωσης=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21980,7 +29017,7 @@ if ($ADD==341111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages για τον εν λόγω αερομεταφορέα\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this carrier\n"; } } else @@ -21997,18 +29034,25 @@ if ($ADD==341111111111) if ($ADD==351111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_tts==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=351111111111&tts_id=$tts_id"; + $modify_footer_ανανέωσης=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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -21918,6 +28964,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
    MODIFY Α ΘΑΛΑΜΙΣΚΟ RECORD: $row[0]\n"; echo "\n"; @@ -21927,10 +28974,14 @@ if ($ADD==341111111111) echo "
    Θαλαμίσκος ID: $carrier_id
    Φέρον Όνομα: $NWB#vicidial_server_carriers-carrier_name$NWE
    Περιγραφή Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_server_carriers-user_group$NWE
    Εγγραφή String: $NWB#vicidial_server_carriers-registration_string$NWE
    Πρότυπο ID:
    Dialplan Είσοδος: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP Διακομιστή: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -22031,7 +29081,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτή την καταχώρηση TTS\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this TTS entry\n"; } } else @@ -22048,18 +29098,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; + $user_group = $row[5]; echo "
    Τροποποίηση μιας TTS RECORD: $tts_id\n"; echo "\n"; @@ -22018,6 +29062,12 @@ if ($ADD==351111111111) echo "
    TTS ID: $tts_id
    TTS Όνομα: $NWB#vicidial_tts_prompts-tts_name$NWE
    Ενεργή:$NWB#vicidial_tts_prompts-active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_tts_prompts-user_group$NWE
    TTS φωνή: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Κείμενο: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo "\n"; +echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -22068,6 +29124,12 @@ if ($ADD==361111111111) echo "
    \n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -22109,7 +29171,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το Music On Hold εισόδου\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this Music On Hold entry\n"; } } else @@ -22126,12 +29188,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_ανανέωσης=1; + } echo "
    Music On Hold ID: $moh_id
    Music Hold On Όνομα: $NWB#vicidial_music_on_hold-moh_name$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_music_on_hold-user_group$NWE
    Ενεργή:$NWB#vicidial_music_on_hold-active$NWE
    Τυχαία σειρά: $NWB#vicidial_music_on_hold-random$NWE
    \n"; echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -22142,18 +29209,43 @@ if ($ADD==371111111111) $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]; echo "
    Τροποποίηση μιας ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ 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"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22167,7 +29259,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages σε αυτή τη θέση τηλεφωνητή\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to this voicemail box\n"; } } else @@ -22178,6 +29270,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_ανανέωσης=1; + } + echo "
    ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ID: $voicemail_id
    Ταυτότητα φωνητικού ταχυδρομείου: $voicemail_id
    Κωδικός:$NWB#vicidial_voicemail-pass$NWE
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Email:$NWB#vicidial_voicemail-email$NWE
    Ενεργή:$NWB#vicidial_voicemail-active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_voicemail-user_group$NWE
    Διαγραφή ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ Μετά Email:$NWB#vicidial_voicemail-delete_vm_after_email$NWE
    Ζώνη Τηλεφωνητής: $NWB#vicidial_voicemail-voicemail_timezone$NWE
    Επιλογές Τηλεφωνητής: $NWB#vicidial_voicemail-voicemail_options$NWE
    Νέα Μηνύματα: $messages
    Παλαιά Μηνύματα: $old_messages
    \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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $user_group = $row[23]; + + echo "
    ΤΡΟΠΟΠΟΙΗΣΗ ΕΤΙΚΕΤΑ ΟΘΟΝΗ: $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#vicidial_screen_labels-label_name$NWE
    Ενεργή:$NWB#vicidial_screen_labels-active$NWE
    Διαχειριστής Ομάδα Χρηστών: $NWB#vicidial_screen_labels-user_group$NWE
    Απόκρυψη ετικετών στα αρχεία καταγραφής κλήσεων: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
    Τίτλος Ετικέτα: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Όνομα: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Μέση Αρχική: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Επώνυμο: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Διεύθυνση1: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Διεύθυνση2: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Address3: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Πόλη: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα κράτος: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα επαρχία: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Τ.Κ.: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα κώδικα οδηγούν Προμηθευτή: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Φύλο Ετικέτα: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Τηλέφωνο: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Κωδικός Τηλέφωνο: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Τηλέφωνο Alt: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ετικέτα Ασφάλειας Φράση: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Αποστολή Ετικέτα: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Σχόλια Ετικέτα: $NWB#vicidial_screen_labels-default_field_labels$NWE
    \n"; + + echo "
    \n"; + + + echo "


    \n"; + echo " Καμπάνιες που χρησιμοποιούν αυτή την ετικέτα ΟΘΟΝΗ:
    \n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
    $row[0] $row[1]


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

    ΔΙΑΓΡΑΦΗ αυτή την ετικέτα ΟΘΟΝΗ\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την ετικέτα οθόνη
    \n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + + +###################### +# ADD=391111111111 modify contact in the system +###################### +if ($ADD==391111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) + { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_ανανέωσης=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_query($stmt, $linkALT); + $row=mysql_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 "
    ΤΡΟΠΟΠΟΙΗΣΗ ΕΠΙΚΟΙΝΩΝΙΑ: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
    Ονομα: $NWB#contact_information$NWE
    Επίθετο: $NWB#contact_information$NWE
    Αριθμός Γραφείου: $NWB#contact_information$NWE
    Αριθμός κυττάρων: $NWB#contact_information$NWE
    Άλλο Αριθμός 1: $NWB#contact_information$NWE
    Άλλο Αριθμός 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Ομάδα:$NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; + + echo "
    \n"; + + if ($LOGast_delete_phones > 0) + { + echo "

    ΔΙΑΓΡΑΦΗ ΠΑΡΟΥΣΑ ΕΠΙΚΟΙΝΩΝΙΑ\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την επαφή\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -22186,6 +29495,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_ανανέωσης=1; + } echo "\n"; echo "\n"; +echo "
    \n"; echo ""; @@ -22232,6 +29546,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_ανανέωσης=1; + } echo "\n"; + + } -echo "\n"; - - -} - echo "
    \n"; echo ""; @@ -22279,10 +29598,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_ανανέωσης=1; + } 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"; @@ -22470,15 +29923,138 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + 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"; @@ -22496,6 +30072,16 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22330,6 +29707,66 @@ if ($ADD==311111111111111) $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_ανανέωσης = $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]; echo "
    ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL\n"; echo "\n"; @@ -22340,6 +29777,10 @@ if ($ADD==311111111111111) echo "
    DB Schema Update Date: $db_schema_update_date
    Auto Χρήστης-add Value: $auto_user_add_value
    Εγκαταστήστε Ημερομηνία: $install_date
    Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
    Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
    Μη-λατινικά χρήσης: $NWB#settings-use_non_latin$NWE
    Webroot writable: $NWB#settings-webroot_writable$NWE
    VICIDIAL ο πράκτορας θέτει εκτός λειτουργίας την επίδειξη: $NWB#settings-vicidial_agent_disable$NWE
    Επιτρέψτε τα μηνύματα SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
    Σπίτι URL Admin:$NWB#settings-admin_home_url$NWE
    Διαχειριστής Τροποποίηση Αυτόματη Ανανέωση: $NWB#settings-admin_modify_ανανέωσης$NWE
    Διαχειριστής No-Cache: $NWB#settings-nocache_admin$NWE
    Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων: $NWB#settings-enable_agc_xfer_log$NWE
    Επιτρέψτε το αρχείο ημερολογίου διάθεσης πρακτόρων: $NWB#settings-enable_agc_dispo_log$NWE
    Ώρα ρολόι Τέλος της ημέρας:$NWB#settings-timeclock_end_of_day$NWE
    Προεπιλογή τοπική ώρα GMT: (Μην ρυθμίσεις για DST)$NWB#settings-default_local_gmt$NWE
    Προεπιλογή Ζώνη Τηλεφωνητής: $NWB#settings-default_voicemail_timezone$NWE
    Πράκτορες Κλήσεις Επαναφορά: $NWB#settings-agents_calls_reset$NWE
    ΤελευταίαΏρα ρολόι Αυτόματη Αποσύνδεση: $timeclock_last_reset_date
    Agent Screen Επικεφαλίδας Μορφή Ημερομηνίας:
    Κεντρική Sound Control Ενεργό: $NWB#settings-sounds_central_control_active$NWE
    Ήχοι Web Server: $NWB#settings-sounds_web_server$NWE
    Ήχοι Web Directory: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
    Διαχειριστής Web Directory: $NWB#settings-admin_web_directory$NWE
    Ενεργή ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ Server: $NWB#settings-active_voicemail_server$NWE
    Επιτρέψτε Custom dialplan Καταχωρήσεις: $NWB#settings-allow_custom_dialplan$NWE
    Όριο PLLB Ομαδοποίηση: $NWB#settings-pllb_grouping_limit$NWE
    Δημιουργία Σταυρού-Server Extensions Τηλέφωνο: $NWB#settings-generate_cross_server_exten$NWE
    Χρήστης Εδάφη Ενεργή:$NWB#settings-user_territories_active$NWE
    Ενεργοποίηση Δεύτερη Webform: $NWB#settings-enable_second_webform$NWE
    Ενεργοποίηση TTS Ολοκλήρωσης: $NWB#settings-enable_tts_integration$NWE
    Επιτρέψτε CallCard: $NWB#settings-callcard_enabled$NWE
    Ενεργοποίηση προσαρμοσμένων πεδίων λίστας: $NWB#settings-custom_fields_enabled$NWE
    Ενεργοποίηση καλεί δοκιμής Εκστρατεία: $NWB#settings-test_campaign_calls$NWE
    Ενεργοποίηση Διευρυμένη Στατιστικά Λίστα: $NWB#settings-expanded_list_stats$NWE
    Ενεργοποίηση Areacode Εκστρατεία CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
    Ενεργοποίηση απομακρυσμένης παρακάμψεων Επέκταση γραφείο: $NWB#settings-did_ra_extensions_enabled$NWE
    Enable Contacts: $NWB#settings-contacts_enabled$NWE
    Πρώτη Trigger Είσοδος: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Προεπιλεγμένος κωδικός πρόσβασης Εγγραφή Τηλέφωνο: $NWB#settings-default_phone_registration_password$NWE     Δύναμη:
    Προεπιλογή Κωδικός Είσοδος Τηλέφωνο: $NWB#settings-default_phone_login_password$NWE     Δύναμη:
    Προεπιλεγμένος κωδικός πρόσβασης διακομιστή: $NWB#settings-default_server_password$NWE     Δύναμη:
    Slave διακομιστή βάσης δεδομένων: $NWB#settings-slave_db_server$NWE
    Εκθέσεις για την χρήση της DB Slave: $NWB#settings-reports_use_slave_db$NWE
    Είσοδος Dialplan συνήθειας: $NWB#settings-custom_dialplan_entry$NWE
    Ανανέωση Dialplan Στις Διακομιστές: $NWB#settings-reload_dialplan_on_servers$NWE
    Είσοδος Dialplan συνήθειας: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Απόκρυψη ετικετών στα αρχεία καταγραφής κλήσεων: $NWB#settings-label_hide_field_logs$NWE
    Τίτλος Ετικέτα: $NWB#settings-default_field_labels$NWE
    Ετικέτα Όνομα: $NWB#settings-default_field_labels$NWE
    Ετικέτα Μέση Αρχική: $NWB#settings-default_field_labels$NWE
    Ετικέτα Επώνυμο: $NWB#settings-default_field_labels$NWE
    Ετικέτα Διεύθυνση1: $NWB#settings-default_field_labels$NWE
    Ετικέτα Διεύθυνση2: $NWB#settings-default_field_labels$NWE
    Ετικέτα Address3: $NWB#settings-default_field_labels$NWE
    Ετικέτα Πόλη: $NWB#settings-default_field_labels$NWE
    Ετικέτα κράτος: $NWB#settings-default_field_labels$NWE
    Ετικέτα επαρχία: $NWB#settings-default_field_labels$NWE
    Ετικέτα Τ.Κ.: $NWB#settings-default_field_labels$NWE
    Ετικέτα κώδικα οδηγούν Προμηθευτή: $NWB#settings-default_field_labels$NWE
    Φύλο Ετικέτα: $NWB#settings-default_field_labels$NWE
    Ετικέτα Τηλέφωνο: $NWB#settings-default_field_labels$NWE
    Ετικέτα Κωδικός Τηλέφωνο: $NWB#settings-default_field_labels$NWE
    Ετικέτα Τηλέφωνο Alt: $NWB#settings-default_field_labels$NWE
    Ετικέτα Ασφάλειας Φράση: $NWB#settings-default_field_labels$NWE
    Αποστολή Ετικέτα: $NWB#settings-default_field_labels$NWE
    Σχόλια Ετικέτα: $NWB#settings-default_field_labels$NWE
    QC Χαρακτηριστικά Ενεργή:$NWB#settings-qc_features_active$NWE
    QC Τελευταία Τραβήξτε Ώρα: $qc_last_pull_time
    Προεπιλογή Codecs: $NWB#settings-default_codecs$NWE
    Προεπιλογή Webphone: $NWB#settings-default_webphone$NWE
    Εξωτερικός κεντρικός υπολογιστής IP προεπιλογής: $NWB#settings-default_external_server_ip$NWE
    Webphone URL: $NWB#settings-webphone_url$NWE
    Διαδικτυακό κοινόχρηστο τηλέφωνο Key System: $NWB#settings-webphone_systemkey$NWE
    Όχι-Απάντηση Σύνδεση: $NWB#settings-noanswer_log$NWE
    Σύνδεση DID, γραφείο: $NWB#settings-did_agent_log$NWE
    Alt-Σύνδεση διακομιστή DB: $NWB#settings-alt_log_server_ip$NWE
    Alt-Log DB Name: $NWB#settings-alt_log_server_ip$NWE
    Alt-Log DB Σύνδεση:$NWB#settings-alt_log_server_ip$NWE
    Alt-Log DB Κωδικός:$NWB#settings-alt_log_server_ip$NWE
    Alt-Πίνακες Σύνδεση: $NWB#settings-tables_use_alt_log_db$NWE
    Επιτρέψτε την αναγραφή QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
    QueueMetrics κεντρικός υπολογιστής IP: $NWB#settings-queuemetrics_server_ip$NWE
    QueueMetrics όνομα DB: $NWB#settings-queuemetrics_dbname$NWE
    QueueMetrics σύνδεση-έξω: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallΚατάσταση:$NWB#settings-queuemetrics_callstatus$NWE
    QueueMetrics Addmember Ενεργοποιήθηκε: $NWB#settings-queuemetrics_addmember_enabled$NWE
    QueueMetrics Κωδικός Παύση DISPO: $NWB#settings-queuemetrics_dispo_pause$NWE
    QueueMetrics Τηλέφωνο Περιβάλλοντος Τηλέφωνο Προσάρτηση: $NWB#settings-queuemetrics_pe_phone_append$NWE
    Ενεργοποίηση Vtiger Ένταξη: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Κάντε κλικ εδώ για να Συγχρονίστε χρήστες με Vtiger\n"; @@ -22512,7 +30098,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Κάντε κλικ εδώ για να δείτε Admin chages για τις ρυθμίσεις του συστήματος\n"; + echo "

    Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής to the system settings\n"; } } else @@ -22533,15 +30119,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_ανανέωσης=1; + } echo "
    \n"; echo ""; echo "
    \n"; echo "VICIDIAL ΘΕΣΕΙΣ ΜΕΣΑ ΣΕ ΑΥΤΟ ΤΟ ΣΥΣΤΗΜΑ:  $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -22558,8 +30161,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -22580,15 +30182,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -22616,14 +30216,16 @@ if ($ADD==321111111111111) echo "
    ΠΡΟΣΘΕΣΤΕ ΤΗ ΝΕΑ ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ
    \n"; echo "\n"; echo "Κατάσταση:   \n"; - echo "Περιγραφή:
    \n"; + echo "Περιγραφή:   \n"; echo "Επιλέξιμο:   \n"; - echo "Ανθρώπινα Απάντηση:   \n"; + echo "Ανθρώπινα Απάντηση:
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Κατηγορία:\n"; echo "
    ΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗSELECT-
    ABLE
    ΑΝΘΡΩΠΙΝΗ
    ΑΠΑΝΤΗΣΗ
    ΚΑΤΗΓΟΡΙΑMODIFY/DELETE
    S
    T
    A
    T
    U
    S
    ΠΕΡΙΓΡΑΦΗΚΑΤΗΓΟΡΙΑ
    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 "\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])) @@ -22599,15 +30208,6 @@ if ($ADD==321111111111111) { echo "ΔΙΑΓΡΑΦΗ\n"; } - - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
    \n"; echo ""; @@ -22695,7 +30302,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -22759,6 +30366,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_ανανέωσης_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_ανανέωσης=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -22847,7 +30459,7 @@ if ($ADD==550) echo "
    Επίπεδο Χρήστη:
    Ομάδα Χρήστη: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23204,6 +30820,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23228,6 +30845,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -23235,6 +30853,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -23243,7 +30863,7 @@ if ($ADD==100) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23251,7 +30871,7 @@ if ($ADD==100) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23184,6 +30799,7 @@ if ($ADD==10) echo "CAMPAIGN ID
    ΟΝΟΜΑ
    ACTIVE   GROUP   ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ  
    $row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -23283,7 +30903,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23310,7 +30930,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23319,7 +30938,7 @@ if ($ADD==1000) echo "
    ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗRTIMELEADS COUNT
    "; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -23347,6 +30967,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23365,18 +30986,20 @@ if ($ADD==1300) echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -23330,6 +30949,7 @@ if ($ADD==1000) echo "ΟΝΟΜΑΠΡΟΤΕΡΑΙΟΤΗΤΑΣΕΝΕΡΓΟΜέλη της ομάδας adminTIMECOLORΤΡΟΠΟΠΟΙΗΣΗ $row[1] $row[2] $row[3] $row[6] $row[4]  ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); - echo "
    Εισερχόμενα DID LISTINGS:\n"; + echo "
    INBOUND DID LISTINGS:\n"; echo "
    \n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23392,7 +31015,9 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23409,7 +31034,7 @@ if ($ADD==1500) echo "
    #DIDΠΕΡΙΓΡΑΦΗΕΝΕΡΓΟΜέλη της ομάδας adminROUTERECΤΡΟΠΟΠΟΙΗΣΗ
    $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -23434,6 +31060,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -23449,6 +31076,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -23460,6 +31088,72 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
    \n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -23418,6 +31043,7 @@ if ($ADD==1500) echo "
    MENU IDΟΝΟΜΑGROUPPROMPTTIMEOUTOPTIONS
    $menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
    \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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
    ΦΙΛΤΡΟ ΑΚΙΝΗΤΑ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ:\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=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    FPG IDFPG NAMEΠΕΡΙΓΡΑΦΗΜέλη της ομάδας adminPHONES COUNTΤΡΟΠΟΠΟΙΗΣΗ
    $row[0] $row[1] $row[2] $row[4] $row[3]ΤΡΟΠΟΠΟΙΗΣΗ
    $row[0] $row[1] $row[2] $row[4] $row[3]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23468,7 +31162,28 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23497,6 +31213,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23505,6 +31222,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23479,6 +31194,7 @@ if ($ADD==10000) echo "LINESΔΙΑΚΟΜΙΣΤΗΣ   CONF-EXTEN   GROUP   STATUS   CAMPAIGN   ΤΡΟΠΟΠΟΙΗΣΗ
    $row[4] $row[5] $row[6] $row[7]ΤΡΟΠΟΠΟΙΗΣΗ
    \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_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
    ΛΙΣΤΕΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    GROUPΤΗΛ.ΣΥΝΔΕΣΗRANK   RESTRICT   COUNT   LAST CALL   LAST ID   ΤΡΟΠΟΠΟΙΗΣΗ
    $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -23513,7 +31277,7 @@ if ($ADD==100000) echo "
    \n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -23552,7 +31316,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23575,6 +31340,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23591,7 +31357,7 @@ if ($ADD==10000000) echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -23562,6 +31326,7 @@ if ($ADD==1000000) echo "SCRIPT IDSCRIPT ΟΝΟΜΑACTIVE   Μέλη της ομάδας admin   ΤΡΟΠΟΠΟΙΗΣΗ
    $row[0] $row[1] $row[2] $row[3]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23612,6 +31379,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23628,7 +31396,10 @@ if ($ADD==100000000) echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -23600,6 +31366,7 @@ if ($ADD==10000000) echo "
    FILTER IDFILTER NAMEΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[0] $row[1] $row[2]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23653,6 +31425,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23668,7 +31441,7 @@ if ($ADD==1000000000) echo "
    \n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -23639,6 +31410,7 @@ if ($ADD==100000000) echo "CALLTIME ΟΝΟΜΑDEFAULT STARTDEFAULT STOPΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[1] $row[2] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23695,6 +31469,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23710,7 +31485,7 @@ if ($ADD==130000000) echo "
    \n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -23680,6 +31453,7 @@ if ($ADD==1000000000) echo "CALLTIME ΟΝΟΜΑDEFAULT STARTDEFAULT STOPΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[2] $row[3] $row[4] $row[5] ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23737,6 +31513,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23765,7 +31542,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -23779,6 +31556,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23797,7 +31575,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -23813,7 +31592,7 @@ if ($ADD==12000000000) echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -23722,6 +31497,7 @@ if ($ADD==130000000) echo "SHIFT STARTSHIFT ΜΗΚΟΣΚαθημερινάΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[2] $row[3] $row[4] $row[5] ΤΡΟΠΟΠΟΙΗΣΗ
    ΚΑΤΑΣΤΑΣΗΟΝΟΜΑVMAILGROUPΣΥΝΔΕΣΜΟΙ
    $row[5] $row[6] $row[7]$row[8]$row[8]$row[9]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23836,6 +31616,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23851,7 +31632,7 @@ if ($ADD==13000000000) echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23823,6 +31602,7 @@ if ($ADD==12000000000) echo "ALIAS IDΨευδώνυμοΤΗΛ. ΚΑΤΑΛΟΓΟΣ συνδέσειςGROUPΤΡΟΠΟΠΟΙΗΣΗ
    $row[0]$row[1]$row[2]$row[3]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23878,6 +31660,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23893,7 +31676,7 @@ if ($ADD==100000000000) echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23863,6 +31644,7 @@ if ($ADD==13000000000) echo "ΑΡΙΘΜΟΣ CIDCID ΟΝΟΜΑΕΝΕΡΓΟΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[2]$row[3]$row[4]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -23939,7 +31722,7 @@ if ($ADD==130000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23960,6 +31744,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23975,7 +31760,7 @@ if ($ADD==140000000000) echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); @@ -23948,6 +31731,7 @@ if ($ADD==130000000000) echo "
    Πρότυπο IDΌνομαΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[0]$row[1]$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24004,6 +31790,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24020,7 +31807,7 @@ if ($ADD==150000000000) echo "
    \n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -23988,6 +31773,7 @@ if ($ADD==140000000000) echo "ProtocolΕγγραφήΕνεργόΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[3]$row[4]$row[5]$row[6]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24048,7 +31837,9 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24065,7 +31856,7 @@ if ($ADD==160000000000) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24030,7 +31817,9 @@ if ($ADD==150000000000) echo "TTS IDTTS ΌνομαΕνεργόTTS φωνήTTS ΚείμενοΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[0]$row[1]$row[2]$row[4]$row[3]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24094,6 +31886,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24110,7 +31903,7 @@ if ($ADD==170000000000) echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -24076,6 +31867,7 @@ if ($ADD==160000000000) echo "MOH NameΕνεργόΤυχαία σειράΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[1]$row[2]$row[3]$row[4]ΤΡΟΠΟΠΟΙΗΣΗ
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24140,6 +31934,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24148,6 +31943,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -24123,6 +31916,7 @@ if ($ADD==170000000000) echo "Νέα ΜηνύματαΠαλαιά ΜηνύματαDeleteΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[3]$row[4]$row[5]$row[6]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + echo ""; + + $stmt="SELECT label_id,label_name,active,user_group from vicidial_screen_labels $whereLOGadmin_viewable_groupsSQL order by label_id"; + $rslt=mysql_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
    Ετικέτες οθόνης γραφείο:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    LABEL IDNameΕνεργόΜέλη της ομάδας adminΤΡΟΠΟΠΟΙΗΣΗ
    $row[0]$row[1]$row[2]$row[3]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24302,6 +32200,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24323,7 +32222,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    ΟΝΟΜΑΑριθμός ΓραφείουBU NameDepartmentGroupJob TitleLocationΤΡΟΠΟΠΟΙΗΣΗ
    $row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ΤΡΟΠΟΠΟΙΗΣΗ
    \n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -24248,7 +32145,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24262,6 +32159,7 @@ if ($ADD==700000000000000) echo "
    SECTIONTYPERECORD IDGROUPΠΕΡΙΓΡΑΦΗGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24387,6 +32287,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24405,73 +32306,90 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
    \n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -24332,7 +32231,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24346,6 +32245,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGROUPΠΕΡΙΓΡΑΦΗGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
    ADMIN CHANGE LOG: Τμήμα Εγγραφές - $category - $stage\n"; - echo "
    \n"; - echo ""; - echo ""; - echo ""; - 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) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDΠΕΡΙΓΡΑΦΗGOTO
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + $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 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    ADMIN CHANGE LOG: Τμήμα Εγγραφές - $category - $stage\n"; + echo "
    \n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $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')";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
    \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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDGROUPΠΕΡΙΓΡΑΦΗGOTO
    $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 "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; } - echo "


    \n"; - echo "\n"; - echo "
    \n"; } @@ -24481,53 +32399,66 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
    ADMIN CHANGE LOG: Εγγραφή Λεπτομέρειες - $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"; - $row[9] = eregi_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]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; - echo "\n"; - echo "
    \n"; + 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_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
    ADMIN CHANGE LOG: Εγγραφή Λεπτομέρειες - $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] = eregi_replace("',","' ,",$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: $row[11]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; + echo "\n"; + echo "
    \n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; } } @@ -24542,7 +32473,7 @@ if ($ADD==999999) 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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -24564,13 +32495,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -24582,54 +32519,104 @@ if ($ADD==999999)
          - Real-Time Εκθέσεις
    -
    - Inbound and Outbound Calling Εκθέσεις
    - \n"; + echo "
    \n"; + echo "      \n"; + echo "\n"; + echo "Agent Εκθέσεις
    \n"; + echo "
      \n"; + if ( (preg_match("/Agent Ωρα Λεπτομέρειες/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Agent Ωρα Λεπτομέρειες\n";} + if ( (preg_match("/Agent Status Λεπτομέρειες/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Agent Status Λεπτομέρειες\n";} + if ( (preg_match("/Agent Performance Λεπτομέρειες/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Agent Performance Λεπτομέρειες\n";} + if ( (preg_match("/Team Performance Λεπτομέρειες/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Team Performance Λεπτομέρειες\n";} + if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Single Agent Daily\n";} + if ( (preg_match("/Στατιστικά Χρήστη/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Στατιστικά Χρήστη\n";} + if ( (preg_match("/Χρήστης Ώρα Φύλλο/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Χρήστης Ώρα Φύλλο\n";} + echo "

    \n"; + echo "Time Clock Εκθέσεις
    \n"; + echo "
    \n"; + echo "Other Εκθέσεις and Links
    \n"; + echo "
      \n"; + if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Server Performance Report\n";} -
    -       - - Agent Εκθέσεις
    -
    - Time Clock Εκθέσεις
    -
    - Other Εκθέσεις and Links
    -
      -
    • Server Perforrmance Report - = 9) + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + {echo "
    • Maximum System Stats\n";} + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) ) { echo "
    • Administration Change Log\n"; } @@ -24641,58 +32628,117 @@ if ($ADD==999999) { echo "
    • VtigerCRM Home\n"; } - if ($list_update_count > 0) + if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) ) { echo "
    • List Update Stats\n"; } - ?> -
    -
    - - -
    
    -		
    -		 $o)
    +		if ($SScallcard_enabled > 0)
     			{
    -			$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";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			$o++;
    +			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) )
    +				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERΠΕΡΙΓΡΑΦΗIPACTLOADCHANDISKΕΞΕΡΧΟΜΕΝΟΕισερχόμενα
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Εκθέσεις Links/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$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;
    +			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";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				else
    +					{
    +					if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) )
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					else
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					}
    +				echo "\n";
    +				$o++;
    +				}
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +
    +				$stmt="SELECT NOW();";
    +				$rslt=mysql_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    ΔΙΑΚΟΜΙΣΤΗΣ -ΠΕΡΙΓΡΑΦΗIPACTLOADCHANDISKTIME
    ΔΙΑΚΟΜΙΣΤΗΣ +ΠΕΡΙΓΡΑΦΗIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      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 ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) ) + { + echo "

      Διαχειριστής Utilities\n"; + } + } } else { @@ -24700,6 +32746,463 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    + "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -186,12 +309,33 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; + + ### Log search + echo "
    \n"; + echo "
    "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
    + \n"; + echo "   \n"; + } +##### END admin links ##### + + +###################### +# ADD=999997 - user force change password page +###################### +if ($ADD==999997) + { + $show_form=1; + if ($stage=='ΕΠΙΒΕΒΑΙΩΣΗ') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='MODIFY', record_id='$user', event_code='USER FORCE Αλλαγή κωδικού πρόσβασης', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Κωδικός έχει ενημερωθεί, μπορείτε να συνεχίσετε τώρα\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    Αλλαγή κωδικού πρόσβασης\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Νέος κωδικός πρόσβασης:     Δύναμη:
    Είστε υποχρεωμένοι να αλλάξετε τον κωδικό σας για να μπορέσετε να συνεχίσετε με τη διοίκηση. Ένας ισχυρός κωδικός πρόσβασης έχει τόσο πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. Ο κωδικός πρόσβασής σας πρέπει να είναι από 2 έως 20 χαρακτήρες σε μήκος και δεν μπορεί να περιέχει χαρακτήρες που δεν είναι γράμματα ή αριθμούς. Να είστε βέβαιος ότι αυτός ο κωδικός είναι κάτι που μπορείτε να θυμηθείτε, επειδή μόλις κάνετε αυτή την αλλαγή θα σας ζητηθεί να εισάγετε το νέο κωδικό πρόσβασης για να συνδεθείτε ξανά με τη διοίκηση
    \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=='ΕΠΙΒΕΒΑΙΩΣΗ') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΧΡΗΣΤΕΣ', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Οι κωδικοί πρόσβασης έχουν ενημερωθεί, τώρα μπορείτε να συνεχίσετε σε Διοίκηση.

    Μπορεί να θέλετε να ξεκινήσετε από την ανάγνωση του εγχειριδίου ViciDial Manager που διατίθεται στο vicidial.org (υπάρχει μια δωρεάν έκδοση διατίθεται)\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    Καλώς ήλθατε στο ViciDial, αρχική οθόνη ρύθμισης

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Είστε υποχρεωμένοι να αλλάξετε τον κωδικό σας για να μπορέσετε να συνεχίσετε με τη διοίκηση. Ένας ισχυρός κωδικός πρόσβασης έχει τόσο πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. Ο κωδικός πρόσβασής σας πρέπει να είναι από 2 έως 20 χαρακτήρες σε μήκος και δεν μπορεί να περιέχει χαρακτήρες που δεν είναι γράμματα ή αριθμούς. Να είστε βέβαιος ότι αυτός ο κωδικός είναι κάτι που μπορείτε να θυμηθείτε, επειδή μόλις έχετε ολοκληρώσει αυτή την αρχική οθόνη εγκατάστασης θα σας ζητηθεί να εισάγετε το νέο κωδικό πρόσβασης ξανά για να συνδεθείτε ξανά με τη διοίκηση
    Νέος κωδικός πρόσβασης:     Δύναμη:
     
    Οι επόμενες τρεις προεπιλεγμένους κωδικούς που ορίζονται στην ενότητα Ρυθμίσεις του συστήματος, και μπορείτε να τα αλλάξετε μετά τον ορισμό τους εδώ. Είναι μια καλή ιδέα να κάνουν οι κωδικοί πρόσβασης ισχυρή, έτσι ώστε κανείς δεν μπορεί να παρεισφρύσει λογαριασμούς του τηλεφώνου σας και τις τηλεφωνικές κλήσεις πραγματοποιούνται χωρίς να το γνωρίζετε. Ο κωδικός εγγραφής προεπιλογή χρησιμοποιούνται όταν νέα τηλέφωνα προστεθούν στο σύστημα ως το SIP ή τον κωδικό πρόσβασης IAX τηλέφωνο VOIP. Το τηλέφωνο προεπιλεγμένο web κωδικό πρόσβασης χρησιμοποιείται όταν τα νέα κινητά τηλέφωνα προστίθεται στο σύστημα, με τον κωδικό του τηλεφώνου ότι ο αντιπρόσωπος θα χρησιμοποιήσετε στο γραφείο διασύνδεσης ViciDial. Ο κωδικός πρόσβασης προεπιλεγμένο διακομιστή που χρησιμοποιείται όταν οι νέοι διακομιστές προστεθούν στο σύστημα για διακομιστές να επικοινωνούν μεταξύ τους.
    Προεπιλεγμένος κωδικός πρόσβασης Εγγραφή Τηλέφωνο:     Δύναμη:
    Προεπιλογή Κωδικός Είσοδος Τηλέφωνο:     Δύναμη:
    Προεπιλεγμένος κωδικός πρόσβασης διακομιστή:     Δύναμη:
     
    Τα επόμενα δύο ρυθμίσεις επίσης ορίζεται στο τμήμα Ρυθμίσεις Συστήματος, και μπορείτε να τα αλλάξετε μετά τον ορισμό τους εδώ. Θα πρέπει να ορίσετε την προεπιλεγμένη τοπική ώρα GMT την ζώνη ώρας σας ότι οι πράκτορες θέλουν να είναι μέσα Η ζώνη Τηλεφωνητής είναι η λίστα των χρονικών ζωνών τηλεφωνητή ότι τα μηνύματα στον τηλεφωνητή θα είναι συνδεδεμένοι με το χρόνο, όταν έφυγε νέα μηνύματα.
    Προεπιλογή τοπική ώρα GMT: (Μην ρυθμίσεις για DST)$NWB#settings-default_local_gmt$NWE
    Προεπιλογή Ζώνη Τηλεφωνητής: $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 "
    Καλώς ήλθατε στο ViciDial: πνευματικά δικαιώματα, εμπορικό σήμα και άδεια σελίδα

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   Το Call Center της ViciDial Σουίτα συντηρείται από το ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" είναι σήμα κατατεθέν της ViciDial Group. Εδώ είναι ο δικός μας σήμα κατατεθέν της πολιτικής χρήσης
    License:   Το Call Center της ViciDial σουίτα διατίθεται κάτω από το AGPLv2 open source άδεια
    Source Code:   Το Κέντρο ViciDial Σουίτα Call λογισμικό είναι διαθέσιμο για download, και για τη χρήση, χωρίς κόστος. Μπορείτε να κατεβάσετε το εύκολο στην εγκατάσταση ViciBox CD ISO έκδοση, ή μόνο η πηγαίο κώδικα
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Συνεχίστε με την αρχική εγκατάσταση

      \n"; + } + } +##### END copyright trademark license page ##### + + +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: κρυφή σελίδα κοινής ωφελείας - Αν δεν ξέρετε τι κάνουν αυτά τα προγράμματα, τότε μάλλον δεν πρέπει να τους χρησιμοποιήσετε

    \n"; + echo "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$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 Λεπτομέρειες/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $campaign_name = $rowx[0]; + } + else + {echo "Not found"; exit;} + } + + echo "
    Administration: Maximum Stats Λεπτομέρειες for $stage $modify_link$campaign_id
    - $campaign_name   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα";} + + 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + echo "
    \n"; @@ -24713,24 +33216,127 @@ echo "
    \n"; echo "

    "; echo "ΕΚΔΟΣΗ: $admin_version
    "; -echo "ΔΗΜΙΟΥΡΓΙΑ: $build
    \n"; - +echo "ΔΗΜΙΟΥΡΓΙΑ: $build\n"; +if (!preg_match("/_ΔΗΜΙΟΥΡΓΙΑ_/",$SShosted_settings)) + {echo "
    © 2012 ViciDial Group
    ";} +echo "\n"; ?>
    - - 1) and ($modify_footer_ανανέωσης > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_ανανέωσης > 1) and ($modify_footer_ανανέωσης > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Υπάρχουν $complete_leads ολοκληρώθηκε οδηγεί σε αυτές τις λίστες\n";} + } + else + { + echo "καμία θέση πινάκων που επιλέγεται για αυτήν την εκστρατεία\n"; + } + } + else + { + echo "δεν έχουν επιλεχθεί ενεργές λίστες για την εκστρατεία\n"; + } + } +else + { + echo "δεν έχουν επιλεχθεί ενεργές λίστες για την εκστρατεία\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -25053,7 +33659,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -25065,8 +33677,11 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; - echo "Αυτή η εκστρατεία έχει$active_leads οδηγοί που καλούντε στις λίστες\n"; + if ($DB > 0) {echo "|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {echo "Αυτή η εκστρατεία έχει$active_leads οδηγοί που καλούντε στις λίστες\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_campaign_multi_alt.php new file mode 100644 index 00000000..a82c2a24 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ΔΙΟΙΚΗΣΗ: Εκστρατεία Multi-Alt-Εκκινήσεις +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Αυτή η καμπάνια δεν έχει οριστεί σε Αυτόματη-Alt-Dial MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_ΕΠΙΒΕΒΑΙΩΣΗ") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-μολύβδου Ρυθμίσεις κλήσης Αυτόματη Alt Έντυπο<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_ΕΠΙΒΕΒΑΙΩΣΗ>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS ΕΚΣΤΡΑΤΕΙΑ: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>ΚΛΗΘΕΝΤΑ</td><td>ΜΗ ΚΛΗΘΕΝΤΑ</td><td>SELECTED</td><td>OLD RANK</td><td>NEW RANK</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>ΥΠΟΣΥΝΟΛΑ</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>ΣΥΝΟΛΙΚΑ</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Παραγγελία Λίστα Τυχαία: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Παραγγελία Λίστα Δευτεροβάθμια: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Έκδοση: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_header.php index fbebee79..48802b02 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,25 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -27,15 +46,23 @@ if($short_header) ?> <TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR> <TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22>   </TD> + <?php if ($reports_only_user < 1) { + ?> <TD>   <A HREF="admin.php" ALT="Χρήστες"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Χρήστες</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10" ALT="Εκστρατείες"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Εκστρατείες</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100" ALT="Λίστες"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Λίστες</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=1000000" ALT="Βοηθοί"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Βοηθοί</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000000" ALT="Φίλτρα"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Φίλτρα</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=1000" ALT="Εισ-Ομάδες"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Εισ-Ομάδες</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=1000" ALT="Inbound"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Inbound</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100000" ALT="Ομάδες Χρήστη"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Ομάδες Χρήστη</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000" ALT="Απομακρυσμένοι Χειριστές"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Απομακρυσμένοι Χειριστές</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=10000000000" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=999998" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <?php + } + else + { ?> + <TD width=600>     </TD> + <?php } ?> <TD>   <A HREF="admin.php?ADD=999999" ALT="Εκθέσεις"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Εκθέσεις</B></A>   </TD> </TR> </TABLE> @@ -319,41 +346,99 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_ανανέωσης > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_ανανέωσης;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("ανανέωσης_countdown").innerHTML = "<font color=black> screen ανανέωσης in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_ανανέωσης_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -519,22 +604,47 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) ) } + + +### Javascript for shift end-time calculation and display +if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) + { + ?> + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + <?php + } + + +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -546,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -558,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -570,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -622,13 +732,17 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 if (selected_route=='INGROUP') { if (value_context.length < 10) - {value_context = 'CID,LB,998,TESTCAMP,1';} - var value_context_split = value_context.split(","); - var IGhandle_method = value_context_split[0]; - var IGsearch_method = value_context_split[1]; - var IGlist_id = value_context_split[2]; - var IGcampaign_id = value_context_split[3]; - var IGphone_code = value_context_split[4]; + {value_context = 'CID,LB,998,TESTCAMP,1,,,,';} + var value_context_split = value_context.split(","); + var IGhandle_method = value_context_split[0]; + var IGsearch_method = value_context_split[1]; + var IGlist_id = value_context_split[2]; + var IGcampaign_id = value_context_split[3]; + var IGphone_code = value_context_split[4]; + var IGvid_enter_filename = value_context_split[5]; + var IGvid_id_number_filename = value_context_split[6]; + var IGvid_confirm_filename = value_context_split[7]; + var IGvid_validate_digits = value_context_split[8]; if (route == selected_route) { @@ -640,14 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Χειριστείτε Μέθοδος: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 Border=0 ALT="ΒΟΗΘΕΙΑ" ALIGN=TOP></a>'; + new_content = new_content + '<BR>Μέθοδος Αναζήτηση: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID Λίστας: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID Εκστρατείας: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + new_content = new_content + "<BR>   VID εισάγει το όνομα αρχείου: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   Όνομα αρχείου αριθμού ταυτότητας VID: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID επιβεβαιώνει το όνομα αρχείου: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   VID ψηφία: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -667,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "αρχείου ήχου: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -782,14 +901,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -799,14 +922,19 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Χειριστείτε Μέθοδος: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Μέθοδος Αναζήτηση: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID Λίστας: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID Εκστρατείας: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + // new_content = new_content + "<BR>   VID εισάγει το όνομα αρχείου: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   Όνομα αρχείου αριθμού ταυτότητας VID: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID επιβεβαιώνει το όνομα αρχείου: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   VID ψηφία: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + } if (selected_route=='DID') { @@ -826,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "αρχείου ήχου: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,15 +1020,46 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_ανανέωσης > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_ανανέωσης_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_el/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Ελληνικά <img src=\"../agc/images/el.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?> <CENTER> @@ -911,6 +1070,8 @@ $SSenable_tts_integration = $row[1]; <IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="VICIDIAL logo"> <B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR> <TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160> + <?php if ($reports_only_user < 1) { + ?> <!-- ΧΡΗΣΤΕΣ NAVIGATION --> <TR WIDTH=160><TD <?php echo $users_hh ?> WIDTH=160> <a href="<?php echo $ADMIN ?>?ADD=0"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $users_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $users_bold ?>Χρήστες</a> @@ -966,6 +1127,10 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -989,31 +1154,56 @@ $SSenable_tts_integration = $row[1]; ?> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Παύση Κώδικες</a></TD> - <?php } + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>> Προεπιλογές </a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- ΛΙΣΤΕΣ NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { ?> <TR><TD ALIGN=LEFT <?php echo $lists_hh ?>><a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $lists_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $lists_bold ?>Λίστες</a></TD></TR> <?php - if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Προσθήκη-Διαγραφή Αριθμός Από DNC';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Προσθήκη-Διαγραφή DNC Αριθμός';} + else {$DNClink = 'Προσθήκη DNC Αριθμός';} ?> - <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Παρουσιάστε καταλόγους </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε έναν νέο κατάλογο </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Αναζήτηση ενός μολύβδου </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./new_listloader_superL.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Νέοι μόλυβδοι φορτίων </a> - </TD></TR> - <?php } + <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Παρουσιάστε καταλόγους </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε έναν νέο κατάλογο </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Αναζήτηση ενός μολύβδου </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε μια νέα πρωτοβουλία πρωτοποριακής </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Νέοι μόλυβδοι φορτίων </a> + <?php + if ($SScustom_fields_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Λίστα προσαρμοσμένων πεδίων </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Αντιγραφή προσαρμοσμένων πεδίων </a> + <?php + } + ?> + </TD></TR> + <?php + } } ?> <!-- ΒΟΗΘΟΙ NAVIGATION --> @@ -1051,30 +1241,50 @@ $SSenable_tts_integration = $row[1]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> $$$-ΟΜΑΔΕΣ </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?>  εισερχόμενος</a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Προσθήκη-Διαγραφή Αριθμός FPG';} + else {$FPGlink = 'Προσθήκη της FPG Αριθμός';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Παρουσιάστε-ΟΜΑΔΕΣ </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε μια νέα-ΟΜΑΔΑ </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> $$$-ΟΜΑΔΑ αντιγράφων </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> $$$-ΟΜΑΔΑ αντιγράφων </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Δείτε DIDs </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προστίθεται ένα νέο DID </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> ΑντιγραφήDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> ΑντιγραφήDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Δείτε Καλέστε Menus </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε μια νέα κλήση Μενού </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Αντιγραφή Call Μενού </a> + <HR> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Φίλτρο Ομάδες Τηλέφωνο </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθήκη φίλτρου Ομίλου Τηλ. </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> <?php } ?> @@ -1109,12 +1319,16 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Παρουσιάστε μακρινούς πράκτορες </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε τους νέους μακρινούς πράκτορες </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Ομάδες επέκτασης </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε την ομάδα επέκτασης </a> </TD></TR> <?php } ?> <!-- ADMIN NAVIGATION --> <TR><TD <?php echo $admin_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> + <a href="<?php echo $ADMIN ?>?ADD=999998"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> </TD></TR> <?php if (strlen($admin_hh) > 1) @@ -1135,6 +1349,8 @@ $SSenable_tts_integration = $row[1]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1145,6 +1361,10 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1164,6 +1384,8 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Διασκέψεις </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> Τοποθετήσεις συστημάτων </a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Ετικέτες οθόνης </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>>Θέσεις συστημάτων</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1186,7 +1408,23 @@ $SSenable_tts_integration = $row[1]; </TR> <?php } + if ($SScallcard_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cc_sh ?>>   + <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cc_fc ?> SIZE=<?php echo $header_font_size ?>> CallCard Admin </a></TD> + </TR> + + <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } + } ?> <!-- ΑΝΑΦΟΡΕΣ NAVIGATION --> <TR><TD <?php echo $reports_hh ?>> @@ -1202,7 +1440,7 @@ $SSenable_tts_integration = $row[1]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>ΣΠΙΤΙ</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Ώρα ρολόι</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Αποσύνδεση</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>ΣΠΙΤΙ</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Ώρα ρολόι</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Αποσύνδεση</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1245,12 +1483,16 @@ $SSenable_tts_integration = $row[1]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Αντιγράψτε έναν μεταφορέα </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Δείτε TTS Καταχωρήσεις </a>   |   <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε ένα νέο TTS Έναρξη </a></TD></TR> <?php } + if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { + ?> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Το CallCard παράγει τους νέους αριθμούς </a></TD></TR> + <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Δείτε ΜΟΗ Καταχωρήσεις </a>   |   <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέστε ένα νέο MOH Έναρξη </a></TD></TR> @@ -1263,6 +1505,14 @@ $SSenable_tts_integration = $row[1]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Τοποθετήσεις συστημάτων </a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ετικέτες οθόνης </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθέσετε μια ετικέτα οθόνης </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Προσθήκη μιας επαφής </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Θέσεις συστημάτων</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Κατηγορίες θέσης</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>QC κωδικοί</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..56fd91ee --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"ΒΟΗΘΕΙΑ\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- ΕΚΔΟΣΗ: $version ΔΗΜΙΟΥΡΓΙΑ: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Κατάσταση αρχείου:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Εισαγωγή οδηγών από αυτό το αρχείο:
    ID Λίστας Override: + +
    Μήκη Override: + +
    Μορφή αρχείων για χρήση:Standard Format    Εμφάνιση συνήθειας    Custom Template
    Προσαρμοσμένη πρότυπο που θα χρησιμοποιηθεί: οικοδόμος πρότυπο
    Διπλός έλεγχος μολύβδου:
    USA-Canada Check:
    Συμβούλευση ζώνης χρονικής ανοχής:
            
            ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ         Old Lead Loader     LIST LOADER 4th Gen-     ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID Λίστας Override:
    Μήκη Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Επεξεργασίαfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Επεξεργασία$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Επεξεργασία$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Επεξεργασία$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ΣτήληΑρχεία δεδομένων
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Κυριακή March to First Κυριακή November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Κυριακή March to First Κυριακή November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Κυριακή, to 6=Σάββατο) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Κυριακή April to Last Κυριακή October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in April and last Κυριακή in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Κυριακή March to Last Κυριακή October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in March and last Κυριακή in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Κυριακή October to Last Κυριακή March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in October and last Κυριακή in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Κυριακή October to Last Κυριακή March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and last Κυριακή in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Κυριακή in October to First Κυριακή in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and first Κυριακή in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Κυριακή October to Third Κυριακή March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and third Κυριακή in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Κυριακή in September to First Κυριακή in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in September and first Κυριακή in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Κυριακή October to Last Κυριακή February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Κυριακή October to Last Κυριακή February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_third_gen.php new file mode 100644 index 00000000..271e03db --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"ΒΟΗΘΕΙΑ\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Εισαγωγή οδηγών από αυτό το αρχείο:
    ID Λίστας Override: + +
    Μήκη Override: + +
    Μορφή αρχείων για χρήση:Standard Format    Εμφάνιση συνήθειας
    Διπλός έλεγχος μολύβδου:
    USA-Canada Check:
    Συμβούλευση ζώνης χρονικής ανοχής:
            
            ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ         Old Lead Loader     LIST LOADER 3rd Gen-     ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID Λίστας Override:
    Μήκη Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Επεξεργασίαfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Επεξεργασία$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER AREACODE"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Επεξεργασία$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ΣτήληΑρχεία δεδομένων
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Κυριακή March to First Κυριακή November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Κυριακή March to First Κυριακή November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Κυριακή, to 6=Σάββατο) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Κυριακή April to Last Κυριακή October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in April and last Κυριακή in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Κυριακή March to Last Κυριακή October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in March and last Κυριακή in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Κυριακή October to Last Κυριακή March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in October and last Κυριακή in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Κυριακή October to Last Κυριακή March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and last Κυριακή in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Κυριακή in October to First Κυριακή in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and first Κυριακή in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Κυριακή October to Third Κυριακή March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Κυριακή in October and third Κυριακή in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Κυριακή in September to First Κυριακή in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Κυριακή in September and first Κυριακή in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Κυριακή October to Last Κυριακή February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Κυριακή October to Last Κυριακή February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # τοπικός χρόνος calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_lists_custom.php new file mode 100644 index 00000000..41917540 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Τομέας συνήθειας καταλόγωνs +<?php + +################################################################################ +##### BEGIN help section +if ($action == "ΒΟΗΘΕΙΑ") + { + ?> + + + +
    +
    +
    + ViciDial Τομέας συνήθειας καταλόγωνs Help +

    + + +
    + Ετικέτα τομέων - Αυτό είναι το προσδιοριστικό τομέων βάσεων δεδομένων για αυτόν τον τομέα. Αυτό πρέπει να είναι ένα μοναδικό προσδιοριστικό μέσα στους τομείς συνήθειας για αυτόν τον κατάλογο. Μην χρησιμοποιήστε οποιαδήποτε διαστήματα ή στίξη για αυτόν τον τομέα. ανώτατοι 50 χαρακτήρες, ελάχιστο 2 χαρακτήρων. Μπορείτε επίσης να συμπεριλάβετε τα προεπιλεγμένα ViciDial πεδία σε μια προσαρμοσμένη ρύθμιση στον τομέα, και θα δείτε τους σε κόκκινο χρώμα στη λίστα. Αυτά τα πεδία δεν θα προστεθεί στην προσαρμοσμένη λίστα πίνακα της βάσης δεδομένων, η διεπαφή θα πράκτορα αναφοράς αντί του πίνακα vicidial_list άμεσα. Οι ετικέτες που μπορείτε να χρησιμοποιήσετε για να συμπεριλάβετε τις fieds προεπιλογή είναι - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Όνομα τομέων - Αυτό είναι το όνομα του τομέα δεδομένου ότι θα εμφανιστεί σε έναν πράκτορα μέσω της διεπαφής τους. Μπορείτε να χρησιμοποιήσετε το διάστημα σε αυτόν τον τομέα, αλλά κανέναν χαρακτήρα στίξης, το μέγιστο 50 χαρακτήρων και το ελάχιστο 2 χαρακτήρων. +

    + +
    +
    + Περιγραφή τομέων - Η περιγραφή αυτού του τομέα δεδομένου ότι θα εμφανιστεί στη διεπαφή διοίκησης. Αυτό είναι ένας προαιρετικός τομέας με ένα μέγιστο 100 χαρακτήρων. +

    + +
    +
    + Τάξη τομέων - Η διαταγή στην οποία αυτοί οι τομείς επιδεικνύονται στον πράκτορα από χαμηλότερο στην κορυφή σε υψηλότερο στο κατώτατο σημείο. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Βοήθεια τομέων - Ο προαιρετικός τομέας, εάν το συμπληρώσετε, ο πράκτορας θα είναι σε θέση να δει αυτό το κείμενο όταν χτυπούν σε μια σύνδεση βοήθειας δίπλα στον τομέα στη διεπαφή πρακτόρων τους. +

    + +
    +
    + Τύπος τομέων - Αυτή η επιλογή καθορίζει τον τύπο τομέα που θα επιδειχθεί. Το ΚΕΙΜΕΝΟ είναι μια τυποποιημένη μονής γραμμής αίτηση συμμετοχής, η ΠΕΡΙΟΧΗ είναι ένα πολλαπλών γραμμών παράθυρο κειμένου, ΕΠΙΛΕΚΤΕΣ είναι pull-down ενιαίος-επιλογής επιλογές, ΠΟΛΥ είναι ένα πολλαπλάσιος-επίλεκτο παράθυρο, το ΡΑΔΙΟΦΩΝΟ είναι ένας κατάλογος ραδιο κουμπιών όπου μόνο μια επιλογή μπορεί να επιλεχτεί, το ΤΕΤΡΑΓΩΝΙΔΙΟ είναι ένας κατάλογος τετραγωνιδίων όπου οι πολλαπλάσιες επιλογές μπορούν να επιλεχτούν, η ΗΜΕΡΟΜΗΝΙΑ είναι ένα ημερολόγιο ημέρας μήνα έτους υπερεμφανιζόμενο όπου ο πράκτορας μπορεί να επιλέξει την ημερομηνία και ο ΧΡΟΝΟΣ είναι ένα παράθυρο χρονικής επιλογής. Η προεπιλογή είναι ΚΕΙΜΕΝΟ. Για τις ΕΠΙΛΕΚΤΕΣ, ΠΟΛΥ, ΡΑΔΙΟ και επιλογές ΤΕΤΡΑΓΩΝΙΔΙΟΥ πρέπει να καθορίσετε τις τιμές επιλογής κατωτέρω στο κιβώτιο επιλογών τομέων. Η ΕΠΙΔΕΙΞΗ θα επιδείξει μόνο και δεν θα επιτρέψει την τροποποίηση από τον πράκτορα. SCRIPT θα εμφανίσει μόνο, αλλά μπορείτε να χρησιμοποιήσετε μεταβλητές σενάριο ακριβώς όπως στο χαρακτηριστικό Βοηθοί. SCRIPT πεδία θα εμφανιστεί μόνο το περιεχόμενο των επιλογών, και όχι το όνομα του πεδίου, όπως τον τύπο οθόνης κάνει. HIDDEN δεν θα δείξει στον πράκτορα του πεδίου, αλλά θα επιτρέψει στον τομέα να έχουν τα δεδομένα που εισάγονται σε αυτήν και την εξαγωγή από αυτήν, καθώς και το έχουν διαθέσιμο στην καρτέλα σενάριο και τη διεύθυνση ιστού μορφή. Μόνο για ανάγνωση, θα εμφανιστεί η αξία των δεδομένων στον τομέα, αλλά δεν θα επιτρέπουν στον πράκτορα να αλλάξει τα δεδομένα. ΑΠΟΚΡΥΨΗBLOB είναι παρόμοια με ΒΡΕΣ εκτός από τον τύπο αποθήκευσης των δεδομένων στη βάση δεδομένων είναι ένας τύπος BLOB, κατάλληλο για δυαδικά δεδομένα ή δεδομένα που πρέπει να εξασφαλίζονται. +

    + +
    +
    + Επιλογές τομέων - Για τους τύπους ΕΠΙΛΕΚΤΩΝ, ΠΟΛΥ, ΡΑΔΙΟ και τομέων ΤΕΤΡΑΓΩΝΙΔΙΟΥ, πρέπει να καθορίσετε τις τιμές επιλογής σε αυτό το παράθυρο. Πρέπει να βάλετε έναν κατάλογο χωρισμένων κόμμα ετικέτας επιλογής και κειμένου επιλογής εδώ με κάθε επιλογή ένα η γραμμή της. Η πρώτη αξία δεν πρέπει να έχει κανένα διάστημα σε το, και καμία τιμή δεν πρέπει να έχει οποιαδήποτε στίξη. Παραδείγματος χάριν - electric_meter, ηλεκτρικός μετρητής +

    + +
    +
    + Θέση επιλογής - Για το ΤΕΤΡΑΓΩΝΙΔΙΟ και τους ΡΑΔΙΟ τύπους τομέων μόνο, εάν θέστε ΟΡΙΖΟΝΤΙΟΣ οι επιλογές θα εμφανιστούν στην ίδια γραμμή που τυλίγει ενδεχομένως στη γραμμή κατωτέρω εάν υπάρχουν πολλές επιλογές. Εάν θέστε την ΚΑΤΑΚΟΡΥΦΟ θα υπάρξει μόνο μια επιλογή ανά γραμμή. Η προεπιλογή είναι ΟΡΙΖΟΝΤΙΑ. +

    + +
    +
    + Μέγεθος τομέων - Αυτή η ρύθμιση θα σημάνει τα διαφορετικά πράγματα ανάλογα με αυτό που ο τύπος τομέων είναι. Για τους τομείς ΚΕΙΜΕΝΩΝ, το μέγεθος είναι ο αριθμός χαρακτήρων που θα παρουσιάσει στον τομέα. Για τους τομείς ΠΕΡΙΟΧΗΣ, το μέγεθος είναι το πλάτος του παραθύρου κειμένου στους χαρακτήρες. Για τους ΠΟΛΥ τομείς, αυτή η ρύθμιση καθορίζει τον αριθμό επιλογών που παρουσιάζονται στον πολυ επίλεκτο κατάλογο. Για το ΕΠΙΛΕΚΤΟΥΣ, ΡΑΔΙΟ, ΤΕΤΡΑΓΩΝΙΔΙΟ, την ΗΜΕΡΟΜΗΝΙΑ και το ΧΡΟΝΟ αυτή η ρύθμιση αγνοείται. +

    + +
    +
    + Τομέας ανώτατος - Αυτή η ρύθμιση θα σημάνει τα διαφορετικά πράγματα ανάλογα με αυτό που ο τύπος τομέων είναι. Για τους ΚΡΥΜΜΕΝΟ και ΜΟΝΟ ΑΝΆΓΝΩΣΗΣ τομείς ΚΕΙΜΕΝΩΝ, το μέγεθος είναι ο μέγιστος αριθμός χαρακτήρων που επιτρέπονται στον τομέα. Για τους τομείς ΠΕΡΙΟΧΗΣ, αυτός ο τομέας καθορίζει τον αριθμό σειρών του κειμένου ορατών στο παράθυρο κειμένου. Για ΠΟΛΥ, ΕΠΙΛΕΚΤΟΣ, ΡΑΔΙΟ, το ΤΕΤΡΑΓΩΝΙΔΙΟ, την ΗΜΕΡΟΜΗΝΙΑ και το ΧΡΟΝΟ αυτή η ρύθμιση αγνοείται. +

    + +
    +
    + Προεπιλογή τομέων - Αυτός ο προαιρετικός τομέας σας αφήνει να καθορίσετε ποια αξία για να ορίσει σε έναν τομέα εάν τίποτα δεν φορτώνεται σε εκείνο τον τομέα. Η προεπιλογή είναι ΜΗΔΕΝΙΚΗ που θέτει εκτός λειτουργίας τη λειτουργία προεπιλογής. Για τους τύπους τομέων ΗΜΕΡΟΜΗΝΙΑΣ, η προεπιλογή είναι έθεσε πάντα σήμερα εκτός αν ένας αριθμός υποβάλλεται οπότε σ'αυτή την περίπτωση η ημερομηνία θα είναι ότι πολλές ημέρες συν ή μείον σήμερα. Για τους τύπους ΧΡΟΝΙΚΩΝ τομέων, η προεπιλογή είναι έθεσε πάντα τον τρέχοντα χρόνο κεντρικών υπολογιστών εκτός αν ένας αριθμός υποβάλλεται οπότε σ'αυτή την περίπτωση ο χρόνος θα είναι ότι πολλά πρακτικά συν ή μείον τον τρέχοντα χρόνο. +

    + +
    +
    + Κόστος τομέων - Αυτό διάβασε ότι μόνο ο τομέας σας λέει τι το κόστος αυτού του τομέα είναι στον πίνακα τομέων συνήθειας για αυτόν τον κατάλογο. Δεν υπάρχει κανένα σκληρό όριο για τον αριθμό τομέων συνήθειας που μπορείτε να έχετε σε έναν κατάλογο, αλλά το σύνολο του κόστους όλων των τομέων για τον κατάλογο πρέπει να είναι κάτω από 65000. Αυτό επιτρέπει χαρακτηριστικά τις εκατοντάδες των τομέων, αλλά εάν διευκρινίζετε διάφοροι τομείς ΚΕΙΜΕΝΩΝ που είναι εκατοντάδες ή χιλιάδες χαρακτήρες στο μήκος έπειτα εσείς μπορούν να χτυπήσουν αυτό το όριο γρήγορα. Εάν χρειάζεστε ότι πολύ κείμενο σε έναν τομέα που πρέπει να επιλέξετε έναν τύπο ΠΕΡΙΟΧΗΣ, τα οποία αποθηκεύονται διαφορετικά και δεν χρησιμοποιούν τόσο επιτραπέζιο διάστημα. +

    + +
    +
    + Τομέας που απαιτείται - Εάν θέστε το Υ, αυτός ο τομέας θα αναγκάσει τον πράκτορα για να εισαγάγει το κείμενο ή να επιλέξει μια επιλογή για αυτόν τον τομέα. Η προεπιλογή είναι Ν. +

    + +
    +
    + Θέση ονόματος τομέων - Εάν θέστε ΑΡΙΣΤΕΡΑ, αυτό το όνομα τομέων θα εμφανιστεί αριστερά του τομέα, εάν θέστε για ΝΑ ΟΛΟΚΛΗΡΩΣΕΤΕ το όνομα τομέων θα λάβει την ολόκληρη γραμμή και θα εμφανιστεί επάνω από τον τομέα. Η προεπιλογή ΑΦΗΝΕΤΑΙ. +

    + +
    +
    + Επιλογή αντιγράφων - Κατά αντιγραφή των ορισμών τομέων από έναν κατάλογο σε άλλος, την έχετε μερικές επιλογές για το πώς η διαδικασία αντιγραφής λειτουργεί. ΕΠΙΣΥΝΑΨΤΕ θα προσθέσει τους τομείς που δεν είναι παρόντες στον κατάλογο προορισμού, εάν υπάρχουν ετικέτες τομέων ταιριάσματος εκείνοι παραμένοντας άθικτοι, κανένα στοιχείο τομέων συνήθειας δεν θα διαγραφεί ή θα τροποποιηθεί χρησιμοποιώντας αυτήν την επιλογή. Η ΑΝΑΠΡΟΣΑΡΜΟΓΗ θα ενημερώσει τους κοινούς τομείς field_label στον κατάλογο προορισμού στους ορισμούς τομέων από τον κατάλογο πηγής. τα στοιχεία τομέων συνήθειας μπορούν να τροποποιηθούν ή να χαθούν χρησιμοποιώντας αυτήν την επιλογή. ΑΝΤΙΚΑΤΑΣΤΗΣΤΕ θα αφαιρέσει όλους τους υπάρχοντες τομείς συνήθειας στον κατάλογο προορισμού και θα τους αντικαταστήσει με τους τομείς συνήθειας από τον κατάλογο πηγής, όλα τα στοιχεία τομέων συνήθειας θα διαγραφούν χρησιμοποιώντας αυτήν την επιλογή. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "ΛΑΘΟΣ: Οι τομείς συνήθειας δεν είναι ενεργοί σε αυτό το σύστημα\n"; + exit; + } + + +$NWB = "   \"ΒΟΗΘΕΙΑ\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Τομείς αντιγράφων σε έναν άλλο κατάλογο
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Κατάλογος ταυτότητα στους τομείς αντιγράφων από:
    Κατάλογος ταυτότητα στους τομείς αντιγράφων:
    Επιλογή αντιγράφων: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_ΕΠΙΒΕΒΑΙΩΣΗ") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "ΛΑΘΟΣ: Δεν μπορείτε να αντιγράψετε τους τομείς στον ίδιο κατάλογο: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "ΛΑΘΟΣ: Ο κατάλογος πηγής δεν έχει κανέναν τομέα συνήθειας\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας που διαγράφεται - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας προστιθέμενος - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "ΛΑΘΟΣ: Ο πίνακας δεν υπάρχει custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας τροποποιημένος - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ΛΑΘΟΣ: Ο τομέας δεν υπάρχει\n
    ";} + else + { + if ($table_exists < 1) + {echo "ΛΑΘΟΣ: Ο πίνακας δεν υπάρχει custom_$list_id\n
    ";} + else + { + echo "

    ΧΤΥΠΗΣΤΕ ΕΔΩ ΓΙΑ ΝΑ ΕΠΙΒΕΒΑΙΩΣΕΤΕ ΤΗ ΔΙΑΓΡΑΦΗ ΑΥΤΟΥ ΤΟΥ ΤΟΜΕΑ ΣΥΝΗΘΕΙΑΣ: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ΛΑΘΟΣ: Ο τομέας δεν υπάρχει\n
    ";} + else + { + if ($table_exists < 1) + {echo "ΛΑΘΟΣ: Ο πίνακας δεν υπάρχει custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας που διαγράφεται - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "ΣΦΑΛΜΑ: Δεν μπορείτε να χρησιμοποιήσετε δεσμευμένες λέξεις για τις ετικέτες τομέα - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Θα πρέπει να εισάγετε τις επιλογές τομέα όταν η προσθήκη ενός SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "ΛΑΘΟΣ: Ο τομέας υπάρχει ήδη για αυτόν τον κατάλογο - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας προστιθέμενος - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_ΕΠΙΒΕΒΑΙΩΣΗ") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ΛΑΘΟΣ: Ο τομέας δεν υπάρχει\n
    ";} + else + { + if ($table_exists < 1) + {echo "ΛΑΘΟΣ: Ο πίνακας δεν υπάρχει\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Θα πρέπει να εισάγετε τις επιλογές τομέα κατά την ενημέρωση ενός SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας τροποποιημένος - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    Modifyπροσαρμοσμένου πεδίουs: ID Λίστας $list_id         "; + echo "Αρχεία σε αυτόν τον πίνακα συνήθειας: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### ΠΕΡΙΛΗΨΗ ΤΩΝ ΤΟΜΕΩΝ ### + echo "
    ΠΕΡΙΛΗΨΗ ΤΩΝ ΤΟΜΕΩΝ:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Υπάρχουν no custom fields for this list
    TOTALS: $o             $total_cost    


    \n"; + + + ### ΠΑΡΑΔΕΙΓΜΑ ΤΗΣ ΜΟΡΦΗΣ ΣΥΝΗΘΕΙΑΣ ### + echo "\n"; + echo "
    ΠΑΡΑΔΕΙΓΜΑ ΤΗΣ ΜΟΡΦΗΣ ΣΥΝΗΘΕΙΑΣ:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Υπάρχουν no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='ΑΠΟΚΡΥΨΗBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΟΥΣ ΤΟΜΕΙΣ ### + echo "
    ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΟΥΣ ΥΠΑΡΧΟΝΤΕΣ ΤΟΜΕΙΣ:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Ετικέτα τομέων $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Τάξη τομέων $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Όνομα τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Θέση ονόματος τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Περιγραφή τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Βοήθεια τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Τύπος τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Επιλογές τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Θέση επιλογής $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Μέγεθος τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Τομέας ανώτατος $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Προεπιλογή τομέων $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Τομέας που απαιτείται $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    ΠΡΟΣΘΕΣΤΕ ΈΝΑΝ ΝΕΟ ΤΟΜΕΑ ΣΥΝΗΘΕΙΑΣ ΓΙΑ ΑΥΤΟΝ ΤΟΝ ΚΑΤΑΛΟΓΟ:
    New Τάξη τομέων:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Ετικέτα τομέων: $NWB#vicidial_lists_fields-field_label$NWE
    Όνομα τομέων: $NWB#vicidial_lists_fields-field_name$NWE
    Θέση ονόματος τομέων: $NWB#vicidial_lists_fields-name_position$NWE
    Περιγραφή τομέων: $NWB#vicidial_lists_fields-field_description$NWE
    Βοήθεια τομέων: $NWB#vicidial_lists_fields-field_help$NWE
    Τύπος τομέων: $NWB#vicidial_lists_fields-field_type$NWE
    Επιλογές τομέων: $NWB#vicidial_lists_fields-field_options$NWE
    Θέση επιλογής: $NWB#vicidial_lists_fields-multi_position$NWE
    Μέγεθος τομέων: $NWB#vicidial_lists_fields-field_size$NWE
    Τομέας ανώτατος: $NWB#vicidial_lists_fields-field_max$NWE
    Προεπιλογή τομέων: $NWB#vicidial_lists_fields-field_default$NWE
    Τομέας που απαιτείται: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Μετάβαση στη σελίδα τροποποίηση κατάλογο για αυτήν τη λίστα

    \n"; + + echo "  Κάντε κλικ εδώ για να δείτε Διαχειριστής τροποποιήσεις αυτού του καταλόγουs custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    ΑΠΑΡΙΘΜΗΣΤΕ ΤΙΣ ΛΙΣΤΕΣ ΜΕ ΤΗΝ ΑΡΙΘΜΗΣΗ ΤΟΜΕΩΝ ΣΥΝΗΘΕΙΑΣ:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΕΝΕΡΓΟCAMPAIGNCUSTOM FIELDSΤΡΟΠΟΠΟΙΗΣΗ
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΟΥΣ ΤΟΜΕΙΣ
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); + } + else + { + echo "ΑΠΟΤΥΧΙΑ ψαξίματος καθοδήγησης για lead_id $lead_id       $NOW_TIME\n

    \n"; +# echo "Close this window\n

    \n"; + } - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    Πληροφορίες Κλήσης: $first_name $last_name - $phone_number

    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    ADMIN CHANGE LOG: Τμήμα Εγγραφές - $category - $stage\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + 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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDΠΕΡΙΓΡΑΦΗGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Έκδοση: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATE ΠΙΝΑΚΑΣ custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTER ΠΙΝΑΚΑΣ custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='ΑΠΟΚΡΥΨΗBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="ΕΜΦΑΝΙΣΗ COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTER ΠΙΝΑΚΑΣ custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTER ΠΙΝΑΚΑΣ custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='ΑΠΟΚΡΥΨΗBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTER ΠΙΝΑΚΑΣ custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_modify_lead.php index 1d994118..13150112 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,19 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -48,8 +61,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -118,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -130,9 +149,15 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -140,26 +165,35 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -169,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -185,50 +219,137 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Πόλη'; +$label_state = 'State'; +$label_province = 'Επαρχία'; +$label_postal_code = 'Ταχ.Κωδ.'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Φύλο'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Σχόλια'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Τροποποίηση οδηγού + +
    ADMINISTRATION: Τροποποίηση οδηγού
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "Ο μόλυβδος έχει προστεθεί: $lead_id

    \n"; + $end_call=0; + } + else + {echo "ΣΦΑΛΜΑ: Μόλυβδος δεν έχουν προστεθεί, παρακαλώ πηγαίνετε πίσω και να δούμε τι έχετε εισαγάγει

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "οι πληροφορίες τροποποιήθηκαν

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -248,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -258,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -306,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -315,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -324,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -332,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -366,179 +521,365 @@ else $alts_output .= "
    $row[4]
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $u++; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; - echo "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + $entry_list_id = $row[34]; + + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Προσθέστε μια νέα πρωτοβουλία πρωτοποριακής\n";} + else + {echo "
    Πληροφορίες Κλήσης: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID Λίστας: $list_id
    Ονομα:   \n"; - echo " Επίθετο:
    Διεύθυνση 1 :
    Διεύθυνση 2 :
    Διεύθυνση 3 :
    Πόλη :
    Κράτος:   \n"; - echo "Ταχ.Κωδ.
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    NOTES:   $rowA[0]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} + + if ($LOGadmin_hide_lead_data != '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"; + } + 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"; + } + + if ($lead_id != 'NEW') + { echo "\n"; + echo "(with $list_campaign statuses)\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + } + else + { + echo "\n"; + } - + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) + { echo "\n"; - echo "
    Lead ID: $lead_id     ID Λίστας: $list_id
    Fronter: $tsr     Called Count: $called_count
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    Χώρα : $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    Χώρα :
    Main Phone :
    Εναλ Τηλέφωνο :
    Ασφάλεια :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    Σχόλια :
    $label_comments :
    Τερματισμός: (with $log_campaign statuses)
    Modifyvicidial log
    Modifyagent log
    Modifycloser log
    Add closer log record
    \n"; - echo "


    \n"; + } + echo "
    \n"; + echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') + { + echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "Κλήσεις για αυτόν τον οδηγό:\n"; + echo "
    \n"; + echo "Callback Λεπτομέρειεςs:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $CB_to_print = mysql_num_rows($rslt); @@ -625,135 +983,376 @@ else echo "New Callback Owner ΧρήστηςID: \n"; echo "
    \n"; } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Σχόλια: + + +
    + + + + +
    + +
    + + No Callback records found
    \n"; } + } - } - else - { - echo "ΑΠΟΤΥΧΙΑ ψαξίματος καθοδήγησης για lead_id $lead_id       $NOW_TIME\n

    \n"; -# echo "Close this window\n

    \n"; - } - - - - echo "

    \n"; - - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENDED ALTERNATE ΤΗΛΕΦΩΝΑ ΓΙΑ ΤΟ ΠΑΡΟΝ ΜΟΛΥΒΔΟΥ:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - echo "Κλήσεις για αυτόν τον οδηγό:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "ΧΕΙΡΙΣΤΗΣLOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) + echo "
    Αν θέλετε να αλλάξετε αυτό οδήγησε σε μια προγραμματισμένη επανάκλησης, πρώτα να αλλάξετε την διάθεση να CBHOLD, τότε υποβάλλουν και θα είστε σε θέση να καθορίσει την ημερομηνία και την ώρα επανάκλησης.
    \n"; + } + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    \n"; + + echo "

    \n"; + + echo "
    \n"; + + if ($c > 0) + { + echo "EXTENDED ALTERNATE ΤΗΛΕΦΩΝΑ ΓΙΑ ΤΟ ΠΑΡΟΝ ΜΟΛΥΒΔΟΥ:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "Προσαρμοσμένα Πεδία ΓΙΑ ΑΥΤΟ ΤΟ ΜΟΛΥΒΔΟ:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if (eregi("http",$location)) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo "
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "ΧΕΙΡΙΣΤΗΣLOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # ΕΚΣΤΡΑΤΕΙΑDATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modifychanges to this lead\n"; + } + + echo "\n"; } - - - echo "
    \n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin_search_lead.php index 4f61257e..2f42dd6d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -22,6 +22,13 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -39,6 +46,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} @@ -54,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -71,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -91,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -141,13 +219,58 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Πόλη'; +$label_state = 'State'; +$label_province = 'Επαρχία'; +$label_postal_code = 'Ταχ.Κωδ.'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Φύλο'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Σχόλια'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
    \n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
    \n"; echo "\n"; echo "\n"; @@ -156,16 +279,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
    Αναζήτηση Οδηγού Επιλογήs:
    Vendor ID(αυτόματος κωδικός καθοδήγησης):   $label_vendor_lead_code(αυτόματος κωδικός καθοδήγησης):  
     
    Home Τηλεφωνικός αριθμός:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Ονομα:   $label_first_name:  
    Επίθετο:   $label_last_name:  
     
    Log Search Επιλογήs:
    Lead ID:  
     
    $label_phone_number Dialed:  
     
    \n"; echo "\n
    \n"; echo "\n"; @@ -200,9 +344,249 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Υπάρχουν no outbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  CAMPAIGN  CALL ΗΜΕΡΑ  ΚΑΤΑΣΤΑΣΗ  USER  ID ΛΙΣΤΑΣ  LENGTH  DIAL
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
    \n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Υπάρχουν no inbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  INGROUP  CALL ΗΜΕΡΑ  ΚΑΤΑΣΤΑΣΗ  USER  ID ΛΙΣΤΑΣ  LENGTH  
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
    \n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Υπάρχουν no inbound did calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #DID  PHONE  DID ID  CALL ΗΜΕΡΑ  
    $o$row[0]$row[1]$row[2]$row[3]
    \n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


    \nΝΕΑ ΑΝΑΖΗΤΗΣΗ"; + + echo "\n\n\n


    \nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -210,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -244,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -261,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -277,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -301,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -334,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -364,7 +811,15 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_el/audio_store.php index 4f8941ea..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/audio_store.php @@ -1,17 +1,20 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -125,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -191,8 +194,28 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +300,26 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +327,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +360,18 @@ if ($action == "MANUALUPLOAD")
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

    -audio file list
    +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav) +

    All spaces will be stripped from uploaded audio file names

    +audio file list
    + + + +




    \n"; + +echo "


    Click here to see a log of the uploads to the audio store
    \n"; + +?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_el/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_el/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_el/call_report_export.php index f4599238..46961228 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,22 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -42,45 +58,132 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} 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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Εξαγωγή ζητεί έκθεση'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης or no export report permission: |$PHP_AUTH_USER|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +213,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -197,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -218,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Υπάρχουν no outbound calls during this time period for these parameters\n"; exit; } else @@ -236,9 +354,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -248,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Υπάρχουν no inbound calls during this time period for these parameters\n"; exit; } else @@ -266,9 +403,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -282,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN ΕΚΘΕΣΗ ΕΞΑΓΩΓΗΣ CALLS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -299,9 +455,50 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,13 +535,243 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Υπάρχουν no calls during this time period for these parameters\n"; exit; } } @@ -360,7 +787,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -375,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -390,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -405,7 +832,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +862,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +882,9 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -480,13 +909,17 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Εξαγωγή ζητεί έκθεση"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; - echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<font class=\"select_bold\"><B>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; ?> @@ -498,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start </script> <?php @@ -514,13 +947,49 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start </script> <?php + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>προσαρμοσμένου πεδίουs:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Εκστρατείες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -532,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Εισερχόμενες Ομάδες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Λίστες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -559,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Καθεστώτων:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -571,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Ομάδες Χρήστη:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_el/callcard_admin.php new file mode 100644 index 00000000..4e664f1e --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- ΕΚΔΟΣΗ: <?php echo $version ?> ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"ΒΟΗΘΕΙΑ\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Λεπτομέρειες<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Κατάσταση:</td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Ομάδα:</td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Σχόλια: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create Χρήστης/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate Χρήστης/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used Χρήστης/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void Χρήστης/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>ΧΕΙΡΙΣΤΗΣΗΜΕΡΑ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>ΧΕΙΡΙΣΤΗΣDISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΚΑΤΑΣΤΑΣΗ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΚΑΤΑΜΕΤΡΗΣΗ</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Υπάρχουν $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>ΧΕΙΡΙΣΤΗΣΗΜΕΡΑ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΚΑΤΑΜΕΤΡΗΣΗ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΚΑΤΑΜΕΤΡΗΣΗ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Ομάδα:</td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΚΑΤΑΣΤΑΣΗ</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     ΕΚΔΟΣΗ: <?php echo $version ?>     ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_el/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
    "; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "
    \n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_el/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php index dca45485..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php @@ -1,58 +1,71 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) -{ -$DBCagc = file("/etc/astguiclient.conf"); -foreach ($DBCagc as $DBCline) { - $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); - if (ereg("^PATHlogs", $DBCline)) - {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} - if (ereg("^PATHweb", $DBCline)) - {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} - if (ereg("^VARserver_ip", $DBCline)) - {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} - if (ereg("^VARDB_server", $DBCline)) - {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} - if (ereg("^VARDB_database", $DBCline)) - {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} - if (ereg("^VARDB_user", $DBCline)) - {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} - if (ereg("^VARDB_pass", $DBCline)) - {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} - if (ereg("^VARDB_port", $DBCline)) - {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; } -} -else -{ -#defaults for DB connection -$VARDB_server = 'localhost'; -$VARDB_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -if (!$link) { +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { die('MySQL connect ERROR: ' . mysql_error()); -} + } mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_el/fcstats.php index d1b7f7fd..aca65f28 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,18 +39,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "In-Group Fronter-Closer Stats Report\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           ΛΗΨΗ | ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ
    Εμφάνιση as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
     }
     
     else
    @@ -167,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -185,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -216,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| ΧΕΙΡΙΣΤΗΣ                   |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALS FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| ΧΕΙΡΙΣΤΗΣ                   |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -246,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -270,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -309,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -324,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -354,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -369,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -397,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| ΧΕΙΡΙΣΤΗΣ | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| ΧΕΙΡΙΣΤΗΣ | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -425,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -449,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -532,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -546,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -591,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -613,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/functions.php b/agc_2-X/trunk/LANG_www/vicidial_el/functions.php index f3a6e7b7..ab915ff4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "   \"ΒΟΗΘΕΙΑ\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_el/group_hourly_stats.php index 54b12353..ae6b51be 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTAL $status $hour_calls $total_calls $day_calls
    TOTAL $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Παρακαλώ, καταχωρήστε την ομάδα για την οποία θέλετε στατιστικά ανά ώρα:
    \n"; - echo "\n"; - echo "group: \n"; +echo "group:
    \n"; - echo "status:   (example: XFER)
    \n"; - echo "date with hour:   (example: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "status:   (example: XFER)
    \n"; +echo "date with hour:   (example: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \nχρόνος εκτέλεσης διαδ exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_el/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_el/lead_report_export.php new file mode 100644 index 00000000..4abcd7d5 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Εξαγωγή οδηγεί Έκθεση'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Υπάρχουν no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Υπάρχουν no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Υπάρχουν no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Εξαγωγή οδηγεί Έκθεση</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Η παρούσα έκθεση τραβά μολύβδου πληροφορίες για κλήσεις στο επιλεγμένο εύρος ημερομηνιών. Ο μόλυβδος εξάγεται μόνο μία φορά δεν έχει σημασία πόσες κλήσεις αντιμετωπίστηκαν. Η τρέχουσα κατάσταση μόλυβδος χρησιμοποιείται.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Δευτέρα week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>προσαρμοσμένου πεδίουs:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Εκστρατείες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Εισερχόμενες Ομάδες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Λίστες:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Καθεστώτων:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Ομάδες Χρήστη:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_el/leadloader_template_display.php new file mode 100644 index 00000000..489d25a8 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/line.js b/agc_2-X/trunk/LANG_www/vicidial_el/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_el/list_download.php index 8604d872..ec1cddbd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Δεν υπάρχουν αριθμοί τηλεφώνου στη λίστα: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Εκστρατεία DNC list validation ##### + $event_code_type='CAMPAIGN DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Δεν υπάρχουν καλώδια στη λίστα DNC Εκστρατεία: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Δεν υπάρχουν οδηγεί σε αυτό το φίλτρο της ομάδας τηλέφωνο: $group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Υπάρχουν no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTS') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTS') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTS') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_el/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_el/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_el/listloaderMAIN.php index 8c9912db..950299b6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_el/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_el/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_el/new_listloader_superL.php index 019bddc3..927cea43 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -30,11 +30,16 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -127,22 +132,29 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -171,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -203,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -348,6 +360,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <form action=<?php echo $PHP_SELF ?> method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> <input type=hidden name='leadfile_name' value="<?php echo $leadfile_name ?>"> +<input type=hidden name='DB' value="<?php echo $DB ?>"> <?php if ($file_layout!="custom") { ?> <table align=center width="700" border=0 cellpadding=5 cellspacing=0 bgcolor=#D9E6FE> <tr> @@ -384,7 +397,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <tr> <td align=center colspan=2><input type=submit value="ΕΠΙΒΕΒΑΙΩΣΗ" name='submit_file'>        <input type=button onClick="javascript:document.location='new_listloader_superL.php'" value="ΞΕΚΙΝΑ ΠΑΛΙ" name='reload_page'></td> </tr> - <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ</a></font></td><td align=right><font size=1>LIST LOADER-     ΕΚΔΟΣΗ: <?php echo $version ?>     ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?>     </td></tr> + <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ</a>         <a href="./admin_listloader_third_gen.php">3rd Gen Lead Loader</a>     </font></td><td align=right><font size=1>LIST LOADER-     ΕΚΔΟΣΗ: <?php echo $version ?>     ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?>     </td></tr> </table> <?php } ?> @@ -398,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -409,7 +422,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Επεξεργασία$delim_name-delimited file...\n"; @@ -445,7 +458,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +478,36 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +519,69 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +708,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +719,54 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -642,9 +778,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -666,7 +802,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; { print "<BR><BR>ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override<BR><BR>\n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +810,13 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ΕπεξεργασίαCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +844,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +864,112 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1094,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1107,53 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -905,9 +1164,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -919,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='ΛΙΣΤΕΣ', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -930,9 +1189,9 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -941,8 +1200,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1210,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1244,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1264,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1428,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,21 +1443,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1181,9 +1479,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1194,10 +1492,10 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1504,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1512,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1230,8 +1528,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ΕπεξεργασίαCSV file... \n"; @@ -1258,7 +1556,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1576,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1740,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,21 +1754,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID ΛΙΣΤΑΣ</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1452,9 +1789,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1464,6 +1801,7 @@ if ($leadfile) { print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; } else { + ##### BEGIN field chooser ##### print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>"; flush(); print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n"; @@ -1472,15 +1810,67 @@ if ($leadfile) { print " <th><font class='standard' color='white'>Αρχεία δεδομένων</font></th>\r\n"; print " </tr>\r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="ΕΜΦΑΝΙΣΗ ΠΙΝΑΚΑΣS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1488,8 +1878,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1536,10 +1926,10 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1937,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1945,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1571,8 +1961,8 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ΕπεξεργασίαCSV file... \n"; @@ -1617,6 +2007,8 @@ if ($leadfile) { print "</table>\r\n"; # } print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>"; @@ -1638,7 +2030,7 @@ exit; function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { -require("dbconnect.php"); +global $link; $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_el/non_agent_api.php index faecfc20..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -31,10 +38,40 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -129,6 +166,139 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +306,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -186,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -201,13 +372,76 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -216,23 +450,22 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -260,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -280,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -515,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Real-Time Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Επιλογές εμφάνισης Επιλέξτε Έκθεση"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "Ξαναφορτώσετε τώρα"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n";} +else + {echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n";} + +echo "SUMMARY \n"; + + +echo "       ανανέωσης: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       ΑΠΟΚΡΥΨΗ ΟΜΑΔΑ ΧΡΗΣΤΩΝ";} +else + {echo "       VIEW ΟΜΑΔΑ ΧΡΗΣΤΩΝ";} +if ($SERVdisplay>0) + {echo "       ΑΠΟΚΡΥΨΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO";} +else + {echo "       ΕΜΦΑΝΙΣΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO";} +if ($CALLSdisplay>0) + {echo "       ΑΠΟΚΡΥΨΗ WAITING CALLS";} +else + {echo "       ΕΜΦΑΝΙΣΗ WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       ΑΠΟΚΡΥΨΗ IN-GROUP STATS";} +else + {echo "       ΕΜΦΑΝΙΣΗ IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       ΑΠΟΚΡΥΨΗ PHONES";} +else + {echo "       ΕΜΦΑΝΙΣΗ PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       ΑΠΟΚΡΥΨΗ CUSTPHONES";} +else + {echo "       ΕΜΦΑΝΙΣΗ CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_el/remote_dispo.php index 9594124e..f1ff7859 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_el/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/server_stats.php b/agc_2-X/trunk/LANG_www/vicidial_el/server_stats.php deleted file mode 100644 index d46d3c10..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_el/server_stats.php +++ /dev/null @@ -1,97 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# 61101-1331 - Added SIP/IAX listen/barge links -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Στατιστικά Διακομιστή and Reports -VICIDIAL: Στατιστικά Διακομιστή and Reports                           -ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ

    - - -
    
    -
    - $o)
    -	{
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	$o++;
    -	}
    -
    -?>
    -
    SERVERΠΕΡΙΓΡΑΦΗIP ADDRESSΕΝΕΡΓΟVDAD timeVDcall timePARK timeCLOSER/INBOUND time
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_el/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_edit.php index d3afd4e4..497d0738 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_report.php index ff542974..a2b8f63b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,36 +44,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'ΧρήστηςΏρα ρολόι Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +106,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -83,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -99,49 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE>ΧρήστηςΏρα ρολόι Report - -<?php +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -161,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -187,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Ομάδες Χρήστη:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Ομάδες Χρήστη:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Χρήστης:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Εμφάνιση as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "ΧρήστηςΏρα ρολόι Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Χρήστης:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Time range: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&ΕΠΙΒΕΒΑΙΩΣΗ=$ΕΠΙΒΕΒΑΙΩΣΗ&file_download=1\">ΛΗΨΗ</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="ΧρήστηςΏρα ρολόι Report $NOW_TIME\n"; + +$CSV_text.="\"ΧρήστηςΏρα ρολόι Report - $NOW_TIME\"\n"; +$CSV_text.="\"Time range: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -301,92 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Time range: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"CALL HANGUP REASON STATS\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} - -$TOThours = $TOTdbHOURS; -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; - -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_status.php index d12c5cd6..694567d7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -10,9 +10,14 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -33,25 +38,41 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +$report_name = 'Ομάδα ΧρήστηΏρα ρολόι Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,13 +89,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -86,35 +112,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else - { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -131,18 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Ώρα ρολόι Status -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -162,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Ώρα ρολόι Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>ΟΜΑΔΑ ΧΡΗΣΤΩΝ</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Ώρα ρολόι Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>ΟΜΑΔΑ ΧΡΗΣΤΩΝ</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -228,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -247,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -291,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -311,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR ΟΜΑΔΑ ΧΡΗΣΤΩΝ: $user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR ΟΜΑΔΑ ΧΡΗΣΤΩΝ: $user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[ΛΗΨΗ]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR ΟΜΑΔΑ ΧΡΗΣΤΩΝ: $user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPAIGN\"\n"; $o=0; $s=0; @@ -338,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -380,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALS</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -429,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; +$MAIN.="<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -459,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -478,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -501,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -520,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_el/user_group_bulk_change.php index 77201ece..ee4caaa9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Ομάδα Χρήστη $old_group Χρήστες changed to the $group Ομάδα Χρήστη<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Χρήστες changed to the $group Ομάδα Χρήστη<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_el/user_stats.php index 7a21dc8f..0af35bc3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -20,34 +20,65 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'Στατιστικά Χρήστη'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -62,6 +93,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -72,12 +105,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,28 +129,83 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL ΑΝΑΦΟΡΕΣ/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -119,17 +213,17 @@ else +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -?> -<html> -<head> +if ($did > 0) + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} +else + {$HEADER.="<title>ADMINISTRATION: $report_name";} -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: Στατιστικά Χρήστη -<?php ##### BEGIN Set variables to make header show properly ##### @@ -148,402 +242,472 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Στατιστικά Χρήστη for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; +if ($did > 0) + {$MAIN.="<B>   DID Call Stats for $user";} +else + {$MAIN.="<B>   Στατιστικά Χρήστη for $user";} +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -<?php +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="</script>\n"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start -</script> -<?php - -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Δευτέρα week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Ώρα Φύλλο</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">Κατάσταση χρήστη</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Χρήστης multiple day status detail report</a>"; -echo "</center>\n"; - - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; - -echo "<br><center>\n"; - -##### vicidial agent talk time and status ##### - -echo "<B>ΧΕΙΡΙΣΤΗΣΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ΚΑΤΑΣΤΑΣΗ</td><td align=right><font size=2>ΚΑΤΑΜΕΤΡΗΣΗ</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +$MAIN.="<center>\n"; +if ($did > 0) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModifyDID</a>\n"; } - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) +else { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Ώρα Φύλλο</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">Κατάσταση χρήστη</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Χρήστης multiple day status detail report</a>"; + } +$MAIN.="</center>\n"; + + +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +$MAIN.="<br><center>\n"; + + +if ($did < 1) + { + ##### vicidial agent talk time and status ##### + $MAIN.="<B>ΧΕΙΡΙΣΤΗΣΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ:     <a href='$download_link&file_download=1'>[ΛΗΨΗ]</a></B>\n"; + + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ΚΑΤΑΣΤΑΣΗ</td><td align=right><font size=2>ΚΑΤΑΜΕΤΡΗΣΗ</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"ΧΕΙΡΙΣΤΗΣΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>ΧΕΙΡΙΣΤΗΣ ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - } - - $total_calls = ($total_calls + $row[0]); + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; $o++; - } + } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + $call_hours_minutes = sec_convert($total_sec,'H'); -echo "<tr><td><font size=2>ΣΥΝΟΛΙΚΑ</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; -echo "</TABLE></center>\n"; + + ##### Login and Αποσύνδεση time from vicidial agent interface ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>ΧΕΙΡΙΣΤΗΣ ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:     <a href='$download_link&file_download=2'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $CSV_text2.="\"ΧΕΙΡΙΣΤΗΣ ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPAIGN\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) + { + $event_start_seconds = $row[1]; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; + } + else + { + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + $MAIN.="<tr><td><font size=2>ΣΥΝΟΛΙΚΑ</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; + + $MAIN.="</TABLE></center>\n"; -##### vicidial_timeclock log records for user ##### + ##### vicidial_timeclock log records for user ##### -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; + $MAIN.="<br><br>\n"; -echo "<center>\n"; + $MAIN.="<center>\n"; -echo "<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:     <a href='$download_link&file_download=3'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {$MAIN.="|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; + + + + ##### closer in-group selection logs ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPAIGN\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; + + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) + $MAIN.="</TABLE><BR><BR>\n"; + + + ##### vicidial agent outbound calls for this time period ##### + + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + + if ($LOGadmin_hide_phone_data != '0') { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; + } - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + $MAIN.="</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>ΕΞΕΡΧΟΜΕΝΟ CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### -echo "<B>Εισερχόμενα/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> ΧΕΙΡΙΣΤΗΣ(S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[ΛΗΨΗ]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> ΧΕΙΡΙΣΤΗΣ(S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +722,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -565,130 +739,181 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALS</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALS\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>ΧΕΙΡΙΣΤΗΣACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + $MAIN.="<B>ΔΡΑΣΤΗΡΙΟΤΗΤΑ ΠΡΑΚΤΟΡΩΝ ΓΙΑ ΤΗΝ ΠΕΡΙΟΔΟ ΑΥΤΗΣ ΤΗΣ ΠΕΡΙΌΔΟΥ: (10000 record limit)     <a href='$download_link&file_download=7'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>αυτοί οι τομείς είναι στα δευτερόλεπτα </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"ΔΡΑΣΤΗΡΙΟΤΗΤΑ ΠΡΑΚΤΟΡΩΝ ΓΙΑ ΤΗΝ ΠΕΡΙΟΔΟ ΑΥΤΗΣ ΤΗΣ ΠΕΡΙΌΔΟΥ: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPAIGN\",\"PAUSE CODE\"\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; + } + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALS</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALS\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; + + $MAIN.="</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[ΛΗΨΗ]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -704,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -717,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -725,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -732,84 +962,234 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; - + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } - -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL ΕΞΕΡΧΟΜΕΝΟ CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "ΑΠΟΚΡΥΨΗPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### -echo "</TABLE><BR><BR>\n"; + $MAIN.="<B>ΜΟΛΥΒΔΟΣ ΕΡΕΥΝΕΣ για αυτή την περίοδο: (10000 record limit)     <a href='$download_link&file_download=10'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"ΜΟΛΥΒΔΟΣ ΕΡΕΥΝΕΣ για αυτή την περίοδο: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[ΛΗΨΗ]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPAIGN\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_el/user_status.php index adf8d4b7..86f8c7a3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -98,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -106,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -132,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -154,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -270,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -338,48 +370,114 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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_pe_phone_append = $row[8]; } ##### 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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_el/user_territories.php index 92006655..fc93391b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/user_territories.php @@ -40,8 +40,8 @@ if (isset($_GET["batch"])) {$batch=$_GET["batch"];} elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: Χρήστης Εδάφη δεν δραστηριοποιούνται σε αυτό το σύστημα\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$USER|$PASS|\n"; exit; } } @@ -138,8 +138,8 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> -<title>ADMINISTRATION: User Territories +<!-- ΕΚΔΟΣΗ: <?php echo $version ?> ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?> --> +<title>ADMINISTRATION: Χρήστης Εδάφη <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Αλλαγή Επικράτεια Ιδιοκτήτης<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Ιδιοκτήτης:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,12 +175,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Ιδιοκτήτης:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; echo "</TABLE></center>\n"; exit; } @@ -194,7 +194,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i if ( (strlen($accountid)<1) or (strlen($user)<1) ) { - echo "ERROR: Account ID and User must be filled in<BR>\n"; + echo "ERROR: Account ID and Χρήστης must be filled in<BR>\n"; } else { @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Έπρεπε να προσθέσετε έδαφος χρήστη: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Επικράτεια Ιδιοκτήτης Changed: $user $territory<BR>\n"; + echo "Εγγραφές Changed: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,13 +299,13 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">Εδάφη Κατάλογος</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Προσθήκη Επικράτεια</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Προσθήκη Χρήστη Επικράτεια</a></TD> <? if ($enable_vtiger_integration > 0) { ?> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Επικράτεια Owner</a></TD> <? $colspan='4'; } ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"ΒΟΗΘΕΙΑ\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,10 +350,10 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Αλλαγή Επικράτεια Ιδιοκτήτης<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Επικράτεια: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Ιδιοκτήτης:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,12 +387,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Ιδιοκτήτης:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; echo "</TABLE></center>\n"; } ### END change territory owner in the system @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Έδαφος και χρήστη πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Έπρεπε να προσθέσετε έδαφος χρήστη: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Επικράτεια Ιδιοκτήτης Changed: $user $territory       Εγγραφές Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Προσθήκη Χρήστη Επικράτεια<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -550,7 +550,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Επικράτεια: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -567,7 +567,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$territories_list"; echo "</select></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Level: </td><td align=left><select size=1 name=level><option>TOP_AGENT</option><option>STANDARD_AGENT</option><option>BOTTOM_AGENT</option></select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add user territory page @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Έδαφος, χρηστών και το επίπεδο πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: αυτός ο χρήστης έδαφος είναι ήδη στο σύστημα<BR>\n"; } else { @@ -600,7 +600,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Added: $user $territory<BR>\n"; + echo "Χρήστης Επικράτεια Added: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Έδαφος, χρηστών και το επίπεδο πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: Μέλους έδαφος δεν είναι στο σύστημα<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "Χρήστη Επικράτεια Τροποποιημένο: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Έδαφος και χρήστη πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: Μέλους έδαφος δεν είναι στο σύστημα<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "Χρήστη Επικράτεια Διαγράφεται: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -706,12 +706,12 @@ if ($action == "ADD_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Προσθήκη Επικράτεια<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Επικράτεια: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Περιγραφή επικράτειας: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add territory page @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Έδαφος και Επικράτεια Περιγραφή πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -731,14 +731,14 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: υπάρχει ήδη στο έδαφος του συστήματος με αυτό το όνομα<BR>\n"; } else { $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; $rslt=mysql_query($stmt, $link); - echo "Territory Added: $territory<BR>\n"; + echo "Έδαφος Added: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Έδαφος πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Αυτό το έδαφος δεν είναι το σύστημα με αυτό το όνομα<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Έδαφος Διαγράφεται: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Έδαφος και Επικράτεια Περιγραφή πρέπει να συμπληρωθεί<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Αυτό το έδαφος δεν είναι το σύστημα με αυτό το όνομα<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Έδαφος Τροποποιημένο: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Τροποποίηση Επικράτεια<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Επικράτεια: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Περιγραφή επικράτειας: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -857,7 +857,7 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); $user_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Agents: </td><td align=left><B>$user_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Πράκτορες: </td><td align=left><B>$user_count</B></td></tr>"; $owner_count=0; $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; @@ -882,13 +882,13 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rsltV); $vtiger_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Λογαριασμοί: </td><td align=left><B>$vtiger_count</B></td></tr>"; } - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ΕΠΙΒΕΒΑΙΩΣΗ value=ΕΠΙΒΕΒΑΙΩΣΗ></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Χρήστες in this Επικράτεια:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">ΔΙΑΓΡΑΦΗ</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Διαγραφή Αυτό Επικράτεια</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Έδαφος δεν βρέθηκε: $territory<BR>\n"; } } ### END modify territory page @@ -986,13 +986,13 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Όλα τα Εδάφη:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TERRITORY</B></TD>"; - echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ΠΕΡΙΓΡΑΦΗ</B></TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>AGENTS</TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACCOUNTS</TD>\n"; if ($enable_vtiger_integration > 0) @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>Χρήστης Εδάφη     ΕΚΔΟΣΗ: <?php echo $version ?>     ΔΗΜΙΟΥΡΓΙΑ: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_el/vdremote.php index 70d6f9c9..ed64ef12 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_el/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/vicidial_sales_viewer.php b/agc_2-X/trunk/LANG_www/vicidial_el/vicidial_sales_viewer.php index 6d0668cf..b51f8c95 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/vicidial_sales_viewer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/vicidial_sales_viewer.php @@ -88,7 +88,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <input type="hidden" name="list_ids"> <table border=0 cellpadding=5 cellspacing=0 align=center width=600> <tr> - <th colspan=3><font class="standard_bold">Vicidial ΕΞΕΡΧΟΜΕΝΟ recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> + <th colspan=3><font class="standard_bold">Vicidial OUTBOUND recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> <BR></th> </tr> <tr bgcolor='#CCCCCC'> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_el/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_el/welcome.php index 44767cb8..2586f4e9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Καλωσήρθες\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_el/welcome_demo.php index 238cf5cf..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "   \n"; echo "\n"; +echo "\n"; +echo "
    Υποδοχή
     
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_el/welcome_languages.php index d53707a9..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "  
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_el/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_el/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSER_service_level.php index 8a19f094..cbdb450e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -36,6 +39,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -49,7 +56,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -68,18 +75,18 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -93,26 +100,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -120,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; -echo "
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "
    \n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DESCARGAR | MODIFICAR | INFORMES"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if (!$group)
     	{
    -	echo "\n\n";
    -	echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
     	}
     
     else
    @@ -305,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
     	$DURATIONday++;
     	}
     
    -echo "Inbound Service Level Report                      $NOW_TIME\n";
    -echo "\n";
    -echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
    +$MAIN.="\n";
    +$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
     #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
    +$CSV_text.="\n";
    +$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
     
     $d=0;
     while ($d < $DURATIONday)
    @@ -414,7 +457,7 @@ $TOTintervals = $j;
     ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
     $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$MAIN.="$stmt\n";}
     $records_to_grab = mysql_num_rows($rslt);
     $i=0;
     while ($i < $records_to_grab)
    @@ -533,12 +576,40 @@ while ($j < $TOTintervals)
     
     ###################################################
     ### TOTALS SUMMARY SECTION ###
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    -echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    -echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    -echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    +$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    +$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
     
    +
    +$graph_stats=array();
    +$max_drops=1;
    +$max_droppct=1;
    +$max_avgdrops=1;
    +$max_hold=1;
    +$max_holdpct=1;
    +$max_avgholds=1;
    +$max_avgholdstotal=1;
    +$max_calls=1;
    +$max_totalcalltime=1;
    +$max_avgcalltime=1;
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTIME MIN:SECAVG CALLTIME SECONDS

     


    "; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -582,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -595,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -649,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
    INBOUND SERVICE NIVEL REPORT
    ESTADODROPS
    DROP %
    AVG DROP(s)
    HOLD
    HOLD %
    AVG HOLD(s) HOLD
    AVG HOLD(s) TOTAL
    CALLS
    TOTAL CALLTIME MIN:SEC
    AVG CALLTIME SECONDS
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    TOTAL:".trim($FtotDROPS)."
    "; + $DROPPCT_graph.="
    TOTAL:".trim($FtotDROPSpct)."%
    "; + $AVGDROPS_graph.="
    TOTAL:".trim($FtotDROPSavg)."
    "; + $HOLD_graph.="
    TOTAL:".trim($FtotQUEUE)."
    "; + $HOLDPCT_graph.="
    TOTAL:".trim($FtotQUEUEpct)."%
    "; + $AVGHOLDS_graph.="
    TOTAL:".trim($FtotQUEUEavg)."
    "; + $AVGHOLDSTOTAL_graph.="
    TOTAL:".trim($FtotQUEUEtot)."
    "; + $CALLS_graph.="
    TOTAL:".trim($FtotCALLS)."
    "; + $TOTALCALLTIME_graph.="
    TOTAL:".trim($totTIME_MS)."
    "; + $AVGCALLTIME_graph.="
    TOTAL:".trim($FtotCALLSavg)."
    "; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -904,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- LLAMADA EN ESPERA TEMNE DE SEGUNDOS\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RESPUESTA (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- LLAMADA EN ESPERA TEMNE DE SEGUNDOS\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RESPUESTA (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"LLAMADA EN ESPERA TEMNE DE SEGUNDOS\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE RESPUESTA(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -991,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -1017,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php index 2478d017..ac3a7b9a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -31,6 +31,10 @@ # 100802-2347 - Added User Group Allowed Reports option validation # 100913-1634 - Added DID option to select by DIDs instead of In-groups # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -55,6 +59,10 @@ if (isset($_GET["DID"])) {$DID=$_GET["DID"];} elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -65,11 +73,13 @@ if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Inbound Report'; $db_source = 'M'; +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -88,13 +98,13 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -105,14 +115,14 @@ if ($gmt_conf_ct > 0) } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -126,26 +136,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -153,22 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name,8 from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; if ($DID=='Y') - {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids order by did_pattern;";} + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -177,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -192,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -207,137 +245,137 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "Rango de Fecha:
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Rango de Fecha:
    \n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="\n"; if ($DID=='Y') - {echo "Inbound DIDs: \n";} + {$MAIN.="Inbound DIDs: \n";} else - {echo "Grupos De entrada: \n";} -echo "\n"; -echo "\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; if ($DID!='Y') { - echo "MODIFICAR | "; - echo "IVR REPORT | \n"; + $MAIN.="MODIFICAR | "; + $MAIN.="IVR REPORT | \n"; } -echo "INFORMES | "; -echo "\n"; +$MAIN.="INFORMES | "; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +#$MAIN.="\n";
    +$MAIN.="Shift: \n";
    +$MAIN.="
    Exponer as:  "; +$MAIN.="\n
    "; +$MAIN.="   \n"; +$MAIN.="
    \n"; +$MAIN.="\n\n"; +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    +	$MAIN.="\n\n";
     	if ($DID=='Y')
    -		{echo "PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";}
    +		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";}
     	else
    -		{echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";}
    +		{$MAIN.="POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";}
     	}
     
     else
    @@ -366,16 +404,16 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
    -
    +$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        DESCARGAR\n";
     
    +$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
     
     
     if ($DID=='Y')
     	{
    -	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL);";
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$dids_to_print = mysql_num_rows($rslt);
     	$i=0;
     	while ($i < $dids_to_print)
    @@ -390,7 +428,7 @@ if ($DID=='Y')
     
     	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$unids_to_print = mysql_num_rows($rslt);
     	$i=0;
     	while ($i < $unids_to_print)
    @@ -403,25 +441,30 @@ if ($DID=='Y')
     	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
     
     	if ($DB > 0)
    -		{echo "|$did_SQL|$unid_SQL|\n";}
    +		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
     
     	}
     
     if ($group_ct > 1)
     	{
    -	echo "\n";
    -	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
    +
    +	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
    +
     	if ($DID=='Y')
     		{
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    -		echo "| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
     		}
     	else
     		{
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    -		echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
     		}
     
     	$i=0;
    @@ -431,7 +474,7 @@ if ($group_ct > 1)
     		$DIDunid_SQL='';
     		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$Sdids_to_print = mysql_num_rows($rslt);
     		if ($Sdids_to_print > 0)
     			{
    @@ -441,7 +484,7 @@ if ($group_ct > 1)
     
     		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$DIDunids_to_print = mysql_num_rows($rslt);
     		$k=0;
     		while ($k < $DIDunids_to_print)
    @@ -459,7 +502,7 @@ if ($group_ct > 1)
     			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    @@ -468,7 +511,7 @@ if ($group_ct > 1)
     			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    @@ -477,8 +520,9 @@ if ($group_ct > 1)
     			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    +		if ($row[0]>$max_value) {$max_value=$row[0];}
     
     		$groupDISPLAY =	sprintf("%20s", $group[$i]);
     		$gTOTALcalls =	sprintf("%7s", $row[0]);
    @@ -493,19 +537,68 @@ if ($group_ct > 1)
     			}
     		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
     
    -		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
    +		$graph_data_ary[$i][0]=$groupDISPLAY;
    +		$graph_data_ary[$i][1]=$gTOTALcalls;
    +		$graph_data_ary[$i][2]=$gDROPcalls;
    +		$graph_data_ary[$i][3]=$gDROPpercent;
    +		$graph_data_ary[$i][4]=$gIVRcalls;
    +
     		$i++;
     		}
     
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
     
     	}
     
    +	if ($report_display_type=="HTML") {
    +		$max_value=1;
    +		$graph_height=240;
    +		$scale = 1;
    +		$w=0;
    +		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
    +			if ($graph_data_ary[$i][1]>0) {$w++;}
    +		}
    +		$scale = $graph_height / $max_value;
     
    -echo "\n";
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- TOTALS\n";
     
    +		$GRAPH_text.="";
    +		for ($d=0; $d0) {
    +				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
    +				$GRAPH_text.="  \n";
    +			}
    +		}
    +		$GRAPH_text.="
    MULTI-GROUP BREAKDOWN
    GROUPIVRS / DROPS / CALLS
    ".$graph_data_ary[$d][0]."
    ".$graph_data_ary[$d][3]."% drops
     
    \n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][1]."
    • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][2]."
    • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][4]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALS\n"; + +$CSV_text1.="\n\"Time range:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; if ($DID=='Y') @@ -513,16 +606,16 @@ if ($DID=='Y') $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; if ($DID=='Y') { - $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') and uniqueid IN($unid_SQL);"; + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; @@ -531,7 +624,7 @@ if ($DID=='Y') $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -563,15 +656,22 @@ else } -echo "Total de llamadas a adoptarse en este In-Grupo: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $RESPUESTAEDcalls $RESPUESTAEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Grupo: $IVRcalls\n"; +$MAIN.="Total de llamadas a adoptarse en este In-Grupo: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $RESPUESTAEDcalls $RESPUESTAEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Grupo: $IVRcalls\n"; +$CSV_text1.="\"Total de llamadas a adoptarse en este In-Grupo:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$RESPUESTAEDcalls\",\"$RESPUESTAEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- DROPS\n"; +$MAIN.="\n"; +$MAIN.="---------- DROPS\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; if ($DID=='Y') @@ -579,7 +679,7 @@ if ($DID=='Y') $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -609,10 +709,11 @@ else $DROP_RESPUESTAEDpercent = round($DROP_RESPUESTAEDpercent, 0); } -echo "Total DROP Calls: $DROPcalls $DROPpercent% drop/answered: $DROP_RESPUESTAEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Total DROP Calls: $DROPcalls $DROPpercent% drop/answered: $DROP_RESPUESTAEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_RESPUESTAEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) @@ -621,20 +722,20 @@ if (strlen($group_SQL)>3) { $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $Sanswer_sec_pct_rt_stat_one = $row[0]; $Sanswer_sec_pct_rt_stat_two = $row[1]; - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $answer_sec_pct_rt_stat_one = $row[0]; - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $answer_sec_pct_rt_stat_two = $row[0]; @@ -649,14 +750,21 @@ if (strlen($group_SQL)>3) } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Llamadas totales tomadas in to this In-Group): $RESPUESTAEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_RESPUESTAEDpercent%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Llamadas totales tomadas in to this In-Group): $RESPUESTAEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_RESPUESTAEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Llamadas totales tomadas in to this In-Group):\",\"$RESPUESTAEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_RESPUESTAEDpercent%\"\n"; + if ($DID!='Y') { - echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; - echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; } @@ -664,7 +772,7 @@ if ($DID!='Y') $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -681,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -699,8 +807,10 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; if ($DID=='Y') @@ -708,7 +818,7 @@ if ($DID=='Y') $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -738,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -749,11 +863,15 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- LLAMADA EN ESPERA TEMNE DE SEGUNDOS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- LLAMADA EN ESPERA TEMNE DE SEGUNDOS DESCARGAR\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"LLAMADA EN ESPERA TEMNE DE SEGUNDOS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; if ($DID=='Y') @@ -761,9 +879,11 @@ if ($DID=='Y') $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -806,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -816,11 +1008,14 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; if ($DID=='Y') @@ -828,9 +1023,11 @@ if ($DID=='Y') $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -873,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -884,19 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL RESPUESTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL RESPUESTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL RESPUESTAED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; if ($DID=='Y') { - $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -1080,35 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- CONVOCATORIA colgar RAZÓN ESTADÍSTICAS\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CONVOCATORIA colgar RAZÓN ESTADÍSTICAS DESCARGAR\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"CONVOCATORIA colgar RAZÓN ESTADÍSTICAS\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; if ($DID=='Y') { - $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason;"; + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -1117,34 +1465,80 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
    \n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CONVOCATORIA colgar RAZÓN ESTADÍSTICAS
    REASON CALLS
    \"\"".$ct_ary[$i][0]."
    LLAMADAS TOTALES:".trim($TOTALcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     ##############################
     #########  CALL STATUS STATS
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL STATUS STATS\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    -echo "| STATUS | DESCRIPTION          | CATEGORÍA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL STATUS STATS       DESCARGAR\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text.="| STATUS | DESCRIPTION          | CATEGORÍA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTOTAL TIMEAVG TIMECALLS/HR

     


    "; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"CATEGORÍA\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign @@ -1154,9 +1548,22 @@ if ($DID=='Y') $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -1184,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1204,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1234,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
    CALL STATUS STATS
    ESTADOCALLS
    TOTAL TIME
    AVG TIME
    CALLS/HR
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    TOTAL:".trim($TOTALcalls)."
    "; + $TOTALTIME_graph.="
    TOTAL:".trim($TOTALhours)."
    "; + $AVGTIME_graph.="
    TOTAL:".trim($TOTALavg)."
    "; + $CALLSHOUR_graph.="
    TOTAL:".trim($TOTALrate)."
    "; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS CATEGORÍA STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| CATEGORÍA | CALLS | DESCRIPTION |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS CATEGORÍA STATS
    DESCARGAR\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| CATEGORÍA | CALLS | DESCRIPTION |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS CATEGORÍA STATS\"\n"; +$CSV_text5.="\"CATEGORÍA\",\"CALLS\",\"DESCRIPTION\"\n"; $TOTCATcalls=0; $r=0; @@ -1259,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1267,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
    ".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CUSTOM STATUS CATEGORÍA STATS
    CATEGORÍA CALLS
    ".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
    TOTAL:".trim($TOTCATcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else 
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     
     ##############################
    @@ -1277,11 +1793,15 @@ echo "+----------------------+------------+\n";
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    -echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       DESCARGAR\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +
    +$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
    +$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
    +
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
     if ($DID=='Y')
    @@ -1289,7 +1809,7 @@ if ($DID=='Y')
     	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
     	}
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$ASCII_text.="$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
     $i=0;
     while ($i < $positions_to_print)
    @@ -1332,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
     
     $TOTALcalls =		sprintf("%10s", $TOTALcalls);
     
    -echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
     
    +$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
     
    +if ($report_display_type=="HTML") 
    +	{
    +	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
    +	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
    +	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
    +	if ($DID=='Y')
    +		{
    +		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
    +		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
    +		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
    +		}
    +	if ($DB) {$GRAPH_text.=$stmt."\n";}
    +	$ms_rslt=mysql_query($ms_stmt, $link);
    +	$ms_row=mysql_fetch_row($ms_rslt);
    +	$max_position=$ms_row[0];
    +	if ($max_position>25) {$max_position=26;}
    +	for ($i=1; $i<=$max_position; $i++) {
    +		$sec_ary[$i]=0;
    +	}
    +
    +	$mc_rslt=mysql_query($mc_stmt, $link);
    +	$mc_row=mysql_fetch_row($mc_rslt);
    +	$max_calls=$ms_row[0];
    +	if ($max_calls<=10) {
    +		while ($maxcalls%5!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=100) {
    +		while ($maxcalls%10!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=1000) {
    +		while ($maxcalls%50!=0) {
    +			$maxcalls++;
    +		}
    +	} else {
    +		while ($maxcalls%500!=0) {
    +			$maxcalls++;
    +		}
    +	}
    +	$rslt=mysql_query($stmt, $link);
    +	
    +	$GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1345,11 +1935,27 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- AGENTE STATS\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| AGENTE | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- AGENTE STATS DESCARGAR\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| AGENTE | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"AGENTE STATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTIME H:M:SAVERAGE

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; if ($DID=='Y') @@ -1357,7 +1963,7 @@ if ($DID=='Y') $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1380,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1407,18 +2022,61 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
    AGENTE STATS
    AGENTCALLS
    TIME H:M:S
    AVERAGE
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    TOTAL:".trim($TOTALcalls)."
    "; +$TIMEHMS_graph.="
    TOTAL:".trim($TOTtime)."
    "; +$AVERAGE_graph.="
    TOTAL:".trim($TOTavg)."
    "; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTAL Agentes: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- ESTADÍSTICAS DEL TIEMPO\n"; +$MAIN.="\n"; +$MAIN.="---------- ESTADÍSTICAS DEL TIEMPO
    DESCARGAR\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## @@ -1430,7 +2088,7 @@ if ($DID=='Y') $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1441,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1456,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1514,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1544,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1565,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1579,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1595,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1611,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
    GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
    HOURDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL RESPUESTAED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL RESPUESTAED TIME BREAKDOWN IN SECONDS DESCARGAR\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL RESPUESTAED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1709,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1717,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALS| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALS| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALS\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.=""; +$MAIN.="
    "; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php index b2a1da18..52c39e7f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -43,10 +46,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -55,14 +62,14 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} -$report_name = 'Inbound Summary Hourly Report'; +$report_name = 'Resumen horario de entrada Informe'; $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -81,12 +88,12 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -97,14 +104,14 @@ if ($gmt_conf_ct > 0) } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -113,31 +120,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -145,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -161,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -169,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -184,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -200,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -213,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Rango de Fecha:
    \n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; + $MAIN.=" \n"; - echo "
      \n"; - echo "\n"; - echo "Inbound Groups:
    \n"; - echo "
      \n"; + $MAIN.="\n"; + $MAIN.="Grupos De entrada:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "   Exclude Outbound Drop Groups:
    "; - echo "   \n"; - echo "
                          "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="           "; + $MAIN.="DESCARGAR | "; + $MAIN.="MODIFICAR | "; + $MAIN.="INFORMES"; + $MAIN.="\n"; + $MAIN.="
      Exponer as: "; + $MAIN.="\n
    "; + $MAIN.="   Exclude Outbound Drop Groups:
    "; + $MAIN.="   \n"; + $MAIN.="
                          "; + $MAIN.="\n"; - echo "
    \n"; + $MAIN.="
    \n"; - echo "Call Time:
    \n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
     	}
     
     else
    @@ -354,7 +389,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -397,18 +432,48 @@ else
     	$query_date_END = "$end_date 23:59:59";
     
     
    -	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
    +	$MAIN .= "Resumen horario de entrada Informe: $group_string          $NOW_TIME\n";
    +	$CSV_main.="Resumen horario de entrada Informe:,$NOW_TIME\n";
     
     
    +	$JS_text.="\n";
    +
     	if ($costformat > 0)
     		{
    -		echo "
    \n"; + $ASCII_text.="
    \n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
    "; + + echo ""; + + } + } - - ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_DIDstats.php new file mode 100644 index 00000000..b39a8543 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; + } + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
    to
    "; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

    "; +$MAIN.="\n"; +$MAIN.="           DESCARGAR | MODIFICAR | INFORMES \n"; +$MAIN.="
    \n"; +$MAIN.="
    \n"; + +$MAIN.="
    ";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +	#	$time_BEGIN=$AM_shift_BEGIN;
    +	#	$time_END=$AM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +	#	$time_BEGIN=$PM_shift_BEGIN;
    +	#	$time_END=$PM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
    +	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
    +	$MAIN.="\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +
    +	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
    +	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
    +
    +	$d=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) );
    +		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
    +
    +		if ($EQsec < $SQsec)
    +			{
    +			$dEQepoch = ($dEQepoch + 86400);
    +			}
    +
    +		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +		$d++;
    +		}
    +
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### CONSTRUCCION HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $j;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	$extension[0]='';
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$dt[$i] =			0;
    +		$ut[$i] =			($row[0] - $SQepochDAY);
    +		$extension[$i] =	$row[1];
    +		while($ut[$i] >= 86400) 
    +			{
    +			$ut[$i] = ($ut[$i] - 86400);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +
    +		$i++;
    +		}
    +
    +	### Find default route
    +	$default_route='';
    +	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$Drecords_to_grab = mysql_num_rows($rslt);
    +	if ($Drecords_to_grab > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$default_route =	$row[0];
    +		}
    +
    +	###################################################
    +	### TOTALS DID SUMMARY SECTION ###
    +	if (strlen($extension[0]) > 0)
    +		{
    +		$ASCII_text.="DID Summary:\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="| DID                | DESCRIPTION                    | ROUTE      | CALLS      |\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +
    +		$CSV_text1.="\"DID Summary:\"\n";
    +		$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
    +
    +		$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    DID Summary:
    DIDCALLS
    \"\"".$graph_stats[$d][0]."
    LLAMADAS TOTALES:".trim($totCALLS)."
    \n";
    +
    +			$FtotCALLS =	sprintf("%10s", $totCALLS);
    +
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="|                                                           TOTALS | $FtotCALLS |\n";
    +		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
    +		$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
    +		#$MAIN.=$GRAPH;
    +
    +		}
    +
    +
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totCALLSmax=0;
    +	$totCALLSdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
    +				{
    +				$totCALLS++;
    +				$qrtCALLS[$j]++;
    +				$dtt = $dt[$i];
    +				$totCALLSdate[$dtt]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +
    +
    +	###################################################
    +	### TOTALS DATE SUMMARY SECTION ###
    +	$ASCII_text.="\nDate Summary:\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="| SHIFT                                     |        |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +
    +	$CSV_text1.="\n\"Date Summary:\"\n";
    +	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
    +
    +	$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    Date Summary:
    SHIFT DATE-TIME RANGECALLS
    \"\"".$graph_stats[$d][0]."
    LLAMADAS TOTALES:".trim($totCALLS)."
    \n";
    +
    +
    +	$FtotCALLS =	sprintf("%6s", $totCALLS);
    +
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="|                                    TOTALS | $FtotCALLS |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
    +	#$MAIN.=$GRAPH;
    +
    +	if ($report_display_type=="HTML")
    +		{
    +		$MAIN.=$GRAPH_text;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +
    +	## FORMAT OUTPUT ##
    +	$i=0;
    +	$hi_hour_count=0;
    +	$hi_hold_count=0;
    +
    +	while ($i < $TOTintervals)
    +		{
    +		if ($qrtCALLS[$i] > 0)
    +			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
    +
    +		if ($qrtCALLS[$i] > $hi_hour_count) 
    +			{$hi_hour_count = $qrtCALLS[$i];}
    +
    +		$i++;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (70 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (70 / $hi_hold_count);}
    +
    +
    +
    +
    +	###################################################################
    +	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
    +
    +	$MAIN.="\n";
    +	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
    +
    +	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
    +
    +	$ASCII_text.="";
    +
    +	$ASCII_text.="";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
    +
    +	$k=1;
    +	$Mk=0;
    +	$call_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hour_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hour_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hour_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$call_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$call_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$call_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +	$k=1;
    +	$Mk=0;
    +	$hold_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hold_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hold_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hold_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$hold_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$hold_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$hold_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
    +	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
    +
    +
    +
    +	$max_calls=1;
    +	$graph_stats=array();
    +	$GRAPH_text="";
    +
    +
    +	$i=0;
    +	while ($i < $TOTintervals)
    +		{
    +		$char_counter=0;
    +		### BEGIN HOLD TIME TOTALS GRAPH ###
    +			$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count > 0) {$no_lines_yet=0;}
    +
    +		$Gavg_hold = $qrtQUEUEavg[$i];
    +		if ($Gavg_hold < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				$TOT_lines++;
    +				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +				$ASCII_text.="|$HMdisplay[$i]|";
    +				$CSV_text1.="\"$HMdisplay[$i]\",";
    +			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
    +			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +				}
    +			}
    +		else
    +			{
    +			$TOT_lines++;
    +			$no_lines_yet=0;
    +			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
    +			$Yavg_hold = (19 - $Xavg_hold);
    +
    +			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +
    +		#	$ASCII_text.="|$HMdisplay[$i]|";
    +			$ASCII_text.="|$HMdisplay[$i]|";
    +			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
    +		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
    +		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
    +		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
    +		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +			}
    +		### END HOLD TIME TOTALS GRAPH ###
    +
    +		$char_counter=0;
    +		### BEGIN CALLS TOTALS GRAPH ###
    +		$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +			#	$ASCII_text.="  |";
    +				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"0\"\n";
    +				}
    +			}
    +		else
    +			{
    +			$no_lines_yet=0;
    +			$Xhour_count = ($Ghour_count * $hour_multiplier);
    +			$Yhour_count = (69 - $Xhour_count);
    +
    +			$Gdrop_count = $qrtDROPS[$i];
    +			if ($Gdrop_count < 1) 
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
    +				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			else
    +				{
    +				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
    +
    +			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
    +
    +				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
    +
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
    +				$ASCII_text.="D";   $char_counter++;
    +				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				$ASCII_text.="C";   $char_counter++;
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			}
    +		### END CALLS TOTALS GRAPH ###
    +		$graph_stats[$i][0]=$HMdisplay[$i];
    +		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
    +		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
    +		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
    +		$i++;
    +		}
    +
    +
    +	if ($totQUEUEsec > 0)
    +		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
    +	else
    +		{$totQUEUEavgRAW = 0;}
    +	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
    +	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
    +	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
    +	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
    +	$totDROPS =	sprintf("%5s", $totDROPS);
    +	$totCALLS =	sprintf("%5s", $totCALLS);
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +
    +	for ($d=0; $d\n";
    +	}
    +	$GRAPH_text.="
    HOLD TIME, CALL AND DROP STATS
    TIME 15-MIN INTDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
    TOTALS:".trim($totCALLS)."
    "; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRfilter.php index b0dcc07d..a5b91ff5 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "\n"; +$HTML_text.="
    \n"; -echo "\n"; -echo "Rango de Fecha:
    \n"; -echo "\n"; -echo " to \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "INFORMES\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; +$HTML_text.="Rango de Fecha:
    \n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
    \n\n";
    +$HTML_text.="\n";
    +
    +$HTML_text.="
    Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="INFORMES\n"; +$HTML_text.="\n"; + +$HTML_text.="
    \n"; + +$HTML_text.="   \n"; +$HTML_text.="
    \n"; +$HTML_text.="\n\n"; + +$HTML_text.="
    \n\n";
     
     $shift = 'ALL';
     
    @@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
    +$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [DESCARGAR]\n";
    +
    +$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
    +
    +$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
    +$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
    +
    +$i=0;
    +while($start_date<$end_date) {
    +	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
    +	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
    +	for ($j=0; $j<16; $j++) {
    +		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
    +	}
    +	
    +	$i++;
    +	$start_date+=$date_int;
    +}
    +
    +$total=0;
    +$Utotal=0;
    +$totalstq=0;
    +$Utotalstq=0;
    +$totalnocid=0;
    +$Utotalnocid=0;
    +$totaldnc=0;
    +$Utotaldnc=0;
    +$totalsale=0;
    +$Utotalsale=0;
    +$totalarch=0;
    +$Utotalarch=0;
    +$totaltiq=0;
    +$Utotaltiq=0;
    +$totalsta=0;
    +$Utotalsta=0;
    +
    +	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
    +	$rsltA=mysql_query($stmtA, $link);
    +	if ($DB) {$HTML_text.="$stmtA\n";}
    +	while ($rowA=mysql_fetch_row($rsltA)) {
    +		$count_ary[$rowA[2]][0]+=$rowA[0];
    +		$count_ary[$rowA[2]][1]+=$rowA[1];
    +		$count_ary[$rowA[2]][14]+=$rowA[0];
    +		$count_ary[$rowA[2]][15]+=$rowA[1];
    +		$total+=$rowA[0];
    +		$Utotal+=$rowA[1];
    +		$totalstq+=$rowA[0];
    +		$Utotalstq+=$rowA[1];
    +	}
    +
    +	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
    +	$rsltB=mysql_query($stmtB, $link);
    +	if ($DB) {$HTML_text.="$stmtB\n";}
    +	while ($rowB=mysql_fetch_row($rsltB)) {
    +		$count_ary[$rowB[2]][2]+=$rowB[0];
    +		$count_ary[$rowB[2]][3]+=$rowB[1];
    +		$total+=$rowB[0];
    +		$Utotal+=$rowB[1];
    +		$count_ary[$rowB[2]][14]+=$rowB[0];
    +		$count_ary[$rowB[2]][15]+=$rowB[1];
    +		$totalnocid+=$rowB[0];
    +		$Utotalnocid+=$rowB[1];
    +	}
    +
    +	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
    +	$rsltC=mysql_query($stmtC, $link);
    +	if ($DB) {$HTML_text.="$stmtC\n";}
    +	while ($rowC=mysql_fetch_row($rsltC)) {
    +		$count_ary[$rowC[2]][4]+=$rowC[0];
    +		$count_ary[$rowC[2]][5]+=$rowC[1];
    +		$total+=$rowC[0];
    +		$Utotal+=$rowC[1];
    +		$count_ary[$rowC[2]][14]+=$rowC[0];
    +		$count_ary[$rowC[2]][15]+=$rowC[1];
    +		$totaldnc+=$rowC[0];
    +		$Utotaldnc+=$rowC[1];
    +	}
    +
    +	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
    +	$rsltD=mysql_query($stmtD, $link);
    +	if ($DB) {$HTML_text.="$stmtD\n";}
    +	while ($rowD=mysql_fetch_row($rsltD)) {
    +		$count_ary[$rowD[2]][6]+=$rowD[0];
    +		$count_ary[$rowD[2]][7]+=$rowD[1];
    +		$total+=$rowD[0];
    +		$Utotal+=$rowD[1];
    +		$count_ary[$rowD[2]][14]+=$rowD[0];
    +		$count_ary[$rowD[2]][15]+=$rowD[1];
    +		$totalsale+=$rowD[0];
    +		$Utotalsale+=$rowD[1];
    +	}
    +
    +	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
    +	$rsltE=mysql_query($stmtE, $link);
    +	if ($DB) {$HTML_text.="$stmtE\n";}
    +	while ($rowE=mysql_fetch_row($rsltE)) {
    +		$count_ary[$rowE[2]][8]+=$rowE[0];
    +		$count_ary[$rowE[2]][9]+=$rowE[1];
    +		$total+=$rowE[0];
    +		$Utotal+=$rowE[1];
    +		$count_ary[$rowE[2]][14]+=$rowE[0];
    +		$count_ary[$rowE[2]][15]+=$rowE[1];
    +		$totalarch+=$rowE[0];
    +		$Utotalarch+=$rowE[1];
    +	}
    +
    +	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
    +	$rsltF=mysql_query($stmtF, $link);
    +	if ($DB) {$HTML_text.="$stmtF\n";}
    +	while ($rowF=mysql_fetch_row($rsltF)) {
    +		$count_ary[$rowF[2]][10]+=$rowF[0];
    +		$count_ary[$rowF[2]][11]+=$rowF[1];
    +		$totaltiq+=$rowF[0];
    +		$Utotaltiq+=$rowF[1];
    +	}
    +
    +	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
    +	$rsltG=mysql_query($stmtG, $link);
    +	if ($DB) {$HTML_text.="$stmtG\n";}
    +	while ($rowG=mysql_fetch_row($rsltG)) {
    +		$count_ary[$rowG[2]][12]+=$rowG[0];
    +		$count_ary[$rowG[2]][13]+=$rowG[1];
    +		$totalsta+=$rowG[0];
    +		$Utotalsta+=$rowG[1];
    +	}
     
     
    -echo "\n";
    -echo "+----------------------+---------+---------+---------+\n";
    -echo "| CATEGORÍA             | CALLS   | UNIQUE  |      %  |\n";
    -echo "+----------------------+---------+---------+---------+\n";
    +	$HTML_text.="\n";
    +	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
    +	$HTML_text.="|                              |          TOTALS         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
    +	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
    +	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	
    +	$CSV_text.="\n";
    +	$CSV_text.="\"\",\"\",\"TOTALS\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
    +	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
    +
    +	for($i=0; $i
    -
    -
    + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php index 110d3138..45c550fa 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -16,6 +16,10 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -31,26 +35,38 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} -$report_name = 'Inbound IVR Report'; +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} $db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Rango de Fecha:
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Rango de Fecha:
    \n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    to
    "; +$MAIN.="
    to
    "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    \n"; -echo "Grupos De entrada: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Grupos De entrada: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DESCARGAR | "; + $MAIN.="MODIFICAR | "; + $MAIN.="INFORMES | "; + $MAIN.="INFORME CLOSER \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Campañas: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DESCARGAR | "; + $MAIN.="MODIFICAR | "; + $MAIN.="INFORMES | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "MODIFICAR | "; -echo "INFORMES | "; -echo "INFORME CLOSER \n"; -echo "\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
    Exponer as:  "; +$MAIN.="\n
    "; +$MAIN.="    \n"; -   -
    \n"; +$MAIN.="\n\n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
     	}
     
     else
     	{
    -	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    -	echo "                  $group_string\n";
    +	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    +	$MAIN.="                  $group_string\n";
    +
    +	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
     
     	$TOTALcalls=0;
     	$NOCALLERIDcalls=0;
    @@ -383,9 +463,16 @@ else
     	$totFLOWtotal_time=0;
     
     	##### Grab all records for the IVR for the specified time period
    -	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +	if ($type == 'inbound')
    +		{
    +		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +		}
    +	else
    +		{
    +		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
    +		}
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$logs_to_print = mysql_num_rows($rslt);
     	$p=0;
     	while ($p < $logs_to_print)
    @@ -410,11 +497,11 @@ else
     	$r=-1;
     	while ($p < $logs_to_print)
     		{
    -		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
    +		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
     		if ($last_uniqueid === "$uniqueid[$p]")
     			{
     			$unique_calls[$r] .= "----------$comment_b[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			$last_epoch[$r]=$epoch[$p];
     			}
     		else
    @@ -436,7 +523,7 @@ else
     			$unique_calls[$r] = $comment_b[$p];
     			$FLOWuniqueid[$r] = "$uniqueid[$p]";
     			$last_uniqueid = "$uniqueid[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			}
     		$p++;
     		}
    @@ -453,7 +540,7 @@ else
     	$s=0;
     	while ($s <= $r)
     		{
    -		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
    +		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
     		if ($last_Suniqueid === "$unique_calls[$s]")
     			{
     			$STunique_calls_count[$p]++;
    @@ -481,11 +568,15 @@ else
     		}
     
     	#### PRINT LLAMADAS TOTALES INTO THIS IVR
    -	echo "\n";
    -	echo "Calls taken into this IVR:   $TOTALcalls\n";
    -	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
    -	echo "Unique Callers:              $UNIQUEcallers\n";
    -	echo "\n";
    +	$MAIN.="\n";
    +	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
    +	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
    +	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
    +	$MAIN.="\n";
    +
    +	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
    +	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
    +	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
     
     	### sort call flows for counting
     	if ($p > 0)
    @@ -520,11 +611,32 @@ else
     	### put call flows and counts together for sorting again
     	$s=0;
     
    -	echo "+--------+--------+--------+--------+------+------+\n";
    -	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    -	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    -	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    -	echo "+--------+--------+--------+--------+------+------+------------\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
    +	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    +	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    +	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
    +
    +	######## GRAPHING #########
    +	$graph_stats=array();
    +	$max_ivr_calls=1;
    +	$max_queue_calls=1;
    +	$max_queue_drops=1;
    +	$max_queue_drops_percent=1;
    +	$max_ivr_avg=1;
    +	$max_total_avg=1;
    +	$GRAPH="";
    +	$GRAPH.="";
    +	$GRAPH.="
    IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

     


    "; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
    IVR STATS
    IVR CALLSCALL PATH
    "; + $QUEUEDROPCALLS_graph="
    IVR STATS
    QUEUE CALLSCALL PATH
    "; + $QUEUEDROPPERCENT_graph="
    IVR STATS
    QUEUE DROP CALLSCALL PATH
    "; + $IVRAVGTIME_graph="
    IVR STATS
    QUEUE DROP PERCENTCALL PATH
    "; + $TOTALAVGTIME_graph="
    IVR STATS
    IVR AVG TIMECALL PATH
    "; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -538,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -573,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -602,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
    IVR STATS
    TOTAL AVG TIMECALL PATH
    ".$graph_stats[$d][0]."
    ".$graph_stats[$d][2]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][3]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
    ".$graph_stats[$d][5]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][6]."".$graph_stats[$d][0]."
    ".trim($TOTALcalls)."TOTAL
    "; + $QUEUECALLS_graph.="
    ".trim($totFLOWtotal)."TOTAL
    "; + $QUEUEDROPCALLS_graph.="
    ".trim($totFLOWdrop)."TOTAL
    "; + $QUEUEDROPPERCENT_graph.="
    ".trim($totFLOWdropPCT)."%TOTAL
    "; + $IVRAVGTIME_graph.="
    ".trim($TavgFLOWivr_time)."TOTAL
    "; + $TOTALAVGTIME_graph.="
    ".trim($TavgFLOWtotal_time)."TOTAL
    "; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- ESTADÍSTICAS DEL TIEMPO\n"; + $MAIN.="\n"; + $MAIN.="---------- ESTADÍSTICAS DEL TIEMPO\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -621,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -631,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -668,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -698,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -733,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -746,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -760,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..43b01085 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Listas Estados De la Campaña Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..9f71b0f6 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
    \n"; + echo "$query_date|$end_date\n"; + echo "
    \n"; + } + +echo "
    "; + +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    to
    \n"; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           INFORMES \n"; +echo "
    \n"; +echo "
    \n"; + +echo "
    ";
    +
    +
    +if (!$query_date)
    +{
    +echo "\n\n";
    +echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK ENVIAR\n";
    +}
    +
    +else
    +{
    +echo "List Update Process Report                      $NOW_TIME\n";
    +echo "\n";
    +echo "Time range $query_date to $end_date\n\n";
    +
    +
    +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +echo "List Update Summary:\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +
    +$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$records_to_grab = mysql_num_rows($rslt);
    +$i=0;
    +while ($i < $records_to_grab)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$TOTcount = ($TOTcount + $row[0]);
    +	$TOTupdated = ($TOTupdated + $row[3]);
    +	$count =	sprintf("%-8s", $row[0]);
    +	$filename =	sprintf("%-50s", trim($row[1]));
    +	$result =	sprintf("%-10s", $row[2]);
    +	$updated =	sprintf("%-8s", $row[3]);
    +	echo "| $filename | $result | $count | $updated |\n";
    +
    +	$i++;
    +	}
    +$TOTcount =	sprintf("%-8s", $TOTcount);
    +$TOTupdated =	sprintf("%-8s", $TOTupdated);
    +
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "                                                                  | $TOTcount | $TOTupdated |\n";
    +echo "                                                                  +----------+----------+\n";
    +echo "\n
    \n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Detalle:
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
    DATE/TIMELEAD_IDVENDOR_IDPHONEESTADOOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
    $row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

    \nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php index bfe26cb6..08334f9c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -41,10 +44,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -55,12 +62,14 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';} $report_name = 'Outbound Summary Interval Report'; $db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Rango de Fecha:
    \n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
    Campaigns:
    "; - echo "
    Campañas:
    "; + $MAIN.="\n"; - echo "
    "; - echo "Include Drop  
    Rollover:
    "; - echo "
    \n"; - echo "Time Interval:
    "; - echo "\n"; + $MAIN.="
    "; + $MAIN.="Include Drop  
    Rollover:
    "; + $MAIN.="
    \n"; + $MAIN.="Time Interval:
    "; + $MAIN.="\n"; - echo "
    \n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "
            "; - echo "\n"; + {$MAIN.="\n";} - echo "
    \n"; - echo "Call Time:
    \n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="         "; + $MAIN.="DESCARGAR | "; + $MAIN.="MODIFICAR | "; + $MAIN.="INFORMES"; + $MAIN.="

    \n"; + $MAIN.="Exponer as:
    "; + $MAIN.="\n
    "; + $MAIN.="
            "; + $MAIN.="\n"; + + $MAIN.="
    \n"; + + $MAIN.="Call Time:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($group_ct < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK ENVIAR\n";
     	}
     
     else
    @@ -509,7 +526,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -579,7 +596,7 @@ else
     			$Hcalltime_HHMM[$h] = "$H_test";
     			}
     		if ($DB)
    -			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
    +			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
     		$h++;
     		}
     
    @@ -589,19 +606,49 @@ else
     
     	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
     
    -
    +	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
     
     
     	##### Loop through each campaign and gether stats
     	if ($group_ct > 0)
     		{
    -		$MAIN .= "\n";
    -		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    -		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    -		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
    -		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "\n";
    +		$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "|                                          |        | SYSTEM | AGENTE  |        |        | NO     |        | AGENTE      | AGENTE      |\n";
    +		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | RESPUESTA | DROP   | LOGIN      | PAUSE      |\n";
    +		$ASCII_text .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +
    +		$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
    +		$CSV_main.="\"CAMPAIGN\",\"LLAMADAS TOTALES\",\"SYSTEM RELEASE CALLS\",\"AGENTE RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RESPUESTA PERCENT\",\"DROP PERCENT\",\"AGENTE LOGIN TIME(H:M:S)\",\"AGENTE PAUSE TIME(H:M:S)\"\n";
    +		$CSV_subreports="";
    +		
    +		######## GRAPHING #########
    +		$max_calls=1;
    +		$max_system_release=1;
    +		$max_agent_release=1;
    +		$max_sales=1;
    +		$max_dncs=1;
    +		$max_nas=1;
    +		$max_drops=1;
    +		$max_login_time=1;
    +		$max_pause_time=1;
    +
    +		$GRAPH="

    "; + $GRAPH.=""; + $GRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENTE RELEASE CALLSSALE CALLSDNC CALLSNO RESPUESTA PERCENTDROP PERCENTAGENTE LOGIN TIMEAGENTE PAUSE TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -622,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -640,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -667,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -681,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -758,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hRESPUESTAcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -841,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -849,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -979,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -987,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -1004,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1030,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1051,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gRESPUESTAcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1066,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | AGENTE | | | NO | | AGENTE | AGENTE |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | RESPUESTA | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"LLAMADAS TOTALES\",\"SYSTEM RELEASE CALLS\",\"AGENTE RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RESPUESTA PERCENT\",\"DROP PERCENT\",\"AGENTE LOGIN TIME (H:M:S)\",\"AGENTE PAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

    MULTI-CAMPAIGN BREAKDOWN
    CAMPAIGNSLLAMADAS TOTALES
    SYSTEM RELEASE CALLS
    AGENTE RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO RESPUESTA PERCENT
    DROP PERCENT
    AGENTE LOGIN TIME (H:M:S)
    AGENTE PAUSE TIME (H:M:S)
    "; + $SUBGRAPH.=""; + $SUBGRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENTE RELEASE CALLSSALE CALLSDNC CALLSNO RESPUESTA PERCENTDROP PERCENTAGENTE LOGIN TIMEAGENTE PAUSE TIME

     


    "; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1131,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1150,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hRESPUESTAcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1166,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1216,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
    $SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
    INTERVALLLAMADAS TOTALES
    SYSTEM RELEASE CALLS
    AGENTE RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO RESPUESTA PERCENT
    DROP PERCENT
    AGENTE LOGIN TIME (H:M:S)
    AGENTE PAUSE TIME (H:M:S)
    ".$SUBgraph_stats[$d][1]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
    TOTAL:".trim($hTOTcalls_count)."
    "; + $SUBSYSTEMRELEASE_graph.="
    TOTAL:".trim($hTOTsystem_count)."
    "; + $SUBAGENTRELEASE_graph.="
    TOTAL:".trim($hTOTagent_count)."
    "; + $SUBSALES_graph.="
    TOTAL:".trim($hTOTptp_count)."
    "; + $SUBDNCS_graph.="
    TOTAL:".trim($hTOTrtp_count)."
    "; + $SUBNAS_graph.="
    TOTAL:".trim($hTOTna_percent)."%
    "; + $SUBDROPS_graph.="
    TOTAL:".trim($hTOTdrop_percent)."%
    "; + $SUBLOGINTIME_graph.="
    TOTAL:".trim($hTOTagent_sec)."
    "; + $SUBPAUSETIME_graph.="
    TOTAL:".trim($hTOTpause_sec)."
    "; + $JS_onload.="\tDraw".$SUBrpt_campaign."CampañaGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."CampañaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1270,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALS Campañas: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALS Campañas: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H')."
    TOTAL:".trim($TOTcalls_count)."
    "; + $SYSTEMRELEASE_graph.="
    TOTAL:".trim($TOTsystem_count)."
    "; + $AGENTRELEASE_graph.="
    TOTAL:".trim($TOTagent_count)."
    "; + $SALES_graph.="
    TOTAL:".trim($TOTptp_count)."
    "; + $DNCS_graph.="
    TOTAL:".trim($TOTrtp_count)."
    "; + $NAS_graph.="TOTAL:".trim($TOTna_percent)."%"; + $DROPS_graph.="TOTAL:".trim($TOTdrop_percent)."%"; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiCampañaGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiCampañaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo "
    "; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; } ?> -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php index 89041995..94634ffc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -30,6 +30,8 @@ # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100814-2307 - Added display of preset dials if presets are enabled in the campaign # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -68,6 +70,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -79,6 +83,8 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';} $report_name = 'Outbound Calling Report'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -392,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

    Exponer as:
    "; +echo "\n
    "; echo "Shift:  
    "; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           MODIFICAR \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK ENVIAR\n";
    +	}
    +
    +else
    +	{
    +	echo "Live Current Agentes logged in to take calls from $group - $selected_name         $NOW_TIME\n";
    +
    +	echo "\n";
    +
    +	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +
    +	$TOTALagents =	sprintf("%10s", $row[0]);
    +
    +	echo "Total agents:       $TOTALagents\n";
    +
    +
    +	##############################
    +	#########  LIVE AGENTE STATS
    +	$user_list='|';
    +	echo "\n";
    +	echo "---------- LIVE AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +	echo "| #    | USUARIO                        | CAMPAIGN             | STATUS | LAST ACTIVITY       |\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$users_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $users_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		$campaign_id =	sprintf("%-8s", $row[2]);
    +		$status =		sprintf("%-6s", $row[3]);
    +		$time =			sprintf("%-19s", $row[4]);
    +		$user_list .=	"$row[0]---$row[3]|";
    +
    +		echo "| $FMT_i | $user | $campaign_id   Tiempo Real | $status | $time |\n";
    +		}
    +
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	
    +	if ($DB) {echo "\n$user_list\n";}
    +
    +	##############################
    +	#########  ALL AGENTE STATS
    +
    +	echo "\n";
    +	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +	echo "| #    | USUARIO                        | LOGGED IN |\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +
    +	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$Xusers_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $Xusers_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		if (preg_match("/\|$row[0]---/",$user_list))
    +			{
    +			$userstatusARY =	explode("|$row[0]---",$user_list);
    +			$userstatus =		explode('|',$userstatusARY[1]);
    +			$status_line =		sprintf("%-9s", $userstatus[0]);
    +
    +			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
    +			}
    +		else
    +			{$status_line = '         ';}
    +
    +		echo "| $FMT_i | $user | $status_line |\n";
    +		}
    +
    +	echo "+------+--------------------------------+-----------+\n";
    +	
    +	}
    +
    +
    +?>
    +
    + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_log_display.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_log_display.php deleted file mode 100644 index c0cf6161..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: AGPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "
    \n\n"; - -echo "
    \n\n";
    -
    -
    -echo "VICIDIAL ADMIN Change Log                             $NOW_TIME\n";
    -
    -#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
    -passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
    -
    -
    -?>
    -
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_template_maker.php new file mode 100644 index 00000000..6f25ff89 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="ENVIAR LA PLANTILLA" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
    **NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="BORRAR LA PLANTILLA" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
    **$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
    ##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"AYUDA\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
    + + +
    Listloader creador de plantillas personalizadas
    + +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
    $error_msg
    $success_msg
    Crear una nueva plantillaEliminar una plantilla existente
    +
    + Ejemplo de archivo de plantilla de montaje:
    ()


    +
    +
    Seleccione plantilla para eliminar:


    +
            DE NUEVO AL ADMIN         Go to Lead Loader    
    + +
    + + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php index 9cfff39c..94d5f8a3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -42,11 +44,15 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Single Agent Daily'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; echo "Single Agent Daily\n"; @@ -242,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="
    \n";
    +	$GRAPH_text.="
    \n";
     	}
     
     if (strlen($group[0]) < 1)
    @@ -282,10 +314,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Situación días Report: $user                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENTE Detalles -------------\n\n";
    +		$ASCII_text.="Agent Situación días Report: $user                     $NOW_TIME\n";
    +		$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$ASCII_text.="---------- AGENTE Detalles -------------\n\n";
    +		$GRAPH_text.="Agent Situación días Report: $user                     $NOW_TIME\n";
    +		$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$GRAPH_text.="---------- AGENTE Detalles -------------\n";
     		}
     	else
     		{
    @@ -305,7 +339,7 @@ else
     	$date_namesARY[0]='';
     	$k=0;
     
    -	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
    +	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$rows_to_print = mysql_num_rows($rslt);
    @@ -341,10 +375,17 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "LEAD STATS BREAKDOWN:\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    -		echo "| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		for ($i=0; $i$SstatusTXT";
    +		}
    +
     		}
     	else
     		{
    @@ -355,6 +396,18 @@ else
     	$m=0;
     	$CIScountTOT=0;
     	$DNCcountTOT=0;
    +
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_cicalls=1;
    +	$max_dncci=1;
    +	$GRAPH="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -370,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -388,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -427,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -467,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -496,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -515,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -530,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -557,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
    LEAD STATS BREAKDOWN
    ESTADOCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="
    TOTAL:".trim($CIScountTOT)."
    "; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n
    "; } else { @@ -592,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
    \n"; echo "
    Fechas:
    "; @@ -642,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
    "; +echo "Exponer as:   
    "; +echo "\n

    "; echo "
    Usuario:
    "; echo "\n"; echo "
    Shift:
    "; @@ -669,35 +817,38 @@ echo "
    "; echo "
    \n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if ($report_display_type=="TEXT" || !$report_display_type) 
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php
    index 5df4e9e4..4687d610 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     #
    @@ -26,6 +26,10 @@
     # 100712-1324 - Added system setting slave server option
     # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
     # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 110703-1739 - Added file download option
    +# 111007-0709 - Changed user and fullname to use non-truncated for output file
    +# 111104-1249 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -52,20 +56,24 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
     	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
     if (isset($_GET["ENVIAR"]))					{$ENVIAR=$_GET["ENVIAR"];}
     	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
    +if (isset($_GET["file_download"]))				{$file_download=$_GET["file_download"];}
    +	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    -$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
    -
     $report_name = 'Agent Performance Detalle';
     $db_source = 'M';
    +$JS_text="\n";
    -echo "\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
     
    -echo "\n";
    -echo "$report_name\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="$report_name\n";
     
     	$short_header=1;
     
    -	require("admin_header.php");
    +#	require("admin_header.php");
     
    -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "
    Fechas:
    "; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
    Fechas:
    "; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$HTML_text.="\n"; -echo "
    to
    "; +$HTML_text.="
    to
    "; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$HTML_text.="\n"; -echo "
    Campañas:
    "; -echo "
    Campañas:
    "; +$HTML_text.="\n"; -echo "
    Grupos De Usuario:
    "; -echo "\n"; +$HTML_text.="
    Grupos De Usuario:
    "; +$HTML_text.="\n"; -echo "
    Shift:
    "; -echo "

    \n"; -echo "\n"; -echo "
            "; +$HTML_text.="\n"; +$HTML_text.="Shift:
    "; +$HTML_text.="

    \n"; +$HTML_text.="Exponer as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; -echo "          \n"; -echo " INFORMES \n"; -echo "\n"; -echo "
    "; +$HTML_text.="          \n"; +$HTML_text.=" INFORMES \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; -echo "
    \n\n"; +$HTML_text.="\n\n"; -echo "
    \n";
    +$HTML_text.="
    \n";
     
     
     if (!$group)
     {
    -echo "\n";
    -echo "POR FAVOR SELECCIONE UNA CAMPAÑA Y FECHA-TEMNE ANTERIOR Y HAGA CLICK ENVIAR\n";
    -echo " NOTE: stats taken from shift specified\n";
    +$HTML_text.="\n";
    +$HTML_text.="POR FAVOR SELECCIONE UNA CAMPAÑA Y FECHA-TEMNE ANTERIOR Y HAGA CLICK ENVIAR\n";
    +$HTML_text.=" NOTE: stats taken from shift specified\n";
     }
     
     else
    @@ -371,10 +403,10 @@ $query_date_END = "$end_date $time_END";
     if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
     else {$ugSQL='';}
     
    -echo "Agent Performance Detalle                        $NOW_TIME\n";
    +$HTML_text.="Agent Performance Detalle                        $NOW_TIME\n";
     
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- AGENTS Detalles -------------\n\n";
    +$HTML_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +$HTML_text.="---------- AGENTS Detalles -------------\n\n";
     
     
     
    @@ -383,6 +415,12 @@ echo "---------- AGENTS Detalles -------------\n\n";
     $statuses='-';
     $statusesTXT='';
     $statusesHEAD='';
    +
    +$CSV_header="\"Agent Performance Detalle                        $NOW_TIME\"\n";
    +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
    +$CSV_header.="\"---------- AGENTS Detalles -------------\"\n";
    +$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
    +
     $statusesHTML='';
     $statusesARY[0]='';
     $j=0;
    @@ -391,10 +429,44 @@ $usersARY[0]='';
     $user_namesARY[0]='';
     $k=0;
     
    -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
    +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $rows_to_print = mysql_num_rows($rslt);
    +
    +$graph_stats=array();
    +$max_calls=1;
    +$max_time=1;
    +$max_pause=1;
    +$max_pauseavg=1;
    +$max_wait=1;
    +$max_waitavg=1;
    +$max_talk=1;
    +$max_talkavg=1;
    +$max_dispo=1;
    +$max_dispoavg=1;
    +$max_dead=1;
    +$max_deadavg=1;
    +$max_customer=1;
    +$max_customeravg=1;
    +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
    "; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -411,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -418,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -433,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [DESCARGAR]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -454,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -461,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -476,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -483,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -514,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -530,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -561,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -570,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -592,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -603,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -624,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -693,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
    CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
    USERCALLS
    TIME
    PAUSE
    PAUSE AVG
    WAIT
    WAIT AVG
    TALK
    TALK AVG
    DISPO
    DISPO AVG
    DEAD
    DEAD AVG
    CUST
    CUST AVG
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
    TOTAL:".trim($TOTcalls)."
    "; +$TIME_graph.="
    TOTAL:".trim($TOTtime_MS)."
    "; +$PAUSE_graph.="
    TOTAL:".trim($TOTtotPAUSE_MS)."
    "; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -717,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    TOTALNONPAUSEPAUSE
    "; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -736,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -746,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -759,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [DESCARGAR]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Detalle $NOW_TIME\"\n"; +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -786,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -793,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -808,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -815,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -840,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -852,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -878,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -885,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -900,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -930,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n
    $db_source"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
    PAUSE CODE BREAKDOWN
    ESTADOTOTAL
    NONPAUSE
    PAUSE
    $Sstatus
    ".sec_convert($graph_stats[$d][1], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".sec_convert($graph_stats[$d][($e+4)], 'H')."
    TOTAL:".trim($TOTtotTOTAL_MS)."
    "; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
    $db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php index 8ffeb09e..72cf1722 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -43,11 +45,15 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Agent Status Detalle'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; echo "$report_name\n"; @@ -290,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="\n\n\n
    \n";
    +	$GRAPH.="
    \n";
     	}
     
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
    -	echo "\n";
    +	echo "
    \n\n\n";
     	echo "POR FAVOR SELECCIONE UNA CAMPAÑA O GRUPO DE USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK ENVIAR\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
    @@ -330,10 +359,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Status Detalle Report                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENTE Detalles -------------\n\n";
    +		$ASCII_text.="

    Agent Status Detalle Report $NOW_TIME\n"; + $ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- AGENTE Detalles -------------\n\n"; + $GRAPH.="

    Agent Status Detalle Report $NOW_TIME\n"; + $GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- AGENTE Detalles -------------"; } else { @@ -357,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -376,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -391,10 +428,18 @@ else if ($file_download < 1) { - echo "CALLS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { @@ -406,6 +451,18 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; @@ -422,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -439,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -448,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -492,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -531,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -559,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -578,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -593,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -622,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    CALL STATS BREAKDOWN
    ESTADOCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -655,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Fechas:
    "; @@ -726,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

    \n"; +echo "Exponer as:
    "; +echo "\n

    "; echo "\n"; echo "
            "; @@ -738,35 +891,38 @@ echo "
    "; echo "
    \n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if (!$report_display_type || $report_display_type=="TEXT")
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "                              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "                              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "                              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "                              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    \ No newline at end of file
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php
    index 9bca0328..0278fc0b 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php
    @@ -4,7 +4,7 @@
     # Pulls time stats per agent selectable by campaign or user group
     # should be most accurate agent stats of all of the reports
     #
    -# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     # 90522-0723 - First build
    @@ -15,6 +15,14 @@
     # 100712-1324 - Added system setting slave server option
     # 100802-2347 - Added User Group Allowed Reports option validation
     # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
    +# 101207-1719 - Fixed download file formatting bugs(issue 394)
    +# 101208-0320 - Fixed issue 404
    +# 110307-1057 - Added user_case setting in options.php
    +# 110623-0728 - Fixed user group selection bug
    +# 110708-1727 - Added options.php setting for time precision
    +# 111104-1248 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -41,14 +49,33 @@ if (isset($_GET["DB"]))						{$DB=$_GET["DB"];}
     	elseif (isset($_POST["DB"]))			{$DB=$_POST["DB"];}
     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["ENVIAR"]))					{$ENVIAR=$_GET["ENVIAR"];}
    +	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($stage)<2) {$stage='NAME';}
     
    -$report_name = 'Agent Time Detail';
    +$report_name = 'Agente Tiempo Detalle';
     $db_source = 'M';
    +$JS_text="\n";
     	echo "\n";
    +	echo "\n";
     
     	echo "\n";
     	echo "$report_name\n";
    @@ -271,7 +321,7 @@ if ($file_download < 1)
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
     	echo "\n";
    -	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
    +	echo "POR FAVOR SELECCIONE UNA CAMPAÑA O GRUPO DE USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK ENVIAR\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
     
    @@ -309,13 +359,13 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Time Detail                     $NOW_TIME\n";
    +		echo "Agente Tiempo Detalle                     $NOW_TIME\n";
     
     		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     	else
     		{
    -		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
    +		$file_output .= "Agente Tiempo Detalle                     $NOW_TIME\n";
     		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     
    @@ -326,11 +376,34 @@ else
     	############################################################################
     
     	### BEGIN gather user IDs and names for matching up later
    -	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
    +	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$users_to_print = mysql_num_rows($rslt);
     	$i=0;
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_timeclock=1;
    +	$max_agenttime=1;
    +	$max_wait=1;
    +	$max_talk=1;
    +	$max_dispo=1;
    +	$max_pause=1;
    +	$max_dead=1;
    +	$max_customer=1;
    +	$GRAPH="";
    +	$GRAPH2="";
    +	$graph_header="
    CALLSTIME CLOCKAGENTE TIMEWAITTALKDISPOPAUSEDEADCUSTOMER
    "; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -342,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -369,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -390,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -404,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -423,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -492,14 +568,16 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="AGENTE TIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | AGENTE TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { - $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENTE TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -523,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -566,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -575,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -602,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -655,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -691,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -703,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -726,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -753,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -768,53 +899,132 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
    AGENTE TIME BREAKDOWN
    ESTADOCALLS
    TIME CLOCK
    AGENTE TIME
    WAIT
    TALK
    DISPO
    PAUSE
    DEAD
    CUSTOMER
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
    TOTAL:".trim($hTOTcalls)."
    "; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -855,8 +1065,22 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Fechas:
    "; echo "\n"; echo ""; @@ -869,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunes week start
    Campaigns:
    "; +echo "
    Campañas:
    "; echo "\n"; -echo "
    User Groups:
    "; +echo "
    Grupos De Usuario:
    "; echo "

    \n"; -echo "\n"; +echo "Exponer as:
    "; +echo "\n

    "; +echo "\n"; echo "
            "; echo "          \n"; -echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " DESCARGAR | \n"; +echo " INFORMES \n"; echo "\n"; echo "
    "; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php index 89eee30b..089ade87 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -26,7 +28,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -46,7 +48,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -62,6 +64,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; @@ -69,14 +73,14 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -90,47 +94,69 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "$report_name"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -151,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentHoja de tiempofor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "Usuario ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentHoja de tiempofor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="Usuario ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -180,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentHoja de tiempo $NOW_TIME\n"; +$MAIN.="AgentHoja de tiempo $NOW_TIME\n"; + +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentHoja de tiempo- $NOW_TIME\"\n"; +$CSV_text_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"AGENTE TIME SHEET: $agent - $full_name\"\n\n"; -echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -220,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "LLAMADAS TOTALES TAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="LLAMADAS TOTALES TAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[DESCARGAR]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"LLAMADAS TOTALES TAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE AGENTE TIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -271,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; +$MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[DESCARGAR]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK TIEMPO LOGIN/LOGOUT:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"HORAS:MINUTOS\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -299,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -313,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -329,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE><BR>$db_source\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php index 6b03fb37..425c6b4c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php @@ -3,7 +3,7 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build @@ -11,6 +11,8 @@ # 100712-1324 - Added system setting slave server option and added user stats link dates # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -38,13 +40,14 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} -$report_name = 'User Timeclock Detail Report'; +$report_name = 'UsuarioReloj de tiempo Detalle Informe'; $db_source = 'M'; ############################################# @@ -70,7 +73,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -93,7 +96,7 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -103,21 +106,54 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -135,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -146,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -231,6 +267,7 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; @@ -249,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "POR FAVOR SELECCIONE UNA CAMPAÑA O GRUPO DE USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK ENVIAR\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -287,13 +324,13 @@ else if ($file_download < 1) { - echo "User Time-Clock Detail $NOW_TIME\n"; + echo "Usuario Time-Clock Detalle $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; } else { - $file_output .= "User Time-Clock Detail $NOW_TIME\n"; + $file_output .= "Usuario Time-Clock Detalle $NOW_TIME\n"; $file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n"; } @@ -304,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -346,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">USER GROUP</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="AGENTE TIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">GRUPO DE USUARIOS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"AGENTE TIME-CLOCK DETAIL\" class=\"horizontalgraph\">\n"; + $GRAPH.=" <caption align=\"top\">AGENTE TIME-CLOCK DETAIL</caption>\n"; + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">USER/GRUPO DE USUARIOS</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\" nowrap>TIME CLOCK </th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">TIME CLOCK PUNCHES</th>\n"; + $GRAPH.=" </tr>\n"; + } else { @@ -368,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -405,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -421,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -475,6 +525,11 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser&begin_date=$query_date_D&end_date=$end_date_D\">$Suser[$m]</a> | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -506,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -516,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i<count($graph_stats); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($graph_stats)) {$class=" last";} else {$class="";} + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][0]."</th>\n"; + $GRAPH.=" <th class=\"thgraph value$class\" scope=\"col\" nowrap><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(200*$graph_stats[$i][1]/$max_time)."\" height=\"16\" />".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."</th>\n"; + $GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][3]."</th>\n"; + $GRAPH.=" </tr>\n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";} ### BEGIN sort through output to display properly ### @@ -543,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -572,12 +636,22 @@ else if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTALS</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">AGENTS: $TOT_AGENTS</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">$TOTtimeTC</th>\n"; + $GRAPH.=" </tr>\n"; + $GRAPH.=" </table>\n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n</PRE>"; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.="</PRE>"; + $GRAPH.="</PRE>"; } else { @@ -614,12 +688,20 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section ############################################################################ echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>"; +echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Fechas:<BR>"; echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n"; echo "<INPUT TYPE=hidden NAME=query_date ID=query_date VALUE=\"$query_date\">\n"; echo "<INPUT TYPE=hidden NAME=end_date ID=end_date VALUE=\"$end_date\">\n"; @@ -634,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunes week start </script> <?php @@ -651,7 +733,7 @@ var o_cal = new tcal ({ 'controlname': 'end_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunes week start </script> <?php @@ -672,13 +754,13 @@ echo "   <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$end_d # } # echo "</SELECT>\n"; -echo "</TD><TD VALIGN=TOP>User Groups:<BR>"; +echo "</TD><TD VALIGN=TOP>Grupos De Usuario:<BR>"; echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; if (eregi("--ALL--",$user_group_string)) - {echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} + {echo "<option value=\"--ALL--\" selected>-- ALL GRUPOS DE USUARIO --</option>\n";} else - {echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} + {echo "<option value=\"--ALL--\">-- ALL GRUPOS DE USUARIO --</option>\n";} $o=0; while ($user_groups_to_print > $o) { @@ -687,6 +769,11 @@ while ($user_groups_to_print > $o) $o++; } echo "</SELECT>\n"; +echo "</TD><TD VALIGN=TOP>"; +echo "Exponer as:   <BR>"; +echo "<select name='report_display_type'>"; +if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";} +echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>"; echo "</TD><TD VALIGN=TOP>Shift:<BR>"; echo "<SELECT SIZE=1 NAME=shift>\n"; echo "<option selected value=\"$shift\">$shift</option>\n"; @@ -710,15 +797,15 @@ function submit_form() </SCRIPT> -<input type=button value="SUBMIT" name=smt id=smt onClick="submit_form()"> +<input type=button value="ENVIAR" name=smt id=smt onClick="submit_form()"> <?php echo "</TD><TD VALIGN=TOP>         "; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>          \n"; -echo " <a href=\"$LINKbase&stage=$stage&file_download=1\">DOWNLOAD</a> | \n"; -echo " <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n"; +echo " <a href=\"$LINKbase&stage=$stage&file_download=1\">DESCARGAR</a> | \n"; +echo " <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n"; echo "</FONT>\n"; echo "</TD></TR></TABLE>"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_campaign_status_list_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_campaign_status_list_report.php new file mode 100644 index 00000000..458b1889 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_campaign_status_list_report.php @@ -0,0 +1,471 @@ +<?php +# AST_campaign_status_list_report.php +# +# This report is designed to show the breakdown by list_id of the calls and +# their statuses for all lists within a campaign for a set time period +# +# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 110815-2138 - First build +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$report_name="Campaña Status List Report"; +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;} +if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;} +if (!isset($query_date_T)) {$query_date_T="00:00:00";} +if (!isset($end_date_T)) {$end_date_T="23:59:59";} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + +$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER); +$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (preg_match("/-ALL/",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = preg_replace("/,\$/",'',$group_SQL); + $group_SQL_str=$group_SQL; + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$query_date="$query_date_D $query_date_T"; +$end_date="$end_date_D $end_date_T"; + +$HTML_head.="<HTML>\n"; +$HTML_head.="<HEAD>\n"; +$HTML_head.="<STYLE type=\"text/css\">\n"; +$HTML_head.="<!--\n"; +$HTML_head.=" .green {color: white; background-color: green}\n"; +$HTML_head.=" .red {color: white; background-color: red}\n"; +$HTML_head.=" .blue {color: white; background-color: blue}\n"; +$HTML_head.=" .purple {color: white; background-color: purple}\n"; +$HTML_head.="-->\n"; +$HTML_head.=" </STYLE>\n"; + +$HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n"; + +$HTML_head.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HTML_head.="<TITLE>$report_name$group_S\n"; +$short_header=1; + +# require("admin_header.php"); + +$HTML_text.="
    "; + +$HTML_text.="\n"; +$HTML_text.="
    Fechas:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campañas:
    "; +$HTML_text.="\n"; + +$HTML_text.="
     \n"; +$HTML_text.="\n"; +$HTML_text.="Exponer as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DESCARGAR |"; +$HTML_text.=" INFORMES \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="\n\n"; + +$HTML_text.="
    ";
    +$i=0;
    +$group_string='|';
    +$group_ct = count($group);
    +$JS_text.="\n";
    +
    +if ($report_display_type=="HTML")
    +	{
    +	$HTML_text.=$JS_text.$GRAPH;
    +	}
    +else
    +	{
    +	$HTML_text.=$ASCII_text;
    +	}
    +
    +$HTML_text.="
    "; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_carrier_log_report.php new file mode 100644 index 00000000..ee199900 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Del Servidor:
    \n"; +$MAIN.="
    \n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($ENVIAR && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [DESCARGAR]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVIDOR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RESPUESTAED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVIDOR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RESPUESTAED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="
    \n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_dialer_inventory_report.php new file mode 100644 index 00000000..0559be5c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Informe de Inventario'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Campañas:
    "; +$campaign_span_txt.=""; + +$list_span_txt="Listas:
    "; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
    "; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
    \n";
    +
    +$rpt_header="";
    +####### STAT GENERATION #######
    +require("count_functions.inc");
    +function GetListCount($list_id, $inventory_ptnstr) 
    +	{
    +	global $list_start_inv;
    +	global $new_count;
    +	global $link;
    +	global $total_calls;
    +	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
    +	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
    +	$ct_rslt=mysql_query($ct_stmt, $link);
    +	$new_count=0; $total_calls=0;
    +	while ($ct_row=mysql_fetch_row($ct_rslt)) 
    +		{
    +		$list_start_inv+=$ct_row[2];
    +		$total_calls+=($ct_row[1]*$ct_row[2]);
    +		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
    +		}
    +	}
    +
    +if ($ENVIAR) 
    +	{
    +
    +	$total_list_start_inv=0;
    +	$total_dialable_count=0;
    +	$total_dialable_count_nofilter=0;
    +	$total_dialable_count_oneoff=0;
    +	$total_dialable_count_inactive=0;
    +	$total_total_calls=0;
    +	$total_average_call_count=0;
    +	$total_penetration=0;
    +
    +	if ($snapshot_time && $report_source=="SNAPSHOT") 
    +		{
    +		$rpt_header="SNAPSHOT from $snapshot_time\n";
    +		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
    +		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
    +		$rslt=mysql_query($stmt, $link);
    +		$shift_SQL_str="";
    +		while ($shift_row=mysql_fetch_array($rslt)) 
    +			{
    +			$shift_data1=explode("|", $shift_row["shift_data"]);
    +			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
    +		$shift_rslt=mysql_query($shift_stmt, $link);
    +		$c=0;
    +		while($shift_row=mysql_fetch_array($shift_rslt)) 
    +			{
    +			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
    +			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
    +			$rpt_header_SHIFTS_lower.="          |";
    +			$rpt_header_Border.="----------+";
    +			$shift_ary[$c]=$shift_row["shift_id"];
    +			$total_varname="total_".$shift_row["shift_id"];
    +			$$total_varname=0;
    +			if ($DB > 0) {echo "
    -$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
    -$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
    \n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_Border.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPAIGNS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL ESTATUTOS: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL ESTATUTOS: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " DIAL ESTATUTOS: |$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + $rpt_header.="| Call list | List description | Campaña | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Campaña\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + #### PRINT TOTALS #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + } +$HTML_header.="
    \n"; +############################### + +$HTML_text="
    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Report type:
    Campañas
    List
    \n"; +$HTML_text.="
     \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Time setting:
    Server
    Local
    Ignore local campaign call time
    (default to 24 hours)
    \n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
    Report source:
    Snapshot
    Real-time
     
    $snapshot_span_txt\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n"; +$HTML_text.="           DESCARGAR | INFORMES

    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n\n";
    +
    +$HTML_text.="$rpt_header";
    +$HTML_text.="$rpt_body";
    +$HTML_text.="$rpt_footer";
    +
    +$time_end = microtime(true);
    +$ENDtime = date("U");
    +$time = $ENDtime - $STARTtime;
    +
    +$HTML_text.="Executed in $time seconds\n";
    +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_hangup_cause_report.php new file mode 100644 index 00000000..aef23ca5 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Del Servidor:
    \n"; +$MAIN.="
    Hangup Cause/Dial Status:
    "; +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($ENVIAR && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [DESCARGAR]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVIDOR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RESPUESTAED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVIDOR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RESPUESTAED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_inbound_daily_report.php new file mode 100644 index 00000000..86b8f3b9 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DESCARGAR | MODIFICAR | INFORMES
    Show hourly results
    \n"; +$MAIN.="
    \n\n"; + +$MAIN.="
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$time1 = strtotime($time_BEGIN);
    +	$time2 = strtotime($time_END)+1;
    +
    +	$hpd = ceil(($time2 - $time1) / 3600);
    +	if ($hpd<0) {$hpd+=24;}
    +
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
    +	$MAIN.="Selected in-group: $group\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
    +	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
    +	$CSV_text.="Selected in-group: $group\n";
    +	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
    +
    +	$d=0; $q=0; $hr=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
    +
    +		if ($hourly_breakdown) 
    +			{
    +			$dEQepoch = $dSQepoch+3599;
    +			}
    +			else
    +			{
    +			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
    +			if ($EQsec < $SQsec)
    +				{
    +				$dEQepoch = ($dEQepoch + 86400);
    +				}
    +			}
    +
    +		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +	#  || $time_END<=date("H:i:s", $dEQepoch)
    +		if ($hr>=($hpd-1) || !$hourly_breakdown) 
    +			{
    +			$d++;
    +			$hr=0;
    +			if (date("H:i:s", $dEQepoch)>$time_END) 
    +				{
    +				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
    +				}
    +			}
    +			else
    +			{
    +			$hr++;
    +			}
    +		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
    +		$q++;
    +
    +		}
    +	$prev_week=$daySTART[0];
    +	$prev_month=$daySTART[0];
    +	$prev_qtr=$daySTART[0];
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### CONSTRUCCION HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $q;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$ASCII_text.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$qs[$i] = $row[0];
    +		$dt[$i] = 0;
    +		$ut[$i] = ($row[1] - $SQepochDAY);
    +		while($ut[$i] >= $epoch_interval) 
    +			{
    +			$ut[$i] = ($ut[$i] - $epoch_interval);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +		$ls[$i] = $row[2];
    +		$st[$i] = $row[3];
    +		$tr[$i] = $row[4];
    +		$at[$i] = $row[5]; # Actual time
    +
    +		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
    +
    +		$i++;
    +		}
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totDROPS=0;
    +	$totQUEUE=0;
    +	$totCALLSsec=0;
    +	$totDROPSsec=0;
    +	$totQUEUEsec=0;
    +	$totCALLSmax=0;
    +	$totDROPSmax=0;
    +	$totQUEUEmax=0;
    +	$totCALLSdate=$MT;
    +	$totDROPSdate=$MT;
    +	$totQUEUEdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtDROPS=$MT;
    +	$qrtQUEUE=$MT;
    +	$qrtCALLSsec=$MT;
    +	$qrtDROPSsec=$MT;
    +	$qrtQUEUEsec=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtDROPSavg=$MT;
    +	$qrtQUEUEavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$qrtDROPSmax=$MT;
    +	$qrtQUEUEmax=$MT;
    +
    +	$totABANDONSdate=$MT;
    +	$totRESPUESTASdate=$MT;
    +
    +	$totRESPUESTAS=0;
    +	$totABANDONS=0;
    +	$totRESPUESTASsec=0;
    +	$totABANDONSsec=0;
    +	$totRESPUESTASspeed=0;
    +
    +	$FtotRESPUESTAS=0;
    +	$FtotABANDONS=0;
    +	$FtotRESPUESTASsec=0;
    +	$FtotABANDONSsec=0;
    +	$FtotRESPUESTASspeed=0;
    +
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
    +	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
    +	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
    +		$totABANDONSdate[$j]=0;
    +		$totABANDONSsecdate[$j]=0;
    +		$totRESPUESTASdate[$j]=0;
    +		$totRESPUESTASsecdate[$j]=0;
    +		$totRESPUESTASspeeddate[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
    +				{
    +				$totCALLS++;
    +				$totCALLSsec = ($totCALLSsec + $ls[$i]);
    +				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
    +	#			$qrtCALLS[$j]++;
    +	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
    +	#			$dtt = $dt[$i];
    +				$totCALLSdate[$j]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
    +					{
    +					$totABANDONSdate[$j]++;
    +					$totABANDONSsecdate[$j]+=$ls[$i];
    +					$FtotABANDONS++;
    +					$FtotABANDONSsec+=$ls[$i];
    +					}
    +					else 
    +					{
    +					$totRESPUESTASdate[$j]++;
    +					$totRESPUESTASsecdate[$j]+=($ls[$i]-$qs[$i]-15);
    +					$totRESPUESTASspeeddate[$j]+=$qs[$i];
    +					$FtotRESPUESTAS++;
    +					$FtotRESPUESTASsec+=($ls[$i]-$qs[$i]-15);
    +					$FtotRESPUESTASspeeddate+=$qs[$i];
    +					}
    +				if (ereg('DROP',$st[$i])) 
    +					{
    +					$totDROPS++;
    +					$totDROPSsec = ($totDROPSsec + $ls[$i]);
    +					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
    +	#				$qrtDROPS[$j]++;
    +	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
    +					$totDROPSdate[$j]++;
    +	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
    +	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
    +					}
    +				if ($qs[$i] > 0) 
    +					{
    +					$totQUEUE++;
    +					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
    +					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
    +	#				$qrtQUEUE[$j]++;
    +	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
    +					$totQUEUEdate[$j]++;
    +	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
    +	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
    +					}
    +	/*
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +	*/
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +	###################################################
    +	### TOTALS SUMMARY SECTION ###
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
    +	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | RESPUESTA | TALK   | TALK       | WRAP       | CALL       |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | RESPUESTAED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
    +	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"RESPUESTA\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
    +	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"RESPUESTAED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
    +
    +	##########################
    +	$JS_text="\n";
    +
    +	if ($report_display_type=="HTML") 
    +		{
    +		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (20 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (20 / $hi_hold_count);}
    +
    +
    +	$ENDtime = date("U");
    +	$RUNtime = ($ENDtime - $STARTtime);
    +	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
    +	$MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php index 98763450..22f804f1 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php @@ -105,7 +105,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_team_performance_detail.php new file mode 100644 index 00000000..1d57d584 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Detalle'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
    Fechas:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Rango de Fecha:
    \n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campañas:
    "; +$HTML_text.="\n"; + +$HTML_text.="
    Teams/Grupos De Usuario:
    "; +$HTML_text.="\n"; +$HTML_text.="
    Show additional statuses:
    "; +$HTML_text.="
    \n"; +$HTML_text.="Exponer as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DESCARGAR |"; +$HTML_text.=" INFORMES \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +if ($ENVIAR=="ENVIAR") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
    ";
    +	$total_average_sale_time=0;
    +	$total_average_contact_time=0;
    +	$total_talk_time=0; 
    +	$total_system_time=0; 
    +	$total_calls=0;	
    +	$total_leads=0;
    +	$total_contacts=0;
    +	$total_sales=0;
    +	$total_inc_sales=0;
    +	$total_cnc_sales=0;
    +	$total_callbacks=0;
    +	$total_stcall=0;
    +	for ($q=0; $q".$call_status[$q]."";
    +	}
    +	$total_graph_stats[]="";
    +	$max_totalcalls=1;
    +	$max_totalleads=1;
    +	$max_totalcontacts=1;
    +	$max_totalcontactratio=1;
    +	$max_totalsystemtime=1;
    +	$max_totaltalktime=1;
    +	$max_totalsales=1;
    +	$max_totalsalesleadsratio=1;
    +	$max_totalsalescontactsratio=1;
    +	$max_totalsalesperhour=1;
    +	$max_totalincsales=1;
    +	$max_totalcancelledsales=1;
    +	$max_totalcallbacks=1;
    +	$max_totalfirstcall=1;
    +	$max_totalavgsaletime=1;
    +	$max_totalavgcontacttime=1;
    +	$TOTALGRAPH="

    "; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALSALES_graph=$TOTALGRAPH_header.""; + $TOTALSALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

    CALL CENTER TOTAL
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    "; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALS ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    TEAM: $user_group[$i] - $group_name
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    ".$graph_stats[$d][0]."".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][12]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][13]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][14]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
    TOTAL:".trim($group_calls)."
    "; + $LEADS_graph.="
    TOTAL:".trim($group_leads)."
    "; + $CONTACTS_graph.="
    TOTAL:".trim($group_contacts)."
    "; + $CONTACTRATIO_graph.="
    TOTAL:".trim($group_contact_ratio)."%
    "; + $SYSTEMTIME_graph.="
    TOTAL:".sec_convert($group_system_time,'H')."
    "; + $TALKTIME_graph.="
    TOTAL:".sec_convert($group_talk_time,'H')."
    "; + $SALES_graph.="
    TOTAL:".trim($group_sales)."
    "; + $SALESLEADSRATIO_graph.="TOTAL:".trim($group_sales_ratio)."%"; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALSYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALSALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALSALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALSALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALSYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALSALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALSALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALSALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALSALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALSYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALSALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALSALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALSALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALSALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php index b2e1c4af..de703788 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -69,10 +69,17 @@ # 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.4-60'; -$build = '101024-0832'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -138,6 +145,15 @@ if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} + $report_name = 'Tiempo Real Main Report'; $db_source = 'M'; @@ -171,6 +187,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -257,7 +274,6 @@ $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); $epochTWENTYFOURhoursAGO = ($STARTtime - 86400); $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); - $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -281,6 +297,86 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -291,12 +387,14 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="SELECT realtime_block_user_info,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $realtime_block_user_info = $row[0]; $LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} @@ -309,7 +407,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -359,6 +457,22 @@ while($i < $group_ct) } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { @@ -367,6 +481,13 @@ if ( ($group_ct < 1) or (strlen($group_string) < 2) ) $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -388,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -422,6 +569,20 @@ while ($groups_to_print > $o) } $select_list .= ""; $select_list .= "
    (Para seleccionar más de 1 campaña, mantenga pulsada la tecla Ctrl y haga clic en)"; + +$select_list .= "

    Select Grupos De Usuario:
    "; +$select_list .= ""; + $select_list .= ""; $select_list .= "Panel de Cierre

    "; $select_list .= ""; @@ -521,7 +682,7 @@ if ($presets_enabled_count > 0) if ($presets_enabled > 0) { $select_list .= "
    "; - $select_list .= "Show Presets Stats:
    "; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Tiempo Real Report                                                                               \n"; -echo "\n"; -echo "
    \n"; -echo "Elija Opciones de Informe"; -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       MODIFICAR | \n"; - } -else - { - echo "       MODIFICAR | \n"; - } -echo "SUMMARY \n"; -echo "\n\n"; + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1593,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1680,63 +1861,67 @@ echo ""; echo ""; 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Tiempo Real Report                                                                               \n"; + echo "\n"; + echo "
    \n"; + echo "Elija Opciones de Informe"; + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "SLOW | "; + echo "GO"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       MODIFICAR | \n"; + } + else + { + echo "       MODIFICAR | \n"; + } + echo "SUMMARY \n"; + echo "\n\n"; + } if (!$group) {echo "

    please select a campaign from the pulldown above\n"; exit;} @@ -1435,7 +1611,7 @@ else else {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y' $group_SQLand;"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } @@ -1448,13 +1624,13 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } @@ -1484,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1570,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo "
    - min   MAX NIVEL:  $maxDIALlev   $min_link  MAX NIVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    HOPPER NIVEL:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     DROPPED / RESPUESTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses     "; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       PIEL GRUPO DE USUARIOS"; - } -else - { - echo "       VIEW GRUPO DE USUARIOS"; - } -if ($SERVdisplay>0) - { - echo "       PIEL SERVIDOR INFO"; - } -else - { - echo "       DEMOSTRACIÓN SERVIDOR INFO"; - } -if ($CALLSdisplay>0) - { - echo "       PIEL WAITING CALLS"; - } -else - { - echo "       DEMOSTRACIÓN WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       PIEL GRUPO DE USUARIOS"; + } + else + { + echo "       VIEW GRUPO DE USUARIOS"; + } + if ($SERVdisplay>0) + { + echo "       PIEL SERVIDOR INFO"; + } + else + { + echo "       DEMOSTRACIÓN SERVIDOR INFO"; + } + if ($CALLSdisplay>0) + { + echo "       PIEL WAITING CALLS"; + } + else + { + echo "       DEMOSTRACIÓN WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       PIEL IN-GROUP STATS"; + } + else + { + echo "       DEMOSTRACIÓN IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       PIEL PHONES"; + } + else + { + echo "       DEMOSTRACIÓN PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       PIEL CUSTPHONES"; + } + else + { + echo "       DEMOSTRACIÓN CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       PIEL IN-GROUP STATS"; - } -else - { - echo "       DEMOSTRACIÓN IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       PIEL PHONES"; - } -else - { - echo "       DEMOSTRACIÓN PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       PIEL CUSTPHONES"; - } -else - { - echo "       DEMOSTRACIÓN CUSTPHONES"; - } echo "
    "; @@ -1826,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "PIELPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1994,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; +if ($RTajax > 0) + {$HTuser = " USER ";} if ($UidORname>0) { - $HTuser .= "DEMOSTRACIÓN ID "; + if ($RTajax > 0) + {$HTuser .= "DEMOSTRACIÓN ID ";} + else + { + $HTuser .= "DEMOSTRACIÓN ID "; + } } else { - $HTuser .= "DEMOSTRACIÓN NAME"; + if ($RTajax > 0) + {$HTuser .= "DEMOSTRACIÓN NAME";} + else + { + $HTuser .= "DEMOSTRACIÓN NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " GRUPO DE USUARIOS |"; +$HTusergroup = " GRUPO DE USUARIOS |"; +if ($RTajax > 0) + {$HTusergroup = " GRUPO DE USUARIOS |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -2026,9 +2243,13 @@ $HTserver_ip = " SERVIDOR IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVIDOR IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPAIGN |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -2115,7 +2336,11 @@ else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -2142,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -2160,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -2340,7 +2594,7 @@ $calls_to_list = mysql_num_rows($rslt); {$CM='A';} else { - if (eregi("Entrantes",$comments)) + if (eregi("INBOUND",$comments)) {$CM='I';} else {$CM='M';} @@ -2383,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2423,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2455,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2472,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2502,11 +2765,11 @@ $calls_to_list = mysql_num_rows($rslt); if ($realtime_block_user_info > 0) { - $Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } if ($realtime_block_user_info < 1) { - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } $j++; } @@ -2528,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2554,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt); echo "
    $Cecho";
     	}
     
    +echo "
    "; + +if ($RTajax < 1) + { + echo "
    "; + } ?> - -
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php index df4a6c5e..b2a7f001 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -19,10 +19,12 @@ # 100709-1806 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -34,12 +36,17 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='DEMOSTRACIÓN ALL CAMPAÑAS';} $report_name = 'Tiempo Real Campaña Summary'; $db_source = 'M'; @@ -48,7 +55,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -67,7 +74,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } @@ -75,13 +82,13 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -95,13 +102,13 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; @@ -111,7 +118,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -128,10 +135,15 @@ if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; } -$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -143,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; +$MAIN.=""; +$MAIN.="
    "; -echo "Tiempo Real All Campañas Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; +$MAIN.="Tiempo Real All Campañas Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="SLOW | "; +$MAIN.="GO "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + $MAIN.="+ VIEW MORE SETTINGS"; } else { - echo "- VIEW LESS SETTINGS"; + $MAIN.="- VIEW LESS SETTINGS"; } -echo "       INFORMES"; -echo "

    \n\n"; +$MAIN.="      DESCARGAR | INFORMES"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
    DIAL NIVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"DIAL NIVEL:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTER:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX NIVEL:\",\"$maxDIALlev\",\"DROPPED MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"DIAL TIMEOUT:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"DIALABLE LEADS:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"AVG AGENTS:\",\"$agentsONEMIN\",\"DIAL MÉTODO:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"HOPPER NIVEL:\",\"$HOPlev\",\"DROPPED / RESPUESTAED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"STATUSES:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDER:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"AGENTE AVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
    DIAL NIVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
      MAX NIVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
      MAX NIVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL MÉTODO:  $DIALmethod    
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL MÉTODO:  $DIALmethod    
    HOPPER NIVEL:  $HOPlev     DROPPED / RESPUESTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    HOPPER NIVEL:  $HOPlev     DROPPED / RESPUESTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +$MAIN.="
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    "; +$MAIN.="
    "; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
    "; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
    AGENTE AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; ### Header finish @@ -376,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -410,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo "LLAMADAS EN ESPERA\n"; + $MAIN.="LLAMADAS EN ESPERA\n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -435,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -488,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
    \n"; + $MAIN.="\n
    \n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
    ";
    -		echo "";
    +		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
    +		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
    +		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
    +		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
    +		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
    +				
    +		$MAIN.="
    ";
    +		$MAIN.="";
     	}
     	else
     	{
    -	echo " NO AGENTS ON CALLS
    \n"; + $MAIN.=" NO AGENTS ON CALLS
    \n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -511,18 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
    "; +$MAIN.="
    \n\n
    "; -echo "
    \n\n
    "; $k++; } +$MAIN.="\n\n
    "; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } -echo "$db_source\n"; ?> -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonpark.php index e91afcbb..08a07b25 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Agentes Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Agentes Time On Entrante Calls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php index c0b271ad..0baa968a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,10 +103,13 @@ $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, Tiempo Real Main Report, Tiempo Real Campaña Summary , Inbound Report, Inbound Service Level Report, Resumen horario de entrada Informe, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Pide Informe exportación , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List'; +$Vreports = 'NONE, Tiempo Real Main Report, Tiempo Real Campaña Summary , Entrante Report, Entrante Service Level Report, Resumen horario de entrada Informe, Entrante Daily Report, Entrante DID Report, Entrante IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Campaña Status List Report, Pide Informe exportación, Informe de las exportaciones genera , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Team Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List, Dialer Informe de Inventario, Maximum System Stats, Maximum Stats Detalle, Search Leads Logs'; -$UGreports = 'ALL INFORMES, NONE, Tiempo Real Main Report, Tiempo Real Campaña Summary , Inbound Report, Inbound Service Level Report, Resumen horario de entrada Informe, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Pide Informe exportación , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List, Custom Informes Links, CallCard Search'; +$UGreports = 'ALL INFORMES, NONE, Tiempo Real Main Report, Tiempo Real Campaña Summary , Entrante Report, Entrante Service Level Report, Resumen horario de entrada Informe, Entrante Daily Report, Entrante DID Report, Entrante IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Campaña Status List Report, Pide Informe exportación , Informe de las exportaciones genera , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Team Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List, Dialer Informe de Inventario, Custom Informes Links, CallCard Search, Maximum System Stats, Maximum Stats Detalle, Search Leads Logs'; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -325,16 +338,16 @@ 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_fast_refrescar"])) {$enable_fast_refrescar=$_GET["enable_fast_refrescar"];} + elseif (isset($_POST["enable_fast_refrescar"])) {$enable_fast_refrescar=$_POST["enable_fast_refrescar"];} 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["fast_refrescar_rate"])) {$fast_refrescar_rate=$_GET["fast_refrescar_rate"];} + elseif (isset($_POST["fast_refrescar_rate"])) {$fast_refrescar_rate=$_POST["fast_refrescar_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"];} @@ -599,8 +612,8 @@ 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["campaign_stats_refrescar"])) {$campaign_stats_refrescar=$_GET["campaign_stats_refrescar"];} + elseif (isset($_POST["campaign_stats_refrescar"])){$campaign_stats_refrescar=$_POST["campaign_stats_refrescar"];} 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"];} @@ -691,6 +704,8 @@ 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"];} @@ -1475,6 +1490,245 @@ if (isset($_GET["eht_minimum_prompt_seconds"])) {$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_refrescar"])) {$admin_modify_refrescar=$_GET["admin_modify_refrescar"];} + elseif (isset($_POST["admin_modify_refrescar"])) {$admin_modify_refrescar=$_POST["admin_modify_refrescar"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} @@ -1488,7 +1742,7 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -1511,6 +1765,21 @@ if ($qm_conf_ct > 0) $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]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -1583,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_refrescar = ereg_replace("[^0-9]","",$enable_fast_refrescar); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_refrescar_rate = ereg_replace("[^0-9]","",$fast_refrescar_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1617,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1705,6 +1973,48 @@ if ($non_latin < 1) $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_refrescar = ereg_replace("[^0-9]","",$admin_modify_refrescar); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1736,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_refrescar = ereg_replace("[^NY]","",$campaign_stats_refrescar); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1775,7 +2086,6 @@ if ($non_latin < 1) $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); $is_webphone = ereg_replace("[^NY]","",$is_webphone); $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); - $use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid); $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); @@ -1788,9 +2098,22 @@ if ($non_latin < 1) $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); $force_change_password = ereg_replace("[^NY]","",$force_change_password); $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1848,6 +2171,14 @@ if ($non_latin < 1) $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1863,6 +2194,7 @@ if ($non_latin < 1) $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1953,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1985,8 +2314,6 @@ if ($non_latin < 1) $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -2044,6 +2371,38 @@ if ($non_latin < 1) $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -2073,6 +2432,18 @@ if ($non_latin < 1) $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -2080,11 +2451,11 @@ if ($non_latin < 1) $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); ### ALPHA-NUMERIC and spaces and dashes and underscores - $preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name); + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); @@ -2102,77 +2473,88 @@ if ($non_latin < 1) ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); - $external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip); - $default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs); - $codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list); - $label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title); - $label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name); - $label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial); - $label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name); - $label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1); - $label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2); - $label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3); - $label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city); - $label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state); - $label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province); - $label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code); - $label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code); - $label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender); - $label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number); - $label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code); - $label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone); - $label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase); - $label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email); - $label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments); - $slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server); - $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name); - $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description); - $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -2202,10 +2584,13 @@ if ($non_latin < 1) $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma - $ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -2246,7 +2631,10 @@ if ($non_latin < 1) $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); - + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -2261,7 +2649,7 @@ if ($non_latin < 1) # $webphone_url # $webphone_url_override # $filter_url - + # $na_call_url ### VARIABLES not filtered at all ### # $script_text @@ -2577,44 +2965,135 @@ else # 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 # + # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-285'; -$build = '101022-1427'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_refrescar_set=0; +$modify_footer_refrescar=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2629,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refrescar,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2641,6 +3120,9 @@ if ($qm_conf_ct > 0) $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; $SScallcard_enabled = $row[4]; + $SSadmin_modify_refrescar = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2665,7 +3147,7 @@ if ( ($reports_auth > 0) and ($auth < 1) ) $reports_only_user=1; } -if ($WeBRooTWritablE > 0) +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -2684,7 +3166,7 @@ if ( ($auth > 0) or ($reports_auth > 0) ) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; + $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' and pass='$PHP_AUTH_PW';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGfull_name =$row[3]; @@ -2722,12 +3204,25 @@ if ( ($auth > 0) or ($reports_auth > 0) ) $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 from vicidial_user_groups where user_group='$LOGuser_group';"; + $stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - $LOGallowed_reports = $row[1]; + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; $LOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL=''; @@ -2740,7 +3235,50 @@ if ( ($auth > 0) or ($reports_auth > 0) ) } $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; - if ($WeBRooTWritablE > 0) + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) { fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); @@ -2771,9 +3309,9 @@ if ( ($auth > 0) or ($reports_auth > 0) ) } else { - if ($WeBRooTWritablE > 0) + if ($SSwebroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -2787,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_refrescar_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2800,16 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Añadir una Campaña";} if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Campaña Del Copy";} if ($ADD==111) {$hh='lists'; echo "Añadir una Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} -if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";} +if ($ADD==171) {$hh='ingroups'; echo "Filtrar números de teléfono del grupo";} if ($ADD==1111) {$hh='ingroups'; echo "Añadir un Grupo-Entrantes";} if ($ADD==1211) {$hh='ingroups'; echo "En-Grupo Del Copy";} if ($ADD==1311) {$hh='ingroups'; echo "Agregar nuevoDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopiarDID";} if ($ADD==1511) {$hh='ingroups'; echo "Añadir Call Menú";} if ($ADD==1611) {$hh='ingroups'; echo "Copia de llamadas Menú";} -if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";} +if ($ADD==1711) {$hh='ingroups'; echo "Agregar Grupo de teléfono Filtro";} if ($ADD==11111) {$hh='remoteagent'; echo "Añadir Agentes Remotos";} -if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";} +if ($ADD==12111) {$hh='remoteagent'; echo "Añadir grupo de extensiones";} if ($ADD==111111) {$hh='usergroups'; echo "Añadir un Grupo De Usuarios";} if ($ADD==1111111) {$hh='scripts'; echo "Agregue La Nueva Escritura";} if ($ADD==11111111) {$hh='filters'; echo "Agregue El Filtro Nuevo";} @@ -2822,10 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "Añadir NUEVO GRUPO DE if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NUEVO SERVIDOR";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Añadir CONF NUEVA PLANTILLA";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Añadir nueva compañía";} -if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "Añadido de los operadores COPIADO";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRADA";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW contestador";} +if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "ADD ETIQUETA NUEVA PANTALLA";} +if ($ADD==191111111111) {$hh='admin'; $sh='cts'; echo "Añadir nuevo contacto";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NUEVA CONFERENCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Nueva Adición De Usuario";} @@ -2839,7 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nuevo Estado Del Dial Del if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nuevo Código De la Pausa Del Agente";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Estado Del Dial De la Campaña Agregado";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la Campaña Agregada";} -if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campaña Preset Added";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Preestablecido Campaña Alta";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Campaña Modificar Areacode CID";} if ($ADD==211) {$hh='lists'; echo "Nueva Adición De la Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Nueva Adición Del Grupo de Entrantes";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} @@ -2847,9 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Nueva DID adjunta";} if ($ADD==2411) {$hh='ingroups'; echo "Nueva copiado DID adjunta";} if ($ADD==2511) {$hh='ingroups'; echo "Nueva llamada del menú";} if ($ADD==2611) {$hh='ingroups'; echo "Nueva llamada del menú";} -if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";} +if ($ADD==2711) {$hh='ingroups'; echo "Grupo Nuevo Teléfono filtro";} if ($ADD==21111) {$hh='remoteagent'; echo "Nueva Adición de Agentes Remotos";} -if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";} +if ($ADD==22111) {$hh='remoteagent'; echo "Nuevo grupo de adición de Extensión";} if ($ADD==211111) {$hh='usergroups'; echo "Nueva Adición Del Grupo De Usuarios";} if ($ADD==2111111) {$hh='scripts'; echo "Nueva Adición De la Escritura";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adición Del Filtro";} @@ -2863,10 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIÓN DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "AGREGAR NUEVO CONF PLANTILLA";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "AGREGAR NUEVOS SOPORTES";} -if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "AGREGAR CARRIER COPIADO";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "AGREGAR NUEVO TTS ENTRADA";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "AGREGAR NUEVO contestador";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "AGREGAR LA ETIQUETA NUEVA PANTALLA";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "AÑADIR NUEVO CONTACTO";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "CREANDO CONFERENCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADICIÓN DE ESTADOS DE SISTEMA DE VICIDIAL";} @@ -2886,6 +3449,7 @@ if ($ADD==31) if ($SUB==29) {echo " - Mezcla listaes";} if ($SUB=='20A') {echo " - Encuesta";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2899,6 +3463,7 @@ if ($ADD==34) if ($SUB==29) {echo " - Mezcla listaes";} if ($SUB=='20A') {echo " - Encuesta";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Estados De la Campaña";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaña Teclas rápidas";} @@ -2907,14 +3472,16 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Estados Auto Del Dial Del if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos De la Pausa Del Agente De la Campaña";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la Campaña";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} -if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campaña Presets";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Ajustes preestablecidos de la campaña";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Campaña CID Areacode";} if ($ADD==311) {$hh='lists'; echo "Modificar Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==3311) {$hh='ingroups'; echo "ModificarDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Modificar DID RA Extensión Invalida";} if ($ADD==3511) {$hh='ingroups'; echo "Modificar Call Menú";} -if ($ADD==3711) {$hh='ingroups'; echo "Modifique El Filtro Phone Group";} +if ($ADD==3711) {$hh='ingroups'; echo "Modificar Grupo de teléfono Filtro";} if ($ADD==31111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} -if ($ADD==32111) {$hh='remoteagent'; echo "ModificarExtension Group";} +if ($ADD==32111) {$hh='remoteagent'; echo "Modificar Grupo de Extensión";} if ($ADD==311111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==3111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==31111111) {$hh='filters'; echo "Modifique El Filtro";} @@ -2931,6 +3498,8 @@ if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICAR PORTEADOR" if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "Modificar la etiqueta PANTALLA";} +if ($ADD==391111111111) {$hh='admin'; $sh='cts'; echo "MODIFICAR CONTACTO";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} @@ -2948,15 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Código De la Pausa Del Agente";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modificar la campaña de CC Configuración";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} -if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifcar Campaña Preset";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "EDITAR Campaña";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificar la campaña Encuesta";} if ($ADD==411) {$hh='lists'; echo "Modificar Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==4311) {$hh='ingroups'; echo "ModificarDID";} if ($ADD==4511) {$hh='ingroups'; echo "Modificar Call Menú";} -if ($ADD==4711) {$hh='ingroups'; echo "Modifique El Filtro Phone Group";} +if ($ADD==4711) {$hh='ingroups'; echo "Modificar Grupo de teléfono Filtro";} if ($ADD==41111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} -if ($ADD==42111) {$hh='remoteagent'; echo "ModificarExtension Group";} +if ($ADD==42111) {$hh='remoteagent'; echo "Modificar Grupo de Extensión";} if ($ADD==411111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==4111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==41111111) {$hh='filters'; echo "Modifique El Filtro";} @@ -2973,6 +3542,8 @@ if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICAR PORTEADOR" if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "Modificar la etiqueta PANTALLA";} +if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo "MODIFICAR CONTACTO";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} @@ -2987,9 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "BorrarList";} if ($ADD==5111) {$hh='ingroups'; echo "BorrarIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==5511) {$hh='ingroups'; echo "Eliminar del menú de llamadas";} -if ($ADD==5711) {$hh='ingroups'; echo "BorrarPhone Filter Group";} +if ($ADD==5711) {$hh='ingroups'; echo "Eliminar filtro Group Teléfono";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==52111) {$hh='remoteagent'; echo "BorrarExtension Group";} +if ($ADD==52111) {$hh='remoteagent'; echo "Eliminar grupo de extensiones";} if ($ADD==511111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==5111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==51111111) {$hh='filters'; echo "Filtro De la Cancelación";} @@ -3005,6 +3576,8 @@ if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "ELIMINAR PORTEADOR"; if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "BORRAR LA ETIQUETA DE PANTALLA";} +if ($ADD==591111111111) {$hh='admin'; $sh='cts'; echo "Eliminar contacto";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "BorrarUsuario";} @@ -3016,14 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Código De la Pausa Del Agente De la Cancelación";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "El Estado Del Dial De la Campaña Quitó";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quitó";} -if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Campaña Preset Removed";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Preestablecido Campaña eliminado";} if ($ADD==611) {$hh='lists'; echo "BorrarList";} if ($ADD==6111) {$hh='ingroups'; echo "BorrarIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==6511) {$hh='ingroups'; echo "Eliminar del menú de llamadas";} -if ($ADD==6711) {$hh='ingroups'; echo "BorrarPhone Filter Group";} +if ($ADD==6711) {$hh='ingroups'; echo "Eliminar filtro Group Teléfono";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==62111) {$hh='remoteagent'; echo "BorrarExtension Group";} +if ($ADD==62111) {$hh='remoteagent'; echo "Eliminar grupo de extensiones";} if ($ADD==611111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==6111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==61111111) {$hh='filters'; echo "Filtro De la Cancelación";} @@ -3040,6 +3613,8 @@ if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "ELIMINAR PORTEADOR"; if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "BORRAR LA ETIQUETA DE PANTALLA";} +if ($ADD==691111111111) {$hh='admin'; $sh='cts'; echo "Eliminar contacto";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Cuenta Del Plomo De Dialable";} @@ -3057,10 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campañas";} if ($ADD==100) {$hh='lists'; echo "Listas";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Modificar DID RA Extensión Invalida";} if ($ADD==1500) {$hh='ingroups'; echo "Llame a los menús";} -if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";} +if ($ADD==1700) {$hh='ingroups'; echo "Filtrar Grupos de teléfono";} if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} -if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";} +if ($ADD==12000) {$hh='remoteagent'; echo "Grupos de Extensión";} if ($ADD==100000) {$hh='usergroups'; echo "Grupos De Usuario";} if ($ADD==1000000) {$hh='scripts'; echo "Escrituras";} if ($ADD==10000000) {$hh='filters'; echo "Filtros";} @@ -3076,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "LISTA DE TRANSPORTIS if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS LISTA INSCRITOS";} if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "MÚSICA EN ESPERA LISTA DE ENTRADA";} if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "LISTA DE CORREO DE VOZ CAJAS";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "ETIQUETAS DE PANTALLA DE LISTA";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "Lista de Contactos";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERENCIAS";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERENCIAS";} if ($ADD==550) {$hh='users'; echo "Formulario De Búsqueda";} @@ -3085,15 +3663,18 @@ if ($ADD==661) {$hh='users'; echo "RESULTADO DE LA BÚSQUEDA DE TELÉFONOS";} if ($ADD==99999) {$hh='users'; echo "AYUDA";} if ($ADD==999999) {$hh='reports'; echo "INFORMES";} 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==999997) {$hh='reports'; echo "CAMBIO DE CONTRASEÑA";} +if ($ADD==999996) {$hh='reports'; echo "Instalación inicial BIENVENIDOS";} +if ($ADD==999995) {$hh='reports'; echo "DERECHOS DE AUTOR licencia de marca";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "Resumen estadístico";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM Resumen estadístico";} -if ( ($ADD>9) && ($ADD < 99998) ) +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; @@ -3108,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; @@ -3124,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -3138,7 +3719,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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 ##### @@ -3148,7 +3729,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -3165,18 +3746,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$calls_today=0; $SELECT_campaign_rank=0; $SELECT_campaign_grade=1; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { $stmt_grp_values=''; @@ -3184,30 +3766,37 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$campaign_rank = $SELECT_campaign_rank;} + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -3215,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -3245,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -3258,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -3269,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -3308,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -3316,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>Entrantes GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -3339,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -3348,40 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$group_rank = $SELECT_group_rank;} + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -3414,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -3422,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -3435,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -3450,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -3465,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; + if ( (eregi("-ALL",$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=''; @@ -3475,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPAIGNS-"; + } } if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) { @@ -3490,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPAIGNS - LOS USUARIOS PUEDEN VISIÓN CUALQUIER CAMPAÑA</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPAIGNS - LOS USUARIOS PUEDEN VISIÓN CUALQUIER CAMPAÑA</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPAIGNS - USUARIOS PUEDEN CC CUALQUIER CAMPAÑA</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - USUARIOS PUEDEN CC entrantes CUALQUIER GRUPO</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -3528,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -3560,7 +4188,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### 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) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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"; @@ -3611,12 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Contraseña -</B> este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Contraseña -</B> este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. La contraseña de usuario fuerte debe ser por lo menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como el número por lo menos una. <BR> <A NAME="vicidial_users-force_change_password"> <BR> - <B>Force Change Password -</B> If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N. + <B>Forzar cambio de contraseña -</B> Si esta opción está establecida en Y entonces el usuario se le pedirá que cambie su contraseña la próxima vez que inicie sesión en la página web de la administración. El valor predeterminado es N. <BR> <A NAME="vicidial_users-full_name"> @@ -3651,7 +4279,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-voicemail_id"> <BR> - <B>ID de correo de voz -</B> This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Buzón de Voz field set to AGENTVMAIL. + <B>ID de correo de voz -</B> Este es el buzón de voz que las llamadas se dirigirán en un AGENTDIRECT en grupo en el tiempo de caída, si el grupo tiene en el método de caída establece en el campo de correo de voz y correo de voz configurado para AGENTVMAIL. <BR> <A NAME="vicidial_users-optional"> @@ -3671,12 +4299,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_choose_blended"> <BR> - <B>Agent Choose Blended -</B> This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled. + <B>Agente Elija Blended -</B> Esta opción, si se establece en 1 permite al usuario elegir si el agente tiene su conjunto de la campaña de mezclado o no, y si no, entonces el valor predeterminado de mezcla se utilizará. El valor predeterminado es 1 para habilitado. <BR> <A NAME="vicidial_users-agent_choose_territories"> <BR> - <B>Agente Elija territorios -</B> Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña Entrantes_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección. + <B>Agente Elija territorios -</B> Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña INBOUND_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección. <BR> <A NAME="vicidial_users-scheduled_callbacks"> @@ -3728,7 +4356,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_call_log_view_override"> <BR> - <B>Agent Call Log View Override -</B> This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED. + <B>Agente de Registro de llamadas Ver anulación -</B> Este valor prevalecerá sobre lo que el grupo de usuarios de usuarios se ha fijado para la vista Registro de agentes de llamadas. MINUSVALIDOS utilizan la configuración de grupo de usuarios. N no permitirá que muestra el registro de llamadas los usuarios. Y permitirá mostrar el registro de llamadas del usuario. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Principal agente de búsqueda de anulación -</B> Este valor prevalecerá sobre lo que la campaña ha creado para la búsqueda del agente principal. NOT_ACTIVE utilizará el ajuste de la campaña. HABILITADO facilitará la búsqueda de plomo y no discapacitados facilitará la búsqueda de plomo. El valor predeterminado es NOT_ACTIVE. <BR> <A NAME="vicidial_users-alert_enabled"> @@ -3741,9 +4374,14 @@ if ($ADD==99999) <B>Permitir Alertas -</B> Este campo le da la capacidad para permitir navegador agente de alertas para ser habilitado por el agente para cuando las llamadas entran en su período de sesiones vicidial.php. Por defecto es 0 para el NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>La campaña alinea -</B> en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. También en esta sección son la WEB VARs para cada campaña. Estas permiten a cada agente tiene una cadena de la variable que se puede agregar a la WEB DE GUIÓN ficha URL o simplemente poniendo - A - web_vars - B - como le pondría en cualquier otra esfera. + <B>Búsqueda de contactos preestablecido -</B> Si el usuario está conectado a una campaña que tiene presets de transferencia establecidos en la Guía, a continuación, esta opción se puede deshabilitar la búsqueda de contactos sólo para este usuario. El valor predeterminado es NOT_ACTIVE que utilizará cualquiera que sea el ajuste de la campaña es. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>La campaña alinea -</B> en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. También en esta sección son la WEB VARs para cada campaña. Estas permiten a cada agente tiene una cadena de la variable que se puede agregar a la WEB DE GUIÓN ficha URL o simplemente poniendo - A - web_vars - B - como le pondría en cualquier otra esfera. Otro campo en esta sección es de grado, lo que permite la campaign_grade_random siguiente agente Call establecimiento para ser utilizado. Esta opción de grado para aumentar o disminuir la probabilidad de que el agente recibirá la llamada. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3763,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Los campos de usuario personalizada -</B> Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente. + <B>Los campos de usuario personalizada -</B> Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente. El campo personalizado 5 puede ser utilizado como un campo para definir un número de plan de marcado para enviar una llamada a partir de una AGENTDIRECT en grupo, si el usuario no está disponible, sólo tiene que poner AGENTEXT en el campo del mensaje o la extensión de la AGENTDIRECT dentro del grupo y el sistema buscará la costumbre de cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3816,7 +4454,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_fields_modify"> <BR> - <B>Custom Fields Modificar-</B> This option if set to 1 allows the user to modify custom list fields. + <B>Modificar campos personalizados -</B> Esta opción, si el valor 1 permite al usuario modificar los campos personalizados de la lista. <?php } ?> @@ -3955,7 +4593,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Informes de exportación -</B> Este ajuste, si se pone a 1 permitirá un gerente de exportación para acceder a la llamada de los informes sobre la INFORMES pantalla. El valor predeterminado es 0. Pide para el Informe de Exportación, para el siguiente campo se utiliza para las exportaciones: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Informes de exportación -</B> Este ajuste, si se pone a 1 permitirá a un administrador para acceder a la llamada a la exportación y los informes de plomo en la pantalla Informes. El valor predeterminado es 0. Para la exportación Llama y conduce los informes, el orden siguiente campo se utiliza para las exportaciones: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> @@ -3965,7 +4603,23 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-realtime_block_user_info"> <BR> - <B>Realtime Block Usuario Info -</B> This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled. + <B>Bloqueo en tiempo real Información del Usuario -</B> Este ajuste, si se pone a 1 se bloqueará la información del usuario y la estación de que se muestre en el informe en tiempo real. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Modificar el nivel de usuario del mismo -</B> Este ajuste sólo se aplica al nivel 9 usuarios. Si se activa permite que el nivel 9 el usuario puede modificar su propia configuración, así como otros 9 usuarios de nivel. El valor predeterminado es 1 para habilitado. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Ocultar datos de administración de plomo -</B> Este ajuste sólo se aplica a nivel de 7, 8 y 9 usuarios. Si se activa reemplaza los datos principales de los clientes en los muchos informes y pantallas en el sistema con Xs. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Ocultar datos de administración del teléfono -</B> Este ajuste sólo se aplica a nivel de 7, 8 y 9 usuarios. Si está activado, reemplaza los números de teléfono de los clientes en los muchos informes y pantallas en el sistema con Xs. Los ajustes DÍGITOS sólo mostrará los dígitos de los últimos X el número de teléfono. El valor predeterminado es 0 para discapacitados. + @@ -3988,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Descripción de la campaña -</B> esto es un campo de la nota para lacampaña, es opcional y puede ser un máximo de 255 caracteres enlongitud. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de esta campaña, lo que permite la visualización de administrador de esta campaña, así como las listas de asignados a esta campaña para ser restringido por un grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario con permisos de usuario administrador de la campaña del grupo para ver esta campaña. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -4004,14 +4663,19 @@ if ($ADD==99999) <B>Última fecha de convocatoria de la Campaña -</B> Esta es la última vez que una llamada fue manejado por un agente registrado en esta campaña. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Estadísticas Diarias máxima -</B> Estas son las estadísticas que se generan por el sistema cada día durante todo el día hasta que el reloj horario de fin de día, ya que se encuentra en la configuración del sistema. Estos números son generados a partir de los registros en el sistema para permitir la visualización mucho más rápido. Las estadísticas se incluyen son - Total de llamadas, agentes de Máximo, Máximo llamadas entrantes, llamadas salientes máximos. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_refrescar"> <BR> <B>Los Stats de la campaña restauran -</B> este checkbox permitirá queusted fuerce un stats vicidial restaura, incluso si la campaña no esactiva. <BR> <A NAME="vicidial_campaigns-realtime_agent_time_stats"> <BR> - <B>Tiempo Real Agent Time Stats -</B> Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Tiempo Real report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED. + <B>Estadísticas en tiempo real agente de tiempo -</B> Al establecer este a cualquier cosa, pero está deshabilitado permitirá la recolección de estadísticas de los agentes de hoy para esta campaña, que se pueden ver a través del informe en tiempo real. LLAMADAS son el promedio de llamadas atendidas por agente, de espera es el tiempo promedio de espera agente, Cust es el tiempo medio de conversación al cliente, ACW es el promedio de llamadas Después de un tiempo de trabajo, pausa es el tiempo de pausa media. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-active"> @@ -4021,7 +4685,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Park Music-on-Hold -</B> This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default. + <B>Parque de la Música-on-Hold -</B> Aquí es donde usted puede definir el contexto de la música en espera para esta campaña. Asegúrese de seleccionar una música válida en el contexto de la bodega la lista de selección y que el contexto que ha seleccionado tiene los archivos válidos en el mismo. Por defecto es default. <BR> <A NAME="vicidial_campaigns-park_file_name"> @@ -4031,7 +4695,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el botón de la FORMA del WEB. Para personalizar la cadena de la consulta después de que el formulario web, basta con iniciar el formulario web con VAR y, a continuación, la URL que desee utilizar, en sustitución de las variables con el nombre de las variables que desee utilizar - A - phone_number - B -- al igual que en la pestaña de la sección ESCRITURAS. + <B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el botón de la FORMA del WEB. Para personalizar la cadena de la consulta después de que el formulario web, basta con iniciar el formulario web con VAR y, a continuación, la URL que desee utilizar, en sustitución de las variables con el nombre de las variables que desee utilizar - A - phone_number - B -- al igual que en la pestaña de la sección ESCRITURAS. Si desea utilizar campos personalizados en un formulario web de direcciones, es necesario agregar &CF_uses_custom_fields=Y como parte de su URL. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -4092,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Comienza con las zonas horarias del Este y del Oeste de obras <BR>   - DOWN TIMEZONE: Comienza con las zonas horarias occidental y oriental de obras + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Orden de lista aleatoria -</B> Esta opción le permite al azar el orden de los cables en la tolva de carga dentro de los resultados definidos por los criterios establecidos anteriormente. Por ejemplo, el orden del listado se mantendrá, pero los resultados serán escogidos al azar dentro de esa clasificación. Al establecer esta opción a Y se activa esta función. Defecto es n para discapacitados. NOTA, si usted tiene un gran número de lleva esta opción puede ralentizar la velocidad de la secuencia de comandos de carga de la tolva. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Lista de Secundaria Orden -</B> Esta opción le permite seleccionar el orden de clasificación de segundo de los conductores en la carga de la tolva después de la Orden de la lista y dentro de los resultados definidos por los criterios establecidos anteriormente. Por ejemplo, el orden de lista se utilizará para la primera clase de los cables, pero los resultados se ordenarán una segunda vez en que la clasificación a través de la misma serie de la Orden primera lista. Por ejemplo, si usted tiene la lista de Orden establece que la cuenta regresiva y sólo disponen de guías que se han intentado una y 2 veces, entonces, si usted tiene el conjunto de Orden Lista de Secundaria a LEAD_ASCEND todos los cables de tentativa 1, serán ordenados por los más antiguos cables primero y se puso en la tolva de esa manera. El valor predeterminado es LEAD_ASCEND. NOTA, si usted tiene un gran número de conductores que utilizan una de las opciones CALLTIME puede ralentizar la velocidad de la secuencia de comandos de carga de la tolva. Si la lista de Orden aleatoria está activada, esta opción será ignorada. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Tolva llana -</B> éste es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a través en un minuto. + <B>Mínimo nivel de la tolva -</B> Este es el número mínimo de lleva el guión VDhopper trata de mantener en la tabla vicidial_hopper para esta campaña. Si al ejecutar el script de VDhopper cada minuto, hacen de esta un poco mayor que el número de conductores que pasan por en un minuto. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Nivel de la tolva automática -</B> Al establecer esta a Y permitirá Vicidial para ajustar automáticamente la tolva de la base de la configuración que tienes en tu campaña. La fórmula que utiliza para hacer esto es:<BR>Number of Activo Agentes * Nivel del Auto-Dial * ( 60 seconds / Tiempo de espera Del Dial ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Multiplicador de la tolva automática -</B> Esto es multiplicador de la tolva automática. Al establecer esta a menos de 1 hará que el algoritmo de la tolva automática para cargar menos pistas de lo que haría normalmente. Al establecer esta mayor que 1, hará que el algoritmo de la tolva automática para cargar más clientes potenciales que lo haría normalmente. El valor predeterminado es 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Auto Trim Hopper -</B> Al establecer esta a Y permitirá Vicidial para eliminar automáticamente los cables sobrantes de la tolva. El valor predeterminado es Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Hopper VLC Dup Compruebe -</B> Si se establece en Y se traducirá en todas las pistas que se inserta dentro de la tolva que se comprueba por vendor_lead_code para asegurarse de que no hay duplicados cables insertados con la vendor_lead_code misma. Esto es muy útil cuando se auto-Alt-marcado con MULTI_LEAD. El valor predeterminado es N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Filtro del plomo -</B> éste es un método de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaución, él es fácil de parar el marcar accidentalmente con la alteración más leve a la declaración del SQL. El defecto no es NINGUNO. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Recuento de llamadas Límite -</B> Esto impone un límite en el número de intentos de llamada para los conductores marcados en esta campaña. Un líder puede ir encima de este límite un poco si el reciclaje de plomo o Auto-Alt-Marcación está habilitado. El valor predeterminado es 0 para ningún límite. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Recuento de llamadas de destino -</B> Esta opción sólo se utiliza con fines de información y no tiene ningún efecto en los conductores marcados. El valor predeterminado es 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -4115,18 +4819,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-dial_method"> <BR> - <B>Método del dial -</B> Este campo es la manera de definir cómo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el método del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y después no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos métodos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los métodos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profético. Entrantes_MAN permite que el agente de marcación manual de lugar a las llamadas de una campaña de la lista, mientras que ser capaz de tomar las llamadas entrantes entre marcación manual de llamadas. + <B>Método del dial -</B> Este campo es la manera de definir cómo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el método del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y después no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos métodos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los métodos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profético. INBOUND_MAN permite que el agente de marcación manual de lugar a las llamadas de una campaña de la lista, mientras que ser capaz de tomar las llamadas entrantes entre marcación manual de llamadas. <BR> <A NAME="vicidial_campaigns-auto_dial_level"> <BR> <B>Nivel auto del dial -</B> aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automóvil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIÓN del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el método del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Marcación automática de nivel de umbral -</B> Esta opción sólo funciona con un ADAPT o RATIO Método de marcación, y se debe establecer en algo más que MINUSVALIDOS y el número de agentes de ajuste debe ser superior a 0. Esta característica le permite establecer un número mínimo de agentes que el algoritmo de predicción van a funcionar. Si el número de agentes es inferior al número que usted ha fijado, entonces el nivel de acceso telefónico se destinarán a 1,0 hasta que haya más agentes de ingresar o entrar en el estado seleccionado. Logueados IN_AGENTS contará con todos los agentes registrados en la campaña, NO PAUSED_AGENTS sólo contará los agentes que están esperando o hablar, y sólo contará WAITING_AGENTS agentes que están esperando una llamada. El valor predeterminado es DISABLED. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Solamente cuenta disponible -</B> este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Umbral Disponible cifra sólo -</B> Esta opción sólo funciona con un ADAPT o método de la razón Dial, esta cifra sólo disponible se debe establecer en N, esta configuración se debe establecer en algo más que MINUSVALIDOS y el número de agentes de ajuste debe ser superior a 0. Esta característica le permite establecer el número de agentes por debajo del cual se cifra sólo disponible habilitado. Si el número de agentes es inferior al número que usted ha fijado, a continuación, la configuración disponible Tally Sólo con ir a Y temporalmente hasta que más agentes de ingresar o entrar en el estado seleccionado. Logueados IN_AGENTS contará con todos los agentes registrados en la campaña, NO PAUSED_AGENTS sólo contará los agentes que están esperando o hablar, y sólo contará WAITING_AGENTS agentes que están esperando una llamada. El valor predeterminado es DISABLED. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -4150,7 +4864,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Blanco llana de la diferencia del dial -</B> este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los métodos del dial del MANUAL o del COCIENTE. + <B>Blanco Llana De la Diferencia Del Dial -</B> Este campo se utiliza para definir si desea tener como objetivo un determinado número de agentes de espera para las llamadas o las llamadas en espera de los agentes. Por ejemplo, si siempre quisiera tener en promedio un agente libre para recibir llamadas de inmediato que se ponga esto en -1, si usted quisiera tener siempre como objetivo una llamada en espera la espera de un agente que se pone a 1. El valor predeterminado es 0. Este campo no es utilizado por el MANUAL o métodos de marcación INBOUND_MAN. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Marque la diferencia de nivel método de destino -</B> Esta opción le permite definir si el nivel marcado la diferencia de fijación de objetivos sólo se aplica al cálculo del nivel de línea o también a la marcación real en cada servidor de marcación. Si está ejecutando una pequeña campaña con los agentes conectados en muchos servidores es posible que desee utilizar la opción ADAPT_CALC_ONLY, porque la opción CALLS_PLACED puede resultar en un menor número de llamadas que se colocan a deisred. Esta opción sólo está activa si el nivel objetivo marcado la diferencia se establece en algo distinto de 0. El valor predeterminado es ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -4160,7 +4879,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>Cola de prioridad - </B> Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone. + <B>Cola de prioridad - </B> Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla. No se recomienda establecer las llamadas entrantes a una prioridad más alta que las llamadas salientes de la campaña porque la gente de llamadas en espera que esperar a la gente que se llama espera a alguien para estar allí en el teléfono. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> @@ -4170,12 +4889,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-inbound_queue_no_dial"> <BR> - <B>Inbound Queue No Dial -</B> This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED. + <B>Cola de entrada n º telefónico -</B> Esta función está establecida en Activada le permite evitar el marcado automático de salida de esta campaña si hay llamadas entrantes esperando en la cola que forman parte de los grupos entrantes permitidas establecidas en la presente campaña. Si se establece en ALL_SERVERS va a cambiar el algoritmo de cálculo para todas las llamadas entrantes como las llamadas activas en este servidor, incluso si están en otro servidor que reducirá la posibilidad de colocar innecesarias las llamadas salientes si tiene llamadas que entran en otro servidor. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Alt-Nu'mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA métodos del dial cuando no hay contacto en elnúmero de teléfono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el métodoMANUAL del dial. PRORROGADO suplentes números son números cargados en el sistema fuera de la pantalla de información estándar. PRORROGADO utilizando usted puede tener cientos de números de teléfono de un solo registro de cliente. + <B>Alt-Nu'mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA métodos del dial cuando no hay contacto en elnúmero de teléfono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el métodoMANUAL del dial. PRORROGADO suplentes números son números cargados en el sistema fuera de la pantalla de información estándar. PRORROGADO utilizando usted puede tener cientos de números de teléfono de un solo registro de cliente. Usando MULTI_LEAD le permite utilizar un cable separado para cada número de una cuenta de cliente de que todos comparten un vendor_lead_code común, y el tipo de número de teléfono de cada uno se define con una etiqueta en el campo Propietario. Esta opción no permite algunas opciones en la pantalla Modificar la campaña y mostrar un enlace a la página Multi-Alt configuración que le permite establecer el tipo de número de teléfono, que se define por la etiqueta de cada cable, se puede marcar y en qué orden. Esto creará un filtro especial de plomo y alterar el campo Rango de todos los cables dentro de las listas que figuran en esta campaña con el fin de llamar en el orden que haya especificado. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -4185,14 +4904,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Campaña de extensión VDAD -</B> Este campo permite una transferencia personalizada VDAD extensión. Esto le permite utilizar diferentes métodos de gestión de llamadas en función de su campaña. - - 8364 - 8368 misma que - - 8365 - Se envía la llamada a un sólo agente en el mismo servidor que la llamada está en - - 8366 - Utilizado para la prensa-1 y las campañas de estudio - - 8367 - ¿Se tratará de enviar la primera llamada a un agente en el servidor local, entonces se verá en otros servidores - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Se utiliza para Contestador automático de detección después de que, el mismo comportamiento como 8368 - - 8373 - Se utiliza para Contestador automático de detección después de que el mismo comportamiento de 8366 + <B>Extensión de enrutamiento -</B> Este campo permite una extensión de enrutamiento de salida personalizado. Esto le permite utilizar diferentes métodos de manejo de llamadas, dependiendo de cómo desea enrutar las llamadas a través de su campaña de salida. Anteriormente conocido como la Campaña de extensión VDAD. + <BR>- 8364 - misma 8368 + <BR>- 8365 - Enviará la única llamada a un agente en el mismo servidor que la llamada se pone en + <BR>- 8366 - Se utiliza para las campañas de prensa-1, de difusión y estudio + <BR>- 8367 - Se trata de enviar la primera llamada a un agente en el servidor local, y luego se verá en otros servidores + <BR>- 8368 - DEFAULT - Se envía la llamada al siguiente agente disponible independientemente del servidor en que se encuentran en + <BR>- 8369 - Se utiliza para contestar la detección de la máquina después de eso, mismo comportamiento que 8368 + <BR>- 8373 - Se utiliza para contestar la detección de la máquina después de que el mismo comportamiento que 8366 + <BR>- 8374 - Se utiliza para las campañas de prensa-1, de difusión y estudio con Cepstral Texto a voz + <BR>- 8375 - Se utiliza para la detección de la máquina contestadora a continuación, pulse-1, de difusión y estudio de las campañas con Cepstral Texto a voz <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -4234,6 +4955,16 @@ if ($ADD==99999) <BR> <B>seguro puerto Exten -</B> este ser dial plan extensión que desear seguropuerto audio archivo ser localizar en en su servidor. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Safe Harbor de audio -</B> Este es el archivo de audio del sistema que se juega, si la acción de colocar está en AUDIO. El valor predeterminado es rumor. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Safe Harbor menú de llamadas -</B> Este es el menú que una llamada se envía a si la acción de la gota está en CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -4252,12 +4983,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-no_hopper_dialing"> <BR> - <B>N marcado Hopper -</B> Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o Entrantes_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados. + <B>N marcado Hopper -</B> Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o INBOUND_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados. <BR> <A NAME="vicidial_campaigns-agent_dial_owner_only"> <BR> - <B>Único propietario de marcado -</B> Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o Entrantes_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados. + <B>Único propietario de marcado -</B> Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o INBOUND_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados. <?php if ($SSuser_territories_active > 0) @@ -4334,7 +5065,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Método de encuesta - </B> Esta opción se define lo que sucede a una convocatoria después de que el cliente ha optado-en. AGENT_XFER enviará la convocatoria a la siguiente agente disponible. Buzón de voz se envía la llamada al buzón de voz de la caja que se especifica en el campo de voz. EXTENSIÓN enviará al cliente a la extensión se define en la Encuesta Xfer campo Extensión. Colgar se cuelgue el cliente. CAMPREC_60_WAV enviará al cliente a tener una grabación con su respuesta, esta grabación se coloca en una carpeta con el nombre de la campaña dentro de la Campaña de Estudio de grabación Directorio. + <B>Método de encuesta - </B> Esta opción se define lo que sucede a una convocatoria después de que el cliente ha optado-en. AGENT_XFER enviará la convocatoria a la siguiente agente disponible. Buzón de voz se envía la llamada al buzón de voz de la caja que se especifica en el campo de voz. EXTENSIÓN enviará al cliente a la extensión se define en la Encuesta Xfer campo Extensión. Colgar se cuelgue el cliente. CAMPREC_60_WAV enviará al cliente a tener una grabación con su respuesta, esta grabación se coloca en una carpeta con el nombre de la campaña dentro de la Campaña de Estudio de grabación Directorio. CALLMENU enviará al cliente el menú de llamada se define en la lista de selección a continuación. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -4386,6 +5117,16 @@ if ($ADD==99999) <BR> <B>Agente de pantalla Dialable Leads -</B> Esta opción se mostrará si está habilitado el número de derivaciones dialable disponibles en la campaña en la pantalla del agente. Este segundo número se actualiza en el sistema una vez por minuto y se actualiza en la pantalla del agente por cada par de. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Encuesta del menú de llamadas -</B> Si el método se ajusta a CALLMENU, este es el menú de llamadas que el cliente se envía a si optar por. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Estudio de grabación -</B> Si está activado, este empezará a grabar cuando la llamada es contestada. Sólo se recomienda si el método no está configurado para transferir a un agente. Defecto es n para discapacitados. Si se establece en Y_WITH_AMD incluso contestador detectado llamadas de mensajes serán registrados. + <?php } ?> @@ -4399,6 +5140,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. <BR>   - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. <BR>   - campaign_rank: órdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - campaign_grade_random: da una mayor probabilidad de recibir una llamada a los agentes de mayor grado. <BR>   - fewest_calls: órdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. @@ -4415,7 +5157,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_prefix"> <BR> - <B>Manual Prefijo al marcar -</B> This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Prefijo al marcar defined in the field above. This option does not interfere with the 3way Prefijo al marcar option. + <B>Prefijo Manual -</B> Este campo opcional le permite configurar el prefijo de marcación para ser utilizado solamente cuando la colocación de las llamadas Marcación manual desde la interfaz de agente, como el uso de la función de Marcación manual, o marque el siguiente número, cuando en el método de marcación MANUAL, o marcación manual alt número, o programado por el usuario sólo las devoluciones de llamada. El valor predeterminado es vacío para personas con discapacidad, que utilizan el prefijo de marcación se define en el campo de arriba. Esta opción no interfiere con la opción de marcación de prefijo 3way. <BR> <A NAME="vicidial_campaigns-omit_phone_code"> @@ -4430,7 +5172,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-use_custom_cid"> <BR> - <B>Custom CallerID -</B> When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the CallerID de la Campaña defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. + <B>Custom CallerID -</B> Cuando se establece en Y, esta opción le permite utilizar el campo security_phrase en la tabla vicidial_list como el identificador de llamadas para enviar al hacer de cada derivación específica. Si este campo no tiene CID en el que a continuación de la Campaña CallerID definido anteriormente se utilizará en su lugar. Esta opción no permite el CallerID lista de anulación, si se encuentra presente un CID en el campo security_phrase. El valor predeterminado es N. Cuando se establece en CódigoÁrea usted tiene la capacidad para entrar en el submenú de CA-CID y definir callerids múltiples para ser utilizado por código de área. <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> @@ -4445,13 +5187,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Nombre de fichero De Rec De la Campaña -</B> This field allows you to customize the name of the recording when Campaña recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. The default is FULLDATE_AGENTE and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. + <B>Nombre de fichero De Rec De la Campaña -</B> Este campo le permite personalizar el nombre de la grabación cuando la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. El valor predeterminado es FULLDATE_AGENTE y se vería así-20051020 103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>La registración retrasa -</B> para la grabación de ALLCALLS y deALLFORCE solamente. Esta voluntad del ajuste retrasa comenzar de lagrabación en todas las llamadas para el número de los segundosespecificados en este campo. El defecto es 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Llame a notas por llamada -</B> Al establecer esta opción en ENABLED permitirá a los agentes para entrar en las notas de cada llamada que manejan en la interfaz de agente. El campo de entrada de notas aparecerá debajo del campo de comentarios en la interfaz de agente. Además, si el Grupo de agente de usuario se pueden ver los registros de llamadas a continuación, el agente será capaz de ver las notas anteriores de llamadas para tomar una ventaja en cualquier momento. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Agente de Búsqueda de plomo -</B> Al establecer esta opción en ENABLED permitirá a los agentes a buscar pistas y ver la información de plomo durante la pausa en la interfaz de agente. Además, si el Grupo de agente de usuario se pueden ver los registros de llamadas a continuación, el agente será capaz de ver las notas anteriores de llamadas para cualquier iniciativa que se está viendo la información sobre. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Plomo Agente Método de búsqueda -</B> Si la búsqueda del agente de plomo está habilitado, este parámetro define el lugar donde el agente se le permitirá la búsqueda de clientes potenciales. Sistema buscará todo el sistema, se CAMPAIGNLISTS buscar dentro de todas las listas de activos dentro de la campaña, se CAMPLISTS_ALL buscar dentro de todas las listas de activos e inactivos dentro de la campaña, LISTA sólo buscará en el Manual de Identificación de Llamada de lista tal como se define en la campaña . El valor predeterminado es CAMPLISTS_ALL. Una de estas opciones con USER_ frente a sólo buscará dentro de los cables que tienen el campo propietario coincide con el ID de usuario del agente, las opciones con Sonidos reales frente a sólo buscará dentro de los cables que tienen el campo propietario coincide con el grupo de usuarios que el usuario es un miembro de las opciones con TERRITORY_ frente a sólo buscará dentro de los cables que tienen el campo propietario adecuación de los territorios que el agente ha seleccionado. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -4460,7 +5217,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent. + <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. Si los campos de lista personalizados están habilitados en su sistema, FORMA abrirá la ficha del formulario cuando la conexión de una llamada a un agente. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -4470,7 +5227,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Rápida transferencia Button -</B> Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. The LOCKED options are used to lock the value to the Rápida transferencia Button even if the agent uses the transfer conference features during a cacll before using the Rápida transferencia Button. + <B>Rápida transferencia Button -</B> Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. Las opciones de bloqueados se utiliza para bloquear el valor en el botón de transferencia rápida, incluso si el agente utiliza las características de transferencia de la conferencia durante una llamada antes de utilizar el botón de transferencia rápida. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Custom 3-Way Botón de Transferencia -</B> Esta opción, se agregará un botón de transferencia personalizada a la pantalla del agente por debajo de la tecla de Transferencia-Conf que permitirá a un clic de tres vías llamadas mediante el programa seleccionado o en el campo. Las opciones se PRESET_ realizar llamadas utilizando el valor definido preestablecido. Las opciones se FIELD_ realizar llamadas con el número en el campo seleccionado de la iniciativa. MINUSVALIDOS no se mostrará el botón en la pantalla del agente. Las opciones se PARK_ aparcar el cliente antes de marcar. El valor predeterminado es DISABLED. La opción VIEW_PRESET simplemente abrir el marco de la transferencia y el marco preestablecido. La opción VIEW_CONTACTS se abrirá una ventana de búsqueda de contactos, esto sólo funcionará si se selecciona Valores Habilitar se establece CONTACTOS. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> @@ -4480,27 +5242,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-enable_xfer_presets"> <BR> - <B>Enable Transfer Presets -</B> This option will enable the Presets sub menu to appear at the top of the Campaña Modification page, and also you will have the ability to specify Preset dialing numbers for Agentes to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. + <B>Activar presets de transferencia -</B> Esta opción permitirá a los presets del submenú que aparece en la parte superior de la página de modificación de la campaña, y también tendrá la posibilidad de especificar los números predeterminados de marcación para los agentes a utilizar en el marco de transferencia a la Conferencia de la interfaz de agente. El valor predeterminado es DISABLED. CONTACTOS es una opción sólo si Contact_Information está habilitado en su sistema, que es una función personalizada. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Activar presets de transferencia -</B> Esta opción permitirá a los presets del submenú que aparece en la parte superior de la página de modificación de la campaña, y también tendrá la posibilidad de especificar los números predeterminados de marcación para los agentes a utilizar en el marco de transferencia a la Conferencia de la interfaz de agente. El valor predeterminado es DISABLED. CONTACTOS es una opción sólo si Contact_Information está habilitado en su sistema, que es una función personalizada. <BR> <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> <BR> - <B>Hide Transfer Number to Dial -</B> This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED. + <B>Ocultar número de transferencia para marcar -</B> Esta opción se oculta el número a marcar el terreno en el marco de transferencia a la Conferencia de la interfaz de agente. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-ivr_park_call"> <BR> - <B>Park Call IVR -</B> This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED. + <B>Estacionamiento de llamadas IVR -</B> Esta opción permite a un agente para aparcar una llamada con un botón de llamada independiente IVR parque en su interfaz de agente, si esta opción está activada o ENABLED_PARK_ONLY. La opción ENABLED_PARK_ONLY permitirá que el agente para enviar la llamada al parque pero no haga clic en para recuperar la llamada como la opción habilitada. La opción ENABLED_BUTTON_HIDDEN permite que la función a través de la API sólo. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-ivr_park_call_agi"> <BR> - <B>Park Call IVR AGI -</B> If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible. + <B>Estacionamiento de llamadas IVR AGI -</B> Si el Estacionamiento de llamadas IVR campo no está desactivado, este campo se utiliza como la cadena de aplicación de AGI que el cliente se envía. Este es un ajuste que debe ser fijado por el administrador, si es posible. <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Llame Menú specified in the Temporizador de Acción de Destination field, EXTENSION will send the call to the Extension that is specified in the Temporizador de Acción de Destination field, IN_GROUP will send the call to the In-Group specified in the Temporizador de Acción de Destination field. + <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. COLGAR colgará la llamada cuando el temporizador se activa, se CALLMENU enviar la llamada al menú de llamadas especificado en el campo de acción del temporizador de destino, EXTENSIÓN enviará la llamada a la extensión que se especifica en el campo de acción del temporizador de destino, IN_GROUP enviará la llamada a la En-Grupo especificado en el campo de acción del temporizador de destino. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -4515,7 +5282,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-timer_action_destination"> <BR> - <B>Temporizador de Acción de Destination -</B> This field is where you specify the Llame Menú, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. + <B>Temporizador de destino Acción -</B> Este campo es donde se especifica el menú de llamada, extensión o en grupo que desea la convocatoria enviada a si la acción de hora está en la CALLMENU, prórroga o IN_GROUP. Por defecto está vacío. <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> @@ -4525,12 +5292,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> <BR> - <B>Scheduled Callbacks Alert -</B> This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line. + <B>Devoluciones de llamada de alerta programados -</B> Esta opción permite que la línea de estado devoluciones de llamada en la interfaz de agente a ser de color rojo, parpadear o parpadear en rojo cuando no se AGENTONLY programado devoluciones de llamada que han afectado a su tiempo de disparo y la fecha. El valor predeterminado es NONE para la línea de estado estándar. Las opciones de aplazar dejará de parpadear y mostrar-o en rojo cuando se echa las devoluciones de llamada, hasta que el número de devoluciones de llamada de los cambios. <BR> <A NAME="vicidial_campaigns-scheduled_callbacks_count"> <BR> - <B>Scheduled Callbacks Count -</B> This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE. + <B>Rellamadas programadas Conde -</B> Esta opción le permite definir si sólo las devoluciones de llamada LIVE, el usuario sólo devoluciones de llamada programadas que han afectado a la fecha de activación y el tiempo, o devoluciones de llamada de ALL_ACTIVE, el usuario sólo las devoluciones de llamada que están activos en el sistema, así como las devoluciones de llamada VIVOS, BE3 debe contar int que agente de devolución de llamada de alerta sección en la pantalla del agente. El valor predeterminado es ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Programado devoluciones de llamada Días Límite -</B> Esta opción le permite reducir el agente devoluciones de llamada programadas del calendario para un número seleccionable de días a partir de hoy, el pleno del calendario de 12 meses todavía se muestra, pero sólo el número de días va a ser seleccionable. El valor predeterminado es 0 para un número ilimitado. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Programado devoluciones de llamada de horas de vuelo -</B> Esta opción le permite restringir una devolución de llamada useronly previsto que se muestre en la lista de devolución de llamada hasta que el agente X horas después de que se ha establecido. El valor predeterminado es 0 para no bloquear. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Rellamadas programadas bloque Calltime -</B> Esta opción si está habilitado impedirá la devolución de llamada programado en la lista de devolución de llamada del agente de que se está marcando si está fuera de la calltime prevista para la campaña. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Mi devoluciones de llamada predeterminado casilla de verificación -</B> Esta opción le permite pre-configurar la casilla de verificación Mi Devolución de llamada en la pantalla del agente de devolución de llamada programada. Facturado se marque la casilla de forma automática para cada llamada. El valor predeterminado es NO FACTURADO. <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> @@ -4542,6 +5329,26 @@ if ($ADD==99999) <BR> <B>Mensaje de Wrap up -</B> esto es un mensaje campaña-especi'fico que seexhibirá en la pantalla del wrapup si se fijan los segundos delwrapup. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Desactivar la pantalla de dispo -</B> Esta opción le permite desactivar la pantalla de la disposición en la interfaz de agente. El campo Desactivar Estado Dispo a continuación deben ser llenados para que funcione esta opción. El valor predeterminado es DISPO_ENABLED. La opción DISPO_SELECT_DISABLED no desactivar la pantalla de dispo por completo, pero se mostrará la pantalla dispo sin ningún tipo de disposiciones, esta opción sólo debe utilizarse si usted quiere forzar a los agentes a utilizar su software de CRM, que enviará el estado del sistema a través de la API. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Desactivar estado de dispo -</B> Si la opción Desactivar la pantalla se ajusta a dispo DISPO_DISABLED, este campo debe ser llenado pulg Usted puede usar cualquier disposición que desee para este campo, siempre y cuando sea de 1 a 6 caracteres de longitud, con sólo letras y números. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Las etiquetas de la pantalla del agente -</B> Puede seleccionar un conjunto de etiquetas de la pantalla del agente a utilizar con esta opción. El valor predeterminado es - de escenarios del sistema - para las etiquetas predeterminadas. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Campos de la pantalla de estado -</B> Usted puede seleccionar las variables de las llamadas se mostrará en la línea de estado de la pantalla del agente. CallID mostrará el identificador de llamada única de 20 caracteres, LEADID mostrará el ID de sistema de cable, ListId mostrará el ID de la lista. El valor predeterminado es CallID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -4562,6 +5369,21 @@ if ($ADD==99999) <BR> <B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun código de la pausa cuando chascan encendido el botón de PAUSA envicidial.php. Los códigos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinión de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. Fuerza de la fuerza de los agentes para elegir un código PAUSA si hacen clic en el botón PAUSA. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Auto Pause antes de la llamada de trabajo -</B> En el modo de marcación automática, esta opción si está habilitado se establece que el agente se detuvo automáticamente cuando se hace clic agente en cualquiera de las siguientes funciones que les obliga a ser una pausa-Manual de marcación, marcación abreviada, Búsqueda de plomo, llame a Ver registro, devoluciones de llamada de cheque, Ingrese el código de pausa. Defecto es n de las personas inactivas. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Auto Reanudar una llamada previa de trabajo -</B> En el modo de marcación automática, esta opción si está habilitado se establece que el agente activo de forma automática cuando el agente hace clic fuera de, o se cancela, en cualquiera de las siguientes funciones que les obliga a estar marcado una pausa-manual, marcación abreviada, Búsqueda de plomo, llame Ver registro, devoluciones de llamada Check, Introduzca el código de pausa. Defecto es n de las personas inactivas. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Auto Pause antes de la llamada Código -</B> Si el Auto Pause antes de la llamada Función de trabajo anterior es activo, y los códigos de agentes de pausa está activado, este ajuste será el código de pausa que se utiliza cuando el agente se detuvo para estas actividades. El valor predeterminado es PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -4580,7 +5402,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_override"> <BR> - <B>Manual Dial Override -</B> The setting can override the Usuarios setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Usuarios setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE. + <B>Marcación manual de anulación -</B> El ajuste puede anular los Usuarios de ajuste de la capacidad de marcado manual para los agentes, cuando éstos son registrados en esta campaña. NINGUNO seguirá el ajuste de los usuarios, ALLOW_ALL permitirá que cualquier agente registrado en esta campaña para hacer llamadas marcación manual, DISABLE_ALL no permitirá que nadie ha iniciado sesión en esta campaña para hacer llamadas marcación manual. El valor predeterminado es NINGUNO. <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> @@ -4590,12 +5412,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Manual de Acceso telefónico Filtro - </B> Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTAS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas. CAMPLISTAS_ALL - will include listas inactivas in the search for the number. + <B>Manual de Acceso telefónico Filtro - </B> Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas. CAMPLISTS_ALL - se incluyen las listas de inactivos en la búsqueda de la cantidad. <BR> <A NAME="vicidial_campaigns-manual_preview_dial"> <BR> - <B>Manual Preview Dial -</B> This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP. + <B>Manual de marcación previa -</B> Esto permite al agente en el modo de marcación manual para ver la información de plomo cuando se haga clic en Marque el siguiente número antes de marcar activamente la llamada telefónica. Hay un enlace opcional a SKIP la iniciativa y pasar a la siguiente si se ha seleccionado. El valor predeterminado es PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Marcación manual de la API -</B> Esta opción le permite definir la API de Agente a hacer ya sea una llamada a la vez, ESTÁNDAR, o la capacidad de la cola de llamadas de marcación manual y tienen que marcar automáticamente una vez que el agente va a hacer una pausa o está disponible para tomar su próxima convocatoria con la opción para desactivar la marcación automática de estas llamadas, cola o QUEUE_AND_AUTOCALL que es lo mismo que cola, pero sin la opción para desactivar la marcación automática de estas llamadas. Si un agente tiene más de una llamada en cola para ellos verán la cuenta de cuántas llamadas marcación manual se encuentran en la cola justo debajo del botón de pausa, o marque el botón número siguiente. Le sugerimos que si la lista se utiliza que envíe las acciones de la API con la vista previa = yes por lo que no están en repetidas ocasiones de marcar las llamadas para el agente sin previo aviso. Asimismo, si utiliza la cola y en gran medida mediante llamadas de marcación manual en un método de marcación manual no, le recomendamos ajustar la pausa después de cada agente de opción de compra para Y. valor predeterminado es Normal. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Duración de la llamada Manual de Entrada -</B> Si esta opción está activada, se comprobarán todas las llamadas de marcado manual para asegurarse de que están dentro de los ajustes de llamada de tiempo establecidos para la campaña. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Manual de marcación CID -</B> Esto define si un agente de la realización de llamadas Marcación manual tendrá las opciones de campaña CallerID utiliza, o utiliza sus agentes telefónicos configuración de CallerID. El valor predeterminado es CAMPAÑA. Si el uso personalizado opción de campaña de CID está activado o el Escenario de Campaña de la lista de anulación del CID se utiliza, este ajuste se tendrá en cuenta. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Mensaje Teléfono Diferencia de tiempo de alerta -</B> Esta función de marcación manual sólo si está activado, se mostrará una alerta si la zona horaria para el código postal de plomo, o el código postal, es diferente de la zona horaria del código de área del número de teléfono para el plomo. La opción OUTSIDE_CALLTIME_ONLY sólo se mostrará la alerta si las dos zonas de tiempo son diferentes y una de las zonas horarias se encuentra fuera del tiempo de llamada seleccionada para la campaña. OUTSIDE_CALLTIME_PHONE sólo comprueba si la zona horaria del número de teléfono del conductor y alertar si está fuera del tiempo de llamada local. OUTSIDE_CALLTIME_POSTAL sólo comprueba si la zona horaria del código postal de la iniciativa y alertar si está fuera del tiempo de llamada local. OUTSIDE_CALLTIME_BOTH comprobará el código postal y número de teléfono para estar dentro de la duración de la llamada local, incluso si se encuentran en la misma zona horaria. Estas alertas se muestran en la información del registro de llamadas, información de devoluciones de llamada de la lista, la información de resultados de búsqueda, cuando un líder se marca y cuando una ventaja de una vista previa. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -4605,7 +5447,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>3-Vías de salida de llamadas CallerID - </B> Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en. AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones. CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead. + <B>3-Vías de salida de llamadas CallerID - </B> Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en. AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones. CUSTOM_CID usará el CID personalizado que se define en el campo de la tabla security_phrase vicidial_list para el plomo. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> @@ -4615,17 +5457,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> <BR> - <B>Customer 3-Way Hangup Logging -</B> If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED. + <B>Cliente 3-Way Colgar el registro de -</B> Si esta opción está activada, el user_call_log registrará cuando un cliente hasta colgar si se cuelga durante una llamada de 3 vías. Además, esto puede permitir que para el cliente de 3 vías de acción de colgar si se defineed a continuación. Valor predeterminado es Activado. <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> <BR> - <B>Customer 3-Way Hangup Seconds -</B> If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds. + <B>Cliente 3-Way Segundos hangup -</B> Si el cliente de 3 vías está habilitado el registro, esta opción le permite definir el número de segundos después de colgar los clientes se detecta antes de que realmente se registra y el cliente opcional de 3 vías de acción de colgar se ejecuta. El valor predeterminado es 5 segundos. <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_action"> <BR> - <B>Customer 3-Way Hangup Action -</B> If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE. + <B>Cliente 3-Way Colgar Acción -</B> Si el cliente de 3 vías está habilitado el registro, esta opción le permite tener la pantalla del agente de forma automática que cuelgan de la llamada y volver a la pantalla DISPO si esta opción está establecida en DISPO. El valor predeterminado es NINGUNO. <?php if ($SSqc_features_active > 0) @@ -4702,12 +5544,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queuemetrics_callstatus"> <BR> - <B>QM CallStatus Override -</B> If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the Ajustes Del Sistema setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting. + <B>QM CallStatus anulación -</B> Si la integración QueueMetrics está activada en la configuración del sistema, esta configuración permite la primordial de la configuración del sistema de ajuste de las entradas CallStatus queue_log. El valor predeterminado es DISABLED que utilizará la configuración del sistema. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>Gestión de calidad para el Medio Ambiente Teléfono -</B> Si la integración QueueMetrics está activada en la configuración del sistema, esta configuración permite la inserción de este valor de datos en el campo de la data4 queue_log para los registros de la actividad del agente. El valor predeterminado es vacío para discapacitados. <BR> <A NAME="vicidial_campaigns-extension_appended_cidname"> <BR> - <B>Extension Append CID -</B> If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + <B>Anexar extensión de CID -</B> Si está activado, las llamadas realizadas a partir de esta campaña tendrá un espacio y la extensión telefónica del agente añade al final del nombre de CallerID de la llamada antes de ser enviada al agente. Defecto es n para discapacitados. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>PLLB Agrupación -</B> Ingresar Teléfono de carga Agrupación de equilibrio, sólo se permite si hay varios servidores de agentes y los alias de teléfono están presentes en el sistema. Si se establece en ONE_SERVER_ONLY que obligará a todos los agentes de esta campaña para iniciar sesión en el mismo servidor. Si se establece a una cascada que se registra en agrupar los agentes en el mismo servidor hasta la Agrupación PLLB Limitar el número de agentes que se alcanzan, entonces el siguiente agente se conectará al servidor de al lado con el menor número de agentes. Si se establece en DISABLED el teléfono el comportamiento estándar de alias de cada agente para encontrar el servidor con el menor número de agentes remotos no han iniciado sesión en que serán utilizados. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>PLLB límite Agrupación -</B> Ingresar Teléfono de equilibrio de carga agrupación Límite. Si Agrupación PLLB se encuentra a una cascada de decir que este ajuste se determinará el número de agentes aceptable en cada servidor para esta campaña. Por defecto es 50. <BR> <A NAME="vicidial_campaigns-crm_popup_login"> @@ -4729,6 +5586,11 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada es dispositioned por un agente, si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. dispo y talk_time son las variables que puede utilizar para recuperar el agente definido por la disposición de la llamada y el tiempo de conversación real en segundos de la llamada. Esta URL no puede ser una ruta relativa. Por defecto está en blanco. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>No Llamar URL -</B> Esta dirección URL de la tela no se ve por el agente, pero si está poblado se llama cada vez que se cuelga una llamada que no es manejado por un agente de arriba o transferido. Utiliza las mismas variables que los campos de formularios web y scripts. dispo puede utilizarse para recuperar el sistema definido por la disposición para la llamada. Esta URL no puede ser una ruta relativa. El valor predeterminado es en blanco. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4767,17 +5629,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-blind_monitor_warning"> <BR> - <B>Blind Monitor Warning -</B> This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED. + <B>Advertencia Monitor de Ciegos -</B> Esta opción le permitirá si está habilitado el agente conoce de varias formas opcionales si están siendo ciego controlados por alguien. DISABLED significa que esta función no está activa, alerta sólo aparecerá una alerta en la pantalla el agente, la notificación se publique una nota que permanece en la pantalla el agente, siempre y cuando theyâ Re siendo monitoreados, de audio reproducirá el nombre define a continuación cuando un agente está empezando a ser monitoreados y las otras opciones son combibnations de las opciones anteriores. El valor predeterminado es DISABLED. <BR> <A NAME="vicidial_campaigns-blind_monitor_message"> <BR> - <B>Blind Monitor Notice -</B> This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is -Someone is blind monitoring your session-. + <B>Ciegos Aviso monitor -</B> Este es el mensaje que aparecerá en la pantalla del agente, mientras que están siendo monitoreados, si la opción se ha seleccionado AVISO. El valor predeterminado es -Someone is blind monitoring your session-. <BR> <A NAME="vicidial_campaigns-blind_monitor_filename"> <BR> - <B>Blind Monitor Filename -</B> This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty. + <B>Nombre del Monitor de Ciegos -</B> Este es el archivo de audio que se reproducirá en la sesión de los agentes en el inicio del monitoreo que alguien les ciega. Este mensaje se reproducirá para todo el mundo, en la sesión, incluyendo al cliente si está presente. Por defecto está vacío. @@ -4785,7 +5647,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_LISTAS TABLA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTS TABLA</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>Identificación de la lista -</B> Úste es el nombre numérico de la lista, él no es editable después de la sumisión inicial, debe contener solamente números y debe estar entre 2 y 8 caracteres en longitud. Must be a number greater than 100. @@ -4849,11 +5711,26 @@ if ($ADD==99999) <BR> <B>Drop de entrada Grupo de Override -</B> Si se establece este campo, en este grupo se utilizará para las llamadas salientes dentro de esta lista que la caída de la campaña de salida en lugar de la caída en grupo situado en la pantalla de detalle de la campaña. Por defecto no se establece. + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Anulación Formulario Web - </ B> Esta es la dirección a medida que al hacer clic en el botón Formulario Web en VICIDIAL le llevará a las llamadas que entran en en esta lista. Si desea utilizar campos personalizados en un formulario web de direcciones, es necesario agregar &CF_uses_custom_fields=Y como parte de su URL. + <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>Xfer-Conf Número Override -</B> Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Informe de Inventario -</B> Si el Informe de Inventario está habilitado en su sistema, esta opción se determinará si esta lista está incluido en el informe o no. No está en S para sí. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Ajuste de Huso Horario -</B> Esta opción le permite definir el método de mantener la búsqueda de la zona horaria actual de los cables dentro de esta lista. Este proceso sólo se realiza por la noche para los cambios que realice no será inmediata. COUNTRY_AND_AREA_CODE es el predeterminado, y utilizará el código de país y código de área del número de teléfono para determinar la zona horaria de la iniciativa. Postal_code utilizará el código postal si está disponible para determinar la zona horaria de la iniciativa. NANPA_PREFIX sólo funciona en los EE.UU. y utilizará el código de área y el prefijo del número de teléfono para determinar la zona horaria de la iniciativa, pero esto no está habilitado por defecto en el sistema, así que por favor asegúrese de tener los datos cargados en el prefijo NANPA su sistema antes de seleccionar esta opción. OWNER_TIME_ZONE_CODE utilizará la zona horaria estándar abbraviation carga en el campo propietario de la mina para determinar la zona horaria, en los ejemplos de Estados Unidos son AST, EST, CST, MST, PST, el CCTA, HST. Esta característica debe ser habilitada por el administrador del sistema para entrar en vigor. + <BR> <A NAME="vicidial_list-dnc"> @@ -4864,7 +5741,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_Entrantes_GROUPS TABLA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_GROUPS TABLA</FONT></B><BR><BR> <A NAME="vicidial_inbound_groups-group_id"> <BR> <B>Identificación de grupo -</B> Úste es el nombre corto del grupo de entrada, él no es editable después de la sumisión inicial, no debe contener cualquier espacio y debe estar entre 2 y 20 caracteres en longitud. @@ -4884,10 +5761,20 @@ if ($ADD==99999) <BR> <B>Activo -</B> esto se determina si este grupo demuestra para arriba en la caja de la selección cuando un agente de VICIDIAL entra. + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativa para este grupo entrante, esto permite la visualización de esta administración en grupo restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver esta dentro del grupo. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>En-Grupo Calldate -</B> Esta es la última fecha y hora en que una llamada fue dirigida a este grupo de entrada. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Forma del Web -</B> Ésta es la dirección de encargo que el chascar en el botón de la FORMA del WEB en VICIDIAL le llevará para las llamadas que vienen adentro en este grupo. + <B>Forma del Web -</B> Ésta es la dirección de encargo que el chascar en el botón de la FORMA del WEB en VICIDIAL le llevará para las llamadas que vienen adentro en este grupo. Si desea utilizar campos personalizados en un formulario web de direcciones, es necesario agregar &CF_uses_custom_fields=Y como parte de su URL. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4896,14 +5783,30 @@ if ($ADD==99999) <BR>   - random: órdenes por el valor al azar de la actualización en la tabla de los vicidial_live_agents <BR>   - oldest_call_start: las órdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. <BR>   - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. + <BR>   - oldest_inbound_call_start: las órdenes de la última vez que un agente fue enviado a una llamada entrante. Resultados de los agentes que reciben el mismo número de llamadas en general. + <BR>   - oldest_inbound_call_finish: las órdenes de la última vez que un agente de terminar una llamada entrante. También conocido como agente de la espera más larga recibe primera llamada. <BR>   - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. <BR>   - inbound_group_rank: órdenes de la fila dada al agente para el grupode entrada específico. Lo más arriba posible a lo más bajo posible. - <BR>   - fewest_calls: órdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - campaign_rank: órdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - ingroup_grade_random: da una mayor probabilidad de recibir una llamada a los agentes de mayor grado por el grupo de pertenencia. + <BR>   - campaign_grade_random: da una mayor probabilidad de recibir una llamada a los agentes de mayor grado por la campaña. + <BR>   - fewest_calls: órdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> NOTAS: Para ring_all, los agentes que utilizan los teléfonos que tengan habilitado El gancho del agente tendrá su anillo de los teléfonos y el primero en responder recibirá la llamada y la información en la pantalla del agente. Desde ring_all ignora el tiempo de espera y agente de la clasificación y se llame a todos los agentes que se encuentra disponible para la cola, no se recomienda utilizar este método para las colas grandes. Cuando se utiliza ring_all, agentes conectados con los teléfonos que tienen el Agente Colgar discapacitados tendrán que utilizar las llamadas en el panel de cola y haga clic en el enlace de mis llamadas para atender las llamadas en cola. La cantidad de tiempo que el teléfono sonará para los agentes ring_all se ajusta a la configuración de anillo con el teléfono colgado de tiempo o el tiempo más corto el anillo de los teléfonos que serán llamados. Nosotros no recomendamos el uso de ring_all de colas de llamadas de alto volumen, o colas con muchos agentes. El método ring_all se destina a ser utilizado con sólo unos pocos agentes y en el volumen de llamadas baja en los grupos. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>Con el teléfono colgado del timbre -</B> Esta opción sólo se utiliza para los agentes que se conectan con los teléfonos que tienen la función de agente con el teléfono colgado habilitado. Este es el número de segundos que cada intento de llamada al agente sonará hasta que el sistema va a esperar un segundo y comienzan a sonar los teléfonos de agentes disponibles de nuevo. Este campo puede ser anulada si los teléfonos del agente se establecen en un momento en el anillo inferior, que puede ser necesario para evitar que las llamadas que se envíe un mensaje de voz móviles. El valor predeterminado es 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>Con el teléfono colgado del CID -</B> Esta opción sólo se utiliza para los agentes que se conectan con los teléfonos que tienen la función de agente con el teléfono colgado habilitado. Este es el identificador de llamadas que se mostrará en sus teléfonos de agentes cuando las llamadas son de llamada. Genérico es un genérico RINGAGENT00000000001 tipo de notificación. Endogrupal mostrará sólo el grupo en la llamada vino. CUSTOMER_PHONE sólo mostrará el número de teléfono del cliente. CUSTOMER_PHONE_RINGAGENTE mostrará RINGAGENT_3125551212 con la RINGAGENTE como parte de la policía judicial, con el número de teléfono del cliente. CUSTOMER_PHONE_INGROUP mostrará los primeros 10 caracteres del en-grupo seguido por el número de teléfono del cliente. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4921,12 +5824,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ignore_list_script_override"> <BR> - <B>Ignore List Script Override-</B> This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any ID De la Lista script settings. Default is N. + <B>No haga caso de anulación de la lista de secuencias de comandos-</B> Esta opción le permite hacer caso omiso de la ID de la lista de secuencias de comandos opción de anulación de las llamadas que entran en este grupo de pertenencia. Si se establece en Y ignorará cualquier configuración del identificador de la lista de secuencias de comandos. El valor predeterminado es N. <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent. + <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. Si los campos de lista personalizados están habilitados en su sistema, FORMA abrirá la ficha del formulario cuando la conexión de una llamada a un agente. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4936,7 +5839,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Llame Menú specified in the Temporizador de Acción de Destination field, EXTENSION will send the call to the Extension that is specified in the Temporizador de Acción de Destination field, IN_GROUP will send the call to the In-Group specified in the Temporizador de Acción de Destination field. + <B>Temporizador de Acción de -</B> Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. COLGAR colgará la llamada cuando el temporizador se activa, se CALLMENU enviar la llamada al menú de llamadas especificado en el campo de acción del temporizador de destino, EXTENSIÓN enviará la llamada a la extensión que se especifica en el campo de acción del temporizador de destino, IN_GROUP enviará la llamada a la En-Grupo especificado en el campo de acción del temporizador de destino. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4951,7 +5854,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action_destination"> <BR> - <B>Temporizador de Acción de Destination -</B> This field is where you specify the Llame Menú, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. + <B>Temporizador de destino Acción -</B> Este campo es donde se especifica el menú de llamada, extensión o en grupo que desea la convocatoria enviada a si la acción de hora está en la CALLMENU, prórroga o IN_GROUP. Por defecto está vacío. <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> @@ -4966,18 +5869,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Caída Extensión - </B> En caso de caída de acción se fija a un mensaje, este es el dial plan de ampliación que la convocatoria se enviará a si llega a soltar Convocatoria Segundos. + <B>Caída Extensión - </B> En caso de caída de acción se fija a un mensaje, este es el dial plan de ampliación que la convocatoria se enviará a si llega a soltar Convocatoria Segundos. Para AGENTDIRECT en los grupos, si el usuario no está disponible, usted puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>Buzón de Voz -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + <B>Buzón de Voz -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Grupo de Transferencia de gota - </B> En caso de caída de Acción se establece en IN_GROUP, la llamada será enviada a este grupo entrantes si llega a soltar Convocatoria Segundos. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Menú desplegable de llamadas -</B> Si la gota de Acción se establece CALLMENU, la llamada será enviada a este menú de llamadas si llega a segundos de caída de llamadas. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Acción de transferencia de CID -</B> Se utiliza para la gota, Abierto por la noche y las acciones no-agente-no-cola. Este es el número identificador de llamadas que utiliza la llamada antes de ser transferida a las extensiones, mensajes, correo de voz o menús de llamadas. Usted puede utilizar CLIENTE en este campo para utilizar el número de teléfono del cliente, o hacer campaña para usar la primera persona que llama permitido campaña de número de identificación. El valor predeterminado es CLIENTE. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4996,22 +5909,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Después de la extensión de las horas -</B> la extensión dialplan paraenviar la llamada si la acción se fija a la EXTENSIÓN. El defecto es8300. + <B>Después de la extensión de las horas -</B> la extensión dialplan paraenviar la llamada si la acción se fija a la EXTENSIÓN. El defecto es8300. Para AGENTDIRECT en grupos, se puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Después de las horas Buzón de Voz -</B> la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + <B>Después de las horas Buzón de Voz -</B> la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>Horas después de la transferencia Grupo - </B> Si después de las horas de Acción se establece en IN_GROUP, la llamada será enviada a este grupo de entrada si ésta entra en el grupo de fuera de la convocatoria régimen de tiempo definido para el grupo en -. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>Después del horario de llamada Menú -</B> Si después de Acción de horas se establece CALLMENU, la llamada será enviada a este menú de llamada si entra en el exterior dentro del grupo del sistema de tiempo de llamada definido para el grupo de pertenencia. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>N de colas n Agentes -</B> Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + <B>N de colas n Agentes -</B> Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar. También se puede poner AGENTEXT en este campo si se ha definido a la extensión y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -5023,6 +5941,21 @@ if ($ADD==99999) <BR> <B>No hay ninguna cola Acción Agente Valor -</B> Este es el valor de la acción anterior. El valor predeterminado es nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Llama al método Max -</B> Esta opción se puede activar la función de máxima llamadas simultáneas para esta dentro del grupo. Si se establece en total, entonces el número total de llamadas que son manejados por los agentes y en la cola en este en-grupo no podrá exceder el máximo número de llamadas número de líneas se definen a continuación. Si se establece en IN_QUEUE, entonces, si el número de llamadas en cola de espera para los agentes no podrán exceder el máximo de llamadas Conde no importa cuántas llamadas están con agentes de este grupo de pertenencia. El valor predeterminado es DISABLED. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Max llama Conde -</B> Esta opción debe ser mayor que 0 si desea utilizar la función Max llama Método. El valor predeterminado es 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Max llama Acción -</B> Esta es la acción a tomar si el máximo de llamadas a métodos es activada y el número de llamadas excede lo establecido anteriormente en la Cuenta Max llama ajuste. Las llamadas por encima de esa cantidad será enviado a cualquiera de la acción DROP, la acción o la acción AfterHours NO_AGENT_NO_QUEUE y se registrará como un estado MAXCAL con una razón de colgar MaxCalls. El valor predeterminado es NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -5051,12 +5984,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> <BR> - <B>On Hold Prompt No Block -</B> Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>Preguntar en espera ningún bloque -</B> Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada en espera cuando el sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras el mensaje en espera Nombre del sistema está jugando a un cliente que no puede ser enviado a un agente. El valor predeterminado es N. <BR> <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> <BR> - <B>On Hold Prompt Seconds -</B> This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10. + <B>Segundos en espera prontas -</B> Este campo debe ser establecido en el número de segundos que el nombre de archivo en espera del sistema juega. El valor predeterminado es 10. <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> @@ -5071,107 +6004,107 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> <BR> - <B>Calculate Estimated Hold Seconds -</B> This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0. + <B>Calcular estimado Segundos Hold -</B> Esto define el número de segundos en la cola que el cliente va a esperar antes de que el tiempo de espera estimado se calculará y jugó de forma opcional. Mínima es de 3 segundos, incluso si se ajusta por debajo de 3. El valor predeterminado es 0. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> <BR> - <B>Estimated Hold Time Minimum Filename -</B> If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive. + <B>Nombre del archivo estimado Hold tiempo mínimo -</B> Si el tiempo de espera estimado es activo y se calcula que es igual o inferior al mínimo de 15 segundos, y luego el archivo del sistema se jugará en lugar del anuncio de fábrica. El valor predeterminado es Empty de las personas inactivas. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> <BR> - <B>Estimated Hold Time Minimum Prompt No Block -</B> If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N. + <B>Mínimo Estimado Tiempo de Espera Preguntar no hay un bloque -</B> Si Tiempo estimado de espera está activa y el tiempo estimado de espera mínima campo Nombre de archivo anterior es rellenado, entonces esta opción para permitir las llamadas en fila detrás de una llamada en donde el indicador está jugando para ir a un agente, si uno está disponible, mientras que el mensaje se está reproduciendo . Mientras que el sistema está jugando a un cliente no puede ser enviado a un agente. El valor predeterminado es N. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> <BR> - <B>Estimated Hold Time Minimum Prompt Seconds -</B> This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10. + <B>Estimación de Hold segundos de tiempo mínimo Prompt -</B> Este campo tiene que estar en el número de segundos que el tiempo estimado de retención mínima del sistema Nombre juega. El valor predeterminado es 10. <BR> <A NAME="vicidial_inbound_groups-wait_time_option"> <BR> - <B>Wait Time Opción -</B> This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line. + <B>Espere Opción Tiempo -</B> Esto le permite ofrecer a los clientes opciones para salir de la cola si su tiempo de espera es más de la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNO. Si una de las opciones PRESS_ está seleccionada, se reproducirá el nombre de archivo de prensa se define más adelante y darle al cliente la opción de pulsar 1 en su teléfono para salir de la cola y ejecutar la opción seleccionada. La opción PRESS_STAY le enviará al cliente a la cola sin perder su lugar en la fila. <BR> <A NAME="vicidial_inbound_groups-wait_time_second_option"> <BR> - <B>Wait Time Second Opción -</B> Same as the first Wait Time Opción field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Opción is selected then this option will not be offered. + <B>Espere Opción segunda vez -</B> Igual que el campo de opción de espera primera vez que el anterior, excepto éste comprobará si el cliente pulsa el botón 2. El valor predeterminado es NINGUNO. Si no hay ninguna opción Tiempo de espera del primero se selecciona esta opción no se le ofrecerá. <BR> <A NAME="vicidial_inbound_groups-wait_time_third_option"> <BR> - <B>Wait Time Third Opción -</B> Same as the first Wait Time Opción field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Opción is selected then this option will not be offered. + <B>Espere Opción tercera vez -</B> Igual que el campo Opción Espera primera vez anterior, pero éste comprobará si el cliente pulsa la tecla 3. El valor predeterminado es NINGUNO. Si no hay ninguna opción Tiempo de espera del segundo lugar se selecciona esta opción no se le ofrecerá. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> <BR> - <B>Wait Time Opción Seconds -</B> If Wait Time Opción is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds. + <B>Espere unos segundos tiempo de la opción -</B> Si la opción Tiempo de espera se establece en algo, pero NINGUNO, este es el número de segundos que el cliente ha estado esperando en la cola que activará las opciones de tiempo de espera. Por defecto es 120 segundos. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_exten"> <BR> - <B>Wait Time Opción Extension -</B> If Wait Time Opción is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. + <B>Espere plazo de prórroga de la opción -</B> Si la opción Tiempo de espera se establece en PRESS_EXTEN, esta es la extensión de plan de marcado que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción. Para AGENTDIRECT en grupos, se puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> <BR> - <B>Wait Time Opción Callmenu -</B> If Wait Time Opción is set to PRESS_CALLMENU, this is the Llame Menú that the call will be sent to if the customer presses the option key when presented with the option. + <B>Espere Callmenu Tiempo Opción -</B> Si la opción Tiempo de espera se establece en PRESS_CALLMENU, este es el menú de llamada que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> <BR> - <B>Wait Time Opción Buzón de Voz -</B> If Wait Time Opción is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + <B>Espera Tiempo de correo de voz opcional -</B> Si la opción Tiempo de espera se establece en PRESS_VMAIL, este es el buzón de voz que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> <BR> - <B>Wait Time Opción Transfer In-Group -</B> If Wait Time Opción is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option. + <B>Espera Tiempo de Transferencia opción dentro del grupo -</B> Si la opción Tiempo de espera se establece en PRESS_INGROUP, este es el grupo de entrada que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> <BR> - <B>Wait Time Opción Press Filename -</B> If Wait Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Opción Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Opcións, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back. + <B>Espere Opción Tiempo Archivo de Prensa -</B> Si la opción Tiempo de espera se establece en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega, si el tiempo de espera de clientes que supera los segundos de tiempo de espera de opciones para dar al cliente la opción de pulsar 1, 2 o 3 en su teléfono para ejecutar los seleccionados de espera las opciones de esta edición. Es muy importante que incluya las opciones en el archivo de audio para todas las opciones seleccionadas tiempo de espera, y que la longitud del archivo de audio en cuestión de segundos está bien definido en el campo Nombre de archivo segundos por debajo o habrá problemas. El valor predeterminado es a-ser-llamada-back. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> <BR> - <B>Wait Time Opción Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Wait Time Opción Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Opción Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>Espere Prensa opción de tiempo de ningún bloque -</B> Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada cuando el Tiempo de espera Pulse la tecla Opción Nombre del sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras que el tiempo de espera Pulse la tecla Opción mensaje de nombre de archivo está jugando a un cliente que no puede ser enviado a un agente. El valor predeterminado es N. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> <BR> - <B>Wait Time Opción Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Wait Time Opción Press Filename plays for. Default is 10. + <B>Tiempo de espera Opción Segundos Nombre de archivo de prensa -</B> Este campo debe ser establecido en el número de segundos que el tiempo de espera de la opción Archivo de Prensa juega. El valor predeterminado es 10. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> <BR> - <B>Wait Time Opción After Press Filename -</B> If Wait Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3. + <B>Espere Opción Tiempo Después de Archivo de Prensa -</B> Si la opción Tiempo de espera se establece en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega después de que el cliente haya presionado 1, 2 o 3. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> <BR> - <B>Wait Time Opción Callback ID De la Lista -</B> If Wait Time Opción is set to PRESS_CID_CALLBACK, this is the ID De la Lista the call is added to as a new lead if the customer presses the option key when presented with the option. + <B>Espere opción Tiempo de devolución de llamada ID Lista -</B> Si la opción Tiempo de espera se establece en PRESS_CID_CALLBACK, este es el ID de la lista de la llamada se añade como una nueva pista, si el cliente pulsa la tecla opción cuando se presentan con la opción. <BR> <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> <BR> - <B>Wait Hold Opción Priority -</B> If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Opción is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only. + <B>Espera tener prioridad Opción -</B> Si ambas opciones estimado tiempo de retención y Wait opciones de tiempo son activos, esta configuración definirá si una, otra o ambas de estas funciones están activas. Por ejemplo, si la opción de espera Tiempo estimado se establece en 360, la opción Tiempo de espera está establecido en 120 y el cliente ha estado esperando durante 120 segundos y todavía hay 400 segundos el tiempo de espera estimado, entonces ellos están activos al mismo tiempo, y este valor será revisado para ver qué opciones se ofrecen. El valor predeterminado es esperar sólo. <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Estimated Mantenga la opción Tiempo - </B> Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. + <B>Estimated Mantenga la opción Tiempo - </B> Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA. Si una de las opciones PRESS_ está seleccionada, se reproducirá el nombre de archivo de prensa se define más adelante y dar al cliente la opción de pulsar 1 en su teléfono para salir de la cola y ejecutar la opción seleccionada. <BR> <A NAME="vicidial_inbound_groups-hold_time_second_option"> <BR> - <B>Hold Time Second Opción -</B> Same as the first Hold Time Opción field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Opción is selected then this option will not be offered. + <B>Mantenga la opción segunda vez -</B> Igual que el campo Opción Hold primera vez que el anterior, excepto éste comprobará si el cliente pulsa el botón 2. El valor predeterminado es NINGUNO. Si no hay ninguna opción Hold primera vez que se selecciona esta opción no se le ofrecerá. <BR> <A NAME="vicidial_inbound_groups-hold_time_third_option"> <BR> - <B>Hold Time Third Opción -</B> Same as the first Hold Time Opción field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Opción is selected then this option will not be offered. + <B>Mantenga la opción tercera vez -</B> Igual que el campo Opción Hold primera vez anterior, pero éste comprobará si el cliente pulsa la tecla 3. El valor predeterminado es NINGUNO. Si no hay ninguna opción Hold segunda vez se selecciona esta opción no se le ofrecerá. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> @@ -5181,22 +6114,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> <BR> - <B>Hold Time Opción Minimum -</B> If Hold Time Opción enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Opción Seconds value. Default is 0 seconds. + <B>Mantenga mínima opción de tiempo -</B> Si la opción Hold Time habilitada, este es el número mínimo de segundos que la llamada debe esperar antes de que se le presentará la opción de tiempo de espera. La opción de tiempo de espera de inmediato se presentará en este momento si el tiempo de espera estimado es mayor que el tiempo de retención Opción Segundos valor. El valor predeterminado es 0 segundos. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Mantenga la opción Tiempo de Extensión - </B> Si el tiempo de la opción se fija a la extensión, esta es la extensión dialplan que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. + <B>Mantenga la opción Tiempo de Extensión - </B> Si el tiempo de la opción se fija a la extensión, esta es la extensión dialplan que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. Para AGENTDIRECT en grupos, se puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> <BR> - <B>Hold Time Opción Callmenu -</B> If Hold Time Opción is set to CALL_MENU, this is the Llame Menú that the call will be sent to if the estimated hold time exceeds the Hold Time Opción Seconds. + <B>Mantenga Callmenu Tiempo Opción -</B> Si Opción Hold Time está ajustado a CALL_MENU, este es el menú de llamadas que el llamado se enviará a si el tiempo de espera estimada supera los Segundos Tiempo de Espera de opciones. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>Mantenga la opción Tiempo de voz - </B> Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + <B>Mantenga la opción Tiempo de voz - </B> Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> @@ -5206,22 +6139,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> <BR> - <B>Hold Time Opción Press Filename -</B> If Hold Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Opción Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Opción. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back. + <B>Mantenga la opción Time Nombre del archivo de prensa -</B> Si la opción Hold Time está establecido en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega, si el tiempo de espera estimado superior a los Segundos Tiempo de Espera de opciones para dar al cliente la opción de pulsar 1 en su teléfono para ejecutar el tiempo de retención seleccionado Pulse Opción. Es muy importante que este archivo de audio es de 10 segundos o menos, o habrá problemas. El valor predeterminado es a-ser-llamada-back. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> <BR> - <B>Hold Time Opción Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Hold Time Opción Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Opción Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>Hold Time Prensa opción No Bloquear -</B> Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada donde nos depara el tiempo de la opción Archivo de Prensa del sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras que el tiempo de retención Pulse la tecla Opción mensaje Nombre está jugando a un cliente que no puede ser enviado a un agente. Por defecto es N. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> <BR> - <B>Hold Time Opción Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Hold Time Opción Press Filename plays for. Default is 10. + <B>Tiempo de espera Opción Segundos Nombre de archivo de prensa -</B> Este campo debe ser establecido en el número de segundos que el tiempo de retención de la opción Archivo de Prensa juega. El valor predeterminado es 10. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Hold Time Opción After Press Filename -</B> If Hold Time Opción is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list. + <B>Mantenga la opción Tiempo Después de Archivo de Prensa -</B> Si la opción Hold Time está establecido en una de las opciones PRESS_ o CALLERID_CALLBACK, este es el símbolo de nombre de archivo que se juega después de que el cliente haya presionado 1 o la llamada ha sido añadido a la lista de devolución de llamada. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -5251,7 +6184,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>In-Group Recording Filename -</B> This field will override the Grabación De la Campaña Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. The default is FULLDATE_AGENTE and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. + <B>In-Group Recording Filename -</B> This field will override the Grabación De la Campaña Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. El valor predeterminado es FULLDATE_AGENTE y se vería así-20051020 103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -5323,7 +6256,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-add_lead_url"> <BR> - <B>Add Lead URL -</B> This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + <B>Agregar el URL de plomo -</B> Esta dirección URL de la tela no se ve por el agente, sino que es llamado cada vez que se añade una ventaja al sistema a través del proceso de entrada. El valor predeterminado es en blanco. Usted debe comenzar la siguiente dirección URL con VAR, si desea utilizar las variables y, por supuesto - una - y - B - en torno a la variable real en la dirección URL en la que desea utilizar. Aquí está la lista de variables que están disponibles para esta función. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>No Llamar URL -</B> Esta dirección URL de la tela no se ve por el agente, pero si está poblado se llama cada vez que se cuelga una llamada que no es manejado por un agente de arriba o transferido. Utiliza las mismas variables que los campos de formularios web y scripts. dispo puede utilizarse para recuperar el sistema definido por la disposición para la llamada. Esta URL no puede ser una ruta relativa. El valor predeterminado es en blanco. <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> @@ -5333,24 +6271,24 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-extension_appended_cidname"> <BR> - <B>Extension Append CID -</B> If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + <B>Anexar extensión de CID -</B> Si está activado, las llamadas que vienen de este grupo en-tendrá un espacio y la extensión telefónica del agente anexa al final del nombre de CallerID para la llamada antes de ser enviada al agente. Defecto es n para discapacitados. <BR> <A NAME="vicidial_inbound_groups-uniqueid_status_display"> <BR> - <B>Uniqueid Status Exponer -</B> If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent. + <B>Pantalla de estado UniqueId -</B> Si está activado, cuando un agente recibe una llamada a través de este dentro del grupo que verá la identificación única de la llamada añadido a la línea de estado en su interfaz de agente. La opción de prefijo se añade el prefijo definido golpe en el comienzo de la uniqueid en la pantalla. El valor predeterminado es DISABLED. Si ya existía una identificación única definida en una llamada de entrar en este grupo de pertenencia, la identificación única original, se mostrará. Si la opción PRESERVE se utiliza y la llamada se envía a un segundo agente, la identificación única y el prefijo de muestra para el primer agente también se mostrará en el segundo agente. <BR> <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> <BR> - <B>Uniqueid Status Prefix -</B> If PREFIX option is selected above then this is the value of that prefix. Default is empty. + <B>Prefijo de Estado UniqueId -</B> Si la opción está seleccionada por encima de PREFIJO entonces este es el valor de ese prefijo. Por defecto está vacío. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_Entrantes_DIDS TABLA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_DIDS TABLA</FONT></B><BR><BR> <BR> <A NAME="vicidial_inbound_dids-did_pattern"> <BR> @@ -5366,6 +6304,11 @@ if ($ADD==99999) <BR> <B>DID activa - </B> Este es el campo en el que configurar la entrada a DID activa o no. Y es por defecto. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este lo hizo, lo que permite la visualización de esta administración ha restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para acceder a este hecho. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> @@ -5374,7 +6317,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-record_call"> <BR> - <B>Record Call -</B> This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N. + <B>Grabar llamadas -</B> Esta opción le permite definir las llamadas que viene a este DID a ser grabada. Y va a grabar toda la llamada, Y_QUEUESTOP grabará la llamada hasta que la llamada es hungup o entra en una cola en grupo, N no grabar la llamada. Por defecto es N. <BR> <A NAME="vicidial_inbound_dids-extension"> @@ -5429,7 +6372,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID. + <B>In-Group Call Manejar el método -</B> IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID. Si un método CIDLOOKUP se utiliza con ALT, buscará el campo alt_phone el número de teléfono si no se encuentran coincidencias con el número de teléfono principal. Si un método se usa con CIDLOOKUP ADDR3, buscará el campo address3 el número de teléfono si no se encuentran coincidencias con el número de teléfono principal y, opcionalmente, el campo alt_phone. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -5454,28 +6397,40 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> <BR> - <B>Clean CID Number -</B> This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L. + <B>Limpie Número CID -</B> Este campo le permite especificar un número de dígitos para restringir el número de identificación de llamada entrante, poniendo una R delante del número de dígitos, por ejemplo, para restringir a la derecha de 10 dígitos que se deben introducir en el R10. También puede utilizar esta función para eliminar sólo un primer dígito o los dígitos al poner una L en la frente de los dígitos específicos que desea eliminar, por ejemplo para eliminar un 1 como el primer dígito quieres entrar en la L1. El valor predeterminado es vacío. Si más de una regla se especifica asegúrese de separarlos con un espacio y la R se ejecutará antes de la L. <BR> <A NAME="vicidial_inbound_dids-filter_inbound_number"> <BR> - <B>Filter Inbound Number -</B> This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back. + <B>Número de entrada del filtro -</B> Esta opción si está activada permite filtrar las llamadas que entran en este DID y enviarlos a una acción alternativa si coinciden con un número de teléfono que hay en el grupo de teléfonos, filtro o una respuesta de dirección si ha configurado una. El valor predeterminado es DISABLED. GRUPO buscará en un grupo de Teléfono del filtro. URL enviar una dirección URL y se ajustará si uno es enviado de vuelta. <BR> <A NAME="vicidial_inbound_dids-filter_phone_group_id"> <BR> - <B>Filter Phone ID De Grupo -</B> If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call. + <B>Teléfono filtro ID de grupo -</B> Si el campo Filtro Número de entrada se cambia al grupo, entonces este es el ID del Grupo de teléfono de filtro que tiene el número de sus búsquedas en busca de una coincidencia con el número de identificador de llamadas de la llamada entrante. <BR> <A NAME="vicidial_inbound_dids-filter_url"> <BR> - <B>Filter URL -</B> If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on. + <B>Filtro de URL -</B> Si el campo Filtro Número de entrada se establece en la URL, entonces este es la dirección web de un script que buscar un sistema remoto y devuelve un 1 en un partido y un 0 para ninguna coincidencia. Sólo dos variables están disponibles en la dirección si se utiliza el prefijo var como con las direcciones de formulario web en campañas, - A - PHONE_NUMBER - B - y - A - did_pattern - B - se puede utilizar en la URL para indicar el identificador de llamadas de la persona que llama y el DID que el cliente llama en el. <BR> <A NAME="vicidial_inbound_dids-filter_action"> <BR> - <B>Filter Action -</B> If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing. + <B>Acción de filtrado -</B> Si el número de entrada del filtro se activa y se encuentra una coincidencia, entonces este es la acción que debe ser tomada. Esta es la misma que la ruta que se seleccione para un DID, y los ajustes por debajo de funcionar igual que lo hacen de una norma de enrutamiento. + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>Custom DID Campos - </ B> Estos cinco campos se pueden utilizar para diversos fines, principalmente en relación a la programación personalizada y los informes. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID remoto anula Agente de Extensión -</B><BR>Esta sección le permite activar DID para que las anulaciones de extensión de agente remoto enruta las llamadas a través de los grupos. El inicio debe ser un usuario válido de arranque remoto de agente de usuario o si desea que la extensión de anulación de entrada al trabajo para todas las llamadas, puede utilizar --- Todos --- en el campo de inicio del usuario. Si hay varias entradas para el mismo DID y el Usuario en Inicio y luego las entradas de activos serán utilizados en una ronda de todos contra todos método. @@ -5485,7 +6440,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENU TABLA</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>Menú ID -</B> Este es el ID para este paso del menú de llamada. Esto también se mostrará como el contexto que se utiliza en el dialplan para esta convocatoria de menú. Here is a list of reserved phrases that cannot be used as menu IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. + <B>Menú ID -</B> Este es el ID para este paso del menú de llamada. Esto también se mostrará como el contexto que se utiliza en el dialplan para esta convocatoria de menú. Aquí es una lista de frases reservadas que no se puede utilizar como menú identificadores: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -5497,6 +6452,11 @@ if ($ADD==99999) <BR> <B>Menú del sistema -</B> Este campo contiene el nombre de archivo del sistema de audio para jugar en el comienzo de este menú. Puede introducir propmts múltiples en este campo y los demás ámbitos del sistema mediante la separación de ellos con un carácter de canalización. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -5537,10 +6497,20 @@ if ($ADD==99999) <BR> <B>Grupo de seguimiento de -</B> Esta es la identificación que se puede utilizar para rastrear las llamadas a este menú de llamada cuando se mira al Informe de IVR. La lista incluye CALLMENU como predeterminado, así como todos los Grupos de In -. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>Oprima la tecla Entrar -</B> Esta opción si está habilitado registrará la pulsación de una tecla DTMF por la persona que llama en este menú de llamada. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Diario de campo -</B> Si la clave de registro de opción de Prensa está habilitada, esta configuración opcional se puede permitir que la respuesta también sea almacenada en este campo de lista. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. El valor predeterminado es NONE para discapacitados. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Valor de la opción -</B> Este campo es donde se define la opción de menú, las opciones posibles son: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. El TIMECHECK opción especial sólo puede utilizarse si tiene menú Hora Hora activado y hay un tiempo de atención definido para el menú de. Para eliminar una opción, establezca la ruta quitar y la opción se borrará cuando usted haga clic en el botón ENVIAR. + <B>Valor de la opción -</B> Este campo es donde se define la opción de menú, las opciones posibles son: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. El TIMECHECK opción especial sólo puede utilizarse si tiene menú Hora Hora activado y hay un tiempo de atención definido para el menú de. Para eliminar una opción, establezca la ruta quitar y la opción se borrará cuando usted haga clic en el botón ENVIAR. Tiempo de espera le permiten establecer lo que ocurre con la llamada cuando el tiempo de espera sin el aporte de la persona que llama. INVALID le permiten establecer lo que sucede cuando la persona que llama entra en una opción no válida. INVALID_2ND y 3 sólo puede ser activo si INVALID no se utiliza, se va a esperar hasta que la entrada no válida la segunda o tercera por la persona que llama antes de ejecutar la opción. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -5565,12 +6535,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_call_menu-ingroup_settings"> <BR> - <B>Llame Menú In-Group Settings -</B> If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled, <a href="#vicidial_inbound_dids-call_handle_method">Click here to see a list of the available handle methods</a>. Search Method defines how the queue will find the next agent, recommend leave this on LB. ID De la Lista is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. ID De la Campaña is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID. + <B>Llame al menú en la configuración del grupo de -</B> Si la ruta se establece en endogrupal entonces hay muchas opciones que se pueden establecer para definir cómo la llamada se envía a en la cola. Dentro del grupo es el grupo de entrada que desea que la llamada para ir a. Método de Mango es la forma en que desea que la llamada se maneja, <a href="#vicidial_inbound_dids-call_handle_method">Haga clic aquí para ver una lista de los métodos de mango disponibles</a>. Método de búsqueda define la forma en la cola se encuentra el siguiente agente, recomendamos dejarlo en LB. Identificación de lista es la lista que la nueva pista se inserta en, también, si el método no es un método de búsqueda y el plomo no se encuentra. ID de campaña es la campaña para buscar a través de listas si uno de los métodos de RC se utiliza. Código de teléfono es la entrada del campo phone_code por el liderato con el que se inserta. VID Ingrese Nombre del archivo se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida a pedir al cliente que introduzca su identificación. VID Nombre Número de identificación se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida después de cliente entra en su documento de identidad, algo así como que ha introducido. VID Nombre Confirmar si se utiliza el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida para confirmar su identidad, algo así como tecla 1 para confirmar y 2 para volver a entrar. Dígitos VID se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, si se establece en un número que es el número de dígitos que deben ser introducidos por el cliente cuando se le solicite para su identificación, si se establece en vacío o X, entonces la cliente tendrá que presione la tecla o hash para terminar su entrada de su documento de identidad. <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. + <B>Entrada Dialplan personalizada -</B> Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. @@ -5581,17 +6551,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> <BR> - <B>Filter Phone ID De Grupo -</B> This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore. + <B>Teléfono filtro ID de grupo -</B> Este es el ID del Grupo de teléfono de filtro que es el contenedor de un grupo de números de teléfono que usted puede tener de forma automática a través de búsquedas en cuando entra una llamada en un archivo. DID y enviar a una ruta alternativa si hay una coincidencia Este campo debe ser entre 2 y 20 caracteres y no tienen puntuacion excepto para destacar. <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> <BR> - <B>Filter Phone Nombre De Grupo -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + <B>Teléfono Filtro Nombre del grupo -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> <BR> - <B>Filter Phone Group Description -</B> This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field. + <B>Teléfono Filtro Descripción del Grupo -</B> Esta es la descripción del Grupo Teléfono del filtro, es exclusivamente para propósitos de notación y no es un campo obligatorio. @@ -5621,7 +6596,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_remote_agents-extension_group"> <BR> - <B>Extension Group -</B> If set to something other than NONE or empty this will override the Extensión Externa field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated. + <B>Grupo de extensiones -</B> Si se establece en algo distinto de NONE o vacíos de este anula el campo de la extensión externa y utilizar las entradas de grupo de extensiones que tienen el ID de la extensión del mismo grupo. El valor predeterminado es NONE para desactivar. <BR> <A NAME="vicidial_remote_agents-status"> @@ -5633,6 +6608,16 @@ if ($ADD==99999) <BR> <B>Campaña -</B> aquí es donde usted selecciona la campaña que estos agentes alejados serán registrados en. Necesidades de entrada de utilizar la campaña MÁS CERCANA y de seleccionar las campañas de entrada debajo de ésa que usted desea recibir llamadas de. + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>Con el teléfono colgado del Agente -</B> Esta opción sólo se utiliza para las llamadas entrantes van a este agente remoto. Esta función se llama el agente remoto y no enviar al cliente al agente de control remoto hasta que la línea se contesta. Defecto es n para discapacitados. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>Con el teléfono colgado del timbre -</B> Esta opción sólo se utiliza cuando el campo Agente con el teléfono colgado anterior se establece en Y, y entonces sólo para las llamadas entrantes que llegan a este agente remoto. Este es el número de segundos que cada intento de llamada sonará a tratar de obtener una respuesta. Se recomienda que se ponga esto en unos pocos segundos a menos de que se necesita para una llamada a ser enviada al correo de voz. El valor predeterminado es 15. + <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> <BR> @@ -5644,27 +6629,27 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABLA</FONT></B><BR><BR> <A NAME="vicidial_extension_groups-extension_group_id"> <BR> - <B>Extension Group -</B> This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers. + <B>Grupo de extensiones -</B> Este campo obligatorio es donde se introduce la ID de grupo que desea que esta extensión para ser puesto en. No hay espacios ni caracteres especiales a excepción de relieve las letras y números. <BR> <A NAME="vicidial_extension_groups-extension"> <BR> - <B>Extension -</B> This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry. + <B>Extension -</B> Este campo requiere es donde se coloca la extensión de plan de marcado que desea que el agente remoto llama a ser enviadas a la entrada para este grupo de extensiones. <BR> <A NAME="vicidial_extension_groups-rank"> <BR> - <B>Rank -</B> This field allows you to rank the extension group entries that share the same extension group. Default is 0. + <B>Rank -</B> Este campo le permite clasificar las entradas de grupo de extensión que comparten el mismo grupo de extensiones. El valor predeterminado es 0. <BR> <A NAME="vicidial_extension_groups-campaign_groups"> <BR> - <B>Campañas Groups -</B> In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string. + <B>Campañas Grupos -</B> En este campo se puede poner una lista de identificadores de campaña y de entrada o ID de grupo que desee restringir el uso del grupo de extensión para. Lista debe ser separado por tuberías y tiene un tubo al principio y al final de la cadena. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTAS</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>Las listas dentro de esta campaña se enumeran aquí, si son activas son denotadas por la Y o N y usted pueden ir a la pantalla de la lista chascando en la identificación de la lista en la primera columna.</B> @@ -5734,7 +6719,18 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR> <A NAME="vicidial_xfer_presets"> <BR> - <B>If the Campaña setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent.</B> + <B>Si el escenario de campaña para los presets se establece en Habilitado entonces usted tiene la capacidad de definir de la Conferencia de transferencia-presets que estarán disponibles para el agente que les permite 3-way llamar a estos presets o llamadas ciegas transferencia a estos números predefinidos. Estas configuraciones también tienen una opción para ocultar el número asociado a cada preset del agente.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN CID CódigoÁreaS</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Si la configuración del sistema de Areacode CID está habilitada y la configuración de la campaña para el uso personalizado de CallerID se establece CódigoÁrea entonces usted tiene la capacidad de definir CID Areacode que se utilizarán cuando las llamadas salientes a los conductores en esta campaña específica. Usted puede agregar múltiples callerids por código de área y se puede activar y desactivar cada uno de ellos en tiempo real. Si más de un identificador de llamadas está activo para un código de área específico, entonces el sistema va a utilizar el identificador de llamadas que se ha utilizado el menor número de veces que en la actualidad. Si no callerids están activos para el código de área a continuación de la campaña de identificación de llamadas o una lista de anulación CallerID se utilizará.</B> @@ -5775,7 +6771,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Estado del agente visible Grupos -</B> Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently. + <B>Estado del agente visible Grupos -</B> Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. La opción NO-logged-in-Agentes permite a todos los usuarios del sistema que se muestra, incluso si no están registrados curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> @@ -5785,22 +6781,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_call_log_view"> <BR> - <B>Agent Call Log View -</B> This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled. + <B>Llamar Ver registro -</B> Esta opción define si el agente va a ser capaz de ver su registro de llamadas de llamadas atendidas a través de la pantalla del agente Vicidial. El valor predeterminado es N para no o discapacitados. <BR> <A NAME="vicidial_user_groups-agent_xfer_options"> <BR> - <B>Agent Transfer Opcións -</B> These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled. + <B>Opciones del agente de transferencia -</B> Estas opciones permiten la desactivación de botones específicos en la sección Encuentros de Transferencia de la interfaz del agente. No está en S para sí o habilitado. <BR> <A NAME="vicidial_user_groups-agent_fullscreen"> <BR> - <B>Agent Fullscreen -</B> This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agentes View, Calls in Queue View or Calls in Session view. Default is N for no or disabled. + <B>Agente de Pantalla Completa -</B> Esta opción si se ajusta a Y ajustar la altura y la anchura de la pantalla del agente Vicidial con el tamaño de la ventana del navegador sin ningún tipo de subsidio para la vista de los agentes, las llamadas en vista de cola de llamadas o en la vista Session. El valor predeterminado es N para no o discapacitados. <BR> <A NAME="vicidial_user_groups-allowed_reports"> <BR> - <B>Allowed Informes -</B> If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports. + <B>Informes de animales -</B> Si un usuario en este grupo se establece en el nivel de usuario 7 o superior, entonces esta función se puede utilizar para restringir los informes que los usuarios pueden ver. El valor predeterminado es ALL. Si desea seleccionar más de un informe a continuación, pulse la tecla Ctrl de su teclado mientras selecciona los informes. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Se admiten grupos de usuarios -</B> Esta es una lista seleccionable de los grupos de usuarios a los que los miembros de este grupo de usuarios pueden ver y, posiblemente, editar. Grupos de usuarios se puede restringir el acceso a casi todos los aspectos del sistema, a partir de DIDs entrantes a los teléfonos a los buzones de voz. El - TODOS - opción permite a los usuarios de este grupo para ver y acceder a cualquier registro en el sistema si sus permisos de usuario permiten que. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Se admiten Tiempo de Llamadas -</B> Esta es una lista seleccionable de los tiempos de llamadas para que los miembros de este grupo de usuarios puede utilizar en las campañas, en los grupos y menús de llamadas. El - TODOS - opción permite a los usuarios en este grupo a usar todos los tiempos de las llamadas en el sistema. + <?php if (strlen($SSwebphone_url) > 5) @@ -5809,17 +6816,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-webphone_url_override"> <BR> - <B>Webphone URL Override -</B> This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty. + <B>Anulación de URL Webphone -</B> Esta configuración le permite configurar una URL webphone alternativo sólo para los miembros de un grupo de usuarios. Por defecto está vacío. <BR> <A NAME="vicidial_user_groups-webphone_systemkey_override"> <BR> - <B>Webphone System Key Override -</B> This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty. + <B>Webphone sistema de llave de anulación -</B> Este ajuste le permite configurar una clave de webphone sistema alternativo sólo para los miembros de un grupo de usuarios. Por defecto está vacío. <BR> <A NAME="vicidial_user_groups-webphone_dialpad_override"> <BR> - <B>Webphone Dialpad Override -</B> This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link. + <B>Webphone teclado de marcación de anulación -</B> Esta opción le permite activar o desactivar el teclado de marcación en el webphone sólo para los miembros de un grupo de usuarios. El valor predeterminado es DISABLED. TOGGLE permitirá al usuario ver y ocultar el teclado haciendo clic en un enlace. TOGGLE_OFF por defecto para no mostrar el teclado de marcación en la primera carga, pero le permitirá al usuario para mostrar el teclado haciendo clic en el enlace de teclado. <?php } @@ -5858,14 +6865,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Comentarios de la escritura -</B> éste es tal como donde usted puede poner los comentarios para una escritura de Vicidial - cambiantes para liberar mejora de sept. el 23 -. caracteres del máximo 255, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Texto de la escritura -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Texto de la escritura -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + También puede utilizar una variable especial IGNORENOSCROLL para obligar a las barras de desplazamiento en la pestaña de secuencias de comandos, incluso si usted está usando un iframe dentro de ella. <BR> <A NAME="vicidial_scripts-active"> @@ -5895,6 +6909,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>El filtro comenta -</B> aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>Filtro SQL -</B> Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. @@ -5920,9 +6939,14 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>El tiempo de la llamada comenta -</B> aquí es donde usted puede poner loscomentarios para una definición del tiempo de la llamada de Vicidialtal como -10am hasta los 4pm con restricciones adicionales del estadode la llamada -. los caracteres del máximo 255. + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_call_times-ct_default_start"> - <B>Tiempos del comienzo y de parada del defecto -</B> éste es el tiempo dedefecto paran que el llamar será permitido que sea comenzado o dentrode esta definición del tiempo de la llamada si la hora de salida dela di'a-de-$$$-SEMANA no se define. 0 es medianoche. Evitar el llamarfijó totalmente este campo a 2400 y fijó el tiempo de parada deldefecto a 2400. Permitir el llamar 24 horas al día fijó la hora desalida a 0 y el tiempo de parada a 2400. + <B>Tiempos del comienzo y de parada del defecto -</B> éste es el tiempo dedefecto paran que el llamar será permitido que sea comenzado o dentrode esta definición del tiempo de la llamada si la hora de salida dela di'a-de-$$$-SEMANA no se define. 0 es medianoche. Evitar el llamarfijó totalmente este campo a 2400 y fijó el tiempo de parada deldefecto a 2400. Permitir el llamar 24 horas al día fijó la hora desalida a 0 y el tiempo de parada a 2400. Por sólo de entrada, también puede ajustar la duración de la llamada parada superior a 2400 si desea que el tiempo de llamada a ir más allá de la medianoche. Así que si usted quiere que su tiempo de llamada para funcionar desde las 6 am hasta las 2 am del día siguiente, se pondría a 0600 como el tiempo de inicio y 2600 como el tiempo de parada. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> @@ -5930,7 +6954,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_call_times-default_afterhours_filename_override"> - <B>After Hours Filename Override -</B> These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty. + <B>Después de anulación Nombre Horas -</B> Estos campos le permiten anular el mensaje horas después para los grupos de entrada si se ha definido a algo. Por defecto está vacío. <BR> <A NAME="vicidial_call_times-ct_state_call_times"> @@ -5954,6 +6978,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Cambio de nombre - </B> Este es un nombre más descriptivo de la Definición Mayúsculas. Este es un breve resumen de la definición Mayús. 50 caracteres como máximo, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Hora de inicio cambio - </B> Este es el momento en que comienza la campaña por turnos. Sólo deben ser números, serían las 9:30 AM y 5:00 AM 0930 sería 1700. @@ -5966,13 +6995,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Cambio semana - </B> En esta sección usted debe elegir los días de la semana que este cambio está activo. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Informe Opción -</B> Esta opción permite que este cambio específico para mostrar en los informes seleccionados que apoyan esta opción. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Informe Rank -</B> Esta opción le permite clasificar los cambios en los informes seleccionados que apoyan esta opción. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio de la tienda -</B> This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here. + <B>Audio de la tienda -</B> Esta utilidad te permite subir archivos de audio en el servidor web para que puedan ser distribuidos a todos los servidores Vicidial en un clúster de varios servidores. Una nota importante, sólo dos tipos de archivos de audio va a funcionar,. Wav que son 8k PCM mono de 16 bits y archivos. GSM, que son 8k de 8 bits. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí. @@ -5991,6 +7027,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Activo -</B> Esta opción le permite definir la música en espera la entrada en activo o inactivo. Inactivo eliminará la entrada de los archivos de conf. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Orden aleatorio -</B> Esta opción le permite definir la reproducción de los archivos de audio en un orden aleatorio. Si se establece a N, entonces el orden definido se utilizará. @@ -6017,13 +7058,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Activo -</B> Esta opción le permite establecer la entrada de TTS a activos o inactivos. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_tts_prompts-tts_voice"> - <B>TTS Voice -</B> This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz. + <B>TTS Voz -</B> Aquí es donde se define la voz para ser utilizado en la generación de TTS. El valor predeterminado es Allison-8kHz. <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Texto -</B> Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Texto -</B> Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> para un descanso de 1 segundo. También puede utilizar varias variables, como el nombre, apellido y el título como variables Vicidial al igual que lo hacen en una secuencia de comandos: - A - nombre apellido - B -. Si usted tiene estáticos archivos de audio que desee utilizar la base en el valor de uno de los campos que puede utilizar, así como con los C y D etiquetas. Los nombres de archivo deben estar todas en minúscula y deben ser de 16 bits PCM 8k archivos wav. El nombre del campo debe ser el mismo pero sin el wav. En el nombre de archivo. Por ejemplo - C ---- A - address3 - B ---- D - en primer lugar encontrar el valor para address3, entonces sería tratar de encontrar un archivo de audio correspondiente que el valor de ponerlo en el símbolo del sistema. Aquí está una lista de las variables disponibles: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -6051,12 +7097,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <B>Email -</B> Este ajuste opcional le permite tener los mensajes de correo de voz enviado a una cuenta de correo electrónico, si su sistema está configurado para enviar correo electrónico. Si este campo está vacío, entonces no los correos electrónicos se envían. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Eliminar correo de voz después del email -</B> Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Correo de voz Zona -</B> Esta configuración le permite configurar la zona que este buzón de voz se establecerá cuando el tiempo se registra para un mensaje. Por defecto se encuentra en la configuración del sistema. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Opciones de correo de voz -</B> Esta configuración opcional le permite definir la configuración de correo de voz adicionales. Se recomienda que lo deja en blanco a menos que sepa lo que está haciendo. <?php if ($SSoutbound_autodial_active > 0) @@ -6073,7 +7129,7 @@ if ($ADD==99999) <LI>Código del plomo del vendedor - demuestra para arriba en el campo de la identificación del vendedor del GUI <LI>Código de fuente - uso interno solamente para los admins y DBAs <LI>Identificación de la lista - el número de la lista que estos plomos demostrarán para arriba debajo - <LI>Código del teléfono - el prefijo para el teléfono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Número de teléfono - debe ser por lo menos 8 dígitos de largo <LI>Título - título del customer(Mr. Ms señ., etc...) <LI>Nombre @@ -6097,6 +7153,15 @@ if ($ADD==99999) <BR>NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. También, los módulos de un Perl de los pares sedeben cargar para ella para trabajar también -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en éstos mirando suarchivo del error_log de apache. También, para los cheques deduplicación contra gampaign enumera, la lista que tiene nuevos plomosel entrar él necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Disposición de encargo" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>ID de plantilla -</B> If the user has selected "Disposición de encargo" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -6112,7 +7177,7 @@ if ($ADD==99999) <B><FONT SIZE=3>TABLA DE LOS TELÉFONOS</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Extensión del teléfono -</B> este campo es donde usted pone los nombres del teléfono que aparecen al marcar con asterisco no incluyendo el protocolo o la barra vertical del principio. Por ejemplo: para el teléfono SIP/test101 del SIP la extensión del teléfono sería test101. También, para los teléfonos IAX2 compruebe que usted utiliza el nombre del teléfono completo: IAX2/IAXphone1@IAXphone1 sería IAXphone1@IAXphone1. Para zap los teléfonos compruebe que usted pone el canal completo: Zap/25-1 sería 25-1. Otra nota, compruebe que usted fija el protocolo abajo correctamente para su tipo de teléfono. + <B>Teléfono de Extensión -</B> Este campo es donde se pone el nombre de los teléfonos, ya que parece Asterisk sin incluir el protocolo o barra al principio. Por ejemplo: para el teléfono SIP SIP/test101 la extensión del teléfono sería test101. Además, para IAX2 teléfonos: IAX2/IAXphone1 @ IAXphone1 sería IAXphone1. Para Zap y Dahdi adjunta channelbank o FXS teléfono, asegúrese de poner el número de canal completa, sin el prefijo: Zap/25-1 sería 25-1. Otra nota, asegúrese de que establece el Protocolo sobre el terreno a continuación correctamente para su tipo de teléfono. <BR> <A NAME="phones-dialplan_number"> @@ -6124,11 +7189,24 @@ if ($ADD==99999) <BR> <B>Caja de Buzón de Voz -</B> este campo es para la caja del buzón de voz donde van los mensajes para al usuario de este teléfono. Utilizamos esto para comprobar los mensajes del buzón de voz y para que el usuario pueda acceder al Buzón de Voz desde astGUIclient. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Correo de voz Zona -</B> Esta configuración le permite configurar la zona que este buzón de voz se establecerá cuando el tiempo se registra para un mensaje. Por defecto se encuentra en la configuración del sistema. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Opciones de correo de voz -</B> Esta configuración opcional le permite definir la configuración de correo de voz adicionales. Se recomienda que lo deja en blanco a menos que sepa lo que está haciendo. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>CallerID de salida -</B> este campo es donde usted incorporara el número del callerID que usted quiera que aparezca en las llamadas de salida. Esto no funciona en las líneas RTB(non-PRI) T1/E1. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -6147,32 +7225,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>Conexión -</B> la conexión usada para el usuario del teléfono a laconexión a los usos del cliente. + <B>Agente de sesión de pantalla -</B> El inicio de sesión para el usuario del teléfono para acceder a las aplicaciones cliente, como la pantalla del agente Vicidial. <BR> <A NAME="phones-pass"> <BR> - <B>Login Password -</B> The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registro Password in the next field. + <B>Inicio de sesión Contraseña -</B> Es la contraseña para el usuario del teléfono para acceder a las aplicaciones cliente basadas en la Web. Importante, esta es la contraseña sólo para el inicio de sesión Web agente de interfaz del teléfono, para cambiar la contraseña de sip.conf o iax.conf, o secreta, para este dispositivo móvil tiene que modificar la contraseña de registro en el siguiente campo. <BR> <A NAME="phones-conf_secret"> <BR> - <B>Registro Password -</B> Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Formerly called Conf. Archivo Secreto. A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Registro Contraseña -</B> Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Anteriormente conocido como Secreto Conf. Archivo. Una contraseña segura debe tener registro de al menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como al menos un número. <BR> <A NAME="phones-is_webphone"> <BR> - <B>Set As Webphone -</B> Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + <B>Establecer como Webphone -</B> Al establecer esta opción a Y se intenta cargar un teléfono basado en la web cuando el agente se registra en la pantalla de su agente. Por defecto es N. <BR> <A NAME="phones-webphone_dialpad"> <BR> - <B>Webphone Dialpad -</B> This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. + <B>Webphone Dialpad -</B> Esta opción le permite activar o desactivar el teclado de marcación para este webphone. Por defecto es Y para activado. TOGGLE permitirá al usuario ver y ocultar el teclado haciendo clic en un enlace. Esta característica no está disponible en todas las versiones Webphone. TOGGLE_OFF por defecto para no mostrar el teclado de marcación en la primera carga, pero le permitirá al usuario para mostrar el teclado haciendo clic en el enlace de teclado. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Webphone Respuesta automática -</B> Esta configuración permite que el teléfono web para ser configurado para responder automáticamente a las llamadas que entran en estableciéndola en Y, o tener anillo de llamadas mediante el establecimiento de que por defecto es N. Y. <BR> <A NAME="phones-use_external_server_ip"> <BR> - <B>Use External IP Del Servidor -</B> If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the IP Del Servidor. Default is empty. + <B>Use IP del servidor externo -</B> Si se utiliza como un teléfono de Internet, usted puede definir a Y para utilizar los servidores IP externa para inscribirse para en lugar de la IP del servidor. Por defecto está vacío. <BR> <A NAME="phones-status"> @@ -6238,6 +7321,11 @@ if ($ADD==99999) <BR> <B>Teléfono Anillo de tiempo de espera -</B> Esta es la cantidad de tiempo, en segundos, que el teléfono sonará en el dialplan antes de enviar la llamada al buzón de voz. El valor predeterminado es 60 segundos. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>Con el teléfono colgado Agent Login -</B> Esta opción sólo se utiliza para las llamadas entrantes van a un agente registrado con este teléfono. Esta función se llama al agente y no le enviará al cliente a la sesión de los agentes hasta que la línea se contesta. Defecto es n para discapacitados. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -6316,12 +7404,12 @@ if ($ADD==99999) <BR> <A NAME="phones-codecs_list"> <BR> - <B>Allowed Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for this phone. Opcións for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty. + <B>Codecs animales -</B> Se puede definir una lista delimitada por comas de los codecs que se establecerá como los codecs por defecto para este teléfono. Opciones para los codecs son ulaw, alaw, gsm, G729, Speex, G722, G723, G726, iLBC, ... Algunos de estos codecs pueden no estar disponibles en su sistema, como el G729 o G726. Si el campo está vacío, entonces los codecs por defecto del sistema o la entrada de teléfono por encima de éste se utilizará para los codecs permitidos. Por defecto está vacío. <BR> <A NAME="phones-codecs_with_template"> <BR> - <B>Allowed Codecs With Template-</B> Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0. + <B>Códecs de animales con plantilla-</B> Al establecer esta opción en 1, se incluyen los códecs definidos anteriormente, incluso si un archivo de plantilla se utiliza conf. El valor predeterminado es 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -6414,12 +7502,12 @@ if ($ADD==99999) <B>Botón de VMail -</B> fije para verdad para exhibir el botón de VOICEMAIL y los mensajes cuentan la exhibición en astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_refrescar"> <BR> <B>Rápido restaure -</B> fije para verdad para permitir un nuevo índice de restauran de la información de la llamada para el astGUIclient. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_refrescar_rate"> <BR> <B>Rápido restaure la tarifa -</B> en milisegundos. Utilizado solamente si es rápido restaure se permite. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. @@ -6563,6 +7651,11 @@ if ($ADD==99999) <BR> <B>Activo -</B> fije si el servidor del asterisco es activo o inactivo. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="servers-sysload"> <BR> @@ -6631,7 +7724,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf. Archivo Secreto -</B> Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Conf. Archivo Secreto -</B> Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Un secreto conf fuerte del archivo debe ser de al menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como al menos un número. <BR> <A NAME="servers-local_gmt"> @@ -6696,7 +7789,12 @@ if ($ADD==99999) <BR> <A NAME="servers-external_server_ip"> <BR> - <B>External IP Del Servidor -</B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External IP Del Servidor. Default is empty. + <B>IP del servidor externo -</B> Esta configuración es donde usted puede poner una dirección IP del servidor o el nombre de otra máquina que se puede utilizar en lugar de la server_ip cuando se utiliza un webphone en la interfaz de agente. Para que esto funcione debe tener también la entrada de teléfonos configurado para utilizar la dirección IP del servidor externo. Por defecto está vacío. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>IP del servidor de Activo doble -</B> Algunos sistemas Vicidial requieren la configuración de servidores Vicidial en parejas. Esta configuración es donde usted puede poner la IP del servidor de otro servidor vicidial que este servidor está hermanada con. El valor predeterminado es vacío para discapacitados. <BR> <A NAME="servers-active_asterisk_server"> @@ -6741,7 +7839,7 @@ if ($ADD==99999) <BR> <A NAME="servers-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context. + <B>Entrada Dialplan personalizada -</B> Este campo le permite introducir en todos los elementos dialplan que desee para el servidor, las líneas se añadirán a la opción por defecto. @@ -6760,6 +7858,11 @@ if ($ADD==99999) <BR> <B>Nombre de la plantilla - </B> Este es el nombre descriptivo de la plantilla de archivo de configuración de entrada. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -6786,6 +7889,11 @@ if ($ADD==99999) <BR> <B>Descripción Carrier -</B> Éste se coloca en los comentarios de los archivos de conf asterisco encima del dialplan y anotaciones en cuenta. Máximo 255 caracteres. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -6894,6 +8002,16 @@ if ($ADD==99999) <BR> <B>URL casero del Admin -</B> ésta es la dirección del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. + <BR> + <A NAME="settings-admin_modify_refrescar"> + <BR> + <B>Admin modifica Auto-actualización -</B> Este es el intervalo de actualización en segundos de las pantallas de modificar en esta interfaz de administración. Si se establece en 0, se desactivará, estableciendo que en su mayoría por debajo de 5 hará que las pantallas modifican inutilizables debido a que se actualizará con demasiada rapidez para cambiar de campo. Esta opción es útil en situaciones en las que más de un gerente es el control de la configuración de una campaña activa o en grupo, de modo que los ajustes se actualizan con frecuencia. El valor predeterminado es 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Administración de No-Cache -</B> Si se establece en 1 pondrá todas las páginas de administración del navegador de no-cache, por lo que cada pantalla tiene que ser recargada cada vez que se ve, incluso si al hacer clic de nuevo en el navegador. El valor predeterminado es 0 para discapacitados. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> @@ -6902,13 +8020,28 @@ if ($ADD==99999) <BR> <A NAME="settings-enable_agc_dispo_log"> <BR> - <B>Enable Agent Disposition Logfile -</B> This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled. + <B>Habilitar el archivo de registro del Agente Disposición -</B> Esta opción se conectará a un archivo de registro de texto en el servidor web cada vez que se dispositioned una llamada por un agente. El valor predeterminado es 0, desactivado. <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Reloj de tiempo Fin de Día - </B> Este ajuste define cuando todos los usuarios se van a auto cerrado la sesión de la timeclock sistema. Sólo se ejecuta una vez al día. debe ser sólo el 4 dígitos dígitos 2 horas y 2 minutos en cifras de 24 horas. Por defecto es 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Local por omisión GMT -</B> Este ajuste define lo que se utilizará por defecto cuando los nuevos teléfonos y servidores se agregan utilizando esta interfaz web de administración. El valor predeterminado es -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Zona de correo de voz por defecto -</B> Esta configuración define qué zona se utilizará por defecto cuando los nuevos teléfonos y buzones de voz se crean. La lista de zonas disponibles se toma directamente desde el archivo voicemail.conf. No está en este. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Agentes de Llamadas Restablecer -</B> Esta configuración define si ha iniciado la sesión en los agentes activos y registros telefónicos las llamadas se deben restaurar en el extremo reloj horario del día. El valor predeterminado es 1 para habilitado. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -6980,7 +8113,7 @@ if ($ADD==99999) <BR> <A NAME="settings-admin_web_directory"> <BR> - <B>Admin Web Directory -</B> This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes. + <B>Directorio Web de administración -</B> Este es el directorio que el contenido de la web Administación, como admin.php, son in por defecto es vicidial. Para averiguar el directorio web de administración, es todo lo que está entre el nombre de dominio y el admin.php en la dirección URL de esta página, sin las barras de inicio y finalización. <BR> <A NAME="settings-active_voicemail_server"> @@ -7005,7 +8138,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Permitir Custom Dialplan entradas -</B> This option allows you to enter custom dialplan lines into Llame a los menús, Servidores and System Settings. Default is 0 for inactive. + <B>Permitir Custom Dialplan entradas -</B> Esta opción le permite introducir líneas personalizadas dialplan en los menús de llamadas, servidores y la configuración del sistema. El valor predeterminado es 0 para los inactivos. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>PLLB límite Agrupación -</B> Ingresar Teléfono de equilibrio de carga agrupación Límite. Si Agrupación PLLB se encuentra a una cascada en el nivel de la campaña que este ajuste se determinará el número de agentes aceptables en cada servidor en todas las campañas. El valor predeterminado es 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Generar entre servidores Extensiones de teléfono -</B> Esta opción, si se pone a 1 generará entradas dialplan para todos los teléfonos en un sistema multi-servidor. El valor predeterminado es 0 para los inactivos. <BR> <A NAME="settings-user_territories_active"> @@ -7025,47 +8168,78 @@ if ($ADD==99999) <BR> <A NAME="settings-callcard_enabled"> <BR> - <B>Enable CallCard -</B> This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled. + <B>Habilitar CallCard -</B> Este ajuste permite que las características CallCard con Vicidial para permitir que las personas que llaman utilizar los números de los pines y card_ids que tienen un saldo de minutos y de esos saldos pueden tener el tiempo del agente charla sobre las llamadas del cliente a deducir en los grupos. El valor predeterminado es 0 para discapacitados. <BR> <A NAME="settings-custom_fields_enabled"> <BR> - <B>Enable Custom List Fields -</B> This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled. + <B>Habilitar Lista de campos personalizados -</B> Esta configuración permite que la función de los campos de lista personalizada que permite a los campos de datos personalizados que se definen en la interfaz web de administración en función de cada lista y luego hacer que los campos disponibles en una ficha de formulario al agente en la interfaz web del agente. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Habilitar llamadas campaña de pruebas -</B> Esta configuración permite la posibilidad de ingresar un código de teléfono y número de teléfono a los campos en la parte inferior de la pantalla Detalle de la campaña y hacer una llamada a ese número como si fuera una ventaja de ser auto-marcado en el sistema. El número de teléfono se almacenan como una nueva pista en la lista del identificador de marcado manual lista. La campaña debe estar activa para que esta función esté habilitada, y se recomienda que las listas de asignados a la campaña de que todo se haya establecido como inactivo. El prefijo de marcación, marcación de tiempo de espera y todas las funciones de marcación relacionadas con otras, a excepción de DNC y opciones de compra de tiempo, afectará a la marcación del número de prueba. La llamada se coloca en el servidor seleccionado como el servidor de correo de voz en la configuración del sistema. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Habilitar Estadísticas ampliados Lista -</B> Esta configuración permite que dos columnas adicionales que se muestran en la mayoría de los cuadros de detalle de lista de estado de la modificación de la lista y las páginas de la campaña de modificación. La penetración se define como el porcentaje de conductores que están en o por encima del límite de campaña de llamadas y de visitas-o el estado está marcado como Completado. El valor predeterminado es 1 para habilitado. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Habilitar Areacode Campaña CID -</B> Esta configuración permite la posibilidad de configurar los números específicos de salida callerid para ser utilizados por campaña. El valor predeterminado es 1 para habilitado. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Habilitar remoto anula Agente de Extensión -</B> Esta configuración permite DID tener reemplazos de extensión de agente remoto enruta las llamadas a través de los grupos. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Contactos Activado -</B> Esta configuración permite que los contactos sub-sección de administración que permite a un administrador para añadir modificar o eliminar contactos en el sistema que pueden ser utilizados como parte de una transferencia personalizada en una campaña donde un agente puede buscar contactos por nombre primer apellido o en la oficina número y luego seleccionar uno de los muchos números asociados con ese contacto. Esta característica se utiliza a menudo por los operadores o en las funciones de centralita telefónica donde el usuario necesita para transferir una llamada a un teléfono que no sea agente. El valor predeterminado es 0 para discapacitados. <BR> <A NAME="settings-first_login_trigger"> <BR> - <B>First Login Trigger -</B> This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system. + <B>Primera sesión de disparo -</B> Esta configuración permite la configuración inicial de la pantalla del servidor para ser mostrado al administrador cuando se registre por primera vez en el sistema. <BR> <A NAME="settings-default_phone_registration_password"> <BR> - <B>Default Phone Registro Password -</B> This is the default registration password used when new phones are added to the system. Default is test. + <B>Teléfono predeterminado Registro Contraseña -</B> Esta es la contraseña de registro predeterminado que se utiliza cuando los teléfonos nuevos se agregan al sistema. El valor predeterminado es la prueba. <BR> <A NAME="settings-default_phone_login_password"> <BR> - <B>Default Conexión Del Teléfono Password -</B> This is the default phone web login password used when new phones are added to the system. Default is test. + <B>Teléfono predeterminado Login -</B> Este es el teléfono web por defecto la contraseña de inicio de sesión utiliza cuando los teléfonos nuevos se agregan al sistema. El valor predeterminado es la prueba. <BR> <A NAME="settings-default_server_password"> <BR> - <B>Default Server Password -</B> This is the default server password used when new servers are added to the system. Default is test. + <B>Contraseña por defecto del servidor -</B> Esta es la contraseña del servidor predeterminado que se utiliza cuando los servidores se añaden al sistema. El valor predeterminado es la prueba. <BR> <A NAME="settings-slave_db_server"> <BR> - <B>Slave Database Server -</B> If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled. + <B>Esclavo del servidor de base de datos -</B> Si usted tiene un esclavo MySQL base de datos a continuación, introduzca la dirección IP local para que el servidor aquí. Esta opción sólo se usa actualmente por los informes seleccionados en la siguiente opción y no tiene nada que ver con la configuración automática de MySQL maestro-esclavo de replicación. El valor predeterminado es vacío para discapacitados. <BR> <A NAME="settings-reports_use_slave_db"> <BR> - <B>Informes to use Slave DB -</B> This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled. + <B>Informes de utilizar DB Esclavo -</B> Esta opción le permite seleccionar los informes que desea que se utilice la base de datos MySQL de esclavos como se define en la opción anterior en lugar de la base de datos maestra de que su sistema Vicidial vivo se está ejecutando. Usted debe configurar el esclavo de replicación de MySQL antes de habilitar esta opción. El valor predeterminado es vacío para discapacitados. <BR> <A NAME="settings-default_field_labels"> <BR> - <B>Default Field Labels -</B> These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. + <B>Las etiquetas de campo predeterminadas -</B> Estos 19 campos le permiten establecer el nombre tal y como aparecerá en la interfaz de agente de Vicidial, así como la página principal de modificación administrativa. El valor predeterminado es vacío, que utilizará los valores por defecto en el código en la interfaz de agente. También puede establecer una etiqueta a --- --- PIEL para ocultar la etiqueta y el campo. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Ocultar etiqueta en los registros de llamadas -</B> Si una etiqueta se establece en OCULTAR --- --- entonces los registros de llamadas de los agentes, si está activado en la campaña, seguirá mostrando el campo y los datos a menos que esta opción está establecida en Y. El valor predeterminado es N. <BR> <A NAME="settings-qc_features_active"> @@ -7075,32 +8249,57 @@ if ($ADD==99999) <BR> <A NAME="settings-default_webphone"> <BR> - <B>Default Webphone -</B> If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0. + <B>Predeterminado Webphone -</B> Si se establece en 1, esta opción hará que todos los nuevos teléfonos creados han fijado como conjunto Webphone a predeterminado es 0 Y.. <BR> <A NAME="settings-webphone_systemkey"> <BR> - <B>Webphone System Key -</B> If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty. + <B>Webphone clave del sistema -</B> Si su sistema o el proveedor lo requiere, aquí es donde la clave del sistema para el webphone deben introducirse in por defecto está vacío. <BR> <A NAME="settings-default_codecs"> <BR> - <B>Default Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for all systems. Opcións for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty. + <B>Códecs predeterminados -</B> Se puede definir una lista delimitada por comas de los codecs que se establecerá como los codecs por defecto para todos los sistemas. Opciones para los codecs son ulaw, alaw, gsm, G729, Speex, G722, G723, G726, iLBC, ... Por defecto está vacío. <BR> <A NAME="settings-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context. + <B>Entrada Dialplan personalizada -</B> Este campo le permite introducir en todos los elementos dialplan que desee para todos los servidores de Asterisk, las líneas se añadirán a la opción por defecto. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Actualizar Dialplan En los servidores -</B> Esta opción le permite forzar una recarga del plan de marcado en todos los servidores de Asterisk en el clúster. Si ha realizado cambios en el plan de marcado de entrada por encima de Custom debe establecer este a 1 y en enviar para que los cambios entren en vigor en los servidores. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Si no hay respuesta Conectarse -</B> Esta opción será registrar las llamadas de marcado automático que no se responden a una tabla separada. El valor predeterminado es N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>DID registro de agentes -</B> Esta opción registrará la entrada DID llamadas, junto con un grupo cerrado y la ID de usuario, en su caso, a una tabla separada. El valor predeterminado es N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt-Log DB del servidor -</B> Este es el servidor de registro de base de datos alternativa. Esto es opcional, y permite que algunos registros que se escriben en una base de datos separada. Por defecto está vacío. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Registro de Alt-Tablas -</B> Estas son las tablas que están disponibles para el registro en el servidor de registro de base de datos alternativa. El valor predeterminado es en blanco. <BR> <A NAME="settings-qc_features_active"> <BR> - <B>Default External IP Del Servidor -</B> If set to 1, this option will make all new phones created have Use External IP Del Servidor set to Y. Default is 0. + <B>IP por defecto del servidor externo -</B> Si se establece en 1, esta opción hará que todos los nuevos teléfonos creados han Use IP del servidor externo establecida en Y. El valor predeterminado es 0. <BR> <A NAME="settings-qc_features_active"> <BR> - <B>Webphone URL -</B> This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty. + <B>URL del web phone -</B> Esta es la URL de la web phone que se utilizará con este sistema, si está habilitada en el registro de los teléfonos que un agente está utilizando. Por defecto está vacío. <BR> <A NAME="settings-enable_queuemetrics_logging"> @@ -7145,12 +8344,27 @@ if ($ADD==99999) <BR> <A NAME="settings-queuemetrics_loginout"> <BR> - <B>QueueMetrics Login-Out -</B> This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently. + <B>QueueMetrics sesión de salida -</B> Esta opción afecta al vicidial registrará los inicios de sesión y cierres de sesión de un agente en el queue_log. El valor predeterminado es norma estándar que se utilizará AGENTLOGIN AGENTLOGOFF, devolución de llamada se utiliza AgentCallbackLogin y la gestión de la calidad AGENTCALLBACKLOGOFF que analizará de forma diferente, NINGUNO no registrará los inicios de sesión y cierres de sesión dentro de queue_log. <BR> <A NAME="settings-queuemetrics_callstatus"> <BR> - <B>QueueMetrics CallStatus -</B> This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled. + <B>QueueMetrics CallStatus -</B> Esta opción, si se pone a 0 no se pone en la entrada CALLSTATUS en queue_log cuando un agente de las disposiciones de una llamada. El valor predeterminado es 1 para habilitado. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics Addmember Activado -</B> Esta opción, si se pone a 1 generará ADDMEMBER2 y las entradas REMOVEMEMBER en queue_log. El valor predeterminado es 0 para discapacitados. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>QueueMetrics dispo Código Pausa -</B> Esta opción, si se rellena, le permite definir si un código de pausa dispo ha entrado en queue_log cuando un agente se encuentra en estado dispo. El valor predeterminado es vacío para discapacitados. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>Teléfono Teléfono QueueMetrics Medio Ambiente Anexar -</B> Esta opción, si está habilitado, tiene que añadir el inicio de sesión de teléfono del agente en el registro de data4 en la tabla de registro de cola si el teléfono de campaña de campo para el Medio Ambiente está poblada. El valor predeterminado es 0 para discapacitados. <BR> <A NAME="settings-enable_vtiger_integration"> @@ -7188,7 +8402,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUSES TABLA</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Con el uso de los estados de sistema, usted puede tener estados queexistan para la campaña y el en-grupo. El estado debe ser 1-6caracteres en longitud, la descripción debe ser 2-30 caracteres enlongitud y seleccionable define si demuestra para arriba en VICIDIALcomo disposición del agente. Human_answered el campo se utiliza alcalcular el porcentaje de la gota, o la tarifa del abandono. El ajustehuman_answered a Y utilizará este estado al contar las llamadashumano-contestadas. La opción de la categoría permite que ustedagrupe varios estados en un catogy que se pueda utilizar para elanálisis estadístico. También hay 5 ajustes adicionales que definirán el tipo de estado: la venta, la DNC, póngase en contacto con los clientes, no les interesa, impracticable.</B> + <B>Con el uso de los estados de sistema, usted puede tener estados queexistan para la campaña y el en-grupo. El estado debe ser 1-6caracteres en longitud, la descripción debe ser 2-30 caracteres enlongitud y seleccionable define si demuestra para arriba en VICIDIALcomo disposición del agente. Human_answered el campo se utiliza alcalcular el porcentaje de la gota, o la tarifa del abandono. El ajustehuman_answered a Y utilizará este estado al contar las llamadashumano-contestadas. La opción de la categoría permite que ustedagrupe varios estados en un catogy que se pueda utilizar para elanálisis estadístico. También hay 5 ajustes adicionales que definirán el tipo de estado: la venta, la DNC, póngase en contacto con los clientes, no les interesa, impracticable, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS TABLA</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a por campaña basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Pantalla del identificador de etiqueta -</B> Este campo tiene que ser por lo menos 2 caracteres de longitud y no más de 20 caracteres de longitud, sin espacios ni caracteres especiales. Este es el identificador que se utilizará para identificar la etiqueta de pantalla en todo el sistema. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Pantalla de Nombre de etiqueta -</B> Este es el nombre descriptivo de la entrada de etiqueta de la pantalla. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Grupo de usuarios de administración -</B> Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Ocultar etiqueta en los registros de llamadas -</B> Si una etiqueta se establece en OCULTAR --- --- entonces los registros de llamadas de los agentes, si está activado en la campaña, seguirá mostrando el campo y los datos a menos que esta opción está establecida en Y. El valor predeterminado es N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Las etiquetas de campo predeterminadas -</B> Estos 19 campos le permiten establecer el nombre tal y como aparecerá en la interfaz de agente de Vicidial, así como la página principal de modificación administrativa. El valor predeterminado es vacío, que utilizará los valores por defecto en el código en la interfaz de agente. También puede establecer una etiqueta a --- --- PIEL para ocultar la etiqueta y el campo. @@ -7200,6 +8447,58 @@ if ($ADD==99999) <B>Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificación de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripción es opcional y la exhibiciónde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD.</B> La venta y Categoría Categoría Principal Muerto son utilizados tanto por el sistema de lista de sugerencias en el análisis de estadísticas de la lista. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Crear una nueva plantilla - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Borrartemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "BORRAR LA PLANTILLA". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>ID de plantilla -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Nombre de plantilla -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>descripción de plantillas -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>ID De la Lista -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Columnas highlighted in blue are standard columns from the vicidial_list table. Columnas highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "ENVIAR LA PLANTILLA" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Máximo del sistema Estadísticas Informes</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Estas estadísticas son totales almacenados en caché que se almacenan a lo largo de cada día en tiempo real a través de procesos de back-end. Para las llamadas entrantes, las llamadas totales por dentro del grupo se calculan para cada llamada que entra en el proceso que se calcula. Para el recuento de todo el sistema, los totales que se generan a partir de entradas de registro, así como los totales del grupo en otros-y la campaña. Estos totales pueden no sumar debido a la configuración que tienes en tu sistema, así como cuando la llamada se cuelga. + + <?php if ($SSqc_features_active > 0) { @@ -7209,7 +8508,7 @@ if ($ADD==99999) <B><FONT SIZE=3>CÓDIGOS DE ESTADO VICIDIAL CC</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>El Control de Calidad, sistema de control de calidad dentro de VICIDIAL tiene su propio conjunto de códigos de estado separados de los de la gestión de llamadas de funciones VICIDIAL. CC statuse códigos debe estar entre 2 y 8 caracteres de longitud y no contienen caracteres especiales, como un espacio o de colon. El código de estado de CC descripción debe estar entre 2 y 30 caracteres de longitud.</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -7249,12 +8548,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -7264,7 +8564,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -7289,13 +8589,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Demuestre La Cuenta De los Plomos De Dialable</B> -<BR><BR>\n"; echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n"; - echo "<B>LISTAS:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>STATUSES:</B> $dial_statuses<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -7387,13 +8689,14 @@ if ($ADD==7111111) $xfercallid = 'xfercallid'; $agent_log_id = 'agent_log_id'; $entry_list_id = 'entry_list_id'; + $call_id = 'call_id'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -7537,6 +8840,7 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -7557,8 +8861,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
    "; + } ###################################################################################################### @@ -7603,33 +8909,22 @@ if ($ADD=="1") echo "NÚmero De Usuario: $NWB#vicidial_users-user$NWE\n"; } - echo "Contraseña: $NWB#vicidial_users-pass$NWE     Strength: \n"; + echo "Contraseña: $NWB#vicidial_users-pass$NWE     Fuerza: \n"; echo "Nombre Completo: $NWB#vicidial_users-full_name$NWE\n"; echo "Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE\n"; echo "Grupo Del Usuario: $NWB#vicidial_users-phone_login$NWE\n"; echo "Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -7679,7 +8974,7 @@ if ($ADD=="1A") echo "NÚmero De Usuario: $NWB#vicidial_users-user$NWE\n"; } - echo "Contraseña: $NWB#vicidial_users-pass$NWE     Strength: \n"; + echo "Contraseña: $NWB#vicidial_users-pass$NWE     Fuerza: \n"; echo "Nombre Completo: $NWB#vicidial_users-full_name$NWE\n"; @@ -7688,7 +8983,7 @@ if ($ADD=="1A") echo "Source Usuario: $NWB#vicidial_campaigns-campaign_name$NWE\n"; echo "Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE\n"; + echo "Grupo de usuarios de administración: $NWB#vicidial_campaigns-user_group$NWE\n"; echo "Activo: $NWB#vicidial_campaigns-active$NWE\n"; - echo "Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE\n"; - echo "Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE\n"; + echo "Parque de la Música-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE\n"; + echo "Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE\n"; if ($SSoutbound_autodial_active > 0) { echo "Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE\n"; - echo "Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE\n"; + echo "Mínimo nivel de la tolva: $NWB#vicidial_campaigns-hopper_level$NWE\n"; echo "Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE\n"; } - echo "Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE\n"; + echo "Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE\n"; echo "Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE\n"; @@ -7879,7 +9178,7 @@ if ($ADD==12) echo "Campaña De la Fuente:$NWB#vicidial_lists-list_description$NWE\n"; echo "Campaña: $NWB#vicidial_inbound_groups-group_name$NWE\n"; echo "Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE\n"; echo "Activo: $NWB#vicidial_inbound_groups-active$NWE\n"; - echo "Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE\n"; + echo "Grupo de usuarios de administración: $NWB#vicidial_inbound_groups-user_group$NWE\n"; + echo "Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE\n"; echo "Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE\n"; - echo "Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE\n"; + echo "Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE\n"; echo "Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE\n"; echo "Escritura: \n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; @@ -8380,6 +9683,10 @@ if ($ADD==1311) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    DID Extensión: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
    DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
    Grupo de usuarios de administración: $NWB#vicidial_inbound_dids-user_group$NWE
    \n"; } @@ -8410,7 +9717,7 @@ if ($ADD==1411) echo "Fuente DID: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Nombre de menú: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Grupo de usuarios de administración: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -8518,7 +9829,7 @@ if ($ADD==1611) echo "Menú Fuente: \n"; echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Filter Phone ID De Grupo: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Filter Phone Nombre De Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descripción: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Teléfono filtro ID de grupo: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Teléfono Filtro Nombre del grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Teléfono Filtro Descripción del Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Grupo de usuarios de administración: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; } @@ -8586,7 +9901,7 @@ if ($ADD==11111) echo "
    NUEVO AGENTE REMOTO
    \n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8916,6 +10245,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8935,7 +10268,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
    Comienzo Del ID del usuario: (Solamente números, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Comienzo Del ID del usuario: (Solamente números, incremented, debe ser un usuario existente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Del Servidor: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; - echo "
    Add Extension Group Entry\n"; + echo "
    Añadir entrada de Grupo de Extensiones\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Extension Grupo: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Grupo de extensiones: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Extensión: (Solamente números)$NWB#vicidial_extension_groups-extension$NWE
    Rango: $NWB#vicidial_extension_groups-rank$NWE
    Campañas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Campañas Grupos: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; } @@ -8652,7 +9967,7 @@ if ($ADD==12111) ###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -8733,9 +10048,14 @@ if ($ADD==1111111) echo "
    Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
    Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
    Activo: $NWB#vicidial_scripts-active$NWE
    Grupo de usuarios de administración: $NWB#vicidial_scripts-user_group$NWE
    Texto de la escritura: "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -8856,6 +10177,10 @@ if ($ADD==11111111) } echo "
    Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_lead_filters-user_group$NWE
    Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -8885,6 +10210,10 @@ if ($ADD==111111111) echo "
    Identificación Del Tiempo De la Llamada: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
    Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_call_times-user_group$NWE
    Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
    State Call Time State: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-state_call_time_state$NWE
    _ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_call_times-user_group$NWE
    Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -8945,6 +10278,10 @@ if ($ADD==131111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -8958,6 +10295,7 @@ if ($ADD==131111111) echo "Viernes
    \n"; echo "Sábado
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Cambio ID: (sin espacios o signos de puntuación)$NWB#vicidial_shifts-shift_id$NWE
    Cambio de nombre: (breve descripción del cambio)$NWB#vicidial_shifts-shift_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_shifts-user_group$NWE
    Cambio Hora de inicio:\n"; echo "   Cambio Hora de finalización:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Informe Opción: $NWB#vicidial_shifts-report_option$NWE
    \n"; } @@ -8975,7 +10313,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -8998,24 +10336,28 @@ if ($ADD==11111111111) echo "
    \n"; if ($voi_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"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -9023,7 +10365,7 @@ if ($ADD==11111111111) # echo "\n"; # echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Extensión del teléfono: Auto-Generated $NWB#phones-extension$NWE
    Teléfono Extensión:Auto-Generated $NWB#phones-extension$NWE
    Extensión del teléfono: $NWB#phones-extension$NWE
    Teléfono Extensión:$NWB#phones-extension$NWE
    Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
    Caja de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
    CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    IP Del Servidor:
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    IP Del Servidor: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Login Contraseña: $NWB#phones-pass$NWE
    Registro Contraseña: $NWB#phones-conf_secret$NWE     Strength:
    Agente de sesión de pantalla: $NWB#phones-login$NWE
    Inicio de sesión Contraseña: $NWB#phones-pass$NWE
    Registro Contraseña: $NWB#phones-conf_secret$NWE     Fuerza:
    Estado: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del Teléfono: $NWB#phones-phone_type$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Protocolo Del Cliente: $NWB#phones-protocol$NWE
    GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    \n"; } @@ -9041,7 +10383,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9053,6 +10395,10 @@ if ($ADD==12111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -9072,7 +10418,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
    Alias ID:$NWB#phones-alias_id$NWE
    Alias Nombre: $NWB#phones-alias_name$NWE
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    Teléfono Logins Lista: (comma separated)$NWB#phones-logins_list$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9087,6 +10433,10 @@ if ($ADD==13111111111) echo "
    Número CallerID: $NWB#phones-caller_id_number$NWE
    Nombre CallerID: $NWB#phones-caller_id_name$NWE
    Activo:
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    \n"; @@ -9118,6 +10468,10 @@ if ($ADD==111111111111) echo "
    Dirección IP del Servidor: $NWB#servers-server_ip$NWE
    Activo: $NWB#servers-active$NWE
    Versión De Asterisk: $NWB#servers-asterisk_version$NWE
    Grupo de usuarios de administración: $NWB#servers-user_group$NWE
    \n"; } @@ -9146,6 +10500,10 @@ if ($ADD==131111111111) echo "
    Plantilla ID: $NWB#vicidial_conf_templates-template_id$NWE
    Nombre de plantilla: $NWB#vicidial_conf_templates-template_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_conf_templates-user_group$NWE
    Plantilla de contenidos: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -9164,7 +10522,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9176,10 +10534,14 @@ if ($ADD==141111111111) echo "
    Portador de Identificación: $NWB#vicidial_server_carriers-carrier_id$NWE
    Transportista Nombre: $NWB#vicidial_server_carriers-carrier_name$NWE
    Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
    Grupo de usuarios de administración: $NWB#vicidial_server_carriers-user_group$NWE
    Cadena de registro: $NWB#vicidial_server_carriers-registration_string$NWE
    Plantilla ID: "; + $SYSTEMRELEASE_graph.=" "; + $AGENTRELEASE_graph.=" "; + $SALES_graph.=" "; + $DNCS_graph.=" "; + $NAS_graph.=" "; + $DROPS_graph.=" "; + $LOGINTIME_graph.=" "; + $PAUSETIME_graph.=" "; + } + $CALLS_graph.="
    \n"; echo ""; - echo "
    ADD COPIED CARRIER\n"; + echo "
    Añadido de los operadores COPIADO\n"; echo "\n"; echo "
    \n"; echo "\n"; @@ -9235,9 +10597,9 @@ if ($ADD==140111111111) echo "$NWB#vicidial_server_carriers-server_ip$NWE\n"; - echo "
    Portador de Identificación: $NWB#vicidial_server_carriers-carrier_id$NWE
    Source Carrier:
    Fuente Carrier: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9282,6 +10644,10 @@ if ($ADD==151111111111) echo "
    TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
    Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
    Activo:
    Grupo de usuarios de administración: $NWB#vicidial_tts_prompts-user_group$NWE
    \n"; @@ -9300,7 +10666,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9312,6 +10678,10 @@ if ($ADD==161111111111) echo "
    Música en espera de identificación: $NWB#vicidial_music_on_hold-moh_id$NWE
    Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
    Orden aleatorio:
    Grupo de usuarios de administración: $NWB#vicidial_music_on_hold-user_group$NWE
    \n"; @@ -9330,7 +10700,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    \n"; echo ""; @@ -9344,6 +10714,81 @@ if ($ADD==171111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Activo:
    Correo electrónico:$NWB#vicidial_voicemail-email$NWE
    Grupo de usuarios de administración: $NWB#vicidial_voicemail-user_group$NWE
    \n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\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 ETIQUETA NUEVA PANTALLA\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    Pantalla del identificador de etiqueta: $NWB#vicidial_screen_labels-label_id$NWE
    Pantalla de Nombre de etiqueta: $NWB#vicidial_screen_labels-label_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_screen_labels-user_group$NWE
    \n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\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 ETIQUETA NUEVA PANTALLA\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Nombre: $NWB#contact_information$NWE
    Apellidos: $NWB#contact_information$NWE
    Número de la oficina: $NWB#contact_information$NWE
    Número de la célula: $NWB#contact_information$NWE
    Otro número 1: $NWB#contact_information$NWE
    Otro número 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Grupo: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; @@ -9651,7 +11096,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -9788,7 +11233,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -9943,7 +11388,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10056,12 +11501,30 @@ if ($ADD==21) { echo "
    CAMPAÑA AÑADIDA: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -10120,13 +11583,31 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_refrescar,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) 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_refrescar,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -10188,7 +11669,7 @@ if ($ADD==22) { echo "
    ESTADO DE LA CAMPAÑA AÑADIDA: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10439,12 +11920,12 @@ if ($ADD==201) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    PRESET NOT ADDED - there is already an entry for this campaign with this preset\n";} + {echo "
    PRESET NO ESTÁ SUJETA - ya hay una entrada para esta campaña con este ajuste de\n";} else { if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    PRESET NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    PRESET NO ESTÁ SUJETA - Vaya por favor detrás y mire los datos que usted incorporó\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"; } @@ -10472,6 +11953,133 @@ if ($ADD==201) } +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    CódigoÁrea CID NO ESTÁ SUJETA - ya hay una entrada para esta campaña con el CID
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    CódigoÁrea CID NO ESTÁ SUJETA - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "
    CódigoÁrea CID AGREGADOS: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    CódigoÁrea CID NO DELETED - esta entrada no existe
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    CódigoÁrea CID NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "
    CódigoÁrea 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 "
    CódigoÁrea CID NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "CódigoÁrea CID MODIFICADO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -10518,7 +12126,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -10571,19 +12179,22 @@ if ($ADD==2111) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url,add_lead_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPO AÑADIDO: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD Entrantes GROUP', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -10636,9 +12247,15 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPO AÑADIDO: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -10683,7 +12300,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -10728,7 +12345,7 @@ if ($ADD==2411) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -10785,7 +12402,7 @@ if ($ADD==2511) 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 NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    Llame Menú ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + echo "
    Identificación de llamada del menú no puede utilizar las palabras reservadas: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; $ADD=1500; } else @@ -10798,7 +12415,7 @@ if ($ADD==2511) } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,user_group) values('$menu_id','$menu_name','$user_group');"; $rslt=mysql_query($stmt, $link); echo "
    CALL AGREGADOS MENU: $menu_id $menu_name\n"; @@ -10852,7 +12469,7 @@ if ($ADD==2611) 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 NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    Llame Menú ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + echo "
    Identificación de llamada del menú no puede utilizar las palabras reservadas: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; $ADD=1500; } else @@ -10865,7 +12482,7 @@ if ($ADD==2611) } 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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; @@ -10899,20 +12516,20 @@ if ($ADD==2711) $rslt=mysql_query($stmt, $link); $row=mysql_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";} + {echo "
    TELÉFONO DEL GRUPO FILTRO NO ESTÁ SUJETA - ya hay un grupo de telefonía filtro en el sistema con este ID\n";} else { if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) { echo "
    PHONE FILTER GRUPO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    Phone Filter La ID de grupo debe estar entre 2 y 20 caracteres en longitud y contener no ' '.\n"; + echo "
    Teléfono ID de grupo del filtro debe ser entre 2 y 20 caracteres de longitud y no contienen ' '.\n"; } else { - $stmt="INSERT INTO vicidial_filter_phone_groups (filter_phone_group_id,filter_phone_group_name,filter_phone_group_description) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description');"; + $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_query($stmt, $link); - echo "
    PHONE FILTER GRUPO AÑADIDO: $filter_phone_group_id $filter_phone_group_name\n"; + echo "
    Group Teléfono filtro añadido: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -10942,11 +12559,11 @@ if ($ADD==21111) else { ### check for a valid user that will be associated with this account - $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "
    AGENTES REMOTOS NOT ADDED - you must use a valid user as the user_start for remote agents\n";} + {echo "
    AGENTES REMOTOS NOT ADDED - debe utilizar un usuario válido como el user_start de agentes remotos\n";} else { ### check for closest remote agents to this account to ensure no overlapping @@ -10955,7 +12572,7 @@ if ($ADD==21111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    AGENTES REMOTOS NOT ADDED - your number of lines overlaps with another remote agent\n";} + {echo "
    AGENTES REMOTOS NOT ADDED - el número de líneas se superpone con otro agente remoto\n";} else { if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) @@ -10996,12 +12613,12 @@ if ($ADD==22111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";} + {echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO NO ESTÁ SUJETA - ya hay una entrada de grupo de extensión con estos valores\n";} else { if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO NO ESTÁ SUJETA - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else @@ -11014,7 +12631,7 @@ if ($ADD==22111) $row=mysql_fetch_row($rslt); $extension_id = $row[0]; - echo "
    EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension\n"; + echo "
    Entrada de extensión grupo añadió: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -11064,9 +12681,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; + $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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
    GRUPO DE USUARIO AÑADIDO: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -11192,7 +12834,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
    ESCRITURA AGREGADA: $script_id\n"; @@ -11245,7 +12887,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11285,7 +12927,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11325,7 +12967,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11389,7 +13031,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11466,7 +13108,7 @@ if ($ADD==21111111111) { echo "
    EL TELÉFONO AGREGÚ\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11515,7 +13157,7 @@ if ($ADD==22111111111) { echo "
    TELÉFONO ALIAS AÑADIDO\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11556,7 +13198,7 @@ if ($ADD==23111111111) { echo "
    GRUPO DE ALIAS AÑADIDO\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11593,7 +13235,7 @@ if ($ADD==211111111111) { echo "
    SERVIDOR AGREGADO\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11690,7 +13332,7 @@ if ($ADD==231111111111) { echo "
    CONF PLANTILLA AÑADIDO\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11726,7 +13368,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11763,9 +13405,9 @@ if ($ADD==240111111111) {echo "
    TRANSPORTISTA NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - echo "
    COPIED CARRIER ADDED\n"; + echo "
    CARRIER copiaban agregaban\n"; - $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11804,7 +13446,7 @@ if ($ADD==251111111111) { echo "
    TTS añadido la entrada de\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11840,7 +13482,7 @@ if ($ADD==261111111111) { echo "
    MÚSICA EN ESPERA añadido la entrada de\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11883,7 +13525,7 @@ if ($ADD==271111111111) { echo "
    Contestador AGREGADOS\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -11908,6 +13550,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ETIQUETA DE LA PANTALLA NO ESTÁ SUJETA - ya hay una etiqueta en el sistema con este ID\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
    ETIQUETA DE LA PANTALLA NO ESTÁ SUJETA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
    ETIQUETA DE LA PANTALLA ESTÁ SUJETA\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    CONTACTO NO ESTÁ SUJETA - ya hay un contacto en el sistema con este nombre y número\n";} + else + { + if (strlen($last_name) < 2) + {echo "
    CONTACTO NO ESTÁ SUJETA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
    Contacto añadido\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -11971,7 +13693,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -11995,7 +13717,7 @@ if ($ADD==221111111111111) { echo "
    EL ESTADO DE SISTEMA AGREGÓ: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12136,7 +13858,7 @@ if ($ADD=="4A") } echo "
    USUARIO MODIFICADO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12285,7 +14007,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12379,7 +14101,7 @@ if ($ADD=="4B") } echo "
    USUARIO MODIFICADO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12528,7 +14250,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12616,7 +14338,7 @@ if ($ADD==4) { echo "
    USUARIO MODIFICADO: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12765,7 +14487,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12846,6 +14568,7 @@ if ($ADD==41) 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'; @@ -12874,6 +14597,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -12888,32 +14613,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
    LISTAS DE CAMBIO DE ACTIVO"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Prueba de llamadas salientes';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
    "; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
    LISTAS DE CAMBIO DE ACTIVO"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -12925,77 +14739,124 @@ if ($ADD==41) } else { - echo "
    CAMPAÑA MODIFICADA: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'Entrantes_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
    CAMPAIGN NOT MODIFIED - Por favor, espere a que toda la página se cargue antes de enviar el formulario\n"; } else { - if ($dial_level_override > 0) + echo "
    CAMPAÑA MODIFICADA: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
    REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
    - Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refrescar='$campaign_stats_refrescar',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
    REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; + echo "
    - Espera 1 minuto antes de marcar el número siguiente\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -13048,7 +14909,7 @@ if ($ADD==42) { echo "
    EL ESTADO DE ENCARGO DE LA CAMPAÑA SE MODIFICÓ: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13155,6 +15016,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -13177,7 +15040,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -13226,7 +15089,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -13417,7 +15280,7 @@ if ($ADD=='40A') { echo "
    ENCUESTA DE AJUSTES MODIFICADOS: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13503,7 +15366,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -13537,7 +15400,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -13611,7 +15474,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -13715,7 +15578,7 @@ if ($ADD==401) if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    PRESET NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    PRESET SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\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"; } @@ -13751,51 +15614,81 @@ if ($ADD==401) if ($ADD==411) { - if ($LOGmodify_lists==1) + if ( ($LOGmodify_lists==1) and (strlen($list_id) > 1) ) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ($stage == 'territory_reset') { - echo "
    LISTA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    el nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - if (strlen($reset_time) < 4) {$reset_time='';} - - echo "
    LISTA MODIFICADA: $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' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') + $p=0; + echo "
    TERRITORIES RESET"; + $territory_reset_ct = count($territory_reset); + while ($p < $territory_reset_ct) { - echo "
    REAJUSTANDO LA LISTA - LLAMADA - ESTADO\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
    LISTA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    el nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
    LISTA MODIFICADA: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
    REAJUSTANDO LA LISTA - LLAMADA - ESTADO\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -13814,84 +15707,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
    GRUPO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    el color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
    USUARIOS NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUARIOS', 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_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
    GRUPO MODIFICADO: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Usted no tiene permiso de visión esta página\n"; + exit; } } else { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
    GRUPO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    el color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; + } + else + { + if ($form_end != 'END') + { + echo "
    GROUP NOT MODIFIED - Por favor, espere a que toda la página se cargue antes de enviar el formulario\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
    GRUPO MODIFICADO: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -13916,7 +15909,7 @@ if ($ADD==4311) { echo "
    DID MODIFICADOS: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13956,12 +15949,12 @@ if ($ADD==4511) { echo "
    CALL menú modificado: $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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -14004,9 +15997,9 @@ if ($ADD==4511) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -14047,7 +16040,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -14101,14 +16094,14 @@ if ($ADD==4711) if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { echo "
    FILTER PHONE GRUPO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
    Filter Phone Nombre De Grupo and ID must be at least 2 characters in length\n"; + echo "
    Teléfono Filtro Nombre del grupo and ID must be at least 2 characters in length\n"; } else { - $stmt="UPDATE vicidial_filter_phone_groups set filter_phone_group_name='$filter_phone_group_name', filter_phone_group_description='$filter_phone_group_description' where filter_phone_group_id='$filter_phone_group_id';"; + $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_query($stmt, $link); - echo "
    FILTER PHONE GRUPO MODIFICADO\n"; + echo "
    GRUPO DE TELÉFONO filtro modificado\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -14138,11 +16131,11 @@ if ($ADD==41111) { echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "
    AGENTES REMOTOS NOT MODIFIED - you must use a valid user as the user_start for remote agents\n";} + {echo "
    AGENTES REMOTOS NOT MODIFIED - debe utilizar un usuario válido como el user_start de agentes remotos\n";} else { ### check for closest remote agents to this account to ensure no overlapping @@ -14151,7 +16144,7 @@ if ($ADD==41111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    AGENTES REMOTOS NOT MODIFIED - your number of lines overlaps with another remote agent\n";} + {echo "
    AGENTES REMOTOS NOT MODIFIED - el número de líneas se superpone con otro agente remoto\n";} else { if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) @@ -14161,7 +16154,7 @@ if ($ADD==41111) } 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' where remote_agent_id='$remote_agent_id';"; + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); echo "
    LOS AGENTES ALEJADOS SE MODIFICARON\n"; @@ -14198,7 +16191,7 @@ if ($ADD==42111) 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 - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
    Extension group id and extension must be at least 2 characters in length\n"; } else @@ -14206,7 +16199,7 @@ if ($ADD==42111) $stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';"; $rslt=mysql_query($stmt, $link); - echo "
    EXTENSION GROUP ENTRY MODIFIED\n"; + echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO MODIFICADO\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -14243,126 +16236,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Usted no está autorizado a editar su grupo de usuarios propia\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - $k=0; - $multi_count = count($allowed_reports); - $multi_array = $allowed_reports; - while ($k < $multi_count) - { - $new_field_value .= "$multi_array[$k],"; - $k++; - } - $allowed_reports = preg_replace("/,$/","",$new_field_value); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - echo "
    GRUPO DE USUARIO MODIFICADO\n"; + echo "
    GRUPO DE USUARIO MODIFICADO\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GRUPO DE USUARIOS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GRUPO DE USUARIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# - - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -14394,7 +16413,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
    LA ESCRITURA SE MODIFICÓ\n"; @@ -14436,7 +16455,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
    FILTRO MODIFICADO\n"; @@ -14492,7 +16511,7 @@ if ($ADD==411111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop', default_afterhours_filename_override='$default_afterhours_filename_override', sunday_afterhours_filename_override='$sunday_afterhours_filename_override', monday_afterhours_filename_override='$monday_afterhours_filename_override', tuesday_afterhours_filename_override='$tuesday_afterhours_filename_override', wednesday_afterhours_filename_override='$wednesday_afterhours_filename_override', thursday_afterhours_filename_override='$thursday_afterhours_filename_override', friday_afterhours_filename_override='$friday_afterhours_filename_override', saturday_afterhours_filename_override='$saturday_afterhours_filename_override' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    TIEMPO DE LA LLAMADA MODIFICADO\n"; @@ -14548,7 +16567,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    TIEMPO DE LA LLAMADA DEL ESTADO MODIFICADO\n"; @@ -14577,7 +16596,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -14599,7 +16618,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
    MAYÚS MODIFICADOS\n"; @@ -14628,14 +16647,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
    TELÉFONO NO MODIFICADO - hay ya un teléfono en el sistema con esta extensión/servidor\n";} else { @@ -14645,7 +16664,7 @@ if ($ADD==41111111111) { echo "
    TELÉFONO MODIFICADO: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refrescar='$enable_fast_refrescar', fast_refrescar_rate='$fast_refrescar_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -14676,7 +16695,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -14689,7 +16708,7 @@ if ($ADD==42111111111) { echo "
    TELÉFONO ALIAS MODIFICADOS: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14716,7 +16735,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -14729,7 +16748,7 @@ if ($ADD==43111111111) { echo "
    GRUPO DE ALIAS MODIFICADOS: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14763,14 +16782,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
    SERVIDOR NOT MODIFIED - there is already a server in the system with this server_id\n";} else { $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
    SERVIDOR NO MODIFICADO - hay ya un servidor en el sistema con este server_ip\n";} else { @@ -14778,7 +16797,7 @@ if ($ADD==411111111111) {echo "
    SERVIDOR NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -14881,7 +16900,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
    CONF TEMPLATE MODIFIED: $template_id\n"; @@ -14910,7 +16929,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -14918,7 +16937,7 @@ if ($ADD==441111111111) {echo "
    TRANSPORTISTA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -14950,7 +16969,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -14958,7 +16977,7 @@ if ($ADD==451111111111) {echo "
    TTS ENTRADA SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
    TTS entrada modificada: $tts_id\n"; @@ -14987,7 +17006,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -15020,7 +17039,7 @@ if ($ADD==461111111111) {echo "
    MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -15088,7 +17107,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -15096,7 +17115,7 @@ if ($ADD==471111111111) {echo "
    Contestador SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15127,6 +17146,87 @@ if ($ADD==471111111111) } +###################### +# 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 "
    ETIQUETA DE LA PANTALLA SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\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_query($stmt, $link); + + echo "
    ETIQUETA DE PANTALLA MODIFICADO: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\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 "
    CONTACTO SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\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_query($stmt, $linkALT); + + echo "
    CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN MODIFICAR CONTACTO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -15140,7 +17240,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    CONFERENCIA - hay ya una conferencia en el sistema con esta extensión - servidor NO MODIFICADO\n";} else { @@ -15177,7 +17277,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    VICIDIAL CONFERENCIA - hay ya una conferencia en el sistema con esta extensión - servidor NO MODIFICADO\n";} else { @@ -15224,11 +17324,27 @@ if ($ADD==411111111111111) } $reports_use_slave_db = preg_replace("/,$/","",$new_field_value); - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refrescar='$admin_modify_refrescar',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -15250,7 +17366,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -15293,7 +17409,7 @@ if ($ADD==421111111111111) { echo "
    ESTADO DE SISTEMA MODIFICADO: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15321,7 +17437,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -15544,7 +17660,7 @@ if ($ADD==53) else { echo "
    CONFIRMACIÓN CLARA DE VDAC: $campaign_id\n"; - echo "

    Chasque aquí para suprimir el más viejo VIVEN expediente en VDACpara $campaign_id


    \n"; + echo "

    Chasque aquí para suprimir el más viejo VIVEN expediente en VDACpara $campaign_id


    \n"; } # go to campaign modification below @@ -15652,13 +17768,13 @@ if ($ADD==5711) if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) ) { - echo "
    FILTER PHONE GROUP NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    GRUPO DE TELÉFONO DEL FILTRO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\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 "

    Haga clic aquí para eliminarFILTER PHONE GROUP $filter_phone_group_id


    \n"; + echo "
    GRUPO DE FILTRO DE TELÉFONO ELIMINACIÓN DE CONFIRMACIÓN: $filter_phone_group_id\n"; + echo "

    Haga clic aquí para borrar GRUPO DE TELÉFONO DEL FILTRO $filter_phone_group_id


    \n"; } $ADD='3711'; # go to filter phone group modification below @@ -15696,13 +17812,13 @@ if ($ADD==52111) if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
    extension_id be at least 1 characters in length\n"; } else { - echo "
    EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id\n"; - echo "

    Haga clic aquí para eliminarextension group entry $extension_id


    \n"; + echo "
    GRUPO DE EXTENSIÓN DE ENTRADA LA ELIMINACIÓN DE CONFIRMACIÓN: $extension_id\n"; + echo "

    Haga clic aquí para eliminar la entrada de extensión del grupo $extension_id


    \n"; } $ADD='32111'; # go to extension group modification below @@ -16040,6 +18156,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
    ETIQUETA DE LA PANTALLA NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    Label ID be at least 2 characters in length\n"; + } + else + { + echo "
    ETIQUETA pantalla de eliminación CONFIRMACIÓN: $label_id - $label_name\n"; + echo "

    Haga clic aquí para borrar la etiqueta de pantalla $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 "
    CONTACTO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
    CONTACTO confirmación de la eliminación: $contact_id - $first_name - $last_name\n"; + echo "

    Haga clic aquí para eliminarcontact $contact_id - $first_name - $last_name


    \n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -16109,27 +18269,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Usted no está autorizado a editar su propio usuario\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUARIOS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUARIOS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    CANCELADURA DEL USUARIO TERMINADA: $user\n"; - echo "

    \n"; + echo "
    CANCELADURA DEL USUARIO TERMINADA: $user\n"; + echo "

    \n"; + } } - $ADD='0'; # go to user list } @@ -16148,50 +18315,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16229,7 +18399,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -16240,6 +18410,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -16279,7 +18450,7 @@ if ($ADD==62) if ($DB) {echo "\n
    VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -16329,7 +18500,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -16340,27 +18511,30 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; - $queuemetrics_loginout = $row[6]; + $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 ##### ########################################### @@ -16375,26 +18549,101 @@ if ($ADD==62) $agents='@agents'; $agent_logged_in=''; - $time_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') order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; - $phone_logged_in = $row[2]; + $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;} - $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_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
    $stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
    $stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
    $stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -16442,7 +18691,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16491,7 +18740,7 @@ if ($ADD==65) { echo "
    EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16522,7 +18771,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -16538,12 +18787,12 @@ if ($ADD==66) { echo "
    ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16585,7 +18834,7 @@ if ($ADD==67) { 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';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16616,7 +18865,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -16632,12 +18881,12 @@ if ($ADD==68) { echo "
    EL ESTADO DEL DIAL DE LA CAMPAÑA QUITÓ: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16672,17 +18921,17 @@ if ($ADD==601) if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) ) { - echo "
    CAMPAIGN PRESET NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    PRESET CAMPAÑA NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\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';"; + $stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16719,11 +18968,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA LISTA DE LA TABLA DE VICIDIAL_LIST\n"; @@ -16734,7 +18983,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -16760,7 +19009,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -16772,6 +19021,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -16803,7 +19055,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16836,7 +19088,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -16867,12 +19119,12 @@ if ($ADD==6711) if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { - echo "
    FILTER PHONE GROUP NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    GRUPO DE TELÉFONO DEL FILTRO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\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' limit 1;"; + $stmt="DELETE from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; @@ -16886,7 +19138,7 @@ if ($ADD==6711) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "
    FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id\n"; + echo "
    SUPRESIÓN DEL FILTRO DEL GRUPO COMPLETO TELÉFONO: $filter_phone_group_id\n"; echo "

    \n"; } @@ -16936,7 +19188,7 @@ if ($ADD==62111) if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
    ENTRADA DE EXTENSIÓN DEL GRUPO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
    extension_id be at least 1 characters in length\n"; } else @@ -16952,7 +19204,7 @@ if ($ADD==62111) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "
    EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id\n"; + echo "
    GRUPO DE EXTENSIÓN BORRADO de inscripción debidamente cumplimentado: $extension_id\n"; echo "

    \n"; } @@ -16976,21 +19228,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Usted no está autorizado a editar su grupo de usuarios propia\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GRUPO DE USUARIOS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GRUPO DE USUARIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; - echo "

    \n"; + echo "
    CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; + echo "

    \n"; + } } - $ADD='100000'; # go to user group list } @@ -17009,7 +19268,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17043,7 +19302,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17077,7 +19336,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17111,7 +19370,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -17169,7 +19428,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17204,7 +19463,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -17240,7 +19499,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17273,7 +19532,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17307,7 +19566,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17390,7 +19649,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17428,7 +19687,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -17464,7 +19723,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17500,7 +19759,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -17533,7 +19792,7 @@ if ($ADD==671111111111) } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -17559,6 +19818,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
    ETIQUETA DE LA PANTALLA NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    SUPRESIÓN DE PANTALLA COMPLETA LA ETIQUETA: $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 "
    CONTACTO NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Eliminar contacto', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

    \n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -17647,10 +19979,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_refrescar=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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -17734,8 +20072,23 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
    Usted no tiene permisos de modificar a este usuario: $user\n"; } @@ -17760,13 +20113,16 @@ if ($ADD==3) 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) { echo "\n"; @@ -17836,19 +20192,22 @@ if ($ADD==3) echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -17870,9 +20229,11 @@ if ($ADD==3) } if ($LOGuser_level > 8) { - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -17898,7 +20259,7 @@ if ($ADD==3) if ($SScustom_fields_enabled > 0) { - echo "\n"; + echo "\n"; } echo "\n"; @@ -17926,7 +20287,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -17934,6 +20307,15 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } echo "\n"; echo "
    NÚmero De Usuario: $user$NWB#vicidial_users-user$NWE
    Contraseña: $NWB#vicidial_users-pass$NWE     Strength:
    Contraseña: $NWB#vicidial_users-pass$NWE     Fuerza:
    Force Change Contraseña: $NWB#vicidial_users-force_change_password$NWE
    Forzar cambio de contraseña: $NWB#vicidial_users-force_change_password$NWE
    Nombre Completo: $NWB#vicidial_users-full_name$NWE
    Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE
    Grupo Del Usuario:
    OPCIONES DE INTERFAZ DEL AGENTE:
    El Agente Elige Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Agent Choose Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agente Elija Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agente Elija territorios: $NWB#vicidial_users-agent_choose_territories$NWE
    Modificar Agente Cliente Sobreescribe Teléfono:$NWB#vicidial_users-alter_custphone_override$NWE
    Agente de Cambio observancia Sobrescribir: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Agent Call Log View Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Agente de Registro de llamadas Ver anulación: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Principal agente de búsqueda de anulación: $NWB#vicidial_users-agent_lead_search_override$NWE
    Alerta Activado: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    Permitir Alertas: $NWB#vicidial_users-allow_alerts$NWE
    Búsqueda de contactos preestablecido: $NWB#vicidial_users-preset_contact_search$NWE
    Filas De la Campaña:$NWB#vicidial_users-campaign_ranks$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKcampaigns_list"; echo "
    \n"; echo "
    Grupos De entrada: $NWB#vicidial_users-closer_campaigns$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKgroups_list"; echo "
    \n"; echo "
    ADMIN REPORT OPTIONS:
    Opciones de Administración INFORME:
    Realtime Block Usuario Info: $NWB#vicidial_users-realtime_block_user_info$NWE
    Bloqueo en tiempo real Información del Usuario: $NWB#vicidial_users-realtime_block_user_info$NWE
    Ocultar datos de administración de plomo: $NWB#vicidial_users-admin_hide_lead_data$NWE
    Ocultar datos de administración del teléfono: $NWB#vicidial_users-admin_hide_phone_data$NWE
    OPCIONES DE INTERFAZ DEL ADMIN:
    Custom Fields Modify: $NWB#vicidial_users-custom_fields_modify$NWE
    Modificar campos personalizados: $NWB#vicidial_users-custom_fields_modify$NWE
    Modifique Las Campañas: $NWB#vicidial_users-modify_sections$NWE
    Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
    BorrarTiempos De la Llamada: $NWB#vicidial_users-delete_call_times$NWE
    Modifique Los Servidores: $NWB#vicidial_users-modify_sections$NWE
    CallCard Access: $NWB#vicidial_users-modify_sections$NWE
    Modificar Mayúsculass: $NWB#vicidial_users-modify_sections$NWE
    ModificarMóviles: $NWB#vicidial_users-modify_sections$NWE
    ModificarTransportistas: $NWB#vicidial_users-modify_sections$NWE
    ModificarLabels: $NWB#vicidial_users-modify_sections$NWE
    ModificarEstados: $NWB#vicidial_users-modify_sections$NWE
    ModificarBuzón de Voz: $NWB#vicidial_users-modify_sections$NWE
    ModificarAudio de la tienda: $NWB#vicidial_users-modify_sections$NWE
    ModificarMúsica en espera: $NWB#vicidial_users-modify_sections$NWE
    ModificarTTS: $NWB#vicidial_users-modify_sections$NWE
    ModificarContacts: $NWB#vicidial_users-modify_sections$NWE
    CallCard acceso: $NWB#vicidial_users-modify_sections$NWE
    Agente de acceso a la API:$NWB#vicidial_users-vdc_agent_api_access$NWE
    AñadirReloj de tiempo Registrarse Registro: $NWB#vicidial_users-add_timeclock_log$NWE
    EliminarReloj de tiempo Registrarse Registro: $NWB#vicidial_users-delete_timeclock_log$NWE
    Gerente de Turno observancia Sobrescribir: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    Modificar el nivel de usuario del mismo: $NWB#vicidial_users-modify_same_user_level$NWE
    \n"; @@ -17949,7 +20331,7 @@ if ($ADD==3) echo "

    Chasque aquí para los asimientos del servicio repetido del usuario\n"; if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a la presente acta
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para este disco\n"; } } } @@ -17974,6 +20356,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_refrescar=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17984,6 +20371,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -17991,16 +20388,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -18050,7 +20450,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_refrescar = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -18153,14 +20553,61 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Configuración";} + else + {$ALTmultiDISABLE=0; $ALTmultiLINK='';} + + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -18171,7 +20618,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -18199,7 +20646,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -18243,7 +20690,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18274,7 +20721,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -18298,9 +20745,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -18323,6 +20772,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -18344,9 +20818,11 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -18361,7 +20837,11 @@ if ($ADD==31) echo ""; if ($enable_xfer_presets == 'ENABLED') { - echo ""; + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; } if ($SSqc_features_active > 0) { @@ -18371,7 +20851,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
    $row[0]: Básico   Básico Detalle EstadosTeclas rápidasPausa CódigosPresets Valores de menores/font>AC-CID Tiempo Real Tiempo Real
    \n"; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20547,7 +23672,7 @@ if ($ADD==32) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20609,7 +23734,7 @@ if ($ADD==33) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20671,7 +23796,7 @@ if ($ADD==35) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20733,7 +23858,7 @@ if ($ADD==36) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20795,7 +23920,7 @@ if ($ADD==37) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20857,7 +23982,7 @@ if ($ADD==39) echo ""; echo "
    \n"; @@ -18384,20 +20864,31 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; @@ -18426,139 +20917,200 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + 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"; @@ -18770,11 +21328,17 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + 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) { @@ -18844,43 +21410,65 @@ if ($ADD==31) } 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"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -18899,6 +21487,11 @@ if ($ADD==31) } 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"; @@ -18912,13 +21505,21 @@ if ($ADD==31) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -18930,18 +21531,18 @@ if ($ADD==31) echo "\n"; - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -18992,28 +21593,44 @@ if ($ADD==31) if ($SSenable_queuemetrics_logging > 0) { - echo "\n"; + 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"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { @@ -19035,6 +21652,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
    ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID De la Campaña: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
    Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE
    Campaña Fecha de cambio: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Campaña Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Activo: $NWB#vicidial_campaigns-active$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
    \n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
    Activo: $NWB#vicidial_campaigns-active$NWE
    Grupo de usuarios de administración: $NWB#vicidial_campaigns-user_group$NWE
    Parque de la Música-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulario Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulario Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulario web de destino: $NWB#vicidial_campaigns-web_form_target$NWE
    Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Add A Dial Estado:
    Añadir un Estado Marcar para llamar:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
    Mezcla lista:
    Orden De la Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Orden de lista aleatoria: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
    Lista de Secundaria Orden: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
    Mezcla lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Filtro del plomo: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Tiempo de caída de bloqueo: $NWB#vicidial_campaigns-drop_lockout_time$NWE
    Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Recuento de llamadas Límite: $NWB#vicidial_campaigns-call_count_limit$NWE
    Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Recuento de llamadas de destino: $NWB#vicidial_campaigns-call_count_target$NWE
    Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
    Mínimo nivel de la tolva: $NWB#vicidial_campaigns-hopper_level$NWE
    Nivel de la tolva automática: $NWB#vicidial_campaigns-use_auto_hopper$NWE
    Multiplicador de la tolva automática: $NWB#vicidial_campaigns-hopper_level$NWE
    Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
    Hopper VLC Dup Compruebe: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
    Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
    Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPTE LA INVALIDACIÓN
    Solamente Cuenta Disponible: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Marcación automática de nivel de umbral: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
    Solamente Cuenta Disponible: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Umbral Disponible cifra sólo: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
    Límite Del Porcentaje De la Gota: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
    Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Marque la diferencia de nivel método de destino: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
    Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Cola de prioridad:$NWB#vicidial_campaigns-drop_rate_group$NWE
    Inbound Queue No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    Cola de entrada n º telefónico: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    El Marcar Auto Del Alt-Nu'mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    El Marcar Auto Del Alt-Nu'mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
    Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
    Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
    Franja horaria de llamada:
    Prefijo al marcar: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Manual Prefijo al marcar: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Prefijo Manual: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Omita El Código Del Teléfono: $NWB#vicidial_campaigns-omit_phone_code$NWE
    CallerID de la Campaña: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Extensión de enrutamiento: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Extensión de Rec de la campaña: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
    La Registración Retrasa: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
    Llame a notas por llamada: $NWB#vicidial_campaigns-per_call_notes$NWE
    Agente de Búsqueda de plomo: $NWB#vicidial_campaigns-agent_lead_search$NWE
    Plomo Agente Método de búsqueda: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
    Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -18788,8 +21352,8 @@ if ($ADD==31) {$cfwHTML = '';} echo "
    Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
    Mensaje del contestador automático: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
    Mensaje del contestador automático: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -18818,25 +21382,27 @@ if ($ADD==31) echo "
    Transfiera -Conf El Número 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Enable Transfer Presets: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Activar presets de transferencia: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Hide Transfer Number to Dial: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Ocultar número de transferencia para marcar: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Custom 3-Way Botón de Transferencia: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
    Transferencia de rellenar previamente Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Park Call IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Estacionamiento de llamadas IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Park Call IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Estacionamiento de llamadas IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
    Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
    Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
    Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Temporizador de Acción de Destination: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Temporizador de destino Acción: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Scheduled Callbacks Alert: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Devoluciones de llamada de alerta programados: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Scheduled Callbacks Count: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Rellamadas programadas Conde: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Programado devoluciones de llamada Días Límite: $NWB#vicidial_campaigns-callback_days_limit$NWE
    Programado devoluciones de llamada de horas de vuelo: $NWB#vicidial_campaigns-callback_hours_block$NWE
    Rellamadas programadas bloque Calltime: $NWB#vicidial_campaigns-callback_list_calltime$NWE
    Mi devoluciones de llamada predeterminado casilla de verificación: $NWB#vicidial_campaigns-my_callback_option$NWE
    Segundos De la Llamada De la Gota: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Caída de Acción:$NWB#vicidial_campaigns-drop_action$NWE
    Caída de Acción:$NWB#vicidial_campaigns-drop_action$NWE
    Puerto Seguro Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
    Buzón de Voz: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Safe Harbor de audio: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
    Grupo de Transferencia de caída:
    Safe Harbor menú de llamadas: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
    Buzón de Voz: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Grupo de Transferencia de caída: $NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Desactivar la pantalla de dispo: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
    Desactivar estado de dispo: $NWB#vicidial_campaigns-disable_dispo_status$NWE
    Segundos De Wrap Up: $NWB#vicidial_campaigns-wrapup_seconds$NWE
    Mensaje De Wrap Up: $NWB#vicidial_campaigns-wrapup_message$NWE
    Utilice La Lista Interna de DNC: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Utilice La Lista Interna de DNC: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Campaña de uso Lista DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    Campaña de uso Lista DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    AgentCódigos De la PausaActivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
    Campaña Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Auto Pause antes de la llamada de trabajo: $NWB#vicidial_campaigns-auto_pause_precall$NWE
    Tiempo Real Agent Time Stats: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Auto Reanudar una llamada previa de trabajo: $NWB#vicidial_campaigns-auto_resume_precall$NWE
    Auto Pause antes de la llamada Código: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
    Campaña Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refrescar$NWE
    Estadísticas en tiempo real agente de tiempo: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Inhabilite Alteran Datos Del Cliente:$NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Deshabilitar Modificar Cliente Teléfono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agente de pantalla Dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
    Las etiquetas de la pantalla del agente: $NWB#vicidial_campaigns-screen_labels$NWE
    Campos de la pantalla de estado: $NWB#vicidial_campaigns-status_display_fields$NWE
    Agente Mostrar cola Cuenta:$NWB#vicidial_campaigns-display_queue_count$NWE
    Agente de pausa después de cada llamada: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Manual Dial Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Marcación manual de anulación: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Identificación Manual De la Lista Del Dial:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Manual de Acceso telefónico Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manual de Acceso telefónico Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manual Preview Dial: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Manual de marcación previa: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Duración de la llamada Manual de Entrada: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
    Marcación manual de la API: $NWB#vicidial_campaigns-api_manual_dial$NWE
    Manual de marcación CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
    Mensaje Teléfono Diferencia de tiempo de alerta: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
    Agente de pantalla Portapapeles Copiar: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    3-Vías de llamadas Prefijo telefónico: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Customer 3-Way Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Cliente 3-Way Colgar el registro de: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Customer 3-Way Hangup Seconds: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Cliente 3-Way Segundos hangup: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Customer 3-Way Hangup Action: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Cliente 3-Way Colgar Acción: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Grupo Alias permitidas: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    QM CallStatus anulación: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    Gestión de calidad para el Medio Ambiente Teléfono: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
    PLLB Agrupación: $NWB#vicidial_campaigns-pllb_grouping$NWE
    PLLB límite Agrupación: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
    CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
    CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
    Iniciar llamada URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Iniciar llamada URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Extension Append CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    No Llamar URL: $NWB#vicidial_campaigns-na_call_url$NWE
    Blind Monitor Warning: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Anexar extensión de CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Blind Monitor Notice: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Advertencia Monitor de Ciegos: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Blind Monitor Filename: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    Ciegos Aviso monitor: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Nombre del Monitor de Ciegos: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    \n"; @@ -19054,6 +21673,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -19061,6 +21681,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -19069,14 +21691,14 @@ if ($ADD==31) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -19121,8 +21743,6 @@ if ($ADD==31) echo "\n"; echo "
    ID DE LA LISTANOMBRE DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVO

    \n"; - echo "
    \n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -19131,13 +21751,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

    \n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
    Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
    ESTADOS DE ACTIVOS EN LAS LISTAS PARA ESTA CAMPAÑA:\n"; + echo " - PIEL
    "; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADODIALABLEPENETRATION
    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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 "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADO
    $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]."
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]    
    TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "Indican los estados de PLOMO EN ESTA CAMPAÑA

    "; + } + + + + echo "
    \n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - PIEL

    "; } else @@ -19146,7 +21948,7 @@ if ($ADD==31) echo " - DEMOSTRACIÓN

    "; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -19157,9 +21959,36 @@ if ($ADD==31) echo "Haga clic aquí para ver un informe VDAD para esta campaña

    \n"; } echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

    \n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Prueba de llamadas salientes: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


    \n"; + } + else + { + echo "Prueba llamando a discapacitados

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

    Haga clic aquí para ver Admin chages a esta campaña
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para esta campaña\n"; } echo "
    \n"; } @@ -19170,7 +21999,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -19187,17 +22016,45 @@ if ($ADD==31) echo "
    \n"; echo "
    ESTADOS DE ENCARGO DENTRO DE ESTA CAMPAÚA:   $NWB#vicidial_campaign_statuses$NWE
    \n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + echo "
    ESTADODESCRIPCIÓNSELECCIONABLERESPUESTA HUMANOSACATEGORÍAMODIFY-DELETE
    \n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -19212,42 +22069,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
    S
    T
    A
    T
    U
    S
    DESCRIPCIÓNCATEGORÍA
    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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "ELIMINAR\n"; - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "ELIMINAR\n"; + } + else + { + echo "ELIMINAR\n"; + } echo "
    \n"; + echo "
    AGREGAR ESTADO PERSONALIZADO A LA CAMPAÑA
    \n"; echo "\n"; echo "\n"; echo "Estado:   \n"; echo "Descripción:   \n"; - echo "Seleccionable:  
    \n"; - echo "Respuesta humana:   \n"; + echo "Seleccionable:   \n"; + echo "Respuesta humana:  
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoría:\n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -19313,7 +22180,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -19326,7 +22193,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -19452,7 +22319,7 @@ if ($ADD==31) echo "
    ACCESO DIRECTOESTADODESCRIPCIÓNELIMINAR
    \n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -19492,7 +22359,7 @@ if ($ADD==31) ##### 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -19517,7 +22384,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19530,7 +22397,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19584,7 +22451,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -19603,6 +22470,9 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    CÓDIGOS DE LA PAUSAFACTURABLEMODIFICARELIMINAR
    No encuesta interesadas dígitos: $NWB#vicidial_campaigns-survey_ni_digit$NWE
    Encuesta de Opt-in de archivos de audio: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
    No encuesta interesadas archivo de audio: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
    Método de estudio: $NWB#vicidial_campaigns-survey_method$NWE
    Método de estudio: $NWB#vicidial_campaigns-survey_method$NWE
    Estudio n-Respuesta de acción: $NWB#vicidial_campaigns-survey_no_response_action$NWE
    Estudio de estado no le interesa: $NWB#vicidial_campaigns-survey_ni_status$NWE
    Estudio de grabación Campaña Directorio: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
    Buzón de Voz: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
    Encuesta del menú de llamadas: $NWB#vicidial_campaigns-survey_menu_id$NWE
    Estudio de grabación: $NWB#vicidial_campaigns-survey_recording$NWE
    \n"; echo "

    \n"; @@ -19612,13 +22482,25 @@ if ($ADD==31) ##### CAMPAIGN PRESETS ##### if ($SUB==201) { - echo "

    PRESETS FOR THIS CAMPAÑA:   $NWB#vicidial_xfer_presets$NWE
    \n"; - echo "
    \n"; - echo "\n"; - - $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' order by preset_name"; + $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_query($stmt, $link); $presets_to_print = mysql_num_rows($rslt); + + echo "

    $presets_to_print PRESETS para esta campaña:   $NWB#vicidial_xfer_presets$NWE
    \n"; + + echo "
    AÑADIR NUEVO PRESET -
    \n"; + echo "\n"; + echo "\n"; + echo "Nombre del ajuste: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Ocultar número:  \n"; + echo "
    \n"; + echo "

    \n"; + + echo "
    PRESET NAMENÚMERODTMFPIELMODIFICARELIMINAR
    \n"; + echo "\n"; + $o=0; while ($presets_to_print > $o) { @@ -19630,31 +22512,108 @@ if ($ADD==31) else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } echo "
    # PRESET NAMENÚMERODTMFPIELMODIFICARELIMINAR
    $rowx[0]\n"; + echo "
    $o $rowx[0]\n"; echo "\n"; echo "\n"; echo "  ELIMINAR
    ELIMINAR
    \n"; + } - echo "
    ADD NEW PRESET
    \n"; - echo "\n"; + + ##### CAMPAIGN CódigoÁrea CID ##### + if ($SUB==202) + { + echo "

    CIDS CódigoÁrea para esta campaña:   $NWB#vicidial_campaign_cid_areacodes$NWE
    \n"; + if ($use_custom_cid != 'CódigoÁrea') + {echo "
    The campaign setting Custom CallerID is not set to CódigoÁrea!
    ";} + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "Preset Name: \n"; - echo "Preset Number:
    \n"; - echo "Preset DTMF: \n"; - echo "   Hide Number: \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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 "
    #CódigoÁreaCID NÚMERODESCRIPCIÓNACTIVOCALLSELIMINAR
      $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   ELIMINAR
    \n"; + echo "

    \n"; + + echo "
    ADD CódigoÁrea CID NUEVO
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Areacode: \n"; + echo "Outbound CID:
    \n"; + echo "Descripción: \n"; echo "
    \n"; echo "

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

    \n"; @@ -19686,6 +22645,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_refrescar=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -19696,8 +22660,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -19722,9 +22696,10 @@ if ($ADD==34) $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_stats_refrescar = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -19732,13 +22707,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Configuración";} + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -19756,7 +22738,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19777,7 +22759,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -19788,7 +22770,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -19818,14 +22800,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -19840,15 +22822,18 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: $campaign_id: Vista Básica Vista Detallada Mezcla lista Pantalla En tiempo real Pantalla En tiempo real  
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19875,137 +22860,164 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
    ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID De la Campaña: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
    Descripción De la Campaña: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
    Campaña Fecha de cambio: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Activo: $NWB#vicidial_campaigns-active$NWE
    Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Grupo de usuarios de administración: $user_group $NWB#vicidial_campaigns-user_group$NWE
    Parque de la Música-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Formulario Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    Add A Dial Estado:
    Añadir un Estado Marcar para llamar:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
    Mezcla lista:
    Orden De la Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Mezcla lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Filtro del plomo: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Mínimo nivel de la tolva: $NWB#vicidial_campaigns-hopper_level$NWE
    Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
    Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
    Nivel del Auto-Dial: \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
    ID DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVOÚLTIMA FECHA DE CONVOCATORIAMODIFICAR
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
    ID DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVOÚLTIMA FECHA DE CONVOCATORIAMODIFICAR
    $row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]MODIFICAR

    \n"; + echo "
    \n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

    \n"; + + + if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) ) + { + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]MODIFICAR

    \n"; - echo "
    \n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

    \n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - PIEL

    "; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - DEMOSTRACIÓN

    "; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Esta campaña tiene $hopper_leads Leads en el Hopper

    \n"; - echo "Chasque aquí para ver qué plomos están en la tolva ahora

    \n"; - echo "Haga clic aquí para ver un informe VDAD para esta campaña

    \n"; + echo "
    ESTADOS DE ACTIVOS EN LAS LISTAS PARA ESTA CAMPAÑA:\n"; + echo " - PIEL
    "; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADO
    $CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "Indican los estados de PLOMO EN ESTA CAMPAÑA

    "; + } + + + 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 " - PIEL

    "; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - DEMOSTRACIÓN

    "; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Esta campaña tiene $hopper_leads Leads en el Hopper

    \n"; + echo "Chasque aquí para ver qué plomos están en la tolva ahora

    \n"; + echo "Haga clic aquí para ver un informe VDAD para esta campaña

    \n"; } echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

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

    Haga clic aquí para ver Admin chages a esta campaña
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para esta campaña\n"; } echo "
    \n"; @@ -20218,24 +23342,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
    \n"; echo "
    FILAS DEL AGENTE PARA ESTA CAMPAÑA:
    \n"; - echo "\n"; - echo "\n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
    USER     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

    \n"; @@ -20272,7 +23397,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -20291,7 +23416,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
    ADVERTENCIA, sólo recomendamos Lista Mix para usuarios avanzados, por favor lea el Manual de Administrador de Vicidial
    \n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -20300,7 +23425,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -20523,7 +23648,7 @@ if ($ADD==32) echo "
    MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20585,7 +23710,7 @@ if ($ADD==33) echo "MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by hotkey"; + $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by hotkey;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20647,7 +23772,7 @@ if ($ADD==35) echo "MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20709,7 +23834,7 @@ if ($ADD==36) echo "MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20771,7 +23896,7 @@ if ($ADD==37) echo "MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by pause_code;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20833,7 +23958,7 @@ if ($ADD==39) echo "MODIFICAR
    $campaigns_name_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $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_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20884,9 +24009,9 @@ if ($ADD==39) if ($ADD==301) { echo "
    \n"; - echo ""; + echo ""; - echo "
    CAMPAIGN PRESET LISTINGS:\n"; + echo "
    CAMPAÑA PRESET LISTADOS:\n"; echo "
    \n"; echo "\n"; echo "\n"; @@ -20895,59 +24020,125 @@ if ($ADD==301) echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $enable_xfer_presets_list[$o] = $row[2]; - $o++; - } + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $enable_xfer_presets_list[$o] = $row[2]; + $o++; + } - $o=0; - $k=0; - while ($campaigns_to_print > $o) + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if ($enable_xfer_presets_list[$o] == 'ENABLED') { - if ($enable_xfer_presets_list[$o] == 'ENABLED') + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; - echo ""; - echo ""; - echo "\n"; - - $k++; + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; } - $o++; + if ($p<1) + {echo "NONE";} + echo ""; + echo "\n"; + + $k++; } + $o++; + } echo "
    CAMPAIGNMODIFICAR
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) { - if (eregi("1$|3$|5$|7$|9$", $k)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; - $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) - { - $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; - } - if ($p<1) - {echo "NONE";} - echo "MODIFY PRESETS
    MODIFY PRESETS
    \n"; } +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
    \n"; + echo ""; + + echo "
    LISTADOS DE LA CAMPAÑA CódigoÁrea CID:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    CAMPAIGNNOMBRECUSTOM CIDAC-CIDSMODIFICAR
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + echo "MODIFY AC-CIDS
    \n"; + } + + ###################### # ADD=311 modify list info in the system @@ -20957,10 +24148,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -21098,19 +24306,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -20979,9 +24175,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -20990,10 +24190,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -21002,13 +24203,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -21021,7 +24223,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -21055,7 +24257,7 @@ if ($ADD==311) echo "
    Descripción De la Lista: $NWB#vicidial_lists-list_description$NWE
    Campaña: $NWB#vicidial_lists-drop_inbound_group_override$NWE
    Formulario Web: $NWB#vicidial_lists-web_form_address$NWE
    Formulario Web Two: $NWB#vicidial_lists-web_form_address$NWE
    Transfiera -Conf El Número 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Transfiera -Conf El Número 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Transfiera -Conf El Número 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Informe de Inventario: $NWB#vicidial_lists-inventory_report$NWE
    Ajuste de Huso Horario: $NWB#vicidial_lists-time_zone_setting$NWE
    \n"; echo "
    \n"; echo "
    ESTADOS DENTRO DE ESTA LISTA:
    \n"; - echo "\n"; - echo "\n"; + + if ($SSexpanded_list_stats > 0) + { + echo "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADO
    \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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADODIALABLEPENETRATION
    \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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -21164,15 +24411,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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 "
    ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADO
    $CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    $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]."
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]    
    TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; unset($lead_list); @@ -21182,7 +24467,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -21221,7 +24506,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -21243,67 +24528,142 @@ if ($ADD==311) echo "
    \n"; echo "
    PROPIETARIOS dentro de esta lista:
    \n"; - echo "
    DESPLAZAMIENTO GMT AHORA (tiempo local)LLAMADONO LLAMADO
    \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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
    OWNERLLAMADONO LLAMADO
    \n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
    OWNERLLAMADONO LLAMADORESET
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    \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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
    OWNERLLAMADONO LLAMADO
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; unset($lead_list); @@ -21316,7 +24676,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -21378,7 +24738,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -21501,7 +24861,7 @@ if ($ADD==311) $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - echo "

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

    Los campos personalizados definidos para esta lista: $rowx[0]
    \n"; } echo "

    Haga clic aquí para ver todas las CallBack mantiene en esta lista
    \n"; @@ -21513,7 +24873,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a esta lista
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para esta lista\n"; } } else @@ -21533,10 +24893,15 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_refrescar=1; + } 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 "\n"; + echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) @@ -21806,32 +25218,36 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -21839,10 +25255,12 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -21927,67 +25351,67 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; @@ -21997,13 +25421,13 @@ if ($ADD==3111) echo "$Tgroups_menu"; echo "$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -22016,7 +25440,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -22054,18 +25478,21 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + 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) @@ -22077,7 +25504,7 @@ if ($ADD==3111) $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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -22101,7 +25528,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -22127,7 +25554,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -22140,7 +25567,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -22177,13 +25604,12 @@ if ($ADD==3111) ### list of agent rank or skill-level for this inbound group - # ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ - echo "
    \n"; - echo "
    AGENTE RANKS FOR THIS Entrantes GROUP:
    \n"; - 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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21640,32 +25005,52 @@ if ($ADD==3111) $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]; ##### get callmenu listings for dynamic pulldown - $stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id"; + $stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $Xmenus_to_print = mysql_num_rows($rslt); $o=0; $Xmenuslist=''; + $Wmenuslist=''; while ($Xmenus_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -21676,6 +25061,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -21686,6 +25073,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -21738,6 +25132,10 @@ if ($ADD==3111) {$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 @@ -21754,12 +25152,22 @@ if ($ADD==3111) echo "
    Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
    Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
    Activo: $NWB#vicidial_inbound_groups-active$NWE
    Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    En-Grupo Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
    \n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
    Grupo de usuarios de administración: $NWB#vicidial_inbound_groups-user_group$NWE
    Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Formulario Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Formulario Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Cola de prioridad: $NWB#vicidial_inbound_groups-queue_priority$NWE
    Con el teléfono colgado del timbre: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
    Con el teléfono colgado del CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
    Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Ignore List Script Override: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    No haga caso de anulación de la lista de secuencias de comandos: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Transfiera -Conf El Número 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
    Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
    Temporizador de mensaje de acción: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Temporizador Segundos Acción: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Temporizador de Acción de Destination: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Temporizador de destino Acción: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Segundos De la Llamada De la Gota: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Caída de Acción:$NWB#vicidial_inbound_groups-drop_action$NWE
    Caída de Acción:$NWB#vicidial_inbound_groups-drop_action$NWE
    Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
    Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Grupo de Transferencia de caída:
    Grupo de Transferencia de caída: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
    Menú desplegable de llamadas:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
    Tiempo De la Llamada:$NWB#vicidial_inbound_groups-call_time_id$NWE
    Después De la Acción De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Acción de transferencia de CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
    Después De la Acción De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Después De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Después De las Horas Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Horas después de la transferencia del Grupo:
    Horas después de la transferencia del Grupo: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
    Después del horario de llamada Menú:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
    N de colas n Agentes: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
    No No Acción cola de agente: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -21873,9 +25291,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID De la Lista: "; echo "
    ID De la Campaña: audio chooser\n"; + echo "archivo de audio: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -21917,6 +25335,12 @@ if ($ADD==3111) echo "
     
    Llama al método Max: $NWB#vicidial_inbound_groups-max_calls_method$NWE
    Max llama Conde: $NWB#vicidial_inbound_groups-max_calls_count$NWE
    Max llama Acción: $NWB#vicidial_inbound_groups-max_calls_action$NWE
    Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Reproducir Mensaje de Bienvenida:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
    On Hold Prompt No Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    Preguntar en espera ningún bloque: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    On Hold Prompt Seconds: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Segundos en espera prontas: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Lugar jugar en línea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Juega Mantenga Tiempo estimado:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Calculate Estimated Hold Seconds: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Calcular estimado Segundos Hold: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Estimated Hold Time Minimum Filename: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Nombre del archivo estimado Hold tiempo mínimo: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Estimated Hold Time Minimum Prompt No Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Mínimo Estimado Tiempo de Espera Preguntar no hay un bloque: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Estimated Hold Time Minimum Prompt Seconds: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Estimación de Hold segundos de tiempo mínimo Prompt: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Wait Time Opción: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Espere Opción Tiempo: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Wait Time Second Opción: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Espere Opción segunda vez: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Wait Time Third Opción: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Espere Opción tercera vez: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Wait Time Opción Seconds: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Espere unos segundos tiempo de la opción: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Wait Time Opción Extensión:$NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Espere plazo de prórroga de la opción: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Wait Time Opción Callmenu:
    Espere Callmenu Tiempo Opción: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Wait Time Opción Buzón de Voz: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Espera Tiempo de correo de voz opcional: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Wait Time Opción Transfer In-Grupo:
    Espera Tiempo de Transferencia opción dentro del grupo: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Wait Time Opción Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Espere Opción Tiempo Archivo de Prensa: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Wait Time Opción Press No Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Espere Prensa opción de tiempo de ningún bloque: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Wait Time Opción Press Filename Seconds: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Tiempo de espera Opción Segundos Nombre de archivo de prensa: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Wait Time Opción After Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Espere Opción Tiempo Después de Archivo de Prensa: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Wait Time Opción Callback ID De la Lista: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Espere opción Tiempo de devolución de llamada ID Lista: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Wait Hold Opción Priority: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Espera tener prioridad Opción: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Estimated Mantenga la opción Hora:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Espera estimado Opción Tiempo: $NWB#vicidial_inbound_groups-hold_time_option$NWE
    Hold Time Second Opción: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Mantenga la opción segunda vez: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Hold Time Third Opción: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Mantenga la opción tercera vez: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Mantenga la opción Segundos Hora:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Hold Time Opción Minimum: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Mantenga mínima opción de tiempo: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Mantenga Tiempo Opción Extensión:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Hold Time Opción Callmenu:
    Mantenga Callmenu Tiempo Opción: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Hold Time Opción Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Mantenga la opción Time Nombre del archivo de prensa: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Hold Time Opción Press No Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Prensa opción No Bloquear: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Opción Press Filename Seconds: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Tiempo de espera Opción Segundos Nombre de archivo de prensa: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Hold Time Opción After Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Mantenga la opción Tiempo Después de Archivo de Prensa: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Mantenga la opción Tiempo de llamada Lista ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Estadísticas Porcentaje de llamadas respondidas dentro de X segundos 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
    Iniciar llamada URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Iniciar llamada URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Add Lead URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Agregar el URL de plomo: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Extension Append CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    No Llamar URL: $NWB#vicidial_inbound_groups-na_call_url$NWE
    Uniqueid Status Exponer: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Anexar extensión de CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Uniqueid Status Prefix: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
    Pantalla de estado UniqueId: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Prefijo de Estado UniqueId: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
    \n"; - echo "\n"; + echo "
    \n"; + echo "
    AGENTE RANKS FOR THIS INBOUND GROUP:
    \n"; + echo "
    USERSELECTED     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y';"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -22196,6 +25622,7 @@ if ($ADD==3111) $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';} @@ -22207,7 +25634,7 @@ if ($ADD==3111) while ($users_to_print > $o) { $o++; - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; + $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_query($stmt, $link); $viga_to_print = mysql_num_rows($rsltx); if ($viga_to_print > 0) @@ -22215,16 +25642,18 @@ if ($ADD==3111) $rowx=mysql_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';"; + $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_query($stmtD, $link); if ($DB > 0) {echo "|$stmtD|";} $stmtDlog .= "$stmtD|"; $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; $ARIG_rank[$o] = '0'; $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; } } if (strlen($ARIG_changenotes) > 10) @@ -22248,16 +25677,21 @@ if ($ADD==3111) $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 = ereg_replace("[^A-Z]","",$ARIG_checked); $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_replace("[^-0-9]","",$ARIG_graded); $stmtA=''; $stmtB=''; @@ -22290,6 +25724,14 @@ if ($ADD==3111) $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_query($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 ### @@ -22302,7 +25744,7 @@ if ($ADD==3111) } } - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $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_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -22317,6 +25759,7 @@ if ($ADD==3111) $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';} @@ -22336,10 +25779,12 @@ if ($ADD==3111) $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"; + $users_output .= "\n"; + echo "\n"; echo "$users_output"; @@ -22362,18 +25818,16 @@ if ($ADD==3111) echo "
    USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
    $ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]   select all  
        select all  

    \n"; - echo "

    \n"; - echo "Haga clic aquí para ver un informe de este grupo entrante

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

    \n"; + echo "Haga clic aquí para ver los agentes registrados en este grupo de entrada

    \n"; echo "
    \n"; - echo "DIDS USING THIS IN-GROUP:
    \n"; + echo "DIDS EL USO DE ESTE GRUPO-EN:
    \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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -22385,10 +25839,10 @@ if ($ADD==3111) } echo "

    \n"; - echo "CALL MENUS USING THIS IN-GROUP:
    \n"; + echo "CALL MENUS EL USO DE ESTE GRUPO-EN:
    \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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -22423,7 +25877,7 @@ if ($ADD==3111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver a esta Administración chages en Grupo\n"; + echo "

    Haga clic aquí para ver los cambios de administrador para el Grupo-En\n"; } } else @@ -22431,6 +25885,7 @@ if ($ADD==3111) echo "Usted no tiene permiso de visión esta página\n"; exit; } + } @@ -22443,13 +25898,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -22602,7 +26072,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu order by menu_id;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -22624,7 +26094,7 @@ if ($ADD==3311) 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 order by filter_phone_group_id;"; + $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_query($stmt, $link); $Fgroups_to_print = mysql_num_rows($rslt); $Fgroups_list=''; @@ -22650,10 +26120,10 @@ if ($ADD==3311) $i++; } - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22674,7 +26144,7 @@ if ($ADD==3311) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - - - - + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; 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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -22494,9 +25954,15 @@ if ($ADD==3311) $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"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -22509,7 +25975,7 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -22547,7 +26013,7 @@ if ($ADD==3311) ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -22591,8 +26057,12 @@ if ($ADD==3311) echo "
    DID Extensión:$NWB#vicidial_inbound_dids-did_pattern$NWE
    DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
    Activo: $NWB#vicidial_inbound_dids-did_active$NWE
    Grupo de usuarios de administración: $NWB#vicidial_inbound_dids-user_group$NWE
    DID Ruta:$NWB#vicidial_inbound_dids-did_route$NWE
    Record Call: $NWB#vicidial_inbound_dids-record_call$NWE
    Grabar llamadas: $NWB#vicidial_inbound_dids-record_call$NWE
    Extensión:$NWB#vicidial_inbound_dids-extension$NWE
    Extensión Contexto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Caja de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    In-ID De Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
    En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    En Grupo Agente Método de búsqueda:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    -En la lista Grupo de Identificación:$NWB#vicidial_inbound_dids-list_id$NWE
    En el Grupo de Campaña-ID:
    En el Grupo-Teléfono Código:$NWB#vicidial_inbound_dids-phone_code$NWE
    Clean CID Number: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Limpie Número CID: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Filter Inbound Number: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Número de entrada del filtro: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filter Phone ID De Grupo: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Teléfono filtro ID de grupo: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Filter URL: $NWB#vicidial_inbound_dids-filter_url$NWE
    Filter Action: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filtro de URL: $NWB#vicidial_inbound_dids-filter_url$NWE
    Acción de filtrado: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Extensión:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Extensión Contexto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter In-ID De Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter En Grupo Agente Método de búsqueda:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter -En la lista Grupo de Identificación:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter En el Grupo de Campaña-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter En el Grupo-Teléfono Código:$NWB#vicidial_inbound_dids-phone_code$NWE
    Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
    \n"; echo "

    \n"; echo "
    Haga clic aquí para ver un informe de tráfico para este DID

    \n"; - echo "
    Click here to see a list of recordings and calls for this DID

    \n"; + echo "
    Haga clic aquí para ver una lista de las grabaciones y las llamadas de este DID
    \n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    VER QUÉ remoto omite agente de extensión por eso los\n"; + } if ($LOGdelete_dids > 0) { echo "

    ELIMINAR ESTA DID\n"; } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver a esta Administración chages DID\n"; + echo "

    Haga clic aquí para ver los cambios de administrador para este DID\n"; } } else @@ -22713,6 +26188,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
    \n"; + echo ""; + + echo "
    Remote Agent LISTADOS DE EXTENSIÓN DE ANULACION:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    DIDNOMBRERA-EXTENSMODIFICAR
    $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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/ModificarDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ¿NO AUMENTO A DISTANCIA agente de extensión AGREGADOS - ya hay una entrada para este hecho con esta EXTENSIÓN AR
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    ¿NO AUMENTO A DISTANCIA agente de extensión AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "
    ¿SABÍA DE AUMENTO A DISTANCIA agente de extensión AGREGADOS: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    Extensión DID Remote Agent presupuesto NO DELETED - esta entrada no existe
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    Extensión DID Remote Agent presupuesto NO DELETED - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "
    DID REMOTE AGENTE 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 AGENTE EXTENSION OVERRIDE NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó
    \n"; + } + else + { + echo "Extensión DID Remote Agent OVERRIDE MODIFICADO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/ModificarDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_refrescar=1; + } + echo "
    \n"; + echo ""; + echo "

    El remoto omite agente de extensión por eso los:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTEXTENSIÓNDESCRIPCIÓNACTIVOCALLSELIMINAR
      $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   ELIMINAR
    \n"; + echo "

    \n"; + + echo "
    ADD NEW REMOTE AGENTE EXTENSION OVERRIDE
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Usuario Start: \n"; + echo "Extensión:
    \n"; + echo "Descripción: \n"; + echo "
    \n"; + + echo "

    \n"; + + echo "

    MODIFICAR ESTE DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

    Haga clic aquí para ver los cambios de administrador para este DID
    \n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -22721,10 +26496,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_refrescar=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -22738,6 +26518,9 @@ if ($ADD==3511) $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]; echo "
    MODIFICAR UNA LLAMADA menú de grabación: $menu_id
    \n"; @@ -22746,6 +26529,10 @@ if ($ADD==3511) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -22782,6 +26569,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -22813,7 +26612,7 @@ if ($ADD==3511) $dtmf_list = ""; echo "$ingroup_list"; - echo "   Handle Method: "; echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID De la Lista: "; echo "
    ID De la Campaña: \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: "; + echo "
      VID Ingrese Nombre del archivo: audio chooser"; + echo "
      VID ID Nombre del archivo Número: audio chooser"; + echo "
      VID Confirmar Archivo: audio chooser"; + echo "   VID dígitos: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -22901,7 +26700,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "archivo de audio: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -22925,12 +26724,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
    Menú ID: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
    Nombre de menú: $NWB#vicidial_call_menu-menu_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_call_menu-user_group$NWE
    Menú del sistema: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
    Menú de tiempo de espera: $NWB#vicidial_call_menu-menu_timeout$NWE
    Menú de tiempo de espera del sistema: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
    Oprima la tecla Entrar: $NWB#vicidial_call_menu-dtmf_log$NWE     Diario de campo: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
    Opciones del menú de llamadas:
    Custom Dialplan Entrada:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Custom Dialplan Entrada: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    \n"; echo "

    \n"; - echo "DIDS USING THIS CALL MENU:
    \n"; + echo "DIDS EL USO DE ESTE MENÚ DE LLAMADA:
    \n"; echo "\n"; - $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -22993,7 +26792,7 @@ if ($ADD==3511) echo "

    \n"; - echo "CALL MENUS USING THIS CALL MENU:
    \n"; + echo "CALL MENUS EL USO DE ESTE MENÚ DE LLAMADA:
    \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';"; @@ -23016,7 +26815,7 @@ if ($ADD==3511) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages de administración para este menú de llamada\n"; + echo "

    Haga clic aquí para ver los cambios de administrador para el menú de llamadas\n"; } } else @@ -23036,10 +26835,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_refrescar=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 from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -23050,56 +26854,94 @@ if ($ADD==31111) $status = $row[5]; $campaign_id = $row[6]; $extension_group = $row[8]; + $on_hook_agent = $row[9]; + $on_hook_ring_time =$row[10]; - ##### get extension group listing for dynamic pulldown - $stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); - $extengrp_to_print = mysql_num_rows($rsltx); - $extengrp_list=''; - $o=0; - while ($extengrp_to_print > $o) + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) { $rowx=mysql_fetch_row($rsltx); - $extengrp_list .= "\n"; - $o++; + $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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
    MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $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 "
    Comienzo Del ID del usuario: (Solamente números, incremented, debe ser un usuario existente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
    Extensión Externa: (número del dial plan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
    Grupo de extensiones: $NWB#vicidial_remote_agents-extension_group$NWE
    Estado: $NWB#vicidial_remote_agents-status$NWE
    Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
    Con el teléfono colgado del Agente: $NWB#vicidial_remote_agents-on_hook_agent$NWE
    Con el teléfono colgado del timbre: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE
    \n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "
    Grupos De entrada: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; + echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    HAY $didraext_count DID remoto omite agente de extensión de este agente A DISTANCIA\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

    SUPRIMA ESTE AGENTE ALEJADO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Haga clic aquí para ver los cambios de administrador para el agente remoto
    \n"; + } } - - echo "
    MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $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 "
    Comienzo Del ID del usuario: (Solamente números, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
    Extensión Externa: (número del dial plan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
    Extension Grupo: $NWB#vicidial_remote_agents-extension_group$NWE
    Estado: $NWB#vicidial_remote_agents-status$NWE
    Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
    Grupos De entrada: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; - echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - - - if ($LOGdelete_remote_agents > 0) + else { - echo "

    SUPRIMA ESTE AGENTE ALEJADO\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Haga clic aquí para ver a esta Administración chages agente remoto\n"; + echo "Inicio usuario de este agente remoto no existe: $user_start\n"; + exit; } } else @@ -23118,40 +26960,50 @@ if ($ADD==3711) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; - $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $filter_phone_group_id = $row[0]; $filter_phone_group_name = $row[1]; $filter_phone_group_description = $row[2]; + $user_group = $row[3]; - echo "
    Modifique El Filtro Phone Grupo: $filter_phone_group_id\n"; + echo "
    Modificar Grupo de teléfono Filtro: $filter_phone_group_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 "
    Filter Phone ID De Grupo: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Filter Phone Nombre De Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descripción: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Teléfono filtro ID de grupo: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Teléfono Filtro Nombre del grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Teléfono Filtro Descripción del Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Grupo de usuarios de administración: $NWB#vicidial_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_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "

    Numbers in this Filter Phone Grupo: $row[0]"; + echo "

    Los números en este Grupo de teléfono Filtro: $row[0]"; if ($LOGdelete_dids > 0) { - echo "

    SUPRIMA ESTE FILTRO PHONE GROUP\n"; + echo "

    Eliminar este grupo TELÉFONO DEL FILTRO\n"; } if ($LOGuser_level >= 9) { - echo "

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

    Haga clic aquí para descargar los números de teléfono en este grupo de filtro\n"; - echo "

    Haga clic aquí para ver chages al administrador de este filtro phone group\n"; + echo "

    Haga clic aquí para ver los cambios de administrador para este grupo de teléfono del filtro\n"; } } else @@ -23170,6 +27022,11 @@ if ($ADD==32111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; @@ -23185,12 +27042,12 @@ if ($ADD==32111) $last_call_time = $row[6]; $last_callerid = $row[7]; - echo "
    MODIFY AN EXTENSION GROUP ENTRY: $row[0]\n"; + echo "
    Modificar una entrada de grupo de extensiones: $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 "
    Extension Grupo: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Grupo de extensiones: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Extensión: (Solamente números)$NWB#vicidial_extension_groups-extension$NWE
    Rango: $NWB#vicidial_extension_groups-rank$NWE
    Campañas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Call Count Today: $call_count_today
    Last Tiempo De la Llamada:$last_call_time
    Last Call ID: $last_callerid
    Campañas Grupos: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Recuento de llamadas Hoy: $call_count_today
    Última llamada: $last_call_time
    Identificación de Última Convocatoria: $last_callerid
    \n"; if ($LOGdelete_remote_agents > 0) { - echo "

    DELETE THIS EXTENSION GROUP ENTRY\n"; + echo "

    Borrar esta entrada del grupo de extensiones\n"; } if ($LOGuser_level >= 9) { - echo "

    Click here to see Admin chages to this extension group entry
    \n"; + echo "

    Haga clic aquí para ver los cambios admin to this extension group entry\n"; } } else @@ -23240,220 +27097,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

    Haga clic aquí para ver todas las CallBack Posee en este grupo de usuarios

    \n"; - echo "

    Haga clic aquí para ver elReloj de tiempo Estado para este grupo de usuarios

    \n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - $agent_call_log_view = $row[10]; - $agent_xfer_consultative = $row[11]; - $agent_xfer_dial_override = $row[12]; - $agent_xfer_vm_transfer = $row[13]; - $agent_xfer_blind_transfer = $row[14]; - $agent_xfer_dial_with_customer = $row[15]; - $agent_xfer_park_customer_dial = $row[16]; - $agent_fullscreen = $row[17]; - $allowed_reports = $row[18]; - $webphone_url_override = $row[19]; - $webphone_systemkey_override = $row[20]; - $webphone_dialpad_override = $row[21]; - - echo ""; - - echo "
    MODIFICAR UNA ENTRADA EN LOS GRUPOS DE USUARIOS\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - 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"; + echo "Usted no está autorizado a editar su grupo de usuarios propia\n"; + exit; } else { - echo " "; - echo " "; - echo " "; - } + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_refrescar=1; + } + echo "
    Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
    Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
    FuerzaReloj de tiempo inicio de sesión: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Cambio de título ejecutivo: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campañas Permitidas:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; - echo "$campaigns_list
     "; - echo "
    Grupo de cambios:
    $NWB#vicidial_user_groups-group_shifts$NWE
    \n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " $shift_id_value - $shift_name_value
    \n"; - $o++; - } - echo "
     
    Estado del agente visible Grupos:
    $NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
    \n"; - echo "ALL-GROUPS - All user groups in the system
    \n"; - echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; - 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 order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo " $vgroups_id_value - $vgroups_name_value
    \n"; - $o++; - } - echo "
     
    Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Agent Call Log View: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agent Allow Consultative Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial Override Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Buzón de Voz Message Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Blind Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial With Customer Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Park Customer Dial Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Allowed Informes: $NWB#vicidial_user_groups-allowed_reports$NWE
    Webphone URL Override: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone System Key Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    \n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
    \n"; - echo "
    USUARIOS DENTRO DE ESTE GRUPO DE USUARIO: $users_to_print
    \n"; - echo "
    \n"; + echo ""; - if ($SSqc_features_active > 0) - { - echo "
    CC permitidas Campañas:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; - echo "$qc_campaigns_list"; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + echo "
    MODIFICAR UNA ENTRADA EN LOS GRUPOS DE USUARIOS\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
    Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
    Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
    FuerzaReloj de tiempo inicio de sesión: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Cambio de título ejecutivo: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campañas Permitidas:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; + echo "$campaigns_list
     "; + echo "
    Grupo de cambios:
    $NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
    \n"; + $o++; + } echo "
     
    CC permitidas entrantes Grupos:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; - echo "$qc_groups_list"; + + + echo "
    Estado del agente visible Grupos:
    $NWB#vicidial_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 - Todos los usuarios en el sistema, ni siquiera los usuarios registrados
    \n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } echo "
     
    \n"; + echo "
    Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Llamar Ver registro: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agente Permitir Reenviar Consultivo: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Permitir Reenviar Dial de anulación: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    \n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
    USERNOMBRE COMPLETONIVELACTIVO
    Agente Permitir Reenviar correo de voz de mensajes: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Permitir Reenviar Ciegos: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Permitir Dial Con Reenviar Cliente: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Permitir al cliente Agente Parque Reenviar Dial: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente de Pantalla Completa: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Informes de animales: $NWB#vicidial_user_groups-allowed_reports$NWE
    Anulación de URL Webphone: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone sistema de llave de anulación: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone teclado de marcación de anulación: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    $rowx[0]$rowx[1]$rowx[2]$rowx[3]

    \n"; + if ($SSqc_features_active > 0) + { + echo "
    CC permitidas Campañas:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; + echo "$qc_campaigns_list"; + echo "
     
    CC permitidas entrantes Grupos:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; + echo "$qc_groups_list"; + echo "
     
    Se admiten grupos de usuarios:
    $NWB#vicidial_user_groups-admin_viewable_groups$NWE
    \n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
    \n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

    SUPRIMA A ESTE GRUPO DE USUARIO\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Haga clic aquí para ver Admin chages a este grupo de usuarios\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } + echo "
     
    Se admiten Tiempo de Llamadas:
    $NWB#vicidial_user_groups-admin_viewable_call_times$NWE
    \n"; + echo "ALL-CALLTIMES - Todos los horarios de llamadas en el sistema
    \n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
    \n"; + echo "
    USUARIOS DENTRO DE ESTE GRUPO DE USUARIO: $users_to_print
    \n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    USERNOMBRE COMPLETONIVELACTIVO
    $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 "
    En Agregar o quitar-grupo seleccionado para Usuarios activos en este grupo de usuarios
    \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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Grupo:
    \n"; + echo "
    \n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

    Haga clic aquí para ver todas las CallBack Posee en este grupo de usuarios

    \n"; + echo "

    Haga clic aquí para ver elReloj de tiempo Estado para este grupo de usuarios

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

    SUPRIMA A ESTE GRUPO DE USUARIO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Haga clic aquí para ver los cambios de administrador para este grupo de usuarios\n"; + } } } else @@ -23472,32 +27439,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFIQUE Una ESCRITURA
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Identificación De la Escritura:: $script_id$NWB#vicidial_scripts-script_name$NWE
    Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
    Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_scripts-user_group$NWE
    Activo: $NWB#vicidial_scripts-active$NWE
    Texto de la escritura:

    Escritura De la Inspección previo
    "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -23573,7 +27556,7 @@ if ($ADD==3111111) echo "


    \n"; - echo " CAMPAÑAS USING THIS SCRIPT:
    \n"; + echo " CAMPAÑAS uso de este script:
    \n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; @@ -23588,10 +27571,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " EN-GROUPOS USING THIS SCRIPT:
    \n"; + echo " EN LOS GRUPOS uso de este script:
    \n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -23603,7 +27586,7 @@ if ($ADD==3111111) } echo "


    \n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; + echo " Invalida LISTA uso de este script:
    \n"; echo "\n"; $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; @@ -23617,17 +27600,15 @@ if ($ADD==3111111) $o++; } - echo "
    \n"; - - if ($LOGdelete_scripts > 0) { echo "

    SUPRIMA ESTA ESCRITURA\n"; } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a este script
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para esta secuencia de comandos
    \n"; } + } else { @@ -23645,24 +27626,36 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFIQUE Un FILTRO\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Identificación Del Filtro:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
    Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_lead_filters-user_group$NWE
    Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -23697,7 +27690,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages al administrador de este filtro
    \n"; + echo "

    Haga clic aquí para ver los cambios de administrador para este filtro
    \n"; } } else @@ -23716,6 +27709,11 @@ if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -23761,10 +27759,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -23794,6 +27797,7 @@ if ($ADD==311111111) $thursday_afterhours_filename_override = $row[25]; $friday_afterhours_filename_override = $row[26]; $saturday_afterhours_filename_override = $row[27]; + $user_group = $row[28]; echo ""; @@ -23801,9 +27805,14 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -23841,10 +27850,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -23882,10 +27891,10 @@ if ($ADD==311111111) } echo "
    Identificación Del Tiempo De la Llamada: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_call_times-user_group$NWE
    Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    \n"; - echo "Entrantes GROUPS USING THIS CALL TIME:
    \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';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -23905,7 +27914,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a este tiempo de atención\n"; + echo "

    Haga clic aquí para ver los cambios admin to this call time\n"; } } else @@ -23924,10 +27933,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_refrescar=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -23949,6 +27963,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -23956,10 +27971,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -23974,7 +27994,7 @@ if ($ADD==3111111111) echo "TIEMPOS DE LA LLAMADA USANDO ESTE TIEMPO DE LA LLAMADA DEL ESTADO:
    \n"; echo "
    Identificación Del Tiempo De la Llamada: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
    _ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
    Grupo de usuarios de administración: $NWB#vicidial_call_times-user_group$NWE
    Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE
    Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
    \n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -24006,18 +28026,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -24047,6 +28075,10 @@ if ($ADD==331111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -24074,6 +28106,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Sábado
    \n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    Cambio ID:$shift_id
    Cambio de nombre: (breve descripción del cambio)$NWB#vicidial_shifts-shift_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_shifts-user_group$NWE
    Cambio Hora de inicio:\n"; echo "   Cambio Hora de finalización:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Informe Opción: $NWB#vicidial_shifts-report_option$NWE
    Informe Rango:$NWB#vicidial_shifts-report_rank$NWE
    \n"; @@ -24081,7 +28124,7 @@ if ($ADD==331111111) echo "GRUPOS DE USUARIOS DE UTILIZAR ESTE CAMBIO:
    \n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -24101,7 +28144,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a este cambio\n"; + echo "

    Haga clic aquí para ver los cambios admin to this shift\n"; } } else @@ -24118,12 +28161,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_refrescar=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24135,10 +28183,14 @@ if ($ADD==31111111111) echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24165,6 +28236,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24181,8 +28253,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -24200,8 +28272,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24218,7 +28290,7 @@ if ($ADD==31111111111) echo "\n"; echo "
    Extensión del teléfono: $NWB#phones-extension$NWE (Agent Screen Conexión Del Teléfono)
    Teléfono Extensión:$NWB#phones-extension$NWE
    Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
    Caja de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
    CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
    Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
    IP Del Servidor: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Login Contraseña: $NWB#phones-pass$NWE
    Registro Contraseña: $NWB#phones-conf_secret$NWE     Strength:
    Set As Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Use External IP Del Servidor: $NWB#phones-use_external_server_ip$NWE
    Agente de sesión de pantalla: $NWB#phones-login$NWE
    Inicio de sesión Contraseña: $NWB#phones-pass$NWE
    Registro Contraseña: $NWB#phones-conf_secret$NWE     Fuerza:
    Establecer como Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Webphone Respuesta automática: $NWB#phones-webphone_auto_answer$NWE
    Use IP del servidor externo: $NWB#phones-use_external_server_ip$NWE
    Estado: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del Teléfono: $NWB#phones-phone_type$NWE
    Nombre Completo: $NWB#phones-fullname$NWE
    Correo electrónico: $NWB#phones-email$NWE
    Eliminar correo de voz después del email: $NWB#phones-delete_vm_after_email$NWE
    Correo de voz Zona: $NWB#phones-voicemail_timezone$NWE
    Opciones de correo de voz: $NWB#phones-voicemail_options$NWE
    Compañía: $NWB#phones-company$NWE
    Foto: $NWB#phones-picture$NWE
    Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
    Protocolo Del Cliente: $NWB#phones-protocol$NWE
    GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    Teléfono Anillo de tiempo de espera: $NWB#phones-phone_ring_timeout$NWE
    Con el teléfono colgado del Agente: $NWB#phones-on_hook_agent$NWE
    Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
    Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
    Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
    Contexto De Exten: $NWB#phones-ext_context$NWE
    Teléfono Contexto: $NWB#phones-phone_context$NWE
    Allowed Codecs: $NWB#phones-codecs_list$NWE
    Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE
    Codecs animales: $NWB#phones-codecs_list$NWE
    Códecs de animales con plantilla: $NWB#phones-codecs_with_template$NWE
    Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
    Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
    Colas permitidas: $NWB#phones-QUEUE_ACTION_enabled$NWE
    Ventana emergente del CallerID: $NWB#phones-CallerID_popup_enabled$NWE
    Botón Vmail: $NWB#phones-voicemail_button_enabled$NWE
    Refresco rápido: $NWB#phones-enable_fast_refresh$NWE
    Refresco rápido de la tarifa: (in ms)$NWB#phones-fast_refresh_rate$NWE
    Refresco rápido: $NWB#phones-enable_fast_refrescar$NWE
    Refresco rápido de la tarifa: (in ms)$NWB#phones-fast_refrescar_rate$NWE
    Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
    Auto Marcar el Siguiente Número: $NWB#phones-auto_dial_next_number$NWE
    Parar de Grabar después de cada llamada: $NWB#phones-VDstop_rec_after_each_call$NWE
    Puerto de DBY: (Secundario DB Port)$NWB#phones-DBY_port$NWE
    ID de plantilla:
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24280,7 +28357,11 @@ if ($ADD==32111111111) 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 Nombre: $NWB#phones-alias_name$NWE
    Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    Móviles Logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; @@ -24293,15 +28374,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -24319,7 +28401,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages alias para este teléfono\n"; + echo "

    Haga clic aquí para ver los cambios admin to this phone alias\n"; } } else @@ -24336,12 +28418,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_refrescar=1; + } echo "
    LOGINEXTENSIÓNSERVERPROTOCOLIP
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24351,6 +28438,10 @@ if ($ADD==33111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24364,7 +28455,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a este grupo, alias\n"; + echo "

    Haga clic aquí para ver los cambios admin to this group alias\n"; } } else @@ -24383,10 +28474,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "
    Alias ID Grupo: $row[0] $NWB#phones-group_alias_id$NWE
    Grupo Alias Nombre: $NWB#phones-group_alias_name$NWE
    Grupo de usuarios de administración: $NWB#phones-user_group$NWE
    Número CallerID: $NWB#phones-caller_id_number$NWE
    Nombre CallerID: $NWB#phones-caller_id_name$NWE
    Activo:
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -24462,7 +28564,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24473,7 +28575,8 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24484,11 +28587,11 @@ if ($ADD==311111111111) if ($SSallow_custom_dialplan > 0) { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } @@ -24502,7 +28605,7 @@ if ($ADD==311111111111) 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -24430,6 +28526,8 @@ if ($ADD==311111111111) $conf_secret = $row[38]; $external_server_ip = $row[39]; $custom_dialplan_entry = $row[40]; + $active_twin_server_ip = $row[41]; + $user_group = $row[42]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -24448,6 +28546,10 @@ if ($ADD==311111111111) echo "
    Sistema de carga: $sysload - $cpu%   $NWB#servers-sysload$NWE
    Canales en vivo: $channels_total   $NWB#servers-channels_total$NWE
    Uso del disco: $disk_usage   $NWB#servers-disk_usage$NWE
    Grupo de usuarios de administración: $NWB#servers-user_group$NWE
    Versión De Asterisk: $NWB#servers-asterisk_version$NWE
    Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
    Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE     Strength:
    Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE     Fuerza:
    GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
    Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
    Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
    Portador de registro activo: $NWB#servers-carrier_logging_active$NWE
    Grabación de Enlace Web: $NWB#servers-recording_web_link$NWE
    Alternate Recording IP Del Servidor: $NWB#servers-alt_server_ip$NWE
    External IP Del Servidor: $NWB#servers-external_server_ip$NWE
    IP del servidor externo: $NWB#servers-external_server_ip$NWE
    IP del servidor de Activo doble: $NWB#servers-active_twin_server_ip$NWE
    Activa del servidor de Asterisk: $NWB#servers-active_asterisk_server$NWE
    Activo Server Agent: $NWB#servers-active_agent_login_server$NWE
    Generar los archivos de configuración: $NWB#servers-generate_vicidial_conf$NWE
    Custom Dialplan Entrada: $NWB#servers-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada: $NWB#servers-custom_dialplan_entry$NWE
    Custom Dialplan Entrada: Disabled $NWB#servers-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -24549,7 +28652,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24581,7 +28684,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24679,7 +28782,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver Admin chages a este servidor\n"; + echo "

    Haga clic aquí para ver los cambios admin to this server\n"; } } else @@ -24698,15 +28801,21 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_refrescar=1; + } echo "
    CAMPAÑA TRONCOS RESTRICCIÓN DELETE
    \n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; + $user_group = $row[3]; echo "
    MODIFICAR UN REGISTRO CONF PLANTILLA: $row[0]
    \n"; echo "\n"; @@ -24715,6 +28824,10 @@ if ($ADD==331111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Plantilla ID: $template_id
    Nombre de plantilla: $NWB#vicidial_conf_templates-template_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_conf_templates-user_group$NWE
    Plantilla de contenidos: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -24729,7 +28842,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24760,7 +28873,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24791,7 +28904,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver a esta Administración chages conf plantilla
    \n"; + echo "

    Haga clic aquí para ver los cambios admin to this conf template\n"; } } else @@ -24808,12 +28921,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; 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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -24827,6 +28945,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
    MODIFICAR UN REGISTRO DE TRANSPORTISTA: $row[0]\n"; echo "\n"; @@ -24836,10 +28955,14 @@ if ($ADD==341111111111) echo "
    Portador de Identificación: $carrier_id
    Transportista Nombre: $NWB#vicidial_server_carriers-carrier_name$NWE
    Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
    Grupo de usuarios de administración: $NWB#vicidial_server_carriers-user_group$NWE
    Cadena de registro: $NWB#vicidial_server_carriers-registration_string$NWE
    ID de plantilla: \n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -24928,7 +29062,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages Admin a esta entrada a TTS\n"; + echo "

    Haga clic aquí para ver los cambios admin to this TTS entry\n"; } } else @@ -24945,18 +29079,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; @@ -24905,6 +29033,7 @@ if ($ADD==351111111111) $active = $row[2]; $tts_text = $row[3]; $tts_voice = $row[4]; + $user_group = $row[5]; echo "
    TTS MODIFICAR UN RECORD: $tts_id\n"; echo "\n"; @@ -24914,7 +29043,12 @@ if ($ADD==351111111111) echo "
    TTS ID: $tts_id
    Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
    Activo: $NWB#vicidial_tts_prompts-active$NWE
    TTS Voice: $NWB#vicidial_tts_prompts-tts_voice$NWE
    Grupo de usuarios de administración: $NWB#vicidial_tts_prompts-user_group$NWE
    TTS Voz: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Texto: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -24965,6 +29105,12 @@ if ($ADD==361111111111) echo "
    \n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -25006,7 +29152,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages de administración para esta música en espera de entrada\n"; + echo "

    Haga clic aquí para ver los cambios admin to this Música en espera entry\n"; } } else @@ -25023,12 +29169,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_refrescar=1; + } echo "
    Música en espera de identificación: $moh_id
    Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
    Grupo de usuarios de administración: $NWB#vicidial_music_on_hold-user_group$NWE
    Activo: $NWB#vicidial_music_on_hold-active$NWE
    Orden aleatorio: $NWB#vicidial_music_on_hold-random$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -25064,7 +29240,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages de administración para esta casilla de correo de voz\n"; + echo "

    Haga clic aquí para ver los cambios admin to this voicemail box\n"; } } else @@ -25075,6 +29251,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_refrescar=1; + } + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -25039,6 +29190,9 @@ if ($ADD==371111111111) $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]; echo "
    MODIFICAR UN contestador: $tts_id\n"; echo "\n"; @@ -25050,7 +29204,29 @@ if ($ADD==371111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Correo electrónico:$NWB#vicidial_voicemail-email$NWE
    Activo: $NWB#vicidial_voicemail-active$NWE
    Grupo de usuarios de administración: $NWB#vicidial_voicemail-user_group$NWE
    Eliminar correo de voz después del email: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
    Correo de voz Zona: $NWB#vicidial_voicemail-voicemail_timezone$NWE
    Opciones de correo de voz: $NWB#vicidial_voicemail-voicemail_options$NWE
    Mensajes Nuevos: $messages
    Mensajes Viejos: $old_messages
    \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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $user_group = $row[23]; + + echo "
    Modificar la etiqueta PANTALLA: $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#vicidial_screen_labels-label_name$NWE
    Activo: $NWB#vicidial_screen_labels-active$NWE
    Grupo de usuarios de administración: $NWB#vicidial_screen_labels-user_group$NWE
    Ocultar etiqueta en los registros de llamadas: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
    Etiqueta del título: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Nombre: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta inicial del segundo nombre: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Apellido: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Dirección1: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de Dirección 2: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Dirección3: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de la Ciudad: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Sello del Estado: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Provincia: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Código postal: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Vendedor de etiquetas de código de plomo: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de Género: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de número de teléfono: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de código de teléfono: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de teléfono Alt: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta Frase de Seguridad: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etiqueta de correo electrónico: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Comentarios de etiquetas: $NWB#vicidial_screen_labels-default_field_labels$NWE
    \n"; + + echo "
    \n"; + + + echo "


    \n"; + echo " Las campañas que usan ESTA ETIQUETA DE PANTALLA:
    \n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
    $row[0] $row[1]


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

    BORRAR LA ETIQUETA DE PANTALLA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Haga clic aquí para ver los cambios de administrador para esta etiqueta de pantalla
    \n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + + +###################### +# ADD=391111111111 modify contact in the system +###################### +if ($ADD==391111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) + { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_refrescar=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_query($stmt, $linkALT); + $row=mysql_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 "
    MODIFICAR CONTACTO: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
    Nombre: $NWB#contact_information$NWE
    Apellidos: $NWB#contact_information$NWE
    Número de la oficina: $NWB#contact_information$NWE
    Número de la célula: $NWB#contact_information$NWE
    Otro número 1: $NWB#contact_information$NWE
    Otro número 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Grupo: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; + + echo "
    \n"; + + if ($LOGast_delete_phones > 0) + { + echo "

    Eliminar este contacto\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Haga clic aquí para ver los cambios de administrador para este contacto\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -25083,6 +29476,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "\n"; echo "\n"; +echo "
    \n"; echo ""; @@ -25129,6 +29527,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_refrescar=1; + } echo "\n"; + + } -echo "\n"; - - -} - echo "
    \n"; echo ""; @@ -25176,10 +29579,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_refrescar=1; + } 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"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + + echo "\n"; + + 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"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -25504,13 +30053,16 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; - echo "\n"; echo "\n"; - + echo "\n"; + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -25264,7 +29725,29 @@ if ($ADD==311111111111111) $default_phone_registration_password = $row[79]; $default_phone_login_password = $row[80]; $default_server_password = $row[81]; - + $admin_modify_refrescar = $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]; echo "
    MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL\n"; echo "\n"; @@ -25275,6 +29758,10 @@ if ($ADD==311111111111111) echo "
    DB Schema Update Date: $db_schema_update_date
    Auto Usuario-add Value: $auto_user_add_value
    Fecha de instalación: $install_date
    Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
    Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
    Uso No-Latino: $NWB#settings-use_non_latin$NWE
    Webroot Escribible: $NWB#settings-webroot_writable$NWE
    El Agente de VICIDIAL Inhabilita La Exhibición:$NWB#settings-vicidial_agent_disable$NWE
    Permita Los Mensajes de SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
    URL Casero Del Admin: $NWB#settings-admin_home_url$NWE
    Admin modifica Auto-actualización: $NWB#settings-admin_modify_refrescar$NWE
    Administración de No-Cache: $NWB#settings-nocache_admin$NWE
    Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
    Enable Agent Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
    Habilitar el archivo de registro del Agente Disposición: $NWB#settings-enable_agc_dispo_log$NWE
    Reloj de tiempo Fin de Día:$NWB#settings-timeclock_end_of_day$NWE
    Local por omisión GMT: (No ajustar para el DST)$NWB#settings-default_local_gmt$NWE
    Zona de correo de voz por defecto: $NWB#settings-default_voicemail_timezone$NWE
    Agentes de Llamadas Restablecer: $NWB#settings-agents_calls_reset$NWE
    ÚltimaReloj de tiempo Auto Desconexión: $timeclock_last_reset_date
    Agente de la pantalla de encabezado Formato de fecha:
    Central de control de sonido activo: $NWB#settings-sounds_central_control_active$NWE
    Sonidos de servidor Web: $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
    Directorio Web de administración: $NWB#settings-admin_web_directory$NWE
    Servidor de correo de voz activo:
    Permitir Custom Dialplan entradas: $NWB#settings-allow_custom_dialplan$NWE
    PLLB límite Agrupación: $NWB#settings-pllb_grouping_limit$NWE
    Generar entre servidores Extensiones de teléfono: $NWB#settings-generate_cross_server_exten$NWE
    Territorios de usuario de Activo: $NWB#settings-user_territories_active$NWE
    Formulario de Asistencia Segunda Habilitar: $NWB#settings-enable_second_webform$NWE
    Habilitar TTS Integración: $NWB#settings-enable_tts_integration$NWE
    Enable CallCard: $NWB#settings-callcard_enabled$NWE
    Habilitar CallCard: $NWB#settings-callcard_enabled$NWE
    Enable Custom List Fields: $NWB#settings-custom_fields_enabled$NWE
    Habilitar Lista de campos personalizados: $NWB#settings-custom_fields_enabled$NWE
    First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Habilitar llamadas campaña de pruebas: $NWB#settings-test_campaign_calls$NWE
    Default Phone Registro Contraseña: $NWB#settings-default_phone_registration_password$NWE     Strength:
    Habilitar Estadísticas ampliados Lista: $NWB#settings-expanded_list_stats$NWE
    Default Conexión Del Teléfono Contraseña: $NWB#settings-default_phone_login_password$NWE     Strength:
    Habilitar Areacode Campaña CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
    Default Server Contraseña: $NWB#settings-default_server_password$NWE     Strength:
    Habilitar remoto anula Agente de Extensión: $NWB#settings-did_ra_extensions_enabled$NWE
    Slave Database Server: $NWB#settings-slave_db_server$NWE
    Enable Contacts: $NWB#settings-contacts_enabled$NWE
    Informes to use Slave DB:
    Primera sesión de disparo: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Teléfono predeterminado Registro Contraseña: $NWB#settings-default_phone_registration_password$NWE     Fuerza:
    Teléfono predeterminado Login: $NWB#settings-default_phone_login_password$NWE     Fuerza:
    Contraseña por defecto del servidor: $NWB#settings-default_server_password$NWE     Fuerza:
    Esclavo del servidor de base de datos: $NWB#settings-slave_db_server$NWE
    Informes de utilizar DB Esclavo:
    Custom Dialplan Entrada: $NWB#settings-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada: $NWB#settings-custom_dialplan_entry$NWE
    Actualizar Dialplan En los servidores: $NWB#settings-reload_dialplan_on_servers$NWE
    Custom Dialplan Entrada: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Entrada Dialplan personalizada: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Ocultar etiqueta en los registros de llamadas: $NWB#settings-label_hide_field_logs$NWE
    Label Title: $NWB#settings-default_field_labels$NWE
    Etiqueta del título: $NWB#settings-default_field_labels$NWE
    Label Nombre: $NWB#settings-default_field_labels$NWE
    Etiqueta Nombre: $NWB#settings-default_field_labels$NWE
    Label Inicial Media: $NWB#settings-default_field_labels$NWE
    Etiqueta inicial del segundo nombre: $NWB#settings-default_field_labels$NWE
    Label Apellidos: $NWB#settings-default_field_labels$NWE
    Etiqueta Apellido: $NWB#settings-default_field_labels$NWE
    Label Address1: $NWB#settings-default_field_labels$NWE
    Etiqueta Dirección1: $NWB#settings-default_field_labels$NWE
    Label Address2: $NWB#settings-default_field_labels$NWE
    Etiqueta de Dirección 2: $NWB#settings-default_field_labels$NWE
    Label Address3: $NWB#settings-default_field_labels$NWE
    Etiqueta Dirección3: $NWB#settings-default_field_labels$NWE
    Label Ciudad: $NWB#settings-default_field_labels$NWE
    Etiqueta de la Ciudad: $NWB#settings-default_field_labels$NWE
    Label State: $NWB#settings-default_field_labels$NWE
    Sello del Estado: $NWB#settings-default_field_labels$NWE
    Label Provincia: $NWB#settings-default_field_labels$NWE
    Etiqueta Provincia: $NWB#settings-default_field_labels$NWE
    Label Código Postal: $NWB#settings-default_field_labels$NWE
    Etiqueta Código postal: $NWB#settings-default_field_labels$NWE
    Label Vendor Lead Code: $NWB#settings-default_field_labels$NWE
    Vendedor de etiquetas de código de plomo: $NWB#settings-default_field_labels$NWE
    Label Sexo: $NWB#settings-default_field_labels$NWE
    Etiqueta de Género: $NWB#settings-default_field_labels$NWE
    Label Número De Teléfono: $NWB#settings-default_field_labels$NWE
    Etiqueta de número de teléfono: $NWB#settings-default_field_labels$NWE
    Label Phone Code: $NWB#settings-default_field_labels$NWE
    Etiqueta de código de teléfono: $NWB#settings-default_field_labels$NWE
    Label Alt Phone: $NWB#settings-default_field_labels$NWE
    Etiqueta de teléfono Alt: $NWB#settings-default_field_labels$NWE
    Label Frase De Seguridad: $NWB#settings-default_field_labels$NWE
    Etiqueta Frase de Seguridad: $NWB#settings-default_field_labels$NWE
    Label Correo electrónico:$NWB#settings-default_field_labels$NWE
    Etiqueta de correo electrónico: $NWB#settings-default_field_labels$NWE
    Label Comentarios: $NWB#settings-default_field_labels$NWE
    Comentarios de etiquetas: $NWB#settings-default_field_labels$NWE
    CC Características Activo: $NWB#settings-qc_features_active$NWE
    Tire de CC Última Hora: $qc_last_pull_time
    Default Codecs: $NWB#settings-default_codecs$NWE
    Default Webphone: $NWB#settings-default_webphone$NWE
    Default External IP Del Servidor: $NWB#settings-default_external_server_ip$NWE
    Webphone URL: $NWB#settings-webphone_url$NWE
    Webphone System Key: $NWB#settings-webphone_systemkey$NWE
    Códecs predeterminados: $NWB#settings-default_codecs$NWE
    Predeterminado Webphone: $NWB#settings-default_webphone$NWE
    IP por defecto del servidor externo: $NWB#settings-default_external_server_ip$NWE
    URL del web phone: $NWB#settings-webphone_url$NWE
    Webphone clave del sistema: $NWB#settings-webphone_systemkey$NWE
    Si no hay respuesta Conectarse: $NWB#settings-noanswer_log$NWE
    DID registro de agentes: $NWB#settings-did_agent_log$NWE
    Alt-Log DB del servidor: $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 Contraseña: $NWB#settings-alt_log_server_ip$NWE
    Registro de Alt-Tablas: $NWB#settings-tables_use_alt_log_db$NWE
    Permita La Registración De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
    IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
    QueueMetrics Login-Out:
    QueueMetrics sesión de salida: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallEstado: $NWB#settings-queuemetrics_callstatus$NWE
    QueueMetrics Addmember Activado: $NWB#settings-queuemetrics_addmember_enabled$NWE
    QueueMetrics dispo Código Pausa: $NWB#settings-queuemetrics_dispo_pause$NWE
    Teléfono Teléfono QueueMetrics Medio Ambiente Anexar: $NWB#settings-queuemetrics_pe_phone_append$NWE
    Habilitar Vtiger Integración: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Haga clic aquí para sincronizar los usuarios con Vtiger\n"; @@ -25527,7 +30079,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Haga clic aquí para ver chages a la administración de la configuración del sistema\n"; + echo "

    Haga clic aquí para ver los cambios admin to the system settings\n"; } } else @@ -25548,15 +30100,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_refrescar=1; + } echo "
    \n"; echo ""; echo "
    \n"; echo "ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:  $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -25573,8 +30142,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -25595,15 +30163,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -25631,14 +30197,16 @@ if ($ADD==321111111111111) echo "
    AGREGUE EL NUEVO ESTADO DE SISTEMA
    \n"; echo "\n"; echo "Estado:   \n"; - echo "Descripción:
    \n"; + echo "Descripción:   \n"; echo "Seleccionable:   \n"; - echo "Respuesta humana:   \n"; + echo "Respuesta humana:
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoría:\n"; echo "
    ESTADODESCRIPCIÓNSELECT-
    ABLE
    HUMANOS
    RESPUESTA
    CATEGORÍAMODIFY/DELETE
    S
    T
    A
    T
    U
    S
    DESCRIPCIÓNCATEGORÍA
    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 "\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])) @@ -25614,15 +30189,6 @@ if ($ADD==321111111111111) { echo "ELIMINAR\n"; } - - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
    \n"; echo ""; @@ -25710,7 +30283,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -25774,6 +30347,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_refrescar > 1) and ($modify_refrescar_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_refrescar=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -25862,7 +30440,7 @@ if ($ADD==550) echo "
    Nivel Del Usuario:
    Grupo Del Usuario: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -26219,6 +30801,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -26243,6 +30826,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -26250,6 +30834,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -26266,7 +30852,7 @@ if ($ADD==100) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -26199,6 +30780,7 @@ if ($ADD==10) echo "ID de campaña
    NOMBRE
    ACTIVE   GROUP   DIAL MÉTODO  
    $row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -26333,7 +30919,7 @@ if ($ADD==1000) echo "
    ID DE LA LISTANOMBRE DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNRTIMEENCABEZA COUNT
    "; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -26361,6 +30948,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26379,17 +30967,18 @@ if ($ADD==1300) echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -26344,6 +30930,7 @@ if ($ADD==1000) echo "NOMBREPRIORIDADACTIVOGRUPO DE ADMINTIMECOLORMODIFICAR $row[1] $row[2] $row[3] $row[6] $row[4]  MODIFICAR
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); - echo "
    Entrantes DID LISTINGS:\n"; + echo "
    INBOUND DID LISTINGS:\n"; echo "
    \n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26407,6 +30996,7 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26425,7 +31015,7 @@ if ($ADD==1500) echo "
    #DIDDESCRIPCIÓNACTIVOGRUPO DE ADMINROUTERECMODIFICAR $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -26450,6 +31041,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -26465,6 +31057,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -26484,16 +31077,17 @@ if ($ADD==1700) echo "
    \n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -26434,6 +31024,7 @@ if ($ADD==1500) echo "
    MENU IDNOMBREGROUPPROMPTTIMEOUTOPTIONS
    $menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
    \n"; echo ""; - $stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id group by filter_phone_group_id order by filter_phone_group_id"; + $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_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); - echo "
    FILTER PHONE GROUP LISTINGS:\n"; + echo "
    Filtrar los resultados del grupo de teléfono:\n"; echo "
    \n"; echo ""; echo ""; echo ""; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -26510,13 +31104,14 @@ if ($ADD==1700) 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 from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') order by filter_phone_group_id;"; + $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_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -26530,6 +31125,7 @@ if ($ADD==1700) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; $o++; @@ -26547,7 +31143,28 @@ if ($ADD==10000) echo "
    FPG IDFPG NAMEDESCRIPCIÓNGRUPO DE ADMINPHONES COUNTMODIFICAR
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFICAR
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFICAR
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -26594,11 +31211,11 @@ 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 order by extension_group_id,rank,extension"; + $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_query($stmt, $link); $extensiongroups_to_print = mysql_num_rows($rslt); - echo "
    EXTENSION GROUP LISTINGS:\n"; + echo "
    LISTADOS DE EXTENSIÓN DEL GRUPO:\n"; echo "
    \n"; echo ""; echo ""; @@ -26641,7 +31258,7 @@ if ($ADD==100000) echo "
    GROUP
    \n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -26680,7 +31297,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26703,6 +31321,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26719,7 +31338,7 @@ if ($ADD==10000000) echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -26690,6 +31307,7 @@ if ($ADD==1000000) echo "GUIÓN IDGUIÓN NOMBREACTIVE   GRUPO DE ADMIN   MODIFICAR
    $row[0] $row[1] $row[2] $row[3]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26740,6 +31360,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26756,7 +31377,10 @@ if ($ADD==100000000) echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -26728,6 +31347,7 @@ if ($ADD==10000000) echo "
    FILTER IDFILTER NAMEGRUPO DE ADMINMODIFICAR
    $row[0] $row[1] $row[2]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26781,6 +31406,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26796,7 +31422,7 @@ if ($ADD==1000000000) echo "
    \n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -26767,6 +31391,7 @@ if ($ADD==100000000) echo "CALLTIME NOMBREPREDETERM PRINCIPIOPREDETERM STOPGRUPO DE ADMINMODIFICAR
    $row[1] $row[2] $row[3] $row[4] MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26823,6 +31450,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26838,7 +31466,7 @@ if ($ADD==130000000) echo "
    \n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -26808,6 +31434,7 @@ if ($ADD==1000000000) echo "CALLTIME NOMBREPREDETERM PRINCIPIOPREDETERM STOPGRUPO DE ADMINMODIFICAR
    $row[2] $row[3] $row[4] $row[5] MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26865,6 +31494,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26893,7 +31523,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -26907,6 +31537,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26925,7 +31556,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -26941,7 +31573,7 @@ if ($ADD==12000000000) echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -26850,6 +31478,7 @@ if ($ADD==130000000) echo "MAYÚS PRINCIPIODURACIÓN SHIFTSEMANALGRUPO DE ADMINMODIFICAR
    $row[2] $row[3] $row[4] $row[5] MODIFICAR
    ESTADONOMBREVMAILGROUPENLACES
    $row[5] $row[6] $row[7]$row[8]$row[8]$row[9]MODIFICAR | ESTADÍSTICAS
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26964,6 +31597,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26979,7 +31613,7 @@ if ($ADD==13000000000) echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -26951,6 +31583,7 @@ if ($ADD==12000000000) echo "ALIAS IDNOMBRE ALIASTELÉFONO LISTA LoginsGROUPMODIFICAR
    $row[0]$row[1]$row[2]$row[3]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27006,6 +31641,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27021,7 +31657,7 @@ if ($ADD==100000000000) echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -26991,6 +31625,7 @@ if ($ADD==13000000000) echo "CID NÚMERONOMBRE DEL CIDACTIVOGRUPO DE ADMINMODIFICAR
    $row[2]$row[3]$row[4]$row[5]MODIFICAR
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -27067,7 +31703,7 @@ if ($ADD==130000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27088,6 +31725,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27103,7 +31741,7 @@ if ($ADD==140000000000) echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); @@ -27076,6 +31712,7 @@ if ($ADD==130000000000) echo "
    ID de plantillaNombre de plantillaGRUPO DE ADMINMODIFICAR
    $row[0]$row[1]$row[2]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27132,6 +31771,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27148,7 +31788,7 @@ if ($ADD==150000000000) echo "
    \n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -27116,6 +31754,7 @@ if ($ADD==140000000000) echo "ProtocolRegistroActivoGRUPO DE ADMINMODIFICAR
    $row[3]$row[4]$row[5]$row[6]MODIFICAR
    "; echo ""; echo ""; - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27179,6 +31820,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27195,7 +31837,7 @@ if ($ADD==160000000000) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -27158,8 +31798,9 @@ if ($ADD==150000000000) echo "TTS IDNombre TTSActivoTTS VoiceTTS VozTTS TextoGRUPO DE ADMINMODIFICAR
    $row[2]$row[4]$row[3]$row[5]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27224,6 +31867,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27240,7 +31884,7 @@ if ($ADD==170000000000) echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -27206,6 +31848,7 @@ if ($ADD==160000000000) echo "MOH NameActivoOrden aleatorioGRUPO DE ADMINMODIFICAR
    $row[1]$row[2]$row[3]$row[4]MODIFICAR
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27270,6 +31915,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27278,6 +31924,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -27253,6 +31897,7 @@ if ($ADD==170000000000) echo "Mensajes NuevosMensajes ViejosDeleteGRUPO DE ADMINMODIFICAR
    $row[3]$row[4]$row[5]$row[6]MODIFICAR
    "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -277,27 +349,36 @@ else { if (strlen($log_lead_id)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; } if (strlen($log_phone)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; } - + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $rslt=mysql_query("$stmtA", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no outbound calls matching your search criteria

    \n"; + echo "Hay no outbound calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    SALIENTE LOG RESULTS: $results_to_print
    \n"; + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \n"; 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_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
    Las etiquetas de la pantalla del agente:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    LABEL IDNameActivoGRUPO DE ADMINMODIFICAR
    $row[0]$row[1]$row[2]$row[3]MODIFICAR
    \n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27432,6 +32181,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27453,7 +32203,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    NOMBRENúmero de la oficinaBU NameDepartmentGroupJob TitleLocationMODIFICAR
    $row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFICAR
    \n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -27378,7 +32126,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27392,6 +32140,7 @@ if ($ADD==700000000000000) echo "
    SECTIONTYPERECORD IDGROUPDESCRIPCIÓNGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27517,6 +32268,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27540,7 +32292,13 @@ if ($ADD==720000000000000) echo "
    \n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -27462,7 +32212,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27476,6 +32226,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGROUPDESCRIPCIÓNGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27596,6 +32355,7 @@ if ($ADD==720000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27625,7 +32385,8 @@ if ($ADD==730000000000000) echo "
    \n"; echo ""; - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27554,6 +32312,7 @@ if ($ADD==720000000000000) echo "SECTIONTYPERECORD IDGROUPDESCRIPCIÓNGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    "; echo ""; echo "\n"; + echo ""; + echo ""; + echo "\n"; echo ""; echo ""; echo "\n"; @@ -27690,7 +32454,7 @@ if ($ADD==999999) 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27659,6 +32420,9 @@ if ($ADD==730000000000000) echo "DESCRIPTION: $row[7]
    GRUPO DE ADMIN: $row[11]
    NOTES: $row[8]
    "; - echo "\n"; + echo "\n"; } $o=0; @@ -27877,7 +32672,7 @@ if ($ADD==999999) echo "\n"; if ($stage == 'TIME') { - $stmt="select last_update from server_updater where server_ip='$server_ip[$o]';"; + $stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servertime_to_print = mysql_num_rows($rslt); @@ -27908,7 +32703,7 @@ if ($ADD==999999) { echo ""; - $stmt="select NOW();"; + $stmt="SELECT NOW();"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $dbtime_to_print = mysql_num_rows($rslt); @@ -27919,6 +32714,11 @@ if ($ADD==999999) } } 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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -27712,13 +32476,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -27736,7 +32506,7 @@ if ($ADD==999999) echo "Tiempo Real Informes
    \n"; echo "
      \n"; if ( (preg_match("/Tiempo Real Main Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) - {echo "
    • Tiempo Real Main Report\n";} + {echo "
    • Tiempo Real Main Report\n";} # echo "
        Tiempo Real SIP: Listen - Barge\n"; # echo "
        Tiempo Real IAX: Listen - Barge

      \n"; if ( (preg_match("/Tiempo Real Campaña Summary/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) @@ -27747,11 +32517,13 @@ if ($ADD==999999) if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$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 INFORMES/",$LOGallowed_reports)) ) - {echo "
    • Inbound Report by DID\n";} + {echo "
    • Informe de entrada DID\n";} if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
    • Inbound Service Level Report\n";} if ( (preg_match("/Resumen horario de entrada Informe/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
    • Resumen horario de entrada Informe\n";} + if ( (preg_match("/Inbound Daily Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
    • Inbound Daily Report\n";} if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
    • Inbound DID Report\n";} if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) @@ -27759,15 +32531,33 @@ if ($ADD==999999) if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
    • Outbound Calling Report\n";} if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) - {echo "
    • Outbound Summary Interval Report\n";} + {echo "
    • Outbound Summary Interval Report\n";} + if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + echo "
    • Outbound IVR Report"; + if ($LOGexport_reports >= 1) + { + if ( (preg_match("/Pide Informe exportación/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo " - Export";} + } + echo "\n"; + } if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
    • Fronter - Closer Report\n";} if ( (preg_match("/Listas Estados De la Campaña Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) - {echo "
    • Listas Estados De la Campaña Report\n";} + {echo "
    • Listas Estados De la Campaña Report\n";} + if ( (preg_match("/Campaña Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
    • Campaña Status List Report\n";} # echo "
    • AGENTE SPREADSHEET FUNCIONAMIENTO\n"; + if ( ( (preg_match("/Dialer Informe de Inventario/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) and ($inventory_report_count > 0) ) + {echo "
    • Dialer Informe de Inventario\n";} + if ($LOGexport_reports >= 1) { - echo "
    • Pide Informe exportación\n"; + if ( (preg_match("/Pide Informe exportación/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
    • Pide Informe exportación\n";} + if ( (preg_match("/Informe de las exportaciones genera/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
    • Informe de las exportaciones genera\n";} } echo "
    \n"; echo "
    \n"; @@ -27781,6 +32571,8 @@ if ($ADD==999999) {echo "
  • Agent Status Detalle\n";} if ( (preg_match("/Agent Performance Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
  • Agent Performance Detalle\n";} + if ( (preg_match("/Team Performance Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Team Performance Detalle\n";} if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
  • Single Agent Daily\n";} if ( (preg_match("/Estadísticas de usuario/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) @@ -27802,6 +32594,9 @@ if ($ADD==999999) if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) {echo "
  • Server Performance Report\n";} + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Maximum System Stats\n";} + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) { echo "
  • Administration Change Log\n"; @@ -27845,7 +32640,7 @@ if ($ADD==999999) else { echo "
  • SERVIDOR +DESCRIPCIÓNIPACTLOADCHANDISKSALIENTEEntrantes
    DESCRIPCIÓNIPACTLOADCHANDISKOUTBOUNDINBOUND
    $disk
      PHP Time   " . date("Y-m-d H:i:s") . "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) + { + echo "

      Utilidades admin\n"; + } } } else @@ -27955,6 +32755,7 @@ if ($ADD==999998) echo "
  • Servidores \n"; echo "
  • Conferencias \n"; echo "
  • Ajustes Del Sistema \n"; + echo "
  • Las etiquetas de la pantalla del agente \n"; echo "
  • Estados De Sistema\n"; echo "
  • Buzón de Voz \n"; @@ -27971,6 +32772,10 @@ if ($ADD==999998) { echo "
  • CallCard Admin \n"; } + if ($SScontacts_enabled > 0) + { + echo "
  • Contacts \n"; + } echo "\n"; echo "
  •   \n"; @@ -27987,20 +32792,20 @@ if ($ADD==999997) if ($stage=='ENVIAR') { 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);} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |1|" . strlen($pass);} else { - $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysql_num_rows($rslt); if ($userpass_to_print < 1) - {echo "Password has not been changed, please try again |2|$userpass_to_print";} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |2|$userpass_to_print";} else { $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "Password has not been changed, please try again |3|$row[0]";} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |3|$row[0]";} else { $show_form=0; @@ -28012,11 +32817,11 @@ if ($ADD==999997) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUARIOS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGE PASSWORD', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USUARIOS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CAMBIO DE CONTRASEÑA', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "Password has been updated, you may now continue\n"; + echo "La contraseña ha sido actualizada, ahora pueden continuar\n"; } } } @@ -28026,16 +32831,16 @@ if ($ADD==999997) echo "
    \n"; echo ""; - echo "
    CHANGE PASSWORD\n"; + echo "
    CAMBIO DE CONTRASEÑA\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    New Contraseña:     Strength:
    Nueva contraseña:     Fuerza:
    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
    Usted está obligado a cambiar su contraseña antes de poder continuar en la Administración. Una contraseña segura tiene tanto en minúsculas y mayúsculas, así como al menos un número. Su contraseña debe ser de 2 a 20 caracteres de longitud y no puede contener caracteres que no sean letras o números. Asegúrese de que la contraseña es algo que pueda recordar, porque tan pronto como se realice este cambio se le pedirá que introduzca su nueva contraseña para ingresar de nuevo a la Administración
    \n"; @@ -28055,20 +32860,20 @@ if ($ADD==999996) if ($stage=='ENVIAR') { 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);} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |1|" . strlen($pass);} else { - $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysql_num_rows($rslt); if ($userpass_to_print < 1) - {echo "Password has not been changed, please try again |2|$userpass_to_print";} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |2|$userpass_to_print";} else { $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "Password has not been changed, please try again |3|$row[0]";} + {echo "La contraseña no ha cambiado, por favor, inténtalo de nuevo |3|$row[0]";} else { $show_form=0; @@ -28076,14 +32881,16 @@ if ($ADD==999996) if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; $rslt=mysql_query($stmtA, $link); - $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password';"; + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; $rslt=mysql_query($stmtB, $link); $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; @@ -28097,7 +32904,7 @@ if ($ADD==999996) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($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"; + echo "Las contraseñas se han actualizado, ahora se puede continuar en la Administración.

    Es posible que desee comenzar a leer el Manual de Administrador de Vicidial disponible en vicidial.org (hay una versión disponible gratuitamente)\n"; } } } @@ -28107,26 +32914,50 @@ if ($ADD==999996) echo "
    \n"; echo ""; - echo "
    Bienvenido to ViciDial, initial setup screen

    \n"; + echo "
    Bienvenido a Vicidial, pantalla de configuración inicial

    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -28146,27 +32977,215 @@ if ($ADD==999995) 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
    Usted está obligado a cambiar su contraseña antes de poder continuar en la Administración. Una contraseña segura tiene tanto en minúsculas y mayúsculas, así como al menos un número. Su contraseña debe ser de 2 a 20 caracteres de longitud y no puede contener caracteres que no sean letras o números. Asegúrese de que la contraseña es algo que pueda recordar, porque tan pronto como se complete esta pantalla de configuración inicial se le pedirá que introduzca su nueva contraseña de nuevo para volver a iniciar sesión en Administración de
    New Contraseña:     Strength:
    Nueva contraseña:     Fuerza:
     
    The next three default passwords are defined in the Ajustes Del Sistema 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.
    Los próximos tres contraseñas por defecto se definen en la sección de configuración del sistema, y ​​se pueden cambiar después de que los definen aquí. Es una buena idea hacer estas contraseñas fuertes para que no se puede cortar en sus cuentas de teléfono y hacer llamadas telefónicas sin que usted lo sepa. La contraseña de registro predeterminado que se utiliza cuando los teléfonos nuevos se añaden al sistema como el SIP o IAX contraseña del teléfono VOIP. El teléfono web por defecto la contraseña de inicio de sesión utiliza cuando los teléfonos nuevos se añaden al sistema, como la contraseña del teléfono que un agente se utiliza en la interfaz del agente Vicidial. La contraseña del servidor predeterminado que se utiliza cuando los servidores se añaden al sistema para que los servidores se comunican entre sí.
    Default Phone Registro Contraseña:     Strength:
    Teléfono predeterminado Registro Contraseña:     Fuerza:
    Default Conexión Del Teléfono Contraseña:     Strength:
    Teléfono predeterminado Login:     Fuerza:
    Default Server Contraseña:     Strength:
    Contraseña por defecto del servidor:     Fuerza:
     
    Las siguientes dos opciones se han definido en la sección de configuración del sistema, y ​​se pueden cambiar después de que los definen aquí. Usted debe establecer el valor predeterminado local a la zona horaria GMT de que sus agentes quieren estar adentro La zona de buzón de voz es la lista de zonas horarias de correo de voz que los mensajes de correo de voz será el momento cuando se registra con los nuevos mensajes se quedan.
    Local por omisión GMT: (No ajustar para el DST)$NWB#settings-default_local_gmt$NWE
    Zona de correo de voz por defecto: $NWB#settings-default_voicemail_timezone$NWE
     
    \n"; echo ""; - echo "
    Recepción to ViciDial: copyright, trademark and license page

    \n"; + echo "
    Bienvenido a Vicidial: los derechos de autor, marca registrada y la licencia de la página

    \n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "
    Copyright:   The ViciDial Call Center Suite is maintained by the ViciDial Group, © 2010
    Copyright:   El Call Center Vicidial Suite está mantenido por el ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" is a registered trademark of the ViciDial Group. Here is our trademark use policy
    Trademark:   \"VICIDIAL\" es una marca registrada de la ViciDial Group. Aquí está nuestra marca la política de uso
    License:   The ViciDial Call Center Suite is released under the AGPLv2 open source license
    License:   El Call Center Vicidial Suite está publicado bajo la AGPLv2 licencia de código abierto
    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
    Source Code:   El Centro de Vicidial llamada suite de software está disponible para su descarga, y para el uso, libre de costo. Puede descargar el sencillo de instalar ViciBox ISO de CD la versión, o sólo el de código fuente
    \n"; if ($first_login_link > 0) { echo "

    "; - echo "
    Continue on to the Initial Setup

      \n"; + echo "
    Continúe con la configuración inicial

      \n"; } } ##### END copyright trademark license page ##### +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Página de utilidades ocultas - Si usted no sabe lo que estos servicios lo hace, usted probablemente no debería usarlos

    \n"; + echo "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) + { + echo "\n
     \n"; + } + + echo "
    \n"; + } +##### END admin hidden utilities page ##### + + +###################### +# ADD=999993 - max stats detail report +###################### +if ($ADD==999993) + { + echo "
    \n"; + echo ""; + + if ( (preg_match("/Maximum Stats Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $campaign_name = $rowx[0]; + } + else + {echo "Not found"; exit;} + } + + echo "
    Administration: Maximum Stats Detalle for $stage $modify_link$campaign_id
    - $campaign_name   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Usted no tiene permiso de visión esta página";} + + 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Usted no tiene permiso de visión esta página";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + + + echo "
    \n"; echo "
    \n"; @@ -28180,24 +33199,125 @@ echo "

    "; echo "VERSIÓN: $admin_version
    "; echo "CONSTRUCCION: $build\n"; if (!preg_match("/_CONSTRUCCION_/",$SShosted_settings)) - {echo "
    © 2010 ViciDial Group
    ";} + {echo "
    © 2012 ViciDial Group
    ";} echo "
    \n"; ?>
    - - 1) and ($modify_footer_refrescar > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_refrescar > 1) and ($modify_footer_refrescar > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Hay $complete_leads cables terminados en esas listas\n";} + } + else + { + echo "ningunos estados del dial seleccionados para esta campaña\n"; + } + } + else + { + echo "ningunas listas activas seleccionadas para esta campaña\n"; + } + } +else + { + echo "ningunas listas activas seleccionadas para esta campaña\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -28520,7 +33640,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -28533,7 +33659,10 @@ if (isset($camp_lists)) else {$active_leads = '0';} if ($DB > 0) {echo "|$DB|\n";} - echo "Esta campaña tiene $active_leads Leads para ser llamados en estas listas\n"; + if ($single_status > 0) + {return $active_leads;} + else + {echo "Esta campaña tiene $active_leads Leads para ser llamados en estas listas\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_campaign_multi_alt.php new file mode 100644 index 00000000..9666cae7 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRACIÓN: campaña multi-Alt-Leads +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Esta campaña no está establecido en Auto-Alt-Dial MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_ENVIAR") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-plomo Auto ajustes de marcado Alt Formulario<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_ENVIAR>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS CAMPAÑA: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>LLAMADO</td><td>NO LLAMADO</td><td>SELECTED</td><td>OLD RANK</td><td>NEW RANK</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>SUBTOTALES</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Orden de lista aleatoria: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Lista de Secundaria Orden: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Versión: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php index 9cb4175f..d83a8a80 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -27,6 +27,16 @@ # 100831-2255 - Added password strength checking function # 100914-1311 - Removed other links for reports-only users # 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -336,12 +346,12 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> - var weak = Image(); - weak.src = "images/weak.png"; - var medium = Image(); - medium.src = "images/medium.png"; - var strong = Image(); - strong.src = "images/strong.png"; + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; function pwdChanged(pwd_field_str, pwd_img_str) { @@ -405,10 +415,30 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_refrescar;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("refrescar_countdown").innerHTML = "<font color=black> screen refrescar in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_refrescar_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -599,22 +629,22 @@ if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) } +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -626,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -638,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -650,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -724,19 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Manejar el método: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 Border=0 ALT="AYUDA" ALIGN=TOP></a>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Método de búsqueda: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID De la Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID De la Campaña: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; - new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - new_content = new_content + "<BR>   VID ID Number Filename: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - new_content = new_content + "<BR>   VID Confirm Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + new_content = new_content + "<BR>   VID Ingrese Nombre del archivo: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID ID Nombre del archivo Número: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID Confirmar Archivo: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   VID dígitos: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -756,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "archivo de audio: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,18 +922,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Manejar el método: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Método de búsqueda: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID De la Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID De la Campaña: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; - // new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - // new_content = new_content + "<BR>   VID ID Number Filename: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - // new_content = new_content + "<BR>   VID Confirm Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - // new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + // new_content = new_content + "<BR>   VID Ingrese Nombre del archivo: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID ID Nombre del archivo Número: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID Confirmar Archivo: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   VID dígitos: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') @@ -924,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "archivo de audio: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -990,8 +1020,37 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_refrescar > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_refrescar_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_es/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; $stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; @@ -1070,6 +1129,8 @@ $SScustom_fields_enabled = $row[3]; else {$listmix_sh=''; $listmix_fc='BLACK';} if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -1094,10 +1155,18 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Pausa Códigos</a></TD> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> - <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Presets</a></TD> - <?php } + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>> Valores de menores/a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- LISTAS NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { @@ -1106,8 +1175,8 @@ $SScustom_fields_enabled = $row[3]; <?php if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-BorrarDNC Number';} - else {$DNClink = 'Add DNC Number';} + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Agregar-Eliminar Número de DNC';} + else {$DNClink = 'Agregar número de DNC';} ?> <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Demuestre Las Listas </a> @@ -1116,17 +1185,19 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Búsqueda Para Un Plomo </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Añadir una nueva pista </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_listloader_third_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Nuevos Plomos De la Carga </a> + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Nuevos Plomos De la Carga </a> <?php if ($SScustom_fields_enabled > 0) { ?> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> List Custom Fields </a> + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Lista Campos Personalizados </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarCustom Fields </a> + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia de campos personalizados </a> <?php } ?> @@ -1170,36 +1241,48 @@ $SScustom_fields_enabled = $row[3]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Inbound </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Entrante </a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-BorrarFPG Number';} - else {$FPGlink = 'Add FPG Number';} + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Agregar-Eliminar FPG Número';} + else {$FPGlink = 'Agregar número de FPG';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Demuestre A En-Grupos </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregue A Nuevo En-Grupo </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> En-Grupo Del Copiar</a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> En-Grupo Del Copiar</a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar DIDs </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Añadir un nuevo DID </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Mostrar menús de llamadas </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Añadir un nuevo menú de llamadas </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia de llamadas Menú </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia de llamadas Menú </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filter Phone Groups </a> + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filtrar Grupos de teléfono </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Filter Phone Group </a> + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregar Grupo de teléfono Filtro </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> @@ -1237,9 +1320,9 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregue Los Agentes Alejados Nuevos </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Extension Groups </a> + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Grupos de Extensión </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Extension Group </a> + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Añadir grupo de extensiones </a> </TD></TR> <?php } ?> @@ -1266,6 +1349,8 @@ $SScustom_fields_enabled = $row[3]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1278,6 +1363,8 @@ $SScustom_fields_enabled = $row[3]; else {$tts_sh=''; $tts_fc='BLACK';} if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1297,6 +1384,8 @@ $SScustom_fields_enabled = $row[3]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Conferencias </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> Ajustes Del Sistema </a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Las etiquetas de la pantalla </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>>Estados De Sistema</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1326,6 +1415,14 @@ $SScustom_fields_enabled = $row[3]; </TR> <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } } ?> @@ -1343,7 +1440,7 @@ $SScustom_fields_enabled = $row[3]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>CASERO</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Reloj de tiempo</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Salir</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>CASERO</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Reloj de tiempo</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Salir</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1386,7 +1483,7 @@ $SScustom_fields_enabled = $row[3]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Transportistas </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiarA Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Transportistas </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copie Un Transportista </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> @@ -1394,7 +1491,7 @@ $SScustom_fields_enabled = $row[3]; <?php } if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Generate New Numbers </a></TD></TR> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard generar nuevos números </a></TD></TR> <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> @@ -1408,6 +1505,14 @@ $SScustom_fields_enabled = $row[3]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajustes Del Sistema </a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Las etiquetas de la pantalla </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Añadir una etiqueta de la pantalla </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Agregar un contacto </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Estados De Sistema</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Categorías Del Estado</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Códigos de estado de CC</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..64bbe78e --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AYUDA\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- VERSIÓN: $version CONSTRUCCION: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL DESPLAZAMIENTO GMT AHORA: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Estado actual del archivo:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Cargar Leads de este archivo:
    ID De la Lista Override: + +
    Teléfono Código Sobrescribir: + +
    Disposición de archivo a utilizar:Standard Format    Disposición de encargo    Custom Template
    Plantilla para usar: template builder
    Cheque Del Duplicado Del Plomo:
    USA-Canada Check:
    Operaciones de búsqueda De la Zona De Tiempo De Plomo:
            
            DE NUEVO AL ADMIN         Old Lead Loader     LIST LOADER 4th Gen-     VERSIÓN:     CONSTRUCCION:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID De la Lista Override:
    Teléfono Código Sobrescribir:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSIÓN:     CONSTRUCCION: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesandofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesando$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColumnaDatos del archivo
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domingo March to First Domingo November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domingo March to First Domingo November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # tiempo local calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domingo April to Last Domingo October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in April and last Domingo in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # tiempo local calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domingo March to Last Domingo October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in March and last Domingo in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domingo October to Last Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domingo October to Last Domingo March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domingo in October to First Domingo in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and first Domingo in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domingo October to Third Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and third Domingo in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domingo in September to First Domingo in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in September and first Domingo in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domingo October to Last Domingo February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domingo October to Last Domingo February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_third_gen.php new file mode 100644 index 00000000..ff7c437d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"AYUDA\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Cargar Leads de este archivo:
    ID De la Lista Override: + +
    Teléfono Código Sobrescribir: + +
    Disposición de archivo a utilizar:Standard Format    Disposición de encargo
    Cheque Del Duplicado Del Plomo:
    USA-Canada Check:
    Operaciones de búsqueda De la Zona De Tiempo De Plomo:
            
            DE NUEVO AL ADMIN         Old Lead Loader     LIST LOADER 3rd Gen-     VERSIÓN:     CONSTRUCCION:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID De la Lista Override:
    Teléfono Código Sobrescribir:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSIÓN:     CONSTRUCCION: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesandofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Procesando$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/CódigoÁrea/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER CódigoÁrea"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Procesando$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColumnaDatos del archivo
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domingo March to First Domingo November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domingo March to First Domingo November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # tiempo local calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domingo April to Last Domingo October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in April and last Domingo in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # tiempo local calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domingo March to Last Domingo October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in March and last Domingo in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domingo October to Last Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domingo October to Last Domingo March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domingo in October to First Domingo in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and first Domingo in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domingo October to Third Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and third Domingo in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domingo in September to First Domingo in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in September and first Domingo in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domingo October to Last Domingo February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domingo October to Last Domingo February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # tiempo local calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_lists_custom.php new file mode 100644 index 00000000..4e6ab780 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Muestra una lista de campos personalizadoss +<?php + +################################################################################ +##### BEGIN help section +if ($action == "AYUDA") + { + ?> + + + +
    +
    +
    + ViciDial Muestra una lista de campos personalizadoss Help +

    + + +
    + Campo Etiqueta - Este es el identificador de campo de base de datos para este campo. Esto tiene que ser un identificador único dentro de los campos personalizados de la lista. No use espacios ni signos de puntuación para este campo. máximo de 50 caracteres, mínimo de 2 caracteres. También puede incluir los campos predeterminados Vicidial en una configuración de campo personalizado, y los verás en rojo en la lista. Estos campos no se añadirá a la tabla de lista de base de datos personalizada, la interfaz del agente en cambio, referencia a la tabla vicidial_list directamente. Las etiquetas que se pueden utilizar para incluir a los fieds por defecto son - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Nombre del campo - Este es el nombre del campo como aparecerá a un agente a través de su interfaz. Puede utilizar los espacios en este campo, pero no caracteres puntuacion, un máximo de 50 caracteres y un mínimo de 2 caracteres. +

    + +
    +
    + Campo Descripción - La descripción de este campo tal y como aparecerá en la interfaz de administración. Este es un campo opcional con un máximo de 100 caracteres. +

    + +
    +
    + Rango de campo - El orden en que estos campos se muestra al agente de menor a mayor en la parte superior en la parte inferior. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Campo de Ayuda - Campo opcional, si usted lo llene, el agente será capaz de ver este texto al hacer clic en un vínculo de ayuda al lado del campo en su interfaz de agente. +

    + +
    +
    + Tipo de campo - Esta opción define el tipo de campo que se mostrará. TEXTO es un estándar de una sola línea formulario de participación, el área es un cuadro de texto de varias líneas, SELECT es una selección única menú desplegable, MULTI es una caja de selección múltiple, RADIO es una lista de botones de radio, donde sólo una opción puede ser seleccionado, CheckBox es una lista de casillas de verificación, donde múltiples opciones pueden ser seleccionadas, la fecha es un calendario día mes año emergente donde el agente puede seleccionar la fecha y hora es un cuadro de selección del tiempo. El valor predeterminado es TEXT. Para las opciones de SELECT, MULTI, radio y checkbox debe definir los valores de las opciones a continuación en el cuadro Opciones de campo. DISPLAY se visualizará y no permitir la modificación introducida por el agente de. Script también mostrará solamente, sino que son capaces de utilizar las variables de secuencia de comandos al igual que en la función de secuencias de comandos. Campos de secuencia de comandos también sólo muestran el contenido de las opciones, y no el nombre del campo como el tipo de pantalla. HIDDEN no se mostrará el agente sobre el terreno, pero permitirá que el campo para que los datos importados y exportados en ella de la misma, así como tener a disposición de la ficha de guión y dirección de formulario web. READONLY mostrará el valor de los datos de la esfera, pero no permitirá que el agente de alterar los datos. PIELBLOB es similar a HIDDEN excepto el tipo de almacenamiento de datos en la base de datos es un tipo BLOB, adecuado para los datos binarios o datos que debe ser garantizado. +

    + +
    +
    + Opciones de campo - Para el SELECT, RADIO MULTI, y los tipos de casillas de verificación de campo, debe definir los valores de las opciones en este cuadro. Usted debe poner una lista de la etiqueta de opción separados por comas y el texto de opción aquí con cada opción de una línea propia. El primer valor no debe tener espacios en él, y ninguno de los valores debe tener ninguna puntuacion. Por ejemplo - electric_meter, medidor eléctrico +

    + +
    +
    + Opción Posición - Para los tipos de campo CheckBox y sólo en la radio, si se establece HORIZONTAL las opciones van a aparecer en la misma línea, posiblemente, envolviendo a la línea de abajo si hay muchas opciones. Si se establece en VERTICAL sólo habrá una opción por línea. El valor predeterminado es HORIZONTAL. +

    + +
    +
    + Tamaño del campo - Este ajuste significa cosas diferentes en función de lo que el tipo de campo es. Para los campos de texto, el tamaño es el número de caracteres que se muestran en el campo. Para los campos de la zona, el tamaño es el ancho del cuadro de texto en caracteres. Para los campos de MULTI, este valor define el número de opciones que se muestran en la lista de selección múltiple. Para SELECT, RADIO, CheckBox, FECHA y HORA esta configuración se omite. +

    + +
    +
    + Campo Max - Este ajuste significa cosas diferentes en función de lo que el tipo de campo es. Para TEXT, campos ocultos y ReadOnly, el tamaño es el número máximo de caracteres que se permiten en el campo. Para los campos de interés, este campo define el número de filas de texto visible en el cuadro de texto. Para MULTI, SELECT, RADIO, CheckBox, FECHA y HORA esta configuración se omite. +

    + +
    +
    + Campo por defecto - Este campo opcional le permite definir qué valor asigna a un campo si no se carga en ese campo. El valor predeterminado es NULL, que desactiva la función por defecto. Para los tipos de campo de fecha, el valor por defecto siempre se establece en la actualidad a menos que el número se pone en en cuyo caso la fecha será el que muchos días, más o menos en la actualidad. Para los tipos de campo de tiempo, el valor por defecto se establece siempre en la hora actual del servidor a menos que el número se pone en en cuyo caso el tiempo será el que durante muchos minutos, más o menos la hora actual. +

    + +
    +
    + Costo de campo - Este campo de sólo lectura que indica cuál es el costo de este campo está en la tabla de campos personalizados para esta lista. No hay ningún límite para el número de campos personalizados que puedes tener en una lista, pero el total del costo de todos los campos de la lista debe estar por debajo de 65000. Normalmente, esto permite que cientos de campos, pero si se especifica varios campos de texto que son cientos o miles de caracteres de longitud, entonces pueden alcanzar el límite rápidamente. Si necesita que la cantidad de texto en un campo que debe elegir un tipo de zona, que se almacenan de forma diferente y no utiliza espacio de tabla tanto. +

    + +
    +
    + Campo Obligatorio - Si se establece en Y, en este campo hará que el agente para introducir texto o seleccionar una opción en este campo. El valor predeterminado es N. +

    + +
    +
    + Campo Posición Nombre - Si se establece a izquierda, esta el nombre del campo aparecerá a la izquierda del campo, si se establece al principio El nombre del campo se ocupará de toda la línea y aparecerá sobre el campo. Defecto es de izquierda. +

    + +
    +
    + Copia Opción - Al copiar las definiciones de campo de una lista a otra, usted tiene algunas opciones para cómo funciona el proceso de copia. APPEND agregar los campos que no están presentes en la lista de destinos, si no se pongan en venta las etiquetas de los campos voluntad permanecido relativamente intactas, no hay datos de campos personalizados serán borrados o modificados por esta opción. UPDATE actualizar los campos comunes field_label en la lista de destinos a las definiciones de los campos de la lista de origen. datos de campos personalizados pueden ser modificados o perdidos mediante esta opción. REPLACE se eliminarán todos los campos personalizados existentes en la lista de destinos y reemplazarlos con los campos personalizados de la lista de fuentes, todos los datos de campos personalizados se pueden borrar con esta opción. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "ERROR: Los campos personalizados no están activos en este sistema\n"; + exit; + } + + +$NWB = "   \"AYUDA\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Copie los campos a otra lista
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Lista de ID para copiar campos de:
    Lista de ID para copiar campos de:
    Copia Opción: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_ENVIAR") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "ERROR: No se puede copiar los campos a la misma lista: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "ERROR: no tiene lista de fuentes de campos personalizados\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ÉXITO: ​​Campo personalizado eliminados - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "ÉXITO: ​​Campo personalizado Alta - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "ERROR: La tabla no existe custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "ÉXITO: ​​Campo personalizado Modificado - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: El campo no existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: La tabla no existe custom_$list_id\n
    ";} + else + { + echo "

    HAGA CLICK AQUI PARA confirmar la eliminación de este campo personalizado: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: El campo no existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: La tabla no existe custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ÉXITO: ​​Campo personalizado eliminados - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "ERROR: No se puede utilizar palabras reservadas para las etiquetas de campo - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Usted debe entrar en las opciones de campo cuando se agrega un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "ERROR: El campo ya existe para esta lista - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "ÉXITO: ​​Campo personalizado Alta - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_ENVIAR") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERROR: El campo no existe\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERROR: La tabla no existe\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Usted debe entrar en las opciones de campo cuando se actualiza un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "ÉXITO: ​​Campo personalizado Modificado - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    ModificarCampo Personalizados: ID De la Lista $list_id         "; + echo "Los registros en esta tabla personalizada: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### RESUMEN DE CAMPOS ### + echo "
    RESUMEN DE CAMPOS:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Hay no custom fields for this list
    TOTALS: $o             $total_cost    


    \n"; + + + ### EJEMPLO DE LA FORMA PERSONALIZADA ### + echo "\n"; + echo "
    EJEMPLO DE LA FORMA PERSONALIZADA:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Hay no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='PIELBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### MODIFICAR LOS CAMPOS ### + echo "
    MODIFICAR campos existentes:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Campo Etiqueta $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Rango de campo $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Nombre del campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Campo Posición Nombre $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descripción $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Campo de Ayuda $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo de campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Opciones de campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Opción Posición $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Tamaño del campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Campo por defecto $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Campo Obligatorio $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Agregar un campo personalizado NUEVO PARA ESTA LISTA:
    New Rango de campo:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Campo Etiqueta: $NWB#vicidial_lists_fields-field_label$NWE
    Nombre del campo: $NWB#vicidial_lists_fields-field_name$NWE
    Campo Posición Nombre: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descripción: $NWB#vicidial_lists_fields-field_description$NWE
    Campo de Ayuda: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo de campo: $NWB#vicidial_lists_fields-field_type$NWE
    Opciones de campo: $NWB#vicidial_lists_fields-field_options$NWE
    Opción Posición: $NWB#vicidial_lists_fields-multi_position$NWE
    Tamaño del campo: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max: $NWB#vicidial_lists_fields-field_max$NWE
    Campo por defecto: $NWB#vicidial_lists_fields-field_default$NWE
    Campo Obligatorio: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Ir a la página de modificación de la lista para esta lista

    \n"; + + echo "  Haga clic aquí para ver los cambios de administrador para esta listas custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    LISTA DE LISTA DE CONTAR con campos personalizados:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    ID DE LA LISTANOMBRE DE LA LISTAACTIVOCAMPAIGNCUSTOM FIELDSMODIFICAR
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]MODIFICAR LOS CAMPOS
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; $call_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + $campaign_id = $row[3]; } @@ -532,6 +640,21 @@ else $closer_log .= "\n"; $closer_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + $campaign_id = $row[3]; } @@ -540,6 +663,60 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "PIELLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + if (strlen($row[0]) > 0) {$lead_id = $row[0];} $dispo = $row[3]; @@ -573,7 +750,34 @@ else $owner = $row[33]; $entry_list_id = $row[34]; - echo "
    Información de la llamada: $first_name $last_name - $phone_number

    \n"; + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Añadir una nueva pista\n";} + else + {echo "
    Información de la llamada: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; echo "\n"; echo "\n"; echo "\n"; @@ -587,298 +791,568 @@ else echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    ADMIN Change Log: Sección de Documentos - $category - $stage\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + 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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPCIÓNGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Versión: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATE TABLA custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTER TABLA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='PIELBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="DEMOSTRACIÓN COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTER TABLA custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTER TABLA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='PIELBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTER TABLA custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php index 9c17aadc..9d4fd464 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -39,6 +39,13 @@ # 100703-1122 - Added custom fields display/edit # 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -128,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -140,6 +149,12 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -150,7 +165,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -159,6 +174,7 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -187,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -203,26 +219,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -272,25 +289,67 @@ if (strlen($row[16])>0) {$label_security_phrase = $row[16];} if (strlen($row[17])>0) {$label_email = $row[17];} if (strlen($row[18])>0) {$label_comments = $row[18];} + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Registro del Lead modificado + +
    ADMINISTRATION: Registro del Lead modificado
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "El plomo se ha añadido: $lead_id

    \n"; + $end_call=0; + } + else + {echo "ERROR: El plomo no se añade, por favor, volver atrás y ver lo que ha introducido

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Información modificada

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -310,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -320,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -368,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -377,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -386,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -394,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -465,6 +558,21 @@ else $call_log .= "
    $row[15]   $row[10]
    NOTES:   $rowA[0]
      $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + 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"; + 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 status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses where selectable='Y' order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - $DS=0; - while ($statuses_to_print > $o) + if ($lead_id != 'NEW') { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "\n"; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where selectable='Y' and campaign_id='$list_campaign' order by status"; - $rslt=mysql_query($stmt, $link); - $CAMPstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($CAMPstatuses_to_print > $o) + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "\n"; } - - - if ($DS < 1) {$statuses_list .= "\n";} - echo "$statuses_list"; - echo "(with $list_campaign statuses)\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; echo "
    $label_vendor_lead_code: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID De la Lista: $list_id     Called Count: $called_count
    Lead ID: $lead_id     ID De la Lista: $list_id
    Fronter: $tsr     Called Count: $called_count
    $label_title:   \n"; - echo "$label_first_name:
    $label_middle_initial:   \n"; - echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; - echo " $label_postal_code:
    $label_province :
    País :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    Rank :
    Owner :
    $label_comments :
    Disposición:
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    País : $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    País :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    $label_comments :
    Disposición: (with $list_campaign statuses)
    Modificarvicidial log
    Modificaragent log
    Modificarcloser log
    Add closer log record
    Modificarvicidial log
    Modificaragent log
    Modificarcloser log
    Add closer log record
    \n"; echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') { - ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) + echo "
    \n"; + echo "Callback Detalles:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { - if ($rowx[9] == 'USERONLY') - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    \n"; + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

    \n"; + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

    \n"; + } + else + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

    \n"; + } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Comentarios: + + +
    + + + + +
    + +
    + +
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

    \n"; + echo "
    No Callback records found
    \n"; } + } else { - echo "
    No Callback records found
    \n"; + echo "
    Si desea cambiar esta dado lugar a una devolución de llamada programada, primero cambie la disposición de CBHOLD, a continuación, enviar y usted será capaz de establecer la fecha de devolución de llamada y el tiempo.
    \n"; } - } + echo "
    \n"; + echo "

    \n"; - echo "

    \n"; + echo "
    \n"; - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - - - ### iframe for custom fields display/editing - if ($custom_fields_enabled > 0) - { - $CLlist_id = $list_id; - if (strlen($entry_list_id) > 2) - {$CLlist_id = $entry_list_id;} - $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$CLlist_id\";"; - if ($DB>0) {echo "$stmt";} - $rslt=mysql_query($stmt, $link); - $tablecount_to_print = mysql_num_rows($rslt); - if ($tablecount_to_print > 0) + if ($c > 0) { - $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + echo "EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$CLlist_id\";"; if ($DB>0) {echo "$stmt";} $rslt=mysql_query($stmt, $link); - $fieldscount_to_print = mysql_num_rows($rslt); - if ($fieldscount_to_print > 0) + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $rowx=mysql_fetch_row($rslt); - $custom_records_count = $rowx[0]; - - echo "CUSTOM FIELDS FOR THIS LEAD:
    \n"; - echo "\n"; - echo "

    "; - } - } - } - - - echo "LLAMADAS A ESTE LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "AGENTE LOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - if ($DB) {echo "$logs_to_print|$stmt|\n";} - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) - { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) - { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "Campos personalizados para ESTE CABLE:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "LLAMADAS A ESTE LEAD:\n"; + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "AGENTE LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # CAMPAÑADATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modificarchanges to this lead\n"; + } + + echo "\n"; } - - - echo "


    \n"; - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $admin_display=$row[0]; - if ($admin_display > 0) - { - echo "Click here to see Lead Modificarchanges to this lead\n"; - } - - echo "\n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php index 6b62f25a..8c438ab7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -24,6 +24,11 @@ # 100224-1621 - Added first/last name search and changed format of the page # 100405-1331 - Added log search ability # 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -60,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -77,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -97,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -207,7 +279,7 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo "
    Buscar Lead Opcións:
    $label_vendor_lead_code(código del vendedor del Lead):   $label_vendor_lead_code(código del vendedor del Lead):  
     
    \n"; echo "\n"; echo "\n"; @@ -315,6 +396,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -342,12 +439,12 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound calls matching your search criteria

    \n"; + echo "Hay no inbound calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    Entrantes LOG RESULTS: $results_to_print
    \n"; + echo "
    INBOUND LOG RESULTS: $results_to_print
    \n"; echo "
    #
    \n"; echo "\n"; echo "\n"; @@ -364,6 +461,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -392,12 +505,12 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound did calls matching your search criteria

    \n"; + echo "Hay no inbound did calls matching your search criteria

    \n"; echo "
    \n"; } else { - echo "
    Entrantes DID LOG RESULTS: $results_to_print
    \n"; + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; echo "
    #
    \n"; echo "\n"; echo "\n"; @@ -410,6 +523,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -457,7 +586,7 @@ else ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -465,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -499,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -516,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -532,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -556,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -589,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "PIELLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -619,6 +811,13 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php index 1a8e7bcb..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # @@ -9,10 +9,12 @@ # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel # 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-3'; -$build = '100401-1037'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -126,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -196,8 +198,24 @@ if ($action == "AUTOUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,8 +302,24 @@ if ($action == "MANUALUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_es/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_es/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php index a3d3f05f..3b01bd5a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -25,6 +25,14 @@ # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -56,14 +64,20 @@ if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} 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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (strlen($shift)<2) {$shift='ALL';} -$report_name = 'Export Calls Report'; +$report_name = 'Pide Informe exportación'; $db_source = 'M'; ############################################# @@ -90,7 +104,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; +# echo "\n"; } $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -113,7 +127,7 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Nombre y contraseña inválidos del usuario or no export report permission: |$PHP_AUTH_USER|\n"; exit; } @@ -123,18 +137,20 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -149,6 +165,25 @@ if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) } $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -268,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -289,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Hay no outbound calls during this time period for these parameters\n"; exit; } else @@ -310,9 +357,25 @@ if ($run_export > 0) $export_status[$k] = $row[2]; $export_list_id[$k] = $row[8]; $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; $export_vicidial_id[$k] = $row[36]; $export_entry_list_id[$k] = $row[37]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -322,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Hay no inbound calls during this time period for these parameters\n"; exit; } else @@ -345,7 +408,23 @@ if ($run_export > 0) $export_lead_id[$k] = $row[35]; $export_vicidial_id[$k] = $row[36]; $export_entry_list_id[$k] = $row[37]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -359,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN PIDE INFORME DE EXPORTACIÓN', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -378,10 +457,11 @@ if ($run_export > 0) if ($header_row=='YES') { - $CFheader = ''; $RFheader = ''; - if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) - {$CFheader = "\tcustom_fields";} + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; if ($rec_fields=='ID') {$RFheader = "\trecording_id";} if ($rec_fields=='FILENAME') @@ -390,8 +470,29 @@ if ($run_export > 0) {$RFheader = "\trecording_location";} if ($rec_fields=='ALL') {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} - echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name$RFheader$CFheader\r\n"; + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } } $i=0; @@ -468,12 +569,157 @@ if ($run_export > 0) {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} } + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) { $CF_list_id = $export_list_id[$i]; if ($export_entry_list_id[$i] > 99) {$CF_list_id = $export_entry_list_id[$i];} - $stmt="SHOW TABLES LIKE \"custom_$CF_list_id\";"; + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$CF_list_id\";"; if ($DB>0) {echo "$stmt";} $rslt=mysql_query($stmt, $link); $tablecount_to_print = mysql_num_rows($rslt); @@ -512,13 +758,20 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$custom_data\r\n"; + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Hay no calls during this time period for these parameters\n"; exit; } } @@ -549,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -564,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -630,6 +883,8 @@ else echo "\n"; echo "ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -654,13 +909,17 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Pide Informe exportación"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; - echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<font class=\"select_bold\"><B>Rango de Fecha:</B></font><BR><CENTER>\n"; echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; ?> @@ -672,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lunes week start </script> <?php @@ -688,18 +947,18 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lunes week start </script> <?php echo "<BR><BR>\n"; - echo "Header Row:<BR>\n"; + echo "<B>Header Row:</B><BR>\n"; echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; echo "<BR><BR>\n"; - echo "Recording Fields:<BR>\n"; + echo "<B>Recording Fields:</B><BR>\n"; echo "<select size=1 name=rec_fields>"; echo "<option>ID</option>"; echo "<option>FILENAME</option>"; @@ -712,13 +971,25 @@ else { echo "<BR><BR>\n"; - echo "Custom Fields:<BR>\n"; + echo "<B>Campo Personalizados:</B><BR>\n"; echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; } + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Campañas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -730,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos De entrada:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Listas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -757,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Estados:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -769,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos De Usuario:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_es/callcard_admin.php new file mode 100644 index 00000000..8a6c7811 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSIÓN: <?php echo $version ?> CONSTRUCCION: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AYUDA\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Detalle<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Estado: </td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Grupo: </td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comentarios: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create Usuario/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate Usuario/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used Usuario/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void Usuario/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE FECHA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ESTADO</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Hay $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENTE FECHA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Grupo: </td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ESTADO</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     VERSIÓN: <?php echo $version ?>     CONSTRUCCION: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_es/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
    #
    "; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_es/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php index c6011134..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php @@ -63,9 +63,9 @@ mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php index a154c5dc..0580f544 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -36,6 +39,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -45,12 +52,14 @@ if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Fronter - Closer Report'; $db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "$report_name\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           DESCARGAR | MODIFICAR | INFORMES
    Exponer as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ENVIAR\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ENVIAR\n";
     }
     
     else
    @@ -227,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -245,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -276,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| AGENTE                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALS FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| AGENTE                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -306,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -330,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -369,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -384,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -414,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -429,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -457,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| AGENTE | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| AGENTE | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -485,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -509,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -592,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -606,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -651,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -673,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/functions.php b/agc_2-X/trunk/LANG_www/vicidial_es/functions.php index f3a6e7b7..1298ba76 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "   \"AYUDA\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_es/group_hourly_stats.php index 37bd9465..e5d06efd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTAL $status $hour_calls $total_calls $day_calls
    TOTAL $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Inscriba por favor a grupo que usted desea conseguir el stats cada hora para:
    \n"; - echo "\n"; - echo "group: \n"; +echo "group:
    \n"; - echo "status:   (example: XFER)
    \n"; - echo "date with hour:   (example: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "status:   (example: XFER)
    \n"; +echo "date with hour:   (example: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \nScript runtime: $RUNtime seconds
    "; exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_es/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_es/lead_report_export.php new file mode 100644 index 00000000..5ae2fc92 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Informe de las exportaciones genera'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Hay no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Hay no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Hay no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Informe de las exportaciones genera</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Este informe recoge la información contenida de plomo para las llamadas realizadas en el intervalo de fechas seleccionado. Una ventaja sólo se exporta una vez sin importar cuántas llamadas han sido manipulados. El estado actual de plomo se utiliza.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Rango de Fecha:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lunes week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lunes week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>Campo Personalizados:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campañas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos De entrada:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Listas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Estados:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Grupos De Usuario:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_es/leadloader_template_display.php new file mode 100644 index 00000000..2be6078e --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/line.js b/agc_2-X/trunk/LANG_www/vicidial_es/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php index 2de73711..2ad575be 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php @@ -108,7 +108,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -143,7 +143,7 @@ if ($download_type == 'systemdnc') if ($leads_count < 1) { - echo "There are no phone numbers in list: SYSTEM INTERNAL DNC\n"; + echo "No hay números de teléfono en la lista: SYSTEM INTERNAL DNC\n"; exit; } } @@ -181,7 +181,7 @@ elseif ($download_type == 'dnc') if ($leads_count < 1) { - echo "There are no leads in Campaña DNC list: $group_id\n"; + echo "No hay pistas en la lista de Campaña DNC: $group_id\n"; exit; } } @@ -219,7 +219,7 @@ elseif ($download_type == 'fpgn') if ($leads_count < 1) { - echo "There are no leads in this filter phone group: $group_id\n"; + echo "No hay pistas de este grupo de teléfono del filtro: $group_id\n"; exit; } } @@ -228,7 +228,7 @@ else ##### list download validation ##### $event_code_type='LIST'; $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -247,7 +247,7 @@ else } $stmt="select count(*) from vicidial_list where list_id='$list_id';"; - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') {$stmt="select count(*) from vicidial_list where list_id > 0;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -261,7 +261,7 @@ else if ($leads_count < 1) { - echo "There are no leads in list_id: $list_id\n"; + echo "Hay no leads in list_id: $list_id\n"; exit; } } @@ -305,7 +305,7 @@ else $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; $list_id_header=''; $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') { $list_id_header="list_id\t"; $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; @@ -343,7 +343,7 @@ while ($i < $leads_to_print) { $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') { $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; $export_list_id[$i] = $row[0]; @@ -363,7 +363,7 @@ $ch=0; if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) { $valid_custom_table=0; - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') { $stmtA = "SELECT list_id from vicidial_lists;"; $rslt=mysql_query($stmtA, $link); @@ -435,7 +435,7 @@ if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) $i=0; while ($i < $leads_to_print) { - if ($list_id=='ALL-LISTAS') + if ($list_id=='ALL-LISTS') { $valid_custom_table=0; $u=0; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_es/listloaderMAIN.php index 33889c3c..40fbe586 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php index caa1d454..df4014a8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -34,11 +34,12 @@ # 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> # 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats # 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.4-37'; -$build = '100712-1416'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -143,7 +144,7 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_ ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -153,6 +154,7 @@ if ($qm_conf_ct > 0) $non_latin = $row[0]; $admin_web_directory = $row[1]; $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -181,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -213,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -409,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -724,7 +726,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -740,7 +742,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; ### insert good record into vicidial_list table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -778,7 +780,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -813,7 +815,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; @@ -1112,7 +1114,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -1128,7 +1130,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1164,7 +1166,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -1176,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1187,7 +1189,7 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; @@ -1198,7 +1200,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -1443,7 +1445,7 @@ if ($leadfile) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1479,7 +1481,7 @@ if ($leadfile) { if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1490,7 +1492,7 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; @@ -1515,7 +1517,7 @@ if ($leadfile) { } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; @@ -1526,7 +1528,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; @@ -1754,7 +1756,7 @@ if ($leadfile) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1789,7 +1791,7 @@ if ($leadfile) { if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1865,7 +1867,7 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; @@ -1876,7 +1878,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -1924,7 +1926,7 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; @@ -1947,7 +1949,7 @@ if ($leadfile) { } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; @@ -1959,7 +1961,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>ProcesandoCSV file... \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php index 6be8f1f4..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -37,10 +44,34 @@ # 100723-1333 - Added no_update option to the update_lead function # 100728-1952 - Added delete_lead option to the update_lead function # 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.4-23'; -$build = '100924-1403'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -159,6 +190,114 @@ if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} header ("Content-type: text/html; charset=utf-8"); @@ -218,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -233,7 +372,7 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); @@ -251,6 +390,58 @@ if ($non_latin < 1) $no_update = ereg_replace("[^A-Z]","",$no_update); $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -269,8 +460,8 @@ $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; @@ -302,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -322,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -557,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Tiempo Real Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Elija Opciones de Informe"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "Actualiza ahora"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       MODIFICAR | \n";} +else + {echo "       MODIFICAR | \n";} + +echo "SUMMARY \n"; + + +echo "       refrescar: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       PIEL GRUPO DE USUARIOS";} +else + {echo "       VIEW GRUPO DE USUARIOS";} +if ($SERVdisplay>0) + {echo "       PIEL SERVIDOR INFO";} +else + {echo "       DEMOSTRACIÓN SERVIDOR INFO";} +if ($CALLSdisplay>0) + {echo "       PIEL WAITING CALLS";} +else + {echo "       DEMOSTRACIÓN WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       PIEL IN-GROUP STATS";} +else + {echo "       DEMOSTRACIÓN IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       PIEL PHONES";} +else + {echo "       DEMOSTRACIÓN PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       PIEL CUSTPHONES";} +else + {echo "       DEMOSTRACIÓN CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_es/remote_dispo.php index 203a7c0f..dacf8a52 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_es/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/server_stats.php b/agc_2-X/trunk/LANG_www/vicidial_es/server_stats.php deleted file mode 100644 index 1d24f7a0..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_es/server_stats.php +++ /dev/null @@ -1,97 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# 61101-1331 - Added SIP/IAX listen/barge links -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: ESTADÍSTICAS DEL SERVIDOR and Reports -VICIDIAL: ESTADÍSTICAS DEL SERVIDOR and Reports                           -DE NUEVO AL ADMIN

    - - -
    
    -
    - $o)
    -	{
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	echo "\n";
    -	$o++;
    -	}
    -
    -?>
    -
    SERVERDESCRIPCIÓNIP ADDRESSACTIVOVDAD timeVDcall timePARK timeCLOSER/INBOUND time
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_es/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_edit.php index 96ca497d..579f7d98 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php index 1ba83d19..2df818e8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -41,6 +44,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} @@ -52,7 +59,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -72,21 +79,21 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -100,26 +107,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -127,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -143,50 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE> - -<?php -echo "$report_name"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -206,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -232,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Rango de Fecha:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Rango de Fecha:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunes week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunes week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Grupos De Usuario:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Grupos De Usuario:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Usuario:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Exponer as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "UsuarioReloj de tiempo Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Usuario:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Time range: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&ENVIAR=$ENVIAR&file_download=1\">DESCARGAR</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="UsuarioReloj de tiempo Report $NOW_TIME\n"; + +$CSV_text.="\"UsuarioReloj de tiempo Report - $NOW_TIME\"\n"; +$CSV_text.="\"Time range: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -346,78 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Time range: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"CONVOCATORIA colgar RAZÓN ESTADÍSTICAS\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} -$TOThours = $TOTdbHOURS; - - -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php index 09ca5e09..2b2e2984 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -13,9 +13,11 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -36,6 +38,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $report_name = 'Grupo Del UsuarioReloj de tiempo Status Report'; @@ -45,7 +49,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -66,7 +70,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -92,12 +96,11 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -111,29 +114,51 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -150,19 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: -<?php -echo "$report_name"; +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -182,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Reloj de tiempo Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GRUPO DE USUARIOS</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Reloj de tiempo Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GRUPO DE USUARIOS</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -248,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -267,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -311,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -331,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR GRUPO DE USUARIOS: $user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR GRUPO DE USUARIOS: $user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[DESCARGAR]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR GRUPO DE USUARIOS: $user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPAIGN\"\n"; $o=0; $s=0; @@ -358,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -400,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALS</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -449,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; +$MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -479,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -498,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -521,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -540,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_group_bulk_change.php index be78d5c1..aa65a5a7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Grupo Del Usuario $old_group Usuarios changed to the $group Grupo Del Usuario<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Usuarios changed to the $group Grupo Del Usuario<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php index 0aa88237..46de9c93 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -28,9 +28,14 @@ # 100802-2347 - Added User Group Allowed Reports option validation # 100908-1205 - Added customer 3way hangup flags to user calls display # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); @@ -41,9 +46,9 @@ $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -53,6 +58,7 @@ if ($qm_conf_ct > 0) $slave_db_server = $row[2]; $reports_use_slave_db = $row[3]; $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -63,7 +69,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -87,6 +93,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -104,7 +112,7 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -122,40 +130,82 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGfullname = $row[0]; -$LOGuser_group = $row[1]; +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; -fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); -fclose($fp); +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "No tienes permiso para ver este informe: |$PHP_AUTH_USER|$report_name|\n"; exit; } if ($did > 0) { - $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';"; + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; } else { - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -163,21 +213,16 @@ else - -?> -<html> -<head> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; if ($did > 0) - {echo "<title>ADMINISTRATION: DID Call Stats";} + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} else - {echo "<title>ADMINISTRATION: $report_name";} + {$HEADER.="<title>ADMINISTRATION: $report_name";} @@ -207,98 +252,93 @@ if ($did > 0) } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2> -<?php +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; if ($did > 0) - {echo "<B>   DID Call Stats for $user";} + {$MAIN.="<B>   DID Call Stats for $user";} else - {echo "<B>   Estadísticas de usuario for $user";} + {$MAIN.="<B>   Estadísticas de usuario for $user";} -?> -</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> -<?php +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=hidden name=did_id value=\"$did_id\">\n"; -echo "<input type=hidden name=did value=\"$did\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="</script>\n"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunes week start -</script> -<?php +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunes week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunes week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "<input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "<input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; if ($did > 0) { - echo "<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; - echo " | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificarDID</a>\n"; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificarDID</a>\n"; } else { - echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Hoja de tiempo</a>\n"; - echo " | <a href=\"./user_status.php?user=$user\">Condición de Usuario</a>\n"; - echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; - echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Hoja de tiempo</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">Condición de Usuario</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; } -echo "</center>\n"; +$MAIN.="</center>\n"; -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="<br><center>\n"; if ($did < 1) { ##### vicidial agent talk time and status ##### - echo "<B>AGENTE TIEMPO Y ESTADO DE CONVERSACIÓN:</B>\n"; + $MAIN.="<B>AGENTE TIEMPO Y ESTADO DE CONVERSACIÓN:     <a href='$download_link&file_download=1'>[DESCARGAR]</a></B>\n"; - echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>ESTADO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ESTADO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"AGENTE TIEMPO Y ESTADO DE CONVERSACIÓN\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); @@ -356,9 +396,10 @@ if ($did < 1) $call_hours_minutes = sec_convert($call_sec[$o],'H'); - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; $total_calls = ($total_calls + $counts[$o]); $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; @@ -367,21 +408,25 @@ if ($did < 1) $call_hours_minutes = sec_convert($total_sec,'H'); - echo "<tr><td><font size=2>LLAMADAS TOTALES </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - echo "</TABLE></center>\n"; + $MAIN.="<tr><td><font size=2>LLAMADAS TOTALES </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"LLAMADAS TOTALES\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; ##### Login and Salir time from vicidial agent interface ##### - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>AGENTE TIEMPO LOGIN/LOGOUT:</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + $MAIN.="<B>AGENTE TIEMPO LOGIN/LOGOUT:     <a href='$download_link&file_download=2'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $CSV_text2.="\"AGENTE TIEMPO LOGIN/LOGOUT\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPAIGN\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -399,15 +444,16 @@ if ($did < 1) if (ereg("LOGIN", $row[0])) { $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -419,22 +465,24 @@ if ($did < 1) $total_login_time = ($total_login_time + $event_seconds); $event_hours_minutes = sec_convert($event_seconds,'H'); - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td>\n"; - echo "<td align=right colspan=4><font size=2>  </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; $event_start_seconds=''; $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; } else { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right colspan=5><font size=2>  </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; } } @@ -446,13 +494,14 @@ if ($did < 1) $total_login_hours_minutes = sec_convert($total_login_time,'H'); - echo "<tr><td><font size=2>TOTAL</td>"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>TOTAL</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; - echo "</TABLE></center>\n"; + $MAIN.="</TABLE></center>\n"; @@ -466,16 +515,18 @@ if ($did < 1) $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; - echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:     <a href='$download_link&file_download=3'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK TIEMPO LOGIN/LOGOUT\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -496,13 +547,14 @@ if ($did < 1) if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -510,15 +562,16 @@ if ($did < 1) $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -526,32 +579,35 @@ if ($did < 1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} - echo "<tr><td align=right><font size=2> </td>"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; - echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - - echo "</TABLE></center>\n"; + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; ##### closer in-group selection logs ##### - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; - echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAÑA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAÑA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPAIGN\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); @@ -567,25 +623,28 @@ if ($did < 1) {$bgcolor='bgcolor="#9BB9FB"';} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; } - echo "</TABLE><BR><BR>\n"; + $MAIN.="</TABLE><BR><BR>\n"; ##### vicidial agent outbound calls for this time period ##### - echo "<B>SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -601,33 +660,53 @@ if ($did < 1) {$bgcolor='bgcolor="#9BB9FB"';} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } + } + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; } - echo "</TABLE><BR><BR>\n"; + $MAIN.="</TABLE><BR><BR>\n"; } ##### vicidial agent inbound calls for this time period ##### -echo "<B>Entrantes/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[DESCARGAR]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; if ($did > 0) { - $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_Entrantes' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -660,37 +739,58 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALS</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALS\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### if ($did < 1) { - echo "<B>AGENTE ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $MAIN.="<B>AGENTE DE LA ACTIVIDAD PARA ESTE PERIODO DE TIEMPO: (10000 record limit)     <a href='$download_link&file_download=7'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>estos campos son en segundos </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"AGENTE DE LA ACTIVIDAD PARA ESTE PERIODO DE TIEMPO: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPAIGN\",\"PAUSE CODE\"\n"; $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -742,46 +842,48 @@ if ($did < 1) $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); - echo "<tr $bgcolor>"; - echo "<td><font size=1>  </td>"; - echo "<td><font size=2>$DBcall_end</td>"; - echo "<td align=right><font size=2> $DBtotal_sec </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; } $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; } - echo "<tr bgcolor=white>"; - echo "<td colspan=2><font size=2>TOTALS</td>"; - echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; - echo "<td colspan=4><font size=2>   </td></tr>\n"; + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALS</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALS\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); @@ -790,25 +892,28 @@ if ($did < 1) $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - echo "<tr bgcolor=white>"; - echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; - echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; - echo "<td colspan=4><font size=2>   </td></tr>\n"; + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; - echo "</TABLE></center><BR><BR>\n"; + $MAIN.="</TABLE></center><BR><BR>\n"; } ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[DESCARGAR]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -824,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -837,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -845,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -857,27 +967,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; if ($did < 1) { ##### vicidial agent outbound user manual calls for this time period ##### - echo "<B>MANUAL SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -898,21 +1011,134 @@ if ($did < 1) if (strlen($row[9]) > 1) {$C3HU = "$row[9] $row[10]";} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td>\n"; - echo "<td align=right><font size=2> $row[8] </td>\n"; - echo "<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "PIELPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } } - echo "</TABLE><BR><BR>\n"; + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### + + $MAIN.="<B>PLOMO PARA BÚSQUEDAS Este período de tiempo: (10000 record limit)     <a href='$download_link&file_download=10'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"PLOMO PARA BÚSQUEDAS Este período de tiempo: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[DESCARGAR]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2> CAMPAÑA</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPAIGN\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } @@ -920,22 +1146,50 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php index fdf779cf..825951cc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,11 @@ # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process # 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -65,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -99,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -107,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -133,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -155,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -271,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -339,20 +370,22 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; - $queuemetrics_loginout = $row[6]; + $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_pe_phone_append = $row[8]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -367,26 +400,84 @@ if ($stage == "log_agent_out") $agents='@agents'; $agent_logged_in=''; - $time_logged_in=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; - $phone_logged_in = $row[2]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_territories.php index 92006655..6b19de08 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_territories.php @@ -40,8 +40,8 @@ if (isset($_GET["batch"])) {$batch=$_GET["batch"];} elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: Territorios de usuario no están activos en este sistema\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Nombre y contraseña inválidos del usuario: |$USER|$PASS|\n"; exit; } } @@ -138,8 +138,8 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> -<title>ADMINISTRATION: User Territories +<!-- VERSIÓN: <?php echo $version ?> CONSTRUCCION: <?php echo $build ?> --> +<title>ADMINISTRATION: Territorios de usuario <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambio Territorio Propietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,12 +175,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; exit; } @@ -194,7 +194,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i if ( (strlen($accountid)<1) or (strlen($user)<1) ) { - echo "ERROR: Account ID and User must be filled in<BR>\n"; + echo "ERROR: Account ID and Usuario must be filled in<BR>\n"; } else { @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Tuvo que añadir el territorio de usuario: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Territorio Propietario cambiado: $user $territory<BR>\n"; + echo "Registros modificados: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,13 +299,13 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">Lista de territorios</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Añadir Territorio</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Añadir usuario Territorio</a></TD> <? if ($enable_vtiger_integration > 0) { ?> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territorio Owner</a></TD> <? $colspan='4'; } ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AYUDA\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,10 +350,10 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambio Territorio Propietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,12 +387,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END change territory owner in the system @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio y el usuario deberá ser llenado en<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Tuvo que añadir el territorio de usuario: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Territorio Propietario cambiado: $user $territory       Registros modificados: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Añadir usuario Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -550,7 +550,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -567,7 +567,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$territories_list"; echo "</select></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Level: </td><td align=left><select size=1 name=level><option>TOP_AGENT</option><option>STANDARD_AGENT</option><option>BOTTOM_AGENT</option></select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add user territory page @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, y de nivel de usuario debe ser llenado en<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: este usuario territorio ya está en el sistema de<BR>\n"; } else { @@ -600,7 +600,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Added: $user $territory<BR>\n"; + echo "Usuario Territorio Añadido: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, y de nivel de usuario debe ser llenado en<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: este usuario territorio no está en el sistema<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "Usuario Territorio Modificado: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio y el usuario deberá ser llenado en<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: este usuario territorio no está en el sistema<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "Usuario Territorio eliminados: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -706,12 +706,12 @@ if ($action == "ADD_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Añadir Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio Descripción: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add territory page @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio y Territorio Descripción deben ser rellenados<BR>\n"; } else { @@ -731,14 +731,14 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: ya existe un territorio en el sistema con ese nombre<BR>\n"; } else { $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; $rslt=mysql_query($stmt, $link); - echo "Territory Added: $territory<BR>\n"; + echo "Territorio en que se agregó: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Territorio debe ser llenado en<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Este territorio no está en el sistema con ese nombre<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Territorio eliminados: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio y Territorio Descripción deben ser rellenados<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Este territorio no está en el sistema con ese nombre<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Territorio Modificado: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Modificar Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio Descripción: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -857,7 +857,7 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); $user_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Agents: </td><td align=left><B>$user_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Agentes: </td><td align=left><B>$user_count</B></td></tr>"; $owner_count=0; $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; @@ -882,13 +882,13 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rsltV); $vtiger_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Cuentas Vtiger: </td><td align=left><B>$vtiger_count</B></td></tr>"; } - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=ENVIAR value=ENVIAR></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Usuarios in this Territorio:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">ELIMINAR</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Suprimir este territorio</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Territorio que no se encuentra: $territory<BR>\n"; } } ### END modify territory page @@ -986,13 +986,13 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Lista de todos los territorios:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TERRITORY</B></TD>"; - echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPCIÓN</B></TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>AGENTS</TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACCOUNTS</TD>\n"; if ($enable_vtiger_integration > 0) @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>Territorios de usuario     VERSIÓN: <?php echo $version ?>     CONSTRUCCION: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_es/vdremote.php index 43a1f130..eaa7d89e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_es/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/vicidial_sales_viewer.php b/agc_2-X/trunk/LANG_www/vicidial_es/vicidial_sales_viewer.php index ffbd09ec..e249a192 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/vicidial_sales_viewer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/vicidial_sales_viewer.php @@ -88,7 +88,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <input type="hidden" name="list_ids"> <table border=0 cellpadding=5 cellspacing=0 align=center width=600> <tr> - <th colspan=3><font class="standard_bold">Vicidial SALIENTE recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> + <th colspan=3><font class="standard_bold">Vicidial OUTBOUND recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> <BR></th> </tr> <tr bgcolor='#CCCCCC'> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_es/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_es/welcome.php index 9bf59ccc..b2e171d2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Bienvenido\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php index 3b48ee07..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -59,6 +59,9 @@ echo "   \n"; echo "\n"; +echo "
    Recepción
     
    "; echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php index 4fe6d387..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php @@ -2,7 +2,7 @@ # welcome_languages.php - VICIDIAL welcome Languages page # # -# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -59,6 +59,9 @@ echo "  
    "; echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_es/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_es/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSER_service_level.php index d581bc60..6c44bfc5 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90801-0923 - Added in-group name to pulldown # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,33 +39,57 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Service Level Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -69,6 +99,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -76,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Service Level Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; -echo "
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFIER | RAPPORTS \n"; -echo "
    \n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           TÉLÉCHARGER | MODIFIER | RAPPORTS"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if (!$group)
     	{
    -	echo "\n\n";
    -	echo "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
     	}
     
     else
    @@ -261,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
     	$DURATIONday++;
     	}
     
    -echo "Inbound Service Level Report                      $NOW_TIME\n";
    -echo "\n";
    -echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
    +$MAIN.="\n";
    +$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
     #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
    +$CSV_text.="\n";
    +$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
     
     $d=0;
     while ($d < $DURATIONday)
    @@ -370,7 +457,7 @@ $TOTintervals = $j;
     ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
     $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$MAIN.="$stmt\n";}
     $records_to_grab = mysql_num_rows($rslt);
     $i=0;
     while ($i < $records_to_grab)
    @@ -489,12 +576,40 @@ while ($j < $TOTintervals)
     
     ###################################################
     ### TOTALS SUMMARY SECTION ###
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    -echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    -echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    -echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    +$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    +$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
     
    +
    +$graph_stats=array();
    +$max_drops=1;
    +$max_droppct=1;
    +$max_avgdrops=1;
    +$max_hold=1;
    +$max_holdpct=1;
    +$max_avgholds=1;
    +$max_avgholdstotal=1;
    +$max_calls=1;
    +$max_totalcalltime=1;
    +$max_avgcalltime=1;
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTIME MIN:SECAVG CALLTIME SECONDS

     


    "; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -538,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -551,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -605,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
    INBOUND SERVICE NIVEAU REPORT
    ETATDROPS
    DROP %
    AVG DROP(s)
    HOLD
    HOLD %
    AVG HOLD(s) HOLD
    AVG HOLD(s) TOTAL
    CALLS
    TOTAL CALLTIME MIN:SEC
    AVG CALLTIME SECONDS
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    TOTAL:".trim($FtotDROPS)."
    "; + $DROPPCT_graph.="
    TOTAL:".trim($FtotDROPSpct)."%
    "; + $AVGDROPS_graph.="
    TOTAL:".trim($FtotDROPSavg)."
    "; + $HOLD_graph.="
    TOTAL:".trim($FtotQUEUE)."
    "; + $HOLDPCT_graph.="
    TOTAL:".trim($FtotQUEUEpct)."%
    "; + $AVGHOLDS_graph.="
    TOTAL:".trim($FtotQUEUEavg)."
    "; + $AVGHOLDSTOTAL_graph.="
    TOTAL:".trim($FtotQUEUEtot)."
    "; + $CALLS_graph.="
    TOTAL:".trim($FtotCALLS)."
    "; + $TOTALCALLTIME_graph.="
    TOTAL:".trim($totTIME_MS)."
    "; + $AVGCALLTIME_graph.="
    TOTAL:".trim($FtotCALLSavg)."
    "; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -860,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- CALL TIME HOLD RÉPARTITION EN SECONDES\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE REPONSE (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL TIME HOLD RÉPARTITION EN SECONDES\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE REPONSE (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"CALL TIME HOLD RÉPARTITION EN SECONDES\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE REPONSE(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -947,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -973,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERstats.php index d5b7a593..f3a02d2e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -27,6 +27,14 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -47,8 +55,14 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -56,23 +70,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -82,13 +114,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +135,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,19 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -126,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -141,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -156,128 +245,138 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Inbound Stats\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Date Range:
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Date Range:
    \n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo "
    \n"; -echo "Groupes entrants: \n"; -echo "\n"; -echo "\n"; +if ($DID=='Y') + {$MAIN.="Inbound DIDs: \n";} +else + {$MAIN.="Groupes entrants: \n";} +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; -echo "MODIFIER | "; -echo "RAPPORTS | "; -echo "IVR REPORT \n"; -echo "\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; +if ($DID!='Y') + { + $MAIN.="MODIFIER | "; + $MAIN.="IVR REPORT | \n"; + } +$MAIN.="RAPPORTS | "; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +#$MAIN.="\n";
    +$MAIN.="Shift: \n";
    +$MAIN.="
    Afficher as:  "; +$MAIN.="\n
    "; +$MAIN.="   \n"; +$MAIN.="
    \n"; +$MAIN.="\n\n"; +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
    -{
    -echo "\n\n";
    -echo "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
    -}
    +	{
    +	$MAIN.="\n\n";
    +	if ($DID=='Y')
    +		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK VALIDER\n";}
    +	else
    +		{$MAIN.="S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";}
    +	}
     
     else
     {
    @@ -305,38 +404,125 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
    +$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        TÉLÉCHARGER\n";
    +
    +$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
     
     
    +if ($DID=='Y')
    +	{
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$dids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $dids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$did_id[$i] = $row[0];
    +		$did_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$did_SQL = eregi_replace(",$",'',$did_SQL);
    +	if (strlen($did_SQL)<3) {$did_SQL="''";}
     
    +	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$unids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $unids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$unid_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
    +	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
     
    +	if ($DB > 0)
    +		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
     
    +	}
     
     if ($group_ct > 1)
     	{
    -	echo "\n";
    -	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    -	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
    +
    +	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
    +
    +	if ($DID=='Y')
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
    +	else
    +		{
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
    +		}
     
     	$i=0;
     	while($i < $group_ct)
     		{
    -		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		$did_id[$i]='0';
    +		$DIDunid_SQL='';
    +		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$Sdids_to_print = mysql_num_rows($rslt);
    +		if ($Sdids_to_print > 0)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$did_id[$i] = $row[0];
    +			}
    +
    +		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
    +		$DIDunids_to_print = mysql_num_rows($rslt);
    +		$k=0;
    +		while ($k < $DIDunids_to_print)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$DIDunid_SQL .= "'$row[0]',";
    +			$k++;
    +			}
    +		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
    +		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
    +
    +		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    +		if ($row[0]>$max_value) {$max_value=$row[0];}
     
     		$groupDISPLAY =	sprintf("%20s", $group[$i]);
     		$gTOTALcalls =	sprintf("%7s", $row[0]);
    @@ -351,32 +537,94 @@ if ($group_ct > 1)
     			}
     		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
     
    -		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
    +		$graph_data_ary[$i][0]=$groupDISPLAY;
    +		$graph_data_ary[$i][1]=$gTOTALcalls;
    +		$graph_data_ary[$i][2]=$gDROPcalls;
    +		$graph_data_ary[$i][3]=$gDROPpercent;
    +		$graph_data_ary[$i][4]=$gIVRcalls;
    +
     		$i++;
     		}
     
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
     
     	}
     
    +	if ($report_display_type=="HTML") {
    +		$max_value=1;
    +		$graph_height=240;
    +		$scale = 1;
    +		$w=0;
    +		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
    +			if ($graph_data_ary[$i][1]>0) {$w++;}
    +		}
    +		$scale = $graph_height / $max_value;
     
    -echo "\n";
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- TOTALS\n";
    +
    +		$GRAPH_text.="";
    +		for ($d=0; $d0) {
    +				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
    +				$GRAPH_text.="  \n";
    +			}
    +		}
    +		$GRAPH_text.="
    MULTI-GROUP BREAKDOWN
    GROUPIVRS / DROPS / CALLS
    ".$graph_data_ary[$d][0]."
    ".$graph_data_ary[$d][3]."% drops
     
    \n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][1]."
    • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][2]."
    • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][4]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALS\n"; + +$CSV_text1.="\n\"Time range:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; +if ($DID=='Y') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -408,19 +656,30 @@ else } -echo "Total des appels pris en Dans ce groupe: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $REPONSEEDcalls $REPONSEEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Groupe: $IVRcalls\n"; +$MAIN.="Total des appels pris en Dans ce groupe: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $REPONSEEDcalls $REPONSEEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Groupe: $IVRcalls\n"; +$CSV_text1.="\"Total des appels pris en Dans ce groupe:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$REPONSEEDcalls\",\"$REPONSEEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- ABANDONNES\n"; +$MAIN.="\n"; +$MAIN.="---------- ABANDONNES\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -450,56 +709,70 @@ else $DROP_REPONSEEDpercent = round($DROP_REPONSEEDpercent, 0); } -echo "Total des appels abandonnés: $DROPcalls $DROPpercent% drop/answered: $DROP_REPONSEEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Total des appels abandonnés: $DROPcalls $DROPpercent% drop/answered: $DROP_REPONSEEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_REPONSEEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) { - $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $Sanswer_sec_pct_rt_stat_one = $row[0]; - $Sanswer_sec_pct_rt_stat_two = $row[1]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_one = $row[0]; - - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $answer_sec_pct_rt_stat_two = $row[0]; - - if ( ($REPONSEEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + if ($DID!='Y') { - $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $REPONSEEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); - #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); - $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $REPONSEEDcalls) * 100); - $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); - #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $Sanswer_sec_pct_rt_stat_one = $row[0]; + $Sanswer_sec_pct_rt_stat_two = $row[1]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_one = $row[0]; + + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $row=mysql_fetch_row($rslt); + $answer_sec_pct_rt_stat_two = $row[0]; + + if ( ($REPONSEEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) ) + { + $PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $REPONSEEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0); + #$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one); + $PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $REPONSEEDcalls) * 100); + $PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0); + #$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two); + } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Total des appels pris in to this In-Group): $REPONSEEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_REPONSEEDpercent%\n"; -echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; -echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Total des appels pris in to this In-Group): $REPONSEEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_REPONSEEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Total des appels pris in to this In-Group):\",\"$REPONSEEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_REPONSEEDpercent%\"\n"; + +if ($DID!='Y') + { + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; + } # GET LIST OF ALL STATUSES and create SQL from human_answered statuses $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -516,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -534,12 +807,18 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; +if ($DID=='Y') + { + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -569,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -580,17 +863,27 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- CALL TIME HOLD RÉPARTITION EN SECONDES\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL TIME HOLD RÉPARTITION EN SECONDES TÉLÉCHARGER\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL TIME HOLD RÉPARTITION EN SECONDES\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -633,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -643,17 +1008,26 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -696,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -707,15 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL REPONSEED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL REPONSEED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL REPONSEED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; +if ($DID=='Y') + { + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -899,31 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- FAIT APPEL Hangup STATS\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- FAIT APPEL Hangup STATS TÉLÉCHARGER\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"FAIT APPEL Hangup STATS\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; +if ($DID=='Y') + { + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -932,42 +1465,105 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
    \n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    FAIT APPEL Hangup STATS
    REASON CALLS
    \"\"".$ct_ary[$i][0]."
    TOTAL DES APPELS:".trim($TOTALcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     ##############################
     #########  CALL STATUS STATS
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL STATUS STATS\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    -echo "| STATUS | DESCRIPTION          | CATÉGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL STATUS STATS       TÉLÉCHARGER\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text.="| STATUS | DESCRIPTION          | CATÉGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTOTAL TIMEAVG TIMECALLS/HR

     


    "; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"CATÉGORIE\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;"; +if ($DID=='Y') + { + $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -995,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1015,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1045,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
    CALL STATUS STATS
    ETATCALLS
    TOTAL TIME
    AVG TIME
    CALLS/HR
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    TOTAL:".trim($TOTALcalls)."
    "; + $TOTALTIME_graph.="
    TOTAL:".trim($TOTALhours)."
    "; + $AVGTIME_graph.="
    TOTAL:".trim($TOTALavg)."
    "; + $CALLSHOUR_graph.="
    TOTAL:".trim($TOTALrate)."
    "; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS CATÉGORIE STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| CATÉGORIE | CALLS | DESCRIPTION |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS CATÉGORIE STATS
    TÉLÉCHARGER\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| CATÉGORIE | CALLS | DESCRIPTION |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS CATÉGORIE STATS\"\n"; +$CSV_text5.="\"CATÉGORIE\",\"CALLS\",\"DESCRIPTION\"\n"; $TOTCATcalls=0; $r=0; @@ -1070,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1078,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
    ".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CUSTOM STATUS CATÉGORIE STATS
    CATÉGORIE CALLS
    ".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
    TOTAL:".trim($TOTCATcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else 
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     
     ##############################
    @@ -1088,15 +1793,23 @@ echo "+----------------------+------------+\n";
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    -echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       TÉLÉCHARGER\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +
    +$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
    +$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
    +
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
    +	}
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$ASCII_text.="$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
     $i=0;
     while ($i < $positions_to_print)
    @@ -1139,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
     
     $TOTALcalls =		sprintf("%10s", $TOTALcalls);
     
    -echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
     
    +$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
     
    +if ($report_display_type=="HTML") 
    +	{
    +	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
    +	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
    +	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
    +	if ($DID=='Y')
    +		{
    +		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
    +		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
    +		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
    +		}
    +	if ($DB) {$GRAPH_text.=$stmt."\n";}
    +	$ms_rslt=mysql_query($ms_stmt, $link);
    +	$ms_row=mysql_fetch_row($ms_rslt);
    +	$max_position=$ms_row[0];
    +	if ($max_position>25) {$max_position=26;}
    +	for ($i=1; $i<=$max_position; $i++) {
    +		$sec_ary[$i]=0;
    +	}
    +
    +	$mc_rslt=mysql_query($mc_stmt, $link);
    +	$mc_row=mysql_fetch_row($mc_rslt);
    +	$max_calls=$ms_row[0];
    +	if ($max_calls<=10) {
    +		while ($maxcalls%5!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=100) {
    +		while ($maxcalls%10!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=1000) {
    +		while ($maxcalls%50!=0) {
    +			$maxcalls++;
    +		}
    +	} else {
    +		while ($maxcalls%500!=0) {
    +			$maxcalls++;
    +		}
    +	}
    +	$rslt=mysql_query($stmt, $link);
    +	
    +	$GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1152,15 +1935,35 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- AGENT STATS\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- AGENT STATS TÉLÉCHARGER\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| AGENT | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"AGENT STATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTIME H:M:SAVERAGE

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +if ($DID=='Y') + { + $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1183,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1210,26 +2022,73 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
    AGENT STATS
    AGENTCALLS
    TIME H:M:S
    AVERAGE
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    TOTAL:".trim($TOTALcalls)."
    "; +$TIMEHMS_graph.="
    TOTAL:".trim($TOTtime)."
    "; +$AVERAGE_graph.="
    TOTAL:".trim($TOTavg)."
    "; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTAL Agents: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- STATISTIQUE TEMPORELLES\n"; +$MAIN.="\n"; +$MAIN.="---------- STATISTIQUE TEMPORELLES
    TÉLÉCHARGER\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## ######### 15-minute increment breakdowns of total calls and drops, then answered table $BDansweredCALLS = 0; $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; +if ($DID=='Y') + { + $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; + } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1240,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1255,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1313,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1343,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1364,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1378,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1394,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1410,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
    GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
    HOURDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL REPONSEED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL REPONSEED TIME BREAKDOWN IN SECONDS TÉLÉCHARGER\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL REPONSEED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1508,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1516,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALS| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALS| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALS\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.=""; +$MAIN.="
    "; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERsummary_hourly.php index 2c5f60dc..272388cf 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 90809-0216 - Added Exclude Outbound Drop Group option # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -40,10 +46,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -52,23 +62,38 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} +$report_name = 'Inbound Résumé Hourly Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -78,21 +103,70 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -100,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -116,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -124,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -139,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -155,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -168,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "Inbound Summary Hourly Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Date Range:
    \n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; + $MAIN.=" \n"; - echo "
      \n"; - echo "\n"; - echo "Inbound Groups:
    \n"; - echo "
      \n"; + $MAIN.="\n"; + $MAIN.="Groupes entrants:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "   Exclude Outbound Drop Groups:
    "; - echo "   \n"; - echo "
                          "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="           "; + $MAIN.="TÉLÉCHARGER | "; + $MAIN.="MODIFIER | "; + $MAIN.="RAPPORTS"; + $MAIN.="\n"; + $MAIN.="
      Afficher as: "; + $MAIN.="\n
    "; + $MAIN.="   Exclude Outbound Drop Groups:
    "; + $MAIN.="   \n"; + $MAIN.="
                          "; + $MAIN.="\n"; - echo "
    \n"; + $MAIN.="
    \n"; - echo "Call Time:
    \n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
     	}
     
     else
    @@ -309,7 +389,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -352,18 +432,48 @@ else
     	$query_date_END = "$end_date 23:59:59";
     
     
    -	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
    +	$MAIN .= "Inbound Résumé Hourly Report: $group_string          $NOW_TIME\n";
    +	$CSV_main.="Inbound Résumé Hourly Report:,$NOW_TIME\n";
     
     
    +	$JS_text.="\n";
    +
     	if ($costformat > 0)
     		{
    -		echo "
    \n"; + $ASCII_text.="
    \n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
    "; + + echo ""; + + } + } - - ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_DIDstats.php new file mode 100644 index 00000000..0dd6e387 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; + } + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
    to
    "; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

    "; +$MAIN.="\n"; +$MAIN.="           TÉLÉCHARGER | MODIFIER | RAPPORTS \n"; +$MAIN.="
    \n"; +$MAIN.="
    \n"; + +$MAIN.="
    ";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK VALIDER\n";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +	#	$time_BEGIN=$AM_shift_BEGIN;
    +	#	$time_END=$AM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +	#	$time_BEGIN=$PM_shift_BEGIN;
    +	#	$time_END=$PM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
    +	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
    +	$MAIN.="\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +
    +	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
    +	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
    +
    +	$d=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) );
    +		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
    +
    +		if ($EQsec < $SQsec)
    +			{
    +			$dEQepoch = ($dEQepoch + 86400);
    +			}
    +
    +		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +		$d++;
    +		}
    +
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### CONSTRUCTION HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $j;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	$extension[0]='';
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$dt[$i] =			0;
    +		$ut[$i] =			($row[0] - $SQepochDAY);
    +		$extension[$i] =	$row[1];
    +		while($ut[$i] >= 86400) 
    +			{
    +			$ut[$i] = ($ut[$i] - 86400);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +
    +		$i++;
    +		}
    +
    +	### Find default route
    +	$default_route='';
    +	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$Drecords_to_grab = mysql_num_rows($rslt);
    +	if ($Drecords_to_grab > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$default_route =	$row[0];
    +		}
    +
    +	###################################################
    +	### TOTALS DID SUMMARY SECTION ###
    +	if (strlen($extension[0]) > 0)
    +		{
    +		$ASCII_text.="DID Summary:\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="| DID                | DESCRIPTION                    | ROUTE      | CALLS      |\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +
    +		$CSV_text1.="\"DID Summary:\"\n";
    +		$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
    +
    +		$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    DID Summary:
    DIDCALLS
    \"\"".$graph_stats[$d][0]."
    TOTAL DES APPELS:".trim($totCALLS)."
    \n";
    +
    +			$FtotCALLS =	sprintf("%10s", $totCALLS);
    +
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="|                                                           TOTALS | $FtotCALLS |\n";
    +		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
    +		$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
    +		#$MAIN.=$GRAPH;
    +
    +		}
    +
    +
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totCALLSmax=0;
    +	$totCALLSdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
    +				{
    +				$totCALLS++;
    +				$qrtCALLS[$j]++;
    +				$dtt = $dt[$i];
    +				$totCALLSdate[$dtt]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +
    +
    +	###################################################
    +	### TOTALS DATE SUMMARY SECTION ###
    +	$ASCII_text.="\nDate Summary:\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="| SHIFT                                     |        |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +
    +	$CSV_text1.="\n\"Date Summary:\"\n";
    +	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
    +
    +	$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    Date Summary:
    SHIFT DATE-TIME RANGECALLS
    \"\"".$graph_stats[$d][0]."
    TOTAL DES APPELS:".trim($totCALLS)."
    \n";
    +
    +
    +	$FtotCALLS =	sprintf("%6s", $totCALLS);
    +
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="|                                    TOTALS | $FtotCALLS |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
    +	#$MAIN.=$GRAPH;
    +
    +	if ($report_display_type=="HTML")
    +		{
    +		$MAIN.=$GRAPH_text;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +
    +	## FORMAT OUTPUT ##
    +	$i=0;
    +	$hi_hour_count=0;
    +	$hi_hold_count=0;
    +
    +	while ($i < $TOTintervals)
    +		{
    +		if ($qrtCALLS[$i] > 0)
    +			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
    +
    +		if ($qrtCALLS[$i] > $hi_hour_count) 
    +			{$hi_hour_count = $qrtCALLS[$i];}
    +
    +		$i++;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (70 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (70 / $hi_hold_count);}
    +
    +
    +
    +
    +	###################################################################
    +	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
    +
    +	$MAIN.="\n";
    +	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
    +
    +	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
    +
    +	$ASCII_text.="";
    +
    +	$ASCII_text.="";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
    +
    +	$k=1;
    +	$Mk=0;
    +	$call_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hour_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hour_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hour_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$call_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$call_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$call_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +	$k=1;
    +	$Mk=0;
    +	$hold_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hold_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hold_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hold_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$hold_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$hold_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$hold_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
    +	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
    +
    +
    +
    +	$max_calls=1;
    +	$graph_stats=array();
    +	$GRAPH_text="";
    +
    +
    +	$i=0;
    +	while ($i < $TOTintervals)
    +		{
    +		$char_counter=0;
    +		### BEGIN HOLD TIME TOTALS GRAPH ###
    +			$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count > 0) {$no_lines_yet=0;}
    +
    +		$Gavg_hold = $qrtQUEUEavg[$i];
    +		if ($Gavg_hold < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				$TOT_lines++;
    +				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +				$ASCII_text.="|$HMdisplay[$i]|";
    +				$CSV_text1.="\"$HMdisplay[$i]\",";
    +			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
    +			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +				}
    +			}
    +		else
    +			{
    +			$TOT_lines++;
    +			$no_lines_yet=0;
    +			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
    +			$Yavg_hold = (19 - $Xavg_hold);
    +
    +			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +
    +		#	$ASCII_text.="|$HMdisplay[$i]|";
    +			$ASCII_text.="|$HMdisplay[$i]|";
    +			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
    +		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
    +		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
    +		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
    +		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +			}
    +		### END HOLD TIME TOTALS GRAPH ###
    +
    +		$char_counter=0;
    +		### BEGIN CALLS TOTALS GRAPH ###
    +		$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +			#	$ASCII_text.="  |";
    +				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"0\"\n";
    +				}
    +			}
    +		else
    +			{
    +			$no_lines_yet=0;
    +			$Xhour_count = ($Ghour_count * $hour_multiplier);
    +			$Yhour_count = (69 - $Xhour_count);
    +
    +			$Gdrop_count = $qrtDROPS[$i];
    +			if ($Gdrop_count < 1) 
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
    +				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			else
    +				{
    +				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
    +
    +			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
    +
    +				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
    +
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
    +				$ASCII_text.="D";   $char_counter++;
    +				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				$ASCII_text.="C";   $char_counter++;
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			}
    +		### END CALLS TOTALS GRAPH ###
    +		$graph_stats[$i][0]=$HMdisplay[$i];
    +		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
    +		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
    +		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
    +		$i++;
    +		}
    +
    +
    +	if ($totQUEUEsec > 0)
    +		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
    +	else
    +		{$totQUEUEavgRAW = 0;}
    +	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
    +	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
    +	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
    +	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
    +	$totDROPS =	sprintf("%5s", $totDROPS);
    +	$totCALLS =	sprintf("%5s", $totCALLS);
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +
    +	for ($d=0; $d\n";
    +	}
    +	$GRAPH_text.="
    HOLD TIME, CALL AND DROP STATS
    TIME 15-MIN INTDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
    TOTALS:".trim($totCALLS)."
    "; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRfilter.php index 1ca68172..60cf1c6f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "\n"; +$HTML_text.="
    \n"; -echo "\n"; -echo "Date Range:
    \n"; -echo "\n"; -echo " to \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "RAPPORTS\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; +$HTML_text.="Date Range:
    \n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
    \n\n";
    +$HTML_text.="\n";
    +
    +$HTML_text.="
    Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="RAPPORTS\n"; +$HTML_text.="\n"; + +$HTML_text.="
    \n"; + +$HTML_text.="   \n"; +$HTML_text.="
    \n"; +$HTML_text.="\n\n"; + +$HTML_text.="
    \n\n";
     
     $shift = 'ALL';
     
    @@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
    +$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [TÉLÉCHARGER]\n";
    +
    +$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
    +
    +$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
    +$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
    +
    +$i=0;
    +while($start_date<$end_date) {
    +	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
    +	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
    +	for ($j=0; $j<16; $j++) {
    +		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
    +	}
    +	
    +	$i++;
    +	$start_date+=$date_int;
    +}
    +
    +$total=0;
    +$Utotal=0;
    +$totalstq=0;
    +$Utotalstq=0;
    +$totalnocid=0;
    +$Utotalnocid=0;
    +$totaldnc=0;
    +$Utotaldnc=0;
    +$totalsale=0;
    +$Utotalsale=0;
    +$totalarch=0;
    +$Utotalarch=0;
    +$totaltiq=0;
    +$Utotaltiq=0;
    +$totalsta=0;
    +$Utotalsta=0;
    +
    +	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
    +	$rsltA=mysql_query($stmtA, $link);
    +	if ($DB) {$HTML_text.="$stmtA\n";}
    +	while ($rowA=mysql_fetch_row($rsltA)) {
    +		$count_ary[$rowA[2]][0]+=$rowA[0];
    +		$count_ary[$rowA[2]][1]+=$rowA[1];
    +		$count_ary[$rowA[2]][14]+=$rowA[0];
    +		$count_ary[$rowA[2]][15]+=$rowA[1];
    +		$total+=$rowA[0];
    +		$Utotal+=$rowA[1];
    +		$totalstq+=$rowA[0];
    +		$Utotalstq+=$rowA[1];
    +	}
    +
    +	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
    +	$rsltB=mysql_query($stmtB, $link);
    +	if ($DB) {$HTML_text.="$stmtB\n";}
    +	while ($rowB=mysql_fetch_row($rsltB)) {
    +		$count_ary[$rowB[2]][2]+=$rowB[0];
    +		$count_ary[$rowB[2]][3]+=$rowB[1];
    +		$total+=$rowB[0];
    +		$Utotal+=$rowB[1];
    +		$count_ary[$rowB[2]][14]+=$rowB[0];
    +		$count_ary[$rowB[2]][15]+=$rowB[1];
    +		$totalnocid+=$rowB[0];
    +		$Utotalnocid+=$rowB[1];
    +	}
    +
    +	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
    +	$rsltC=mysql_query($stmtC, $link);
    +	if ($DB) {$HTML_text.="$stmtC\n";}
    +	while ($rowC=mysql_fetch_row($rsltC)) {
    +		$count_ary[$rowC[2]][4]+=$rowC[0];
    +		$count_ary[$rowC[2]][5]+=$rowC[1];
    +		$total+=$rowC[0];
    +		$Utotal+=$rowC[1];
    +		$count_ary[$rowC[2]][14]+=$rowC[0];
    +		$count_ary[$rowC[2]][15]+=$rowC[1];
    +		$totaldnc+=$rowC[0];
    +		$Utotaldnc+=$rowC[1];
    +	}
    +
    +	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
    +	$rsltD=mysql_query($stmtD, $link);
    +	if ($DB) {$HTML_text.="$stmtD\n";}
    +	while ($rowD=mysql_fetch_row($rsltD)) {
    +		$count_ary[$rowD[2]][6]+=$rowD[0];
    +		$count_ary[$rowD[2]][7]+=$rowD[1];
    +		$total+=$rowD[0];
    +		$Utotal+=$rowD[1];
    +		$count_ary[$rowD[2]][14]+=$rowD[0];
    +		$count_ary[$rowD[2]][15]+=$rowD[1];
    +		$totalsale+=$rowD[0];
    +		$Utotalsale+=$rowD[1];
    +	}
    +
    +	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
    +	$rsltE=mysql_query($stmtE, $link);
    +	if ($DB) {$HTML_text.="$stmtE\n";}
    +	while ($rowE=mysql_fetch_row($rsltE)) {
    +		$count_ary[$rowE[2]][8]+=$rowE[0];
    +		$count_ary[$rowE[2]][9]+=$rowE[1];
    +		$total+=$rowE[0];
    +		$Utotal+=$rowE[1];
    +		$count_ary[$rowE[2]][14]+=$rowE[0];
    +		$count_ary[$rowE[2]][15]+=$rowE[1];
    +		$totalarch+=$rowE[0];
    +		$Utotalarch+=$rowE[1];
    +	}
    +
    +	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
    +	$rsltF=mysql_query($stmtF, $link);
    +	if ($DB) {$HTML_text.="$stmtF\n";}
    +	while ($rowF=mysql_fetch_row($rsltF)) {
    +		$count_ary[$rowF[2]][10]+=$rowF[0];
    +		$count_ary[$rowF[2]][11]+=$rowF[1];
    +		$totaltiq+=$rowF[0];
    +		$Utotaltiq+=$rowF[1];
    +	}
    +
    +	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
    +	$rsltG=mysql_query($stmtG, $link);
    +	if ($DB) {$HTML_text.="$stmtG\n";}
    +	while ($rowG=mysql_fetch_row($rsltG)) {
    +		$count_ary[$rowG[2]][12]+=$rowG[0];
    +		$count_ary[$rowG[2]][13]+=$rowG[1];
    +		$totalsta+=$rowG[0];
    +		$Utotalsta+=$rowG[1];
    +	}
     
     
    -echo "\n";
    -echo "+----------------------+---------+---------+---------+\n";
    -echo "| CATÉGORIE             | CALLS   | UNIQUE  |      %  |\n";
    -echo "+----------------------+---------+---------+---------+\n";
    +	$HTML_text.="\n";
    +	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
    +	$HTML_text.="|                              |          TOTALS         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
    +	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
    +	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	
    +	$CSV_text.="\n";
    +	$CSV_text.="\"\",\"\",\"TOTALS\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
    +	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
    +
    +	for($i=0; $i
    -
    -
    + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRstats.php index de2bb42c..5b59f2cc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -13,6 +13,13 @@ # 91112-0719 - Added in-group names to select list # 100214-1421 - Sort menu alphabetically # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -28,39 +35,71 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} + +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} +$db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "IVR Stats Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Date Range:
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Date Range:
    \n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    to
    "; +$MAIN.="
    to
    "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    \n"; -echo "Groupes entrants: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Groupes entrants: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="TÉLÉCHARGER | "; + $MAIN.="MODIFIER | "; + $MAIN.="RAPPORTS | "; + $MAIN.="RAPPORT SUR LES CLOSERS \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Campagnes: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="TÉLÉCHARGER | "; + $MAIN.="MODIFIER | "; + $MAIN.="RAPPORTS | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "MODIFIER | "; -echo "RAPPORTS | "; -echo "RAPPORT SUR LES CLOSERS \n"; -echo "\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
    Afficher as:  "; +$MAIN.="\n
    "; +$MAIN.="    \n"; -   -
    \n"; +$MAIN.="\n\n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
     	}
     
     else
     	{
    -	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    -	echo "                  $group_string\n";
    +	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    +	$MAIN.="                  $group_string\n";
    +
    +	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
     
     	$TOTALcalls=0;
     	$NOCALLERIDcalls=0;
    @@ -338,9 +463,16 @@ else
     	$totFLOWtotal_time=0;
     
     	##### Grab all records for the IVR for the specified time period
    -	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +	if ($type == 'inbound')
    +		{
    +		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +		}
    +	else
    +		{
    +		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
    +		}
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$logs_to_print = mysql_num_rows($rslt);
     	$p=0;
     	while ($p < $logs_to_print)
    @@ -365,11 +497,11 @@ else
     	$r=-1;
     	while ($p < $logs_to_print)
     		{
    -		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
    +		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
     		if ($last_uniqueid === "$uniqueid[$p]")
     			{
     			$unique_calls[$r] .= "----------$comment_b[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			$last_epoch[$r]=$epoch[$p];
     			}
     		else
    @@ -391,7 +523,7 @@ else
     			$unique_calls[$r] = $comment_b[$p];
     			$FLOWuniqueid[$r] = "$uniqueid[$p]";
     			$last_uniqueid = "$uniqueid[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			}
     		$p++;
     		}
    @@ -408,7 +540,7 @@ else
     	$s=0;
     	while ($s <= $r)
     		{
    -		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
    +		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
     		if ($last_Suniqueid === "$unique_calls[$s]")
     			{
     			$STunique_calls_count[$p]++;
    @@ -436,11 +568,15 @@ else
     		}
     
     	#### PRINT TOTAL DES APPELSINTO THIS IVR
    -	echo "\n";
    -	echo "Calls taken into this IVR:   $TOTALcalls\n";
    -	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
    -	echo "Unique Callers:              $UNIQUEcallers\n";
    -	echo "\n";
    +	$MAIN.="\n";
    +	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
    +	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
    +	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
    +	$MAIN.="\n";
    +
    +	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
    +	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
    +	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
     
     	### sort call flows for counting
     	if ($p > 0)
    @@ -475,11 +611,32 @@ else
     	### put call flows and counts together for sorting again
     	$s=0;
     
    -	echo "+--------+--------+--------+--------+------+------+\n";
    -	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    -	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    -	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    -	echo "+--------+--------+--------+--------+------+------+------------\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
    +	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    +	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    +	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
    +
    +	######## GRAPHING #########
    +	$graph_stats=array();
    +	$max_ivr_calls=1;
    +	$max_queue_calls=1;
    +	$max_queue_drops=1;
    +	$max_queue_drops_percent=1;
    +	$max_ivr_avg=1;
    +	$max_total_avg=1;
    +	$GRAPH="";
    +	$GRAPH.="";
    +	$GRAPH.="
    IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

     


    "; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
    IVR STATS
    IVR CALLSCALL PATH
    "; + $QUEUEDROPCALLS_graph="
    IVR STATS
    QUEUE CALLSCALL PATH
    "; + $QUEUEDROPPERCENT_graph="
    IVR STATS
    QUEUE DROP CALLSCALL PATH
    "; + $IVRAVGTIME_graph="
    IVR STATS
    QUEUE DROP PERCENTCALL PATH
    "; + $TOTALAVGTIME_graph="
    IVR STATS
    IVR AVG TIMECALL PATH
    "; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -493,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -528,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -557,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
    IVR STATS
    TOTAL AVG TIMECALL PATH
    ".$graph_stats[$d][0]."
    ".$graph_stats[$d][2]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][3]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
    ".$graph_stats[$d][5]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][6]."".$graph_stats[$d][0]."
    ".trim($TOTALcalls)."TOTAL
    "; + $QUEUECALLS_graph.="
    ".trim($totFLOWtotal)."TOTAL
    "; + $QUEUEDROPCALLS_graph.="
    ".trim($totFLOWdrop)."TOTAL
    "; + $QUEUEDROPPERCENT_graph.="
    ".trim($totFLOWdropPCT)."%TOTAL
    "; + $IVRAVGTIME_graph.="
    ".trim($TavgFLOWivr_time)."TOTAL
    "; + $TOTALAVGTIME_graph.="
    ".trim($TavgFLOWtotal_time)."TOTAL
    "; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- STATISTIQUE TEMPORELLES\n"; + $MAIN.="\n"; + $MAIN.="---------- STATISTIQUE TEMPORELLES\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -576,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -586,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -623,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -653,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -688,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -701,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -715,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..195a78c9 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Listes Statuts De Campagne Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..cc586581 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
    \n"; + echo "$query_date|$end_date\n"; + echo "
    \n"; + } + +echo "
    "; + +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    to
    \n"; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           RAPPORTS \n"; +echo "
    \n"; +echo "
    \n"; + +echo "
    ";
    +
    +
    +if (!$query_date)
    +{
    +echo "\n\n";
    +echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK VALIDER\n";
    +}
    +
    +else
    +{
    +echo "List Update Process Report                      $NOW_TIME\n";
    +echo "\n";
    +echo "Time range $query_date to $end_date\n\n";
    +
    +
    +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +echo "List Update Summary:\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +
    +$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$records_to_grab = mysql_num_rows($rslt);
    +$i=0;
    +while ($i < $records_to_grab)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$TOTcount = ($TOTcount + $row[0]);
    +	$TOTupdated = ($TOTupdated + $row[3]);
    +	$count =	sprintf("%-8s", $row[0]);
    +	$filename =	sprintf("%-50s", trim($row[1]));
    +	$result =	sprintf("%-10s", $row[2]);
    +	$updated =	sprintf("%-8s", $row[3]);
    +	echo "| $filename | $result | $count | $updated |\n";
    +
    +	$i++;
    +	}
    +$TOTcount =	sprintf("%-8s", $TOTcount);
    +$TOTupdated =	sprintf("%-8s", $TOTupdated);
    +
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "                                                                  | $TOTcount | $TOTupdated |\n";
    +echo "                                                                  +----------+----------+\n";
    +echo "\n
    \n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Détail:
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
    DATE/TIMELEAD_IDVENDOR_IDPHONEETATOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
    $row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

    \nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_OUTBOUNDsummary_interval.php index 4ce1906b..6e8c71c9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,12 @@ # 091129-0017 - Added Sales-type and DNC-type tallies # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,10 +44,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -50,23 +60,40 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Summary Interval Report'; +$db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "Outbound Summary Interval Report\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Date Range:
    \n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
    Campaigns:
    "; - echo "
    Campagnes:
    "; + $MAIN.="\n"; - echo "
    "; - echo "Include Drop  
    Rollover:
    "; - echo "
    \n"; - echo "Time Interval:
    "; - echo "\n"; + $MAIN.="
    "; + $MAIN.="Include Drop  
    Rollover:
    "; + $MAIN.="
    \n"; + $MAIN.="Time Interval:
    "; + $MAIN.="\n"; - echo "
    \n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "
            "; - echo "\n"; + {$MAIN.="\n";} - echo "
    \n"; - echo "Call Time:
    \n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="         "; + $MAIN.="TÉLÉCHARGER | "; + $MAIN.="MODIFIER | "; + $MAIN.="RAPPORTS"; + $MAIN.="

    \n"; + $MAIN.="Afficher as:
    "; + $MAIN.="\n
    "; + $MAIN.="
            "; + $MAIN.="\n"; + + $MAIN.="
    \n"; + + $MAIN.="Call Time:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($group_ct < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK VALIDER\n";
     	}
     
     else
    @@ -483,7 +526,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -553,7 +596,7 @@ else
     			$Hcalltime_HHMM[$h] = "$H_test";
     			}
     		if ($DB)
    -			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
    +			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
     		$h++;
     		}
     
    @@ -563,19 +606,49 @@ else
     
     	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
     
    -
    +	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
     
     
     	##### Loop through each campaign and gether stats
     	if ($group_ct > 0)
     		{
    -		$MAIN .= "\n";
    -		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    -		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    -		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
    -		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "\n";
    +		$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    +		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | REPONSE | DROP   | LOGIN      | PAUSE      |\n";
    +		$ASCII_text .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +
    +		$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
    +		$CSV_main.="\"CAMPAIGN\",\"TOTAL DES APPELS\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO REPONSE PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME(H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n";
    +		$CSV_subreports="";
    +		
    +		######## GRAPHING #########
    +		$max_calls=1;
    +		$max_system_release=1;
    +		$max_agent_release=1;
    +		$max_sales=1;
    +		$max_dncs=1;
    +		$max_nas=1;
    +		$max_drops=1;
    +		$max_login_time=1;
    +		$max_pause_time=1;
    +
    +		$GRAPH="

    "; + $GRAPH.=""; + $GRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENT RELEASE CALLSSALE CALLSDNC CALLSNO REPONSE PERCENTDROP PERCENTAGENT LOGIN TIMEAGENT PAUSE TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -596,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -614,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -641,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -655,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -732,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hREPONSEcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -815,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -823,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -953,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -961,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -978,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1004,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1025,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gREPONSEcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1040,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | REPONSE | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"TOTAL DES APPELS\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO REPONSE PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME (H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

    MULTI-CAMPAIGN BREAKDOWN
    CAMPAIGNSTOTAL DES APPELS
    SYSTEM RELEASE CALLS
    AGENT RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO REPONSE PERCENT
    DROP PERCENT
    AGENT LOGIN TIME (H:M:S)
    AGENT PAUSE TIME (H:M:S)
    "; + $SUBGRAPH.=""; + $SUBGRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENT RELEASE CALLSSALE CALLSDNC CALLSNO REPONSE PERCENTDROP PERCENTAGENT LOGIN TIMEAGENT PAUSE TIME

     


    "; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1105,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1124,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hREPONSEcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1140,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1167,8 +1317,8 @@ else $hTOTcalls_count = sprintf("%6s", $hTOTcalls_count); $hTOTsystem_count = sprintf("%6s", $hTOTsystem_count); $hTOTagent_count = sprintf("%6s", $hTOTagent_count); - $hTOTptp_count = sprintf("%6s", $hTOTrtp_count); - $hTOTrtp_count = sprintf("%6s", $hTOTptp_count); + $hTOTptp_count = sprintf("%6s", $hTOTptp_count); + $hTOTrtp_count = sprintf("%6s", $hTOTrtp_count); if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) ) {$hTOTna_percent=0;} else @@ -1190,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
    $SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
    INTERVALTOTAL DES APPELS
    SYSTEM RELEASE CALLS
    AGENT RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO REPONSE PERCENT
    DROP PERCENT
    AGENT LOGIN TIME (H:M:S)
    AGENT PAUSE TIME (H:M:S)
    ".$SUBgraph_stats[$d][1]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
    TOTAL:".trim($hTOTcalls_count)."
    "; + $SUBSYSTEMRELEASE_graph.="
    TOTAL:".trim($hTOTsystem_count)."
    "; + $SUBAGENTRELEASE_graph.="
    TOTAL:".trim($hTOTagent_count)."
    "; + $SUBSALES_graph.="
    TOTAL:".trim($hTOTptp_count)."
    "; + $SUBDNCS_graph.="
    TOTAL:".trim($hTOTrtp_count)."
    "; + $SUBNAS_graph.="
    TOTAL:".trim($hTOTna_percent)."%
    "; + $SUBDROPS_graph.="
    TOTAL:".trim($hTOTdrop_percent)."%
    "; + $SUBLOGINTIME_graph.="
    TOTAL:".trim($hTOTagent_sec)."
    "; + $SUBPAUSETIME_graph.="
    TOTAL:".trim($hTOTpause_sec)."
    "; + $JS_onload.="\tDraw".$SUBrpt_campaign."CampagneGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."CampagneGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1244,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALS Campagnes: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALS Campagnes: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H')."
    TOTAL:".trim($TOTcalls_count)."
    "; + $SYSTEMRELEASE_graph.="
    TOTAL:".trim($TOTsystem_count)."
    "; + $AGENTRELEASE_graph.="TOTAL:".trim($TOTagent_count).""; + $SALES_graph.="TOTAL:".trim($TOTptp_count).""; + $DNCS_graph.="TOTAL:".trim($TOTrtp_count).""; + $NAS_graph.="TOTAL:".trim($TOTna_percent)."%"; + $DROPS_graph.="TOTAL:".trim($TOTdrop_percent)."%"; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiCampagneGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiCampagneGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo "
    "; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds\n"; } ?> -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_VDADstats.php index 298c7c06..5654caf2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -26,6 +26,12 @@ # 100202-1034 - Added statuses to no-answer section # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100814-2307 - Added display of preset dials if presets are enabled in the campaign +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -73,10 +81,14 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';} if (strlen($carrier_stats)<2) {$carrier_stats='NO';} if (strlen($include_rollover)<2) {$include_rollover='NO';} +$report_name = 'Outbound Calling Report'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; -echo "Outbound Stats\n"; +echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -333,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

    Afficher as:
    "; +echo "\n
    "; echo "Shift:  
    "; echo "\n"; -#echo "\n"; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           MODIFIER \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK VALIDER\n";
    +	}
    +
    +else
    +	{
    +	echo "Live Current Agents logged in to take calls from $group - $selected_name         $NOW_TIME\n";
    +
    +	echo "\n";
    +
    +	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +
    +	$TOTALagents =	sprintf("%10s", $row[0]);
    +
    +	echo "Total agents:       $TOTALagents\n";
    +
    +
    +	##############################
    +	#########  LIVE AGENT STATS
    +	$user_list='|';
    +	echo "\n";
    +	echo "---------- LIVE AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +	echo "| #    | UTILISATEUR                       | CAMPAIGN             | STATUS | LAST ACTIVITY       |\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$users_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $users_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		$campaign_id =	sprintf("%-8s", $row[2]);
    +		$status =		sprintf("%-6s", $row[3]);
    +		$time =			sprintf("%-19s", $row[4]);
    +		$user_list .=	"$row[0]---$row[3]|";
    +
    +		echo "| $FMT_i | $user | $campaign_id   Real-Time | $status | $time |\n";
    +		}
    +
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	
    +	if ($DB) {echo "\n$user_list\n";}
    +
    +	##############################
    +	#########  ALL AGENT STATS
    +
    +	echo "\n";
    +	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +	echo "| #    | UTILISATEUR                       | LOGGED IN |\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +
    +	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$Xusers_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $Xusers_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		if (preg_match("/\|$row[0]---/",$user_list))
    +			{
    +			$userstatusARY =	explode("|$row[0]---",$user_list);
    +			$userstatus =		explode('|',$userstatusARY[1]);
    +			$status_line =		sprintf("%-9s", $userstatus[0]);
    +
    +			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
    +			}
    +		else
    +			{$status_line = '         ';}
    +
    +		echo "| $FMT_i | $user | $status_line |\n";
    +		}
    +
    +	echo "+------+--------------------------------+-----------+\n";
    +	
    +	}
    +
    +
    +?>
    +
    + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_log_display.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_log_display.php deleted file mode 100644 index b5abd944..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: AGPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} - elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "ADMINISTRATION DE VICIDIAL LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "
    \n\n"; - -echo "
    \n\n";
    -
    -
    -echo "ADMINISTRATION DE VICIDIAL CHANGE LOG                             $NOW_TIME\n";
    -
    -#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
    -passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
    -
    -
    -?>
    -
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_template_maker.php new file mode 100644 index 00000000..be496661 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="SOUMETTRE TEMPLATE" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
    **NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="Supprimer le modèle" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
    **$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
    ##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"AIDE\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
    + + +
    Maker Listloader modèle personnalisé
    + +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
    $error_msg
    $success_msg
    Créer un nouveau modèleSupprimer un modèle existant
    +
    + Modèle de fichier de l'échantillon de montage:
    ()


    +
    +
    Sélectionnez le modèle à supprimer:


    +
            RETOUR A L'ADMINISTRATION         Go to Lead Loader    
    + +
    + + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_days_detail.php index 6453eb2f..06b572b1 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,6 +11,11 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -39,12 +44,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Jours Etat Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -172,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="
    \n";
    +	$GRAPH_text.="
    \n";
     	}
     
     if (strlen($group[0]) < 1)
    @@ -212,10 +314,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Jours Etat Report: $user                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENT Détails -------------\n\n";
    +		$ASCII_text.="Agent Jours Etat Report: $user                     $NOW_TIME\n";
    +		$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$ASCII_text.="---------- AGENT Détails -------------\n\n";
    +		$GRAPH_text.="Agent Jours Etat Report: $user                     $NOW_TIME\n";
    +		$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$GRAPH_text.="---------- AGENT Détails -------------\n";
     		}
     	else
     		{
    @@ -235,7 +339,7 @@ else
     	$date_namesARY[0]='';
     	$k=0;
     
    -	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
    +	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$rows_to_print = mysql_num_rows($rslt);
    @@ -271,20 +375,39 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "LEAD STATS BREAKDOWN:\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    -		echo "| DATE       | LEADS  | CIcalls| DNC/CI%|$statusesHTML\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		for ($i=0; $i$SstatusTXT";
    +		}
    +
     		}
     	else
     		{
    -		$file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n";
    +		$file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
     		}
     
     	### BEGIN loop through each user ###
     	$m=0;
     	$CIScountTOT=0;
     	$DNCcountTOT=0;
    +
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_cicalls=1;
    +	$max_dncci=1;
    +	$GRAPH="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -300,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -318,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -357,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -397,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -426,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -445,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -460,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -487,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
    LEAD STATS BREAKDOWN
    ETATCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="
    TOTAL:".trim($CIScountTOT)."
    "; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n
    "; } else { @@ -522,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
    \n"; echo "
    Dates:
    "; @@ -572,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
    "; +echo "Afficher as:   
    "; +echo "\n

    "; echo "
    Utilisateur:
    "; echo "\n"; echo "
    Shift:
    "; @@ -596,38 +814,41 @@ else echo "RAPPORTS \n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if ($report_display_type=="TEXT" || !$report_display_type) 
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_performance_detail.php
    index 5635bb1d..e301f90b 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_performance_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_performance_detail.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     #
    @@ -23,6 +23,13 @@
     # 100203-1131 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 110703-1739 - Added file download option
    +# 111007-0709 - Changed user and fullname to use non-truncated for output file
    +# 111104-1249 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -49,36 +56,61 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
     	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
     if (isset($_GET["VALIDER"]))					{$VALIDER=$_GET["VALIDER"];}
     	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
    +if (isset($_GET["file_download"]))				{$file_download=$_GET["file_download"];}
    +	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    -$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
    +$report_name = 'Agent Performance Détail';
    +$db_source = 'M';
    +$JS_text="\n";
    -echo "\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
     
    -echo "\n";
    -echo "Agent Performance Détail\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="$report_name\n";
     
     	$short_header=1;
     
    -	require("admin_header.php");
    +#	require("admin_header.php");
     
    -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "
    Dates:
    "; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
    Dates:
    "; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$HTML_text.="\n"; -echo "
    to
    "; +$HTML_text.="
    to
    "; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$HTML_text.="\n"; -echo "
    Campagnes:
    "; -echo "
    Campagnes:
    "; +$HTML_text.="\n"; -echo "
    Groupes d'utilisateurs:
    "; -echo "\n"; +$HTML_text.="
    Groupes d'utilisateurs:
    "; +$HTML_text.="\n"; -echo "
    Shift:
    "; -echo "

    \n"; -echo "\n"; -echo "
            "; +$HTML_text.="\n"; +$HTML_text.="Shift:
    "; +$HTML_text.="

    \n"; +$HTML_text.="Afficher as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; -echo "          \n"; -echo " RAPPORTS \n"; -echo "\n"; -echo "
    "; +$HTML_text.="          \n"; +$HTML_text.=" RAPPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; -echo "
    \n\n"; +$HTML_text.="\n\n"; -echo "
    \n";
    +$HTML_text.="
    \n";
     
     
     if (!$group)
     {
    -echo "\n";
    -echo "S'IL VOUS PLAÎT CHOISIR UNE CAMPAGNE ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS VALIDER\n";
    -echo " NOTE: stats taken from shift specified\n";
    +$HTML_text.="\n";
    +$HTML_text.="S'IL VOUS PLAÎT CHOISIR UNE CAMPAGNE ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS VALIDER\n";
    +$HTML_text.=" NOTE: stats taken from shift specified\n";
     }
     
     else
    @@ -300,10 +403,10 @@ $query_date_END = "$end_date $time_END";
     if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
     else {$ugSQL='';}
     
    -echo "Agent Performance Détail                        $NOW_TIME\n";
    +$HTML_text.="Agent Performance Détail                        $NOW_TIME\n";
     
    -echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- AGENTS Détails -------------\n\n";
    +$HTML_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
    +$HTML_text.="---------- AGENTS Détails -------------\n\n";
     
     
     
    @@ -312,6 +415,12 @@ echo "---------- AGENTS Détails -------------\n\n";
     $statuses='-';
     $statusesTXT='';
     $statusesHEAD='';
    +
    +$CSV_header="\"Agent Performance Détail                        $NOW_TIME\"\n";
    +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
    +$CSV_header.="\"---------- AGENTS Détails -------------\"\n";
    +$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
    +
     $statusesHTML='';
     $statusesARY[0]='';
     $j=0;
    @@ -320,10 +429,44 @@ $usersARY[0]='';
     $user_namesARY[0]='';
     $k=0;
     
    -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
    +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $rows_to_print = mysql_num_rows($rslt);
    +
    +$graph_stats=array();
    +$max_calls=1;
    +$max_time=1;
    +$max_pause=1;
    +$max_pauseavg=1;
    +$max_wait=1;
    +$max_waitavg=1;
    +$max_talk=1;
    +$max_talkavg=1;
    +$max_dispo=1;
    +$max_dispoavg=1;
    +$max_dead=1;
    +$max_deadavg=1;
    +$max_customer=1;
    +$max_customeravg=1;
    +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
    "; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -340,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -347,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -362,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [TÉLÉCHARGER]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -383,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -390,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -405,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -412,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -443,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -459,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -490,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -499,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -521,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -532,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -553,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -622,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
    CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
    USERCALLS
    TIME
    PAUSE
    PAUSE AVG
    WAIT
    WAIT AVG
    TALK
    TALK AVG
    DISPO
    DISPO AVG
    DEAD
    DEAD AVG
    CUST
    CUST AVG
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
    TOTAL:".trim($TOTcalls)."
    "; +$TIME_graph.="
    TOTAL:".trim($TOTtime_MS)."
    "; +$PAUSE_graph.="
    TOTAL:".trim($TOTtotPAUSE_MS)."
    "; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -646,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    TOTALNONPAUSEPAUSE
    "; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -665,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -675,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -688,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [TÉLÉCHARGER]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Détail $NOW_TIME\"\n"; +$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -715,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -722,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -737,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -744,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -769,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -781,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -807,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -814,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -829,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -859,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
    PAUSE CODE BREAKDOWN
    ETATTOTAL
    NONPAUSE
    PAUSE
    $Sstatus
    ".sec_convert($graph_stats[$d][1], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".sec_convert($graph_stats[$d][($e+4)], 'H')."
    TOTAL:".trim($TOTtotTOTAL_MS)."
    "; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
    $db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_status_detail.php index b7c4e575..80c7b102 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,11 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -40,12 +45,19 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Détail'; +$db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "Agent Status Détail Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -218,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="\n\n\n
    \n";
    +	$GRAPH.="
    \n";
     	}
     
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
    -	echo "\n";
    +	echo "
    \n\n\n";
     	echo "S'IL VOUS PLAÎT Sélectionnez une campagne ou groupe d'utilisateurs-HEURE ET DATE ET CLIQUEZ CI-DESSUS VALIDER\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
    @@ -258,10 +359,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Status Détail Report                     $NOW_TIME\n";
    -
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENT Détails -------------\n\n";
    +		$ASCII_text.="

    Agent Status Détail Report $NOW_TIME\n"; + $ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- AGENT Détails -------------\n\n"; + $GRAPH.="

    Agent Status Détail Report $NOW_TIME\n"; + $GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- AGENT Détails -------------"; } else { @@ -285,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -304,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -319,14 +428,22 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } @@ -334,11 +451,23 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; $Sfull_name=$user_namesARY[$m]; - $Scalls=$calls[$m]; + $Scalls=0; $SstatusesHTML=''; $SstatusesFILE=''; $CIScount=0; @@ -350,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -367,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -376,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -420,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -459,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -487,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -506,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -521,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -550,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    CALL STATS BREAKDOWN
    ETATCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -583,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Dates:
    "; @@ -654,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

    \n"; +echo "Afficher as:
    "; +echo "\n

    "; echo "\n"; echo "
            "; @@ -663,38 +888,41 @@ echo " RAPPORTS \n"; echo "\n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if (!$report_display_type || $report_display_type=="TEXT")
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "                              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "                              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "                              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "                              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    \ No newline at end of file
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_detail.php
    index 3f3edb50..de15126f 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_detail.php
    @@ -4,7 +4,7 @@
     # Pulls time stats per agent selectable by campaign or user group
     # should be most accurate agent stats of all of the reports
     #
    -# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     # 90522-0723 - First build
    @@ -12,6 +12,17 @@
     # 100203-1147 - Added CUSTOMER time statistics
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
    +# 101207-1719 - Fixed download file formatting bugs(issue 394)
    +# 101208-0320 - Fixed issue 404
    +# 110307-1057 - Added user_case setting in options.php
    +# 110623-0728 - Fixed user group selection bug
    +# 110708-1727 - Added options.php setting for time precision
    +# 111104-1248 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -38,15 +49,37 @@ if (isset($_GET["DB"]))						{$DB=$_GET["DB"];}
     	elseif (isset($_POST["DB"]))			{$DB=$_POST["DB"];}
     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["VALIDER"]))					{$VALIDER=$_GET["VALIDER"];}
    +	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($stage)<2) {$stage='NAME';}
     
    +$report_name = 'Agent Time Détails';
    +$db_source = 'M';
    +$JS_text="\n";
     	echo "\n";
    +	echo "\n";
     
     	echo "\n";
    -	echo "Agent Time Detail\n";
    +	echo "$report_name\n";
     	echo "";
     
     	$short_header=1;
    @@ -198,7 +321,7 @@ if ($file_download < 1)
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
     	echo "\n";
    -	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
    +	echo "S'IL VOUS PLAÎT Sélectionnez une campagne ou groupe d'utilisateurs-HEURE ET DATE ET CLIQUEZ CI-DESSUS VALIDER\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
     
    @@ -236,13 +359,13 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Time Detail                     $NOW_TIME\n";
    +		echo "Agent Time Détails                     $NOW_TIME\n";
     
     		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     	else
     		{
    -		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
    +		$file_output .= "Agent Time Détails                     $NOW_TIME\n";
     		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
     		}
     
    @@ -253,11 +376,34 @@ else
     	############################################################################
     
     	### BEGIN gather user IDs and names for matching up later
    -	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
    +	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$users_to_print = mysql_num_rows($rslt);
     	$i=0;
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_timeclock=1;
    +	$max_agenttime=1;
    +	$max_wait=1;
    +	$max_talk=1;
    +	$max_dispo=1;
    +	$max_pause=1;
    +	$max_dead=1;
    +	$max_customer=1;
    +	$GRAPH="";
    +	$GRAPH2="";
    +	$graph_header="
    CALLSTIME CLOCKAGENT TIMEWAITTALKDISPOPAUSEDEADCUSTOMER
    "; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -269,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -296,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -317,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -331,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -350,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -419,14 +568,16 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="AGENT TIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -450,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -493,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -502,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -529,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -582,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -618,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -630,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -653,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -680,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -695,53 +899,132 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
    AGENT TIME BREAKDOWN
    ETATCALLS
    TIME CLOCK
    AGENT TIME
    WAIT
    TALK
    DISPO
    PAUSE
    DEAD
    CUSTOMER
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
    TOTAL:".trim($hTOTcalls)."
    "; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -782,6 +1065,20 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Dates:
    "; echo "\n"; @@ -796,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lundi week start
    Campaigns:
    "; +echo "
    Campagnes:
    "; echo "\n"; -echo "
    User Groups:
    "; +echo "
    Groupes d'utilisateurs:
    "; echo "

    \n"; -echo "\n"; +echo "Afficher as:
    "; +echo "\n

    "; +echo "\n"; echo "
            "; echo "          \n"; -echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " TÉLÉCHARGER | \n"; +echo " RAPPORTS \n"; echo "\n"; echo "
    "; -echo "
    \n\n"; +echo "\n\n
    $db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_sheet.php index 9c5ce9ed..d80c2169 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,46 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); require("functions.php"); +$report_name = 'Utilisateur Feuille de temps'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -45,20 +64,28 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,27 +93,70 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "Agent Feuille de temps"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -107,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentFeuille de tempsfor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "Utilisateur ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentFeuille de tempsfor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="Utilisateur ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK VALIDER\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK VALIDER\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -136,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentFeuille de temps $NOW_TIME\n"; +$MAIN.="AgentFeuille de temps $NOW_TIME\n"; + +$MAIN.="Time range: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentFeuille de temps- $NOW_TIME\"\n"; +$CSV_text_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"AGENT TIME SHEET: $agent - $full_name\"\n\n"; -echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -176,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "TOTAL DES APPELSTAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="TOTAL DES APPELSTAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[TÉLÉCHARGER]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"TOTAL DES APPELSTAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE AGENT TIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -227,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</td></tr>\n"; +$MAIN.="<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[TÉLÉCHARGER]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK HEURE DE CONNECTION/DECONNECTION:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"HEURES:MINUTES\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -255,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -269,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -285,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE>\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php index e8d0b8b8..3a8651c0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php @@ -3,11 +3,16 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -35,15 +40,19 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'UtilisateurHorloge en temps Rapport détaillé'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,28 +60,100 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -90,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -101,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -145,6 +226,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -185,10 +267,11 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -203,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "S'IL VOUS PLAÎT Sélectionnez une campagne ou groupe d'utilisateurs-HEURE ET DATE ET CLIQUEZ CI-DESSUS VALIDER\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -241,13 +324,13 @@ else if ($file_download < 1) { - echo "User Time-Clock Detail $NOW_TIME\n"; + echo "Utilisateur Time-Clock Détail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; } else { - $file_output .= "User Time-Clock Detail $NOW_TIME\n"; + $file_output .= "Utilisateur Time-Clock Détail $NOW_TIME\n"; $file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n"; } @@ -258,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -300,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| USER NAME | ID | USER GROUP | TIME CLOCK | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="AGENT TIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| USER NAME | ID | GROUPE D'UTILISATEURS | TIME CLOCK | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } else { @@ -322,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -359,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -375,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -428,7 +524,12 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -460,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -470,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i".$graph_stats[$i][0]."\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### @@ -497,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -526,12 +636,22 @@ else if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.=" \n"; + $GRAPH.="
    AGENT TIME-CLOCK DETAIL
    USER/GROUPE D'UTILISATEURSTIME CLOCK TIME CLOCK PUNCHES
    \"\"".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."".$graph_stats[$i][3]."
    TOTALSAGENTS: $TOT_AGENTS$TOTtimeTC
    \n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n
    "; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.="
    "; + $GRAPH.="
    "; } else { @@ -568,6 +688,14 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section @@ -588,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lundi week start \n"; -echo "User Groups:
    "; +echo "Groupes d'utilisateurs:
    "; echo "\n"; +echo ""; +echo "Afficher as:   
    "; +echo "\n

    "; echo "Shift:
    "; echo " +         "; echo "          \n"; -echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " TÉLÉCHARGER | \n"; +echo " RAPPORTS
    \n"; echo "
    \n"; echo ""; @@ -684,7 +817,7 @@ echo "\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "$RUNtime\n"; +echo "$RUNtime|$db_source\n"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_campaign_status_list_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_campaign_status_list_report.php new file mode 100644 index 00000000..3185ed40 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_campaign_status_list_report.php @@ -0,0 +1,471 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110815-2138 - First build +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$report_name="Campagne Status List Report"; +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;} +if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;} +if (!isset($query_date_T)) {$query_date_T="00:00:00";} +if (!isset($end_date_T)) {$end_date_T="23:59:59";} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $HTML_text.="\n"; + } + +$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER); +$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (preg_match("/-ALL/",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = preg_replace("/,\$/",'',$group_SQL); + $group_SQL_str=$group_SQL; + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$query_date="$query_date_D $query_date_T"; +$end_date="$end_date_D $end_date_T"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; +$short_header=1; + +# require("admin_header.php"); + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="
    Dates:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campagnes:
    "; +$HTML_text.="\n"; + +$HTML_text.="
     \n"; +$HTML_text.="\n"; +$HTML_text.="Afficher as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="TÉLÉCHARGER |"; +$HTML_text.=" RAPPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +$HTML_text.="
    ";
    +$i=0;
    +$group_string='|';
    +$group_ct = count($group);
    +$JS_text.="\n";
    +
    +if ($report_display_type=="HTML")
    +	{
    +	$HTML_text.=$JS_text.$GRAPH;
    +	}
    +else
    +	{
    +	$HTML_text.=$ASCII_text;
    +	}
    +
    +$HTML_text.="
    "; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_carrier_log_report.php new file mode 100644 index 00000000..dedef797 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP du serveur:
    \n"; +$MAIN.="
    \n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($VALIDER && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [TÉLÉCHARGER]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVEUR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | REPONSEED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVEUR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"REPONSEED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="
    \n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_dialer_inventory_report.php new file mode 100644 index 00000000..44e194c8 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Rapport d'inventaire'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Campagnes:
    "; +$campaign_span_txt.=""; + +$list_span_txt="Listes:
    "; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
    "; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
    \n";
    +
    +$rpt_header="";
    +####### STAT GENERATION #######
    +require("count_functions.inc");
    +function GetListCount($list_id, $inventory_ptnstr) 
    +	{
    +	global $list_start_inv;
    +	global $new_count;
    +	global $link;
    +	global $total_calls;
    +	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
    +	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
    +	$ct_rslt=mysql_query($ct_stmt, $link);
    +	$new_count=0; $total_calls=0;
    +	while ($ct_row=mysql_fetch_row($ct_rslt)) 
    +		{
    +		$list_start_inv+=$ct_row[2];
    +		$total_calls+=($ct_row[1]*$ct_row[2]);
    +		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
    +		}
    +	}
    +
    +if ($VALIDER) 
    +	{
    +
    +	$total_list_start_inv=0;
    +	$total_dialable_count=0;
    +	$total_dialable_count_nofilter=0;
    +	$total_dialable_count_oneoff=0;
    +	$total_dialable_count_inactive=0;
    +	$total_total_calls=0;
    +	$total_average_call_count=0;
    +	$total_penetration=0;
    +
    +	if ($snapshot_time && $report_source=="SNAPSHOT") 
    +		{
    +		$rpt_header="SNAPSHOT from $snapshot_time\n";
    +		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
    +		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
    +		$rslt=mysql_query($stmt, $link);
    +		$shift_SQL_str="";
    +		while ($shift_row=mysql_fetch_array($rslt)) 
    +			{
    +			$shift_data1=explode("|", $shift_row["shift_data"]);
    +			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
    +		$shift_rslt=mysql_query($shift_stmt, $link);
    +		$c=0;
    +		while($shift_row=mysql_fetch_array($shift_rslt)) 
    +			{
    +			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
    +			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
    +			$rpt_header_SHIFTS_lower.="          |";
    +			$rpt_header_BORDER.="----------+";
    +			$shift_ary[$c]=$shift_row["shift_id"];
    +			$total_varname="total_".$shift_row["shift_id"];
    +			$$total_varname=0;
    +			if ($DB > 0) {echo "
    -$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
    -$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
    \n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_BORDER.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPAIGNS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL STATUTS: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL STATUTS: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " DIAL STATUTS: |$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n"; + $rpt_header.="| Call list | List description | Campagne | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Campagne\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n"; + + #### PRINT TOTALS #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n"; + } +$HTML_header.="
    \n"; +############################### + +$HTML_text="
    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Report type:
    Campagnes
    List
    \n"; +$HTML_text.="
     \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Time setting:
    Server
    Local
    Ignore local campaign call time
    (default to 24 hours)
    \n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
    Report source:
    Snapshot
    Real-time
     
    $snapshot_span_txt\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n"; +$HTML_text.="           TÉLÉCHARGER | RAPPORTS

    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n\n";
    +
    +$HTML_text.="$rpt_header";
    +$HTML_text.="$rpt_body";
    +$HTML_text.="$rpt_footer";
    +
    +$time_end = microtime(true);
    +$ENDtime = date("U");
    +$time = $ENDtime - $STARTtime;
    +
    +$HTML_text.="Executed in $time seconds\n";
    +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_hangup_cause_report.php new file mode 100644 index 00000000..24284592 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP du serveur:
    \n"; +$MAIN.="
    Hangup Cause/Dial Status:
    "; +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($VALIDER && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [TÉLÉCHARGER]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVEUR IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | REPONSEED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVEUR IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"REPONSEED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_inbound_daily_report.php new file mode 100644 index 00000000..ba8236d0 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           TÉLÉCHARGER | MODIFIER | RAPPORTS
    Show hourly results
    \n"; +$MAIN.="
    \n\n"; + +$MAIN.="
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$time1 = strtotime($time_BEGIN);
    +	$time2 = strtotime($time_END)+1;
    +
    +	$hpd = ceil(($time2 - $time1) / 3600);
    +	if ($hpd<0) {$hpd+=24;}
    +
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
    +	$MAIN.="Selected in-group: $group\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
    +	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
    +	$CSV_text.="Selected in-group: $group\n";
    +	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
    +
    +	$d=0; $q=0; $hr=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
    +
    +		if ($hourly_breakdown) 
    +			{
    +			$dEQepoch = $dSQepoch+3599;
    +			}
    +			else
    +			{
    +			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
    +			if ($EQsec < $SQsec)
    +				{
    +				$dEQepoch = ($dEQepoch + 86400);
    +				}
    +			}
    +
    +		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +	#  || $time_END<=date("H:i:s", $dEQepoch)
    +		if ($hr>=($hpd-1) || !$hourly_breakdown) 
    +			{
    +			$d++;
    +			$hr=0;
    +			if (date("H:i:s", $dEQepoch)>$time_END) 
    +				{
    +				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
    +				}
    +			}
    +			else
    +			{
    +			$hr++;
    +			}
    +		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
    +		$q++;
    +
    +		}
    +	$prev_week=$daySTART[0];
    +	$prev_month=$daySTART[0];
    +	$prev_qtr=$daySTART[0];
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### CONSTRUCTION HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $q;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$ASCII_text.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$qs[$i] = $row[0];
    +		$dt[$i] = 0;
    +		$ut[$i] = ($row[1] - $SQepochDAY);
    +		while($ut[$i] >= $epoch_interval) 
    +			{
    +			$ut[$i] = ($ut[$i] - $epoch_interval);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +		$ls[$i] = $row[2];
    +		$st[$i] = $row[3];
    +		$tr[$i] = $row[4];
    +		$at[$i] = $row[5]; # Actual time
    +
    +		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
    +
    +		$i++;
    +		}
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totDROPS=0;
    +	$totQUEUE=0;
    +	$totCALLSsec=0;
    +	$totDROPSsec=0;
    +	$totQUEUEsec=0;
    +	$totCALLSmax=0;
    +	$totDROPSmax=0;
    +	$totQUEUEmax=0;
    +	$totCALLSdate=$MT;
    +	$totDROPSdate=$MT;
    +	$totQUEUEdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtDROPS=$MT;
    +	$qrtQUEUE=$MT;
    +	$qrtCALLSsec=$MT;
    +	$qrtDROPSsec=$MT;
    +	$qrtQUEUEsec=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtDROPSavg=$MT;
    +	$qrtQUEUEavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$qrtDROPSmax=$MT;
    +	$qrtQUEUEmax=$MT;
    +
    +	$totABANDONSdate=$MT;
    +	$totREPONSESdate=$MT;
    +
    +	$totREPONSES=0;
    +	$totABANDONS=0;
    +	$totREPONSESsec=0;
    +	$totABANDONSsec=0;
    +	$totREPONSESspeed=0;
    +
    +	$FtotREPONSES=0;
    +	$FtotABANDONS=0;
    +	$FtotREPONSESsec=0;
    +	$FtotABANDONSsec=0;
    +	$FtotREPONSESspeed=0;
    +
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
    +	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
    +	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
    +		$totABANDONSdate[$j]=0;
    +		$totABANDONSsecdate[$j]=0;
    +		$totREPONSESdate[$j]=0;
    +		$totREPONSESsecdate[$j]=0;
    +		$totREPONSESspeeddate[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
    +				{
    +				$totCALLS++;
    +				$totCALLSsec = ($totCALLSsec + $ls[$i]);
    +				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
    +	#			$qrtCALLS[$j]++;
    +	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
    +	#			$dtt = $dt[$i];
    +				$totCALLSdate[$j]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
    +					{
    +					$totABANDONSdate[$j]++;
    +					$totABANDONSsecdate[$j]+=$ls[$i];
    +					$FtotABANDONS++;
    +					$FtotABANDONSsec+=$ls[$i];
    +					}
    +					else 
    +					{
    +					$totREPONSESdate[$j]++;
    +					$totREPONSESsecdate[$j]+=($ls[$i]-$qs[$i]-15);
    +					$totREPONSESspeeddate[$j]+=$qs[$i];
    +					$FtotREPONSES++;
    +					$FtotREPONSESsec+=($ls[$i]-$qs[$i]-15);
    +					$FtotREPONSESspeeddate+=$qs[$i];
    +					}
    +				if (ereg('DROP',$st[$i])) 
    +					{
    +					$totDROPS++;
    +					$totDROPSsec = ($totDROPSsec + $ls[$i]);
    +					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
    +	#				$qrtDROPS[$j]++;
    +	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
    +					$totDROPSdate[$j]++;
    +	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
    +	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
    +					}
    +				if ($qs[$i] > 0) 
    +					{
    +					$totQUEUE++;
    +					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
    +					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
    +	#				$qrtQUEUE[$j]++;
    +	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
    +					$totQUEUEdate[$j]++;
    +	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
    +	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
    +					}
    +	/*
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +	*/
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +	###################################################
    +	### TOTALS SUMMARY SECTION ###
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
    +	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | REPONSE | TALK   | TALK       | WRAP       | CALL       |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | REPONSEED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
    +	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"REPONSE\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
    +	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"REPONSEED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
    +
    +	##########################
    +	$JS_text="\n";
    +
    +	if ($report_display_type=="HTML") 
    +		{
    +		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (20 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (20 / $hi_hold_count);}
    +
    +
    +	$ENDtime = date("U");
    +	$RUNtime = ($ENDtime - $STARTtime);
    +	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
    +	$MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_server_performance.php index 3ef6ccff..b38344ba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?>
    - +
    + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_team_performance_detail.php new file mode 100644 index 00000000..723d4812 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Détail'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
    Dates:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Date Range:
    \n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campagnes:
    "; +$HTML_text.="\n"; + +$HTML_text.="
    Teams/Groupes d'utilisateurs:
    "; +$HTML_text.="\n"; +$HTML_text.="
    Show additional statuses:
    "; +$HTML_text.="
    \n"; +$HTML_text.="Afficher as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="TÉLÉCHARGER |"; +$HTML_text.=" RAPPORTS \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +if ($VALIDER=="VALIDER") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
    ";
    +	$total_average_sale_time=0;
    +	$total_average_contact_time=0;
    +	$total_talk_time=0; 
    +	$total_system_time=0; 
    +	$total_calls=0;	
    +	$total_leads=0;
    +	$total_contacts=0;
    +	$total_sales=0;
    +	$total_inc_sales=0;
    +	$total_cnc_sales=0;
    +	$total_callbacks=0;
    +	$total_stcall=0;
    +	for ($q=0; $q".$call_status[$q]."";
    +	}
    +	$total_graph_stats[]="";
    +	$max_totalcalls=1;
    +	$max_totalleads=1;
    +	$max_totalcontacts=1;
    +	$max_totalcontactratio=1;
    +	$max_totalsystemtime=1;
    +	$max_totaltalktime=1;
    +	$max_totalsales=1;
    +	$max_totalsalesleadsratio=1;
    +	$max_totalsalescontactsratio=1;
    +	$max_totalsalesperhour=1;
    +	$max_totalincsales=1;
    +	$max_totalcancelledsales=1;
    +	$max_totalcallbacks=1;
    +	$max_totalfirstcall=1;
    +	$max_totalavgsaletime=1;
    +	$max_totalavgcontacttime=1;
    +	$TOTALGRAPH="

    "; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALSALES_graph=$TOTALGRAPH_header.""; + $TOTALSALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALSALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

    CALL CENTER TOTAL
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    "; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALS ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    TEAM: $user_group[$i] - $group_name
    USERCALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    ".$graph_stats[$d][0]."".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][12]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][13]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][14]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
    TOTAL:".trim($group_calls)."
    "; + $LEADS_graph.="
    TOTAL:".trim($group_leads)."
    "; + $CONTACTS_graph.="
    TOTAL:".trim($group_contacts)."
    "; + $CONTACTRATIO_graph.="
    TOTAL:".trim($group_contact_ratio)."%
    "; + $SYSTEMTIME_graph.="
    TOTAL:".sec_convert($group_system_time,'H')."
    "; + $TALKTIME_graph.="TOTAL:".sec_convert($group_talk_time,'H').""; + $SALES_graph.="TOTAL:".trim($group_sales).""; + $SALESLEADSRATIO_graph.="TOTAL:".trim($group_sales_ratio)."%"; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALS:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALSYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALSALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALSALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALSALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALSYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALSALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALSALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALSALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALSALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALSYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALSALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALSALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALSALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALSALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADall.php index 6e277ac1..dbf58a58 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -60,10 +60,26 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -123,11 +139,28 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} +$report_name = 'Real-Time Main Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -136,13 +169,25 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -155,13 +200,13 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -216,9 +261,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -230,13 +284,99 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -247,7 +387,43 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -260,29 +436,58 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -294,9 +499,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -304,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -325,7 +556,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "
    Select Campagnes:
    "; +$select_list = "
    Select Campagnes:
    "; $select_list .= ""; $select_list .= "
    (Pour sélectionner plus de 1 campagne, maintenez la touche Ctrl enfoncée et cliquez sur)"; + +$select_list .= "

    Select Groupes d'utilisateurs:
    "; +$select_list .= ""; + $select_list .= "
    "; $select_list .= "Fermer le panneau

    "; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select Groupe utilisateur:
    "; - $select_list .= "

    "; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
    "; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
    "; +$select_list .= "Inbound:
     
    "; + $select_list .= "Select Groupe utilisateur: "; + $select_list .= "
    "; +$select_list .= "Dialable Leads Alert:
    "; + $select_list .= "Voir les statistiques Presets:
    "; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSION: $version   CONSTRUCTION: $build"; $select_list .= "
    "; @@ -422,283 +719,303 @@ $open_list = "< - - -\n"; + // function to display in-groups selected for a specific agent + function ingroup_info(agent_user,count) + { + var cursorheight = (document.REALTIMEform.cursorY.value - 0); + var newheight = (cursorheight + 10); + document.getElementById("agent_ingroup_display").style.top = newheight; + // alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user); + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + var monitorQuery = "source=realtime&function=agent_ingroup_info&stage=change&user=" + user + "&pass=" + pass + "&agent_user=" + agent_user; + xmlhttp.open('POST', 'non_agent_api.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(monitorQuery); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var Xoutput = null; + Xoutput = xmlhttp.responseText; + var regXFerr = new RegExp("ERROR","g"); + if (Xoutput.match(regXFerr)) + {alert(xmlhttp.responseText);} + else + { + document.getElementById("agent_ingroup_display").visibility = "visible"; + document.getElementById("agent_ingroup_display").innerHTML = Xoutput; + } + } + } + delete xmlhttp; + } + } + + // function to display in-groups selected for a specific agent + function hide_ingroup_info() + { + document.getElementById("agent_ingroup_display").visibility = "hidden"; + document.getElementById("agent_ingroup_display").innerHTML = ''; + } + + + + + + \n"; + + echo "\n"; + echo"\n"; + echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + + } $stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; $rslt=mysql_query($stmt, $link); @@ -706,57 +1023,55 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; -echo "\n"; -echo"\n"; -echo "Real-Time Report: $group\n"; - $short_header=1; - - require("admin_header.php"); - -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"; -echo "\n"; -echo "\n"; -echo "Real-Time Report                                                                               \n"; -echo "\n"; -echo "
    \n"; -echo "Rapport Choisissez Options d-affichage"; -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       MODIFIER | \n"; - } -else - { - echo "       MODIFIER | \n"; - } -echo "SUMMARY \n"; -echo "\n\n"; + echo ""; + } + + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -974,10 +1483,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1100,11 +1607,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1115,15 +1624,15 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1151,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1187,6 +1697,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1207,7 +1722,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1217,6 +1732,10 @@ else $DIALorder = "Liste Mix: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Real-Time Report                                                                               \n"; + echo "\n"; + echo "
    \n"; + echo "Rapport Choisissez Options d-affichage"; + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "SLOW | "; + echo "GO"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       MODIFIER | \n"; + } + else + { + echo "       MODIFIER | \n"; + } + echo "SUMMARY \n"; + echo "\n\n"; + } if (!$group) {echo "

    please select a campaign from the pulldown above\n"; exit;} @@ -798,10 +1113,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -936,6 +1250,7 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) $dtp++; } $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; if ($DB > 0) {echo "\n|$stmtB|\n";} @@ -963,6 +1278,200 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
    "; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
    CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
         $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
    no log entries
    "; + $CARRIERstatsHTML .= "
    "; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
      AGENT DIAL PRESETS:     PRESET NAMES                 CALLS  
                $row[0]     $row[1]  
    no log entries
    "; + $PRESETstatsHTML .= "
    "; echo ""; @@ -1228,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1251,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1271,7 +1794,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1290,63 +1861,67 @@ echo ""; echo ""; echo "
    DIAL NIVEAU:  $DIALlev   
    - min   MAX NIVEAU:  $maxDIALlev   $min_link  MAX NIVEAU:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    HOPPER NIVEAU:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     DROPPED / REPONSEED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses     ORDER:  $DIALorder    
    AGENT AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       CACHER GROUPE D'UTILISATEURS"; - } -else - { - echo "       VIEW GROUPE D'UTILISATEURS"; - } -if ($SERVdisplay>0) - { - echo "       CACHER SERVEUR INFO"; - } -else - { - echo "       MONTRER SERVEUR INFO"; - } -if ($CALLSdisplay>0) - { - echo "       CACHER WAITING CALLS"; - } -else - { - echo "       MONTRER WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       CACHER GROUPE D'UTILISATEURS"; + } + else + { + echo "       VIEW GROUPE D'UTILISATEURS"; + } + if ($SERVdisplay>0) + { + echo "       CACHER SERVEUR INFO"; + } + else + { + echo "       MONTRER SERVEUR INFO"; + } + if ($CALLSdisplay>0) + { + echo "       CACHER WAITING CALLS"; + } + else + { + echo "       MONTRER WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       CACHER IN-GROUP STATS"; + } + else + { + echo "       MONTRER IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       CACHER PHONES"; + } + else + { + echo "       MONTRER PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       CACHER CUSTPHONES"; + } + else + { + echo "       MONTRER CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       CACHER IN-GROUP STATS"; - } -else - { - echo "       MONTRER IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       CACHER PHONES"; - } -else - { - echo "       MONTRER PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       CACHER CUSTPHONES"; - } -else - { - echo "       MONTRER CUSTPHONES"; - } echo "
    "; @@ -1390,6 +1965,20 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) ################################################################################### if ($campaign_allow_inbound > 0) { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1422,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "CACHERPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1515,15 +2120,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITÉ | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITÉ | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1548,7 +2153,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -1560,6 +2165,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1589,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; +if ($RTajax > 0) + {$HTuser = " USER ";} if ($UidORname>0) { - $HTuser .= "MONTRER ID "; + if ($RTajax > 0) + {$HTuser .= "MONTRER ID ";} + else + { + $HTuser .= "MONTRER ID "; + } } else { - $HTuser .= "MONTRER NAME"; + if ($RTajax > 0) + {$HTuser .= "MONTRER NAME";} + else + { + $HTuser .= "MONTRER NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " GROUPE D'UTILISATEURS |"; +$HTusergroup = " GROUPE D'UTILISATEURS |"; +if ($RTajax > 0) + {$HTusergroup = " GROUPE D'UTILISATEURS |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1621,9 +2243,13 @@ $HTserver_ip = " SERVEUR IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVEUR IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPAIGN |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1672,9 +2298,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1698,12 +2331,16 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -1730,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -1748,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -1928,7 +2594,7 @@ $calls_to_list = mysql_num_rows($rslt); {$CM='A';} else { - if (eregi("ENTRANT",$comments)) + if (eregi("INBOUND",$comments)) {$CM='I';} else {$CM='M';} @@ -1971,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2000,7 +2667,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2011,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2043,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2060,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2088,14 +2763,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " Système de charge Average: $load_ave\n\n"; + $Aecho .= " Système de charge Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2110,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2123,6 +2810,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE agents morts dans les appels      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
    ";
     		echo "";
    @@ -2135,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt);
     	echo "
    $Cecho";
     	}
     
    +echo "
    "; + +if ($RTajax < 1) + { + echo "
    "; + } ?> - -
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php index bd20b41f..1fa3c911 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -16,10 +16,15 @@ # 80525-1040 - Added IVR status summary display for inbound calls # 90310-2119 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100709-1806 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -31,24 +36,64 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='MONTRER ALL CAMPAIGNS';} + +$report_name = 'Real-Time Campagne Summary'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -56,13 +101,49 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -74,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "Real-Time All Campagnes Summary\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; +$MAIN.=""; +$MAIN.="
    "; -echo "Real-Time All Campagnes Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; +$MAIN.="Real-Time All Campagnes Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="SLOW | "; +$MAIN.="GO "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + $MAIN.="+ VIEW MORE SETTINGS"; } else { - echo "- VIEW LESS SETTINGS"; + $MAIN.="- VIEW LESS SETTINGS"; } -echo "       RAPPORTS"; -echo "

    \n\n"; +$MAIN.="      TÉLÉCHARGER | RAPPORTS"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
    DIAL NIVEAU:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"DIAL NIVEAU:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTER:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX NIVEAU:\",\"$maxDIALlev\",\"DROPPED MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"DIAL TIMEOUT:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"DIALABLE LEADS:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"AVG AGENTS:\",\"$agentsONEMIN\",\"DIAL PROCEDE:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"HOPPER NIVEAU:\",\"$HOPlev\",\"DROPPED / REPONSEED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"STATUSES:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDER:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"AGENT AVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
    DIAL NIVEAU:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
      MAX NIVEAU:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
      MAX NIVEAU:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL PROCEDE:  $DIALmethod    
    DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL PROCEDE:  $DIALmethod    
    HOPPER NIVEAU:  $HOPlev     DROPPED / REPONSEED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    HOPPER NIVEAU:  $HOPlev     DROPPED / REPONSEED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +$MAIN.="
    LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
    "; +$MAIN.="
    "; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
    "; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
    AGENT AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; ### Header finish @@ -307,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -341,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo " PAS D'APPEL EN ATTENTE\n"; + $MAIN.=" PAS D'APPEL EN ATTENTE\n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -366,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -419,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
    \n"; + $MAIN.="\n
    \n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
    ";
    -		echo "";
    +		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
    +		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
    +		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
    +		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
    +		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
    +				
    +		$MAIN.="
    ";
    +		$MAIN.="";
     	}
     	else
     	{
    -	echo " NO AGENTS ON CALLS
    \n"; + $MAIN.=" NO AGENTS ON CALLS
    \n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -442,16 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
    "; +$MAIN.="
    \n\n
    "; -echo "
    \n\n"; $k++; } +$MAIN.="\n\n
    "; +$MAIN.="\n"; +$MAIN.="
    \n"; + +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } ?> - -
    - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonpark.php index 8aac7043..bcc8fe29 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Agents Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Agents Time On Entrant Calls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin.php index 8548dd1a..cdaef2d6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,6 +103,13 @@ $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 Campagne Summary , Entrant Report, Entrant Service Level Report, Entrant Résumé Hourly Report, Entrant Daily Report, Entrant DID Report, Entrant IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listes Statuts De Campagne Report, Campagne Status List Report, Appels d'exportation Rapport, Pistes d'exportation Rapport , Agent Time Détails, Agent Status Détail, Agent Performance Détail, Team Performance Détail, Single Agent Daily , UtilisateurHorloge en temps Report, Groupe utilisateurHorloge en temps Status Report, UtilisateurHorloge en temps Rapport détaillé , Server Performance Report, Administration Change Log, List Update Stats, Statistiques utilisateur, Utilisateur Feuille de temps, Download List, Dialer Rapport d'inventaire, Maximum System Stats, Maximum Stats Détail, Search Leads Logs"; + +$UGreports = "ALL RAPPORTS, NONE, Real-Time Main Report, Real-Time Campagne Summary , Entrant Report, Entrant Service Level Report, Entrant Résumé Hourly Report, Entrant Daily Report, Entrant DID Report, Entrant IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Listes Statuts De Campagne Report, Campagne Status List Report, Appels d'exportation Rapport , Pistes d'exportation Rapport , Agent Time Détails, Agent Status Détail, Agent Performance Détail, Team Performance Détail, Single Agent Daily , UtilisateurHorloge en temps Report, Groupe utilisateurHorloge en temps Status Report, UtilisateurHorloge en temps Rapport détaillé , Server Performance Report, Administration Change Log, List Update Stats, Statistiques utilisateur, Utilisateur Feuille de temps, Download List, Dialer Rapport d'inventaire, Custom Rapports Links, CallCard Search, Maximum System Stats, Maximum Stats Détail, Search Leads Logs"; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -321,16 +338,16 @@ 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_fast_rafraîchir"])) {$enable_fast_rafraîchir=$_GET["enable_fast_rafraîchir"];} + elseif (isset($_POST["enable_fast_rafraîchir"])) {$enable_fast_rafraîchir=$_POST["enable_fast_rafraîchir"];} 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["fast_rafraîchir_rate"])) {$fast_rafraîchir_rate=$_GET["fast_rafraîchir_rate"];} + elseif (isset($_POST["fast_rafraîchir_rate"])) {$fast_rafraîchir_rate=$_POST["fast_rafraîchir_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"];} @@ -595,8 +612,8 @@ 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["campaign_stats_rafraîchir"])) {$campaign_stats_rafraîchir=$_GET["campaign_stats_rafraîchir"];} + elseif (isset($_POST["campaign_stats_rafraîchir"])){$campaign_stats_rafraîchir=$_POST["campaign_stats_rafraîchir"];} 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"];} @@ -687,6 +704,8 @@ 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"];} @@ -1167,9 +1186,553 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n 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_rafraîchir"])) {$admin_modify_rafraîchir=$_GET["admin_modify_rafraîchir"];} + elseif (isset($_POST["admin_modify_rafraîchir"])) {$admin_modify_rafraîchir=$_POST["admin_modify_rafraîchir"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + + +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) { @@ -1179,25 +1742,49 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1265,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_rafraîchir = ereg_replace("[^0-9]","",$enable_fast_rafraîchir); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_rafraîchir_rate = ereg_replace("[^0-9]","",$fast_rafraîchir_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1299,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1307,7 +1893,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1951,70 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_rafraîchir = ereg_replace("[^0-9]","",$admin_modify_rafraîchir); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1397,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_rafraîchir = ereg_replace("[^NY]","",$campaign_stats_rafraîchir); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1433,6 +2083,37 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +2161,24 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +2193,8 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +2206,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1582,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1610,11 +2310,10 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -1632,6 +2331,78 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2416,47 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,53 +2465,96 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -1716,7 +2562,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,8 +2578,19 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); + ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -1761,7 +2617,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,8 +2627,14 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -1783,6 +2645,11 @@ if ($non_latin < 1) # $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 @@ -2046,44 +2913,187 @@ else # 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 # + # 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.2.0-234'; -$build = '100116-0718'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_rafraîchir_set=0; +$modify_footer_rafraîchir=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2098,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_rafraîchir,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2109,6 +3119,10 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; + $SSadmin_modify_rafraîchir = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2120,84 +3134,189 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_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 ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($SSwebroot_writable > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2206,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_rafraîchir > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_rafraîchir_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2219,13 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Ajouter une nouvelle campag if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Campagne De Copy";} if ($ADD==111) {$hh='lists'; echo "Ajouter une nouvelle liste";} if ($ADD==121) {$hh='lists'; echo "Ajouter un nouveau DNC";} +if ($ADD==171) {$hh='ingroups'; echo "Filtre à Numéros de téléphone du groupe";} if ($ADD==1111) {$hh='ingroups'; echo "Ajouter un nouveau in-group";} if ($ADD==1211) {$hh='ingroups'; echo "Dans-Groupe De Copy";} if ($ADD==1311) {$hh='ingroups'; echo "Ajouter un nouveauDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopieDID";} if ($ADD==1511) {$hh='ingroups'; echo "Ajouter un appel Menu";} if ($ADD==1611) {$hh='ingroups'; echo "Copiez Appel du menu";} +if ($ADD==1711) {$hh='ingroups'; echo "Ajouter un groupe Téléphone filtre";} if ($ADD==11111) {$hh='remoteagent'; echo "Ajouter de nouveaux agents distants";} +if ($ADD==12111) {$hh='remoteagent'; echo "Ajouter un groupe d'extension";} if ($ADD==111111) {$hh='usergroups'; echo "Ajouter de nouveaux groupes d'utilisateurs";} if ($ADD==1111111) {$hh='scripts'; echo "Ajouter un nouveau script";} if ($ADD==11111111) {$hh='filters'; echo "Ajouter un nouveau filtre";} @@ -2238,9 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "AJOUTER UN NOUVEAU SERVEUR";} 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 "Ajouter le transporteur COPIE";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW ENTRY TTS";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC ON HOLD ENTRY";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW messagerie vocale";} +if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "Ajouter une étiquette ECRAN NEW";} +if ($ADD==191111111111) {$hh='admin'; $sh='cts'; echo "Ajouter un nouveau contact";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "AJOUTER UNE NOUVELLE CONFERENCE";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Ajout d'un nouvel utilisateur";} @@ -2254,6 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nouveau statut d'appel au if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nouveau code de pause";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Statut d'appel pour la campagne ajouté";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Le Mélange De Liste De Campagne S'est ajouté";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Preset Campagne Ajouté";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Modifier le code zonal de la campagne CID";} if ($ADD==211) {$hh='lists'; echo "Ajout d'une nouvelle liste";} if ($ADD==2111) {$hh='ingroups'; echo "Ajout d'un nouvel In-Group";} if ($ADD==2011) {$hh='ingroups'; echo "Nouvelle Addition Copiée De Dans-Groupe";} @@ -2261,7 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "A New Addition";} if ($ADD==2411) {$hh='ingroups'; echo "Nouvelle adjonction Copied DID";} if ($ADD==2511) {$hh='ingroups'; echo "Nouvel appel Menu";} if ($ADD==2611) {$hh='ingroups'; echo "Nouvel appel Menu";} +if ($ADD==2711) {$hh='ingroups'; echo "Nouveau groupe Téléphone filtre";} if ($ADD==21111) {$hh='remoteagent'; echo "Ajout d'un nouvel agent distant";} +if ($ADD==22111) {$hh='remoteagent'; echo "New Ajout d'extension du groupe";} if ($ADD==211111) {$hh='usergroups'; echo "Ajout d'un nouveau groupe d'utilisateurs";} if ($ADD==2111111) {$hh='scripts'; echo "Ajout d'un nouveau script";} if ($ADD==21111111) {$hh='filters'; echo "Ajout d'un nouveau filtre";} @@ -2275,9 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "AJOUTER UN NOUVEAU SER if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "AJOUT D'UN NOUVEAU TRUNK VERS UN SERVEUR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "AJOUT DE NOUVEAUX CONF TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "AJOUT DE NOUVEAUX CARRIER";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "AJOUT CARRIER COPIE";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "Ajout de nouveaux TTS ENTRY";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "AJOUT DE NEW MUSIC ON HOLD ENTRY";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "AJOUT DE NOUVEAUX la boîte vocale";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "AJOUT LABEL ECRAN NEW";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "AJOUT NOUVEAU CONTACT";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "AJOUT D'UNE NOUVELLE CONFERENCE";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "AJOUTER DES STATUTS DE SYSTÈME DE VICIDIAL";} @@ -2296,6 +3448,8 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Liste Mixes";} if ($SUB=='20A') {echo " - Sondage";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2308,6 +3462,8 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Liste Mixes";} if ($SUB=='20A') {echo " - Sondage";} + if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Statuts De Campagne";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campagne HotKeys";} @@ -2316,11 +3472,16 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Statuts Automatiques De C if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Codes De Pause D'Agent De Campagne";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Statuts De Cadran De Campagne";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mlanges De Liste De Campagne";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Préréglages de la campagne";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Indicatif régional Campagne CID";} if ($ADD==311) {$hh='lists'; echo "Modifier la liste";} if ($ADD==3111) {$hh='ingroups'; echo "Modifier le In-Group";} if ($ADD==3311) {$hh='ingroups'; echo "ModifierDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Modifier DID RA Extension Remplace";} if ($ADD==3511) {$hh='ingroups'; echo "Modifier menu d-appel";} +if ($ADD==3711) {$hh='ingroups'; echo "Modifier le groupe Téléphone filtre";} if ($ADD==31111) {$hh='remoteagent'; echo "Modifier les agents distants";} +if ($ADD==32111) {$hh='remoteagent'; echo "Modifier le groupe d'extension";} if ($ADD==311111) {$hh='usergroups'; echo "Modifier les groupes d'utilisateurs";} if ($ADD==3111111) {$hh='scripts'; echo "Modifier le script";} if ($ADD==31111111) {$hh='filters'; echo "Modifier le filtre";} @@ -2337,6 +3498,8 @@ if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";} if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFIER TTS ENTRY";} if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFIER LA MUSIQUE EN ATTENTE ENTREE";} if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFIER la boîte vocale";} +if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "Modifier l'étiquette ÉCRAN";} +if ($ADD==391111111111) {$hh='admin'; $sh='cts'; echo "Modifier un contact";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFIER LA CONFERENCE";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIER LES REGLAGES DU SYSTEME VICIDIAL";} @@ -2354,12 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifier la campagne Recy if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifier le code de pause";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modifier les paramètres de campagne QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifiez Le Mélange De Liste De Campagne";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifier numéro de la campagne";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modifier Campagne Sondage";} if ($ADD==411) {$hh='lists'; echo "Modifier la liste";} if ($ADD==4111) {$hh='ingroups'; echo "Modifier le In-Group";} if ($ADD==4311) {$hh='ingroups'; echo "ModifierDID";} if ($ADD==4511) {$hh='ingroups'; echo "Modifier menu d-appel";} +if ($ADD==4711) {$hh='ingroups'; echo "Modifier le groupe Téléphone filtre";} if ($ADD==41111) {$hh='remoteagent'; echo "Modifier les agents distants";} +if ($ADD==42111) {$hh='remoteagent'; echo "Modifier le groupe d'extension";} if ($ADD==411111) {$hh='usergroups'; echo "Modifier les groupes d'utilisateurs";} if ($ADD==4111111) {$hh='scripts'; echo "Modifier le script";} if ($ADD==41111111) {$hh='filters'; echo "Modifier le filtre";} @@ -2376,6 +3542,8 @@ if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";} if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFIER TTS ENTRY";} if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFIER LA MUSIQUE EN ATTENTE ENTREE";} if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFIER la boîte vocale";} +if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "Modifier l'étiquette ÉCRAN";} +if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo "Modifier un contact";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFIER LA CONFERENCE";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIER LES REGLAGES DU SYSTEME VICIDIAL";} @@ -2390,7 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "SupprimerList";} if ($ADD==5111) {$hh='ingroups'; echo "SupprimerIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "SupprimerDID";} if ($ADD==5511) {$hh='ingroups'; echo "Supprimer menu d-appel";} +if ($ADD==5711) {$hh='ingroups'; echo "Supprimer Téléphone Filtre Groupe";} if ($ADD==51111) {$hh='remoteagent'; echo "Supprimer les agents distants";} +if ($ADD==52111) {$hh='remoteagent'; echo "Supprimer le groupe d'extension";} if ($ADD==511111) {$hh='usergroups'; echo "Supprimer les utilisateurs Group";} if ($ADD==5111111) {$hh='scripts'; echo "Supprimer les scripts";} if ($ADD==51111111) {$hh='filters'; echo "Supprimer le filtre";} @@ -2406,6 +3576,8 @@ 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 la boîte vocale";} +if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "EFFACER ECRAN LABEL";} +if ($ADD==591111111111) {$hh='admin'; $sh='cts'; echo "Supprimer un contact";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "SupprimerUtilisateur";} @@ -2417,11 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Supprimer ce statut d'app if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Supprimer le code de pause";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Statut d'appel pour la campagne supprimé";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Mélange De Liste De Campagne Enlevé";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Preset campagne Suppression";} if ($ADD==611) {$hh='lists'; echo "SupprimerList";} if ($ADD==6111) {$hh='ingroups'; echo "SupprimerIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "SupprimerDID";} if ($ADD==6511) {$hh='ingroups'; echo "Supprimer menu d-appel";} +if ($ADD==6711) {$hh='ingroups'; echo "Supprimer Téléphone Filtre Groupe";} if ($ADD==61111) {$hh='remoteagent'; echo "Supprimer les agents distants";} +if ($ADD==62111) {$hh='remoteagent'; echo "Supprimer le groupe d'extension";} if ($ADD==611111) {$hh='usergroups'; echo "Supprimer les utilisateurs Group";} if ($ADD==6111111) {$hh='scripts'; echo "Supprimer les scripts";} if ($ADD==61111111) {$hh='filters'; echo "Supprimer le filtre";} @@ -2438,6 +3613,8 @@ 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 la boîte vocale";} +if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "EFFACER ECRAN LABEL";} +if ($ADD==691111111111) {$hh='admin'; $sh='cts'; echo "Supprimer un contact";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Nombre de fiches désavtivées";} @@ -2455,8 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campagnes";} if ($ADD==100) {$hh='lists'; echo "Listes";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Modifier DID RA Extension Remplace";} if ($ADD==1500) {$hh='ingroups'; echo "Appel Menus";} +if ($ADD==1700) {$hh='ingroups'; echo "Téléphone Groupes Filter";} if ($ADD==10000) {$hh='remoteagent'; echo "Agents distants";} +if ($ADD==12000) {$hh='remoteagent'; echo "Groupes d'extension";} if ($ADD==100000) {$hh='usergroups'; echo "Groupes d'utilisateurs";} if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} if ($ADD==10000000) {$hh='filters'; echo "Filtres";} @@ -2472,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "CARRIER LISTE";} 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 "VOCAL encadrés Liste";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "ECRAN LISTE DES ETIQUETTES";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "LA LISTE DES CONTACTS";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTE DE CONFERENCES";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTE DE CONFERENCES";} if ($ADD==550) {$hh='users'; echo "Formulaire de recherche";} @@ -2480,11 +3662,19 @@ if ($ADD==660) {$hh='users'; echo "Résultats de la recherche";} if ($ADD==661) {$hh='users'; echo "RESULTATS DE LA RECHERCHE DE TELEPHONES";} if ($ADD==99999) {$hh='users'; echo "AIDE";} if ($ADD==999999) {$hh='reports'; echo "RAPPORTS";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "CHANGEMENT DE MOT DE PASSE";} +if ($ADD==999996) {$hh='reports'; echo "L'installation initiale BIENVENUE";} +if ($ADD==999995) {$hh='reports'; echo "Licence de marque déposée COPYRIGHT";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "Statistiques récapitulatives";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM Statistiques récapitulatives";} -if ( ($ADD>9) && ($ADD < 99998) ) + +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; @@ -2499,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; @@ -2515,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -2529,30 +3719,17 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2569,45 +3746,57 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; } - else {$campaign_rank = $SELECT_campaign_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2615,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -2645,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -2658,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2669,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2708,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -2716,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>ENTRANT GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $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) @@ -2739,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -2748,37 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; } - else {$group_rank = $SELECT_group_rank;} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -2811,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -2819,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -2832,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -2847,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -2862,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; + if ( (eregi("-ALL",$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=''; @@ -2872,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPAIGNS-"; + } } if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) { @@ -2887,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPAIGNS - LES UTILISATEURS PEUVENT VOIR CHAQUE CAMPAGNE</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPAIGNS - LES UTILISATEURS PEUVENT VOIR CHAQUE CAMPAGNE</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPAIGNS - UTILISATEURS CAN QC TOUTE LA CAMPAGNE</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - UTILISATEURS CAN QC ENTRANT TOUT GROUP</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2925,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -2957,10 +4188,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +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 from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2969,7 +4200,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n"; $o++; } } @@ -3008,7 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Mot de passe -</B> Mot de passe de l'utilisateur VICIDIAL. Doit contenir au moins 2 caractères. + <B>Mot de passe -</B> Mot de passe de l'utilisateur VICIDIAL. Doit contenir au moins 2 caractères. Un mot de passe forte de l'utilisateur doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro. + + <BR> + <A NAME="vicidial_users-force_change_password"> + <BR> + <B>Forcer Changer mot de passe -</B> Si cette option est réglée sur Y, alors l'utilisateur sera invité à modifier leur mot de passe la prochaine fois qu'ils se connectent à la page Web d'administration. Par défaut est N. <BR> <A NAME="vicidial_users-full_name"> @@ -3040,6 +4276,11 @@ if ($ADD==99999) <BR> <B>Active - </B> Ce champ détermine si l'utilisateur est actif dans le système et peuvent utiliser VICIDIAL ressources. La valeur par défaut est Y + <BR> + <A NAME="vicidial_users-voicemail_id"> + <BR> + <B>ID vocale -</B> Il s'agit de la boîte vocale que les appels seront dirigés vers dans un AGENTDIRECT en groupe à la fois si la baisse en groupe a la méthode de la goutte réglé sur VOCAL et le champ de messagerie vocale mis au AGENTVMAIL. + <BR> <A NAME="vicidial_users-optional"> <BR> @@ -3053,12 +4294,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_choose_ingroups"> <BR> - <B>Choix des Ingroups -<\/B> Cette option, si elle est mise à 1 autorise l'utilisateur à choisir les ingroups depuis lesquels il recevra des appels quand il est connecté dans une campagne de type CLOSER ou ENTRANT sinon le manager devra le définir dans l'écran de détails de l'utiliseur sur la page d'amiministration. + <B>Choix des Ingroups -<\/B> Cette option, si elle est mise à 1 autorise l'utilisateur à choisir les ingroups depuis lesquels il recevra des appels quand il est connecté dans une campagne de type CLOSER ou INBOUND sinon le manager devra le définir dans l'écran de détails de l'utiliseur sur la page d'amiministration. + + <BR> + <A NAME="vicidial_users-agent_choose_blended"> + <BR> + <B>Agent Choisissez Blended -</B> Cette option si elle est définie à 1 permet à l'utilisateur de choisir si l'agent a son ensemble campagne pour mélangés ou non, et si non, le réglage par défaut sera utilisé mélangé. Par défaut est 1 pour activé. <BR> <A NAME="vicidial_users-agent_choose_territories"> <BR> - <B>Agent Choisir Territoires -</B> Cette option si la valeur 1 permet à l-utilisateur de choisir les territoires qu-ils vont recevoir des appels à partir de leur connexion à un manuel ou ENTRANT_MAN campagne. Sinon, l-utilisateur sera configuré pour utiliser l-ensemble des territoires qu-ils sont définis comme appartenant à l-utilisateur dans les Territoires Section administrative. + <B>Agent Choisir Territoires -</B> Cette option si la valeur 1 permet à l-utilisateur de choisir les territoires qu-ils vont recevoir des appels à partir de leur connexion à un manuel ou INBOUND_MAN campagne. Sinon, l-utilisateur sera configuré pour utiliser l-ensemble des territoires qu-ils sont définis comme appartenant à l-utilisateur dans les Territoires Section administrative. <BR> <A NAME="vicidial_users-scheduled_callbacks"> @@ -3107,6 +4353,16 @@ if ($ADD==99999) <BR> <B>Agent de l'exécution Shift Override -</B> Ce paramètre remplace les utilisateurs quel que soit le groupe d'utilisateurs a mis en application de la loi pour Maj. HANDICAPES utilise l'utilisateur groupe. OFF ne fera pas appliquer à tous les changements. START ne faire respecter les temps de connexion, mais n'aura pas d'incidence sur un agent qui est en cours d'exécution sur leurs heures de travail si elles sont déjà logged in ALL appliquent passer l'heure de début et se connecter à un agent, après, ils courent sur la fin de leur quart de temps. La valeur par défaut est désactivé. + <BR> + <A NAME="vicidial_users-agent_call_log_view_override"> + <BR> + <B>Agent Call Log Voir Override -</B> Ce paramètre remplace quel que soit le groupe d'utilisateurs utilisateurs s'est fixé pour View Log Agent d'appel. HANDICAPÉS utilisera le réglage du groupe utilisateur. N ne permettra pas montrer le journal des appels utilisateurs. Y permettra montrant le journal des appels de l'utilisateur. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Override Recherche Agent principal -</B> Ce paramètre remplace quelle que soit la campagne s'est fixé pour principal agent de recherche. NOT_ACTIVE utilisera le paramètre de campagne. ENABLED permettra recherche de plomb et de DISABLED ne permettra pas la recherche de plomb. Par défaut est NOT_ACTIVE. + <BR> <A NAME="vicidial_users-alert_enabled"> <BR> @@ -3118,9 +4374,14 @@ if ($ADD==99999) <B>Permettez Alertes -</B> Ce champ vous donne la possibilité de permettre navigateur agent des alertes pour être activé par l-agent pour les appels entrants sur leur session vicidial.php. Par défaut est 0 pour le NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>La campagne se range - dans cette section vous pouvez définir le rangque un agent aura pour chaque campagne. Ces rangs peuvent êtreemployés pour tenir compte du cheminement préféré d'appel quand leprochain appel d'agent est placé au campaign_rank. Également dans cette section sont le WEB VAR pour chaque campagne. Il s'agit de permettre à chaque agent d'avoir une autre variable de chaîne qui peuvent être ajoutés à la fiche de Web ou SCRIPT onglet URL, simplement en mettant - A - web_vars - B - comme vous le mettre dans tout autre domaine. + <B>Contact Recherche Preset -</B> Si l'utilisateur est connecté à une campagne qui a Presets de transfert prévues à l'CONTACTS, alors ce paramètre peut désactiver la recherche de contact pour cet utilisateur uniquement. Par défaut est NOT_ACTIVE qui utilisera quelle que soit la campagne est mise en. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>La campagne se range - dans cette section vous pouvez définir le rangque un agent aura pour chaque campagne. Ces rangs peuvent êtreemployés pour tenir compte du cheminement préféré d'appel quand leprochain appel d'agent est placé au campaign_rank. Également dans cette section sont le WEB VAR pour chaque campagne. Il s'agit de permettre à chaque agent d'avoir une autre variable de chaîne qui peuvent être ajoutés à la fiche de Web ou SCRIPT onglet URL, simplement en mettant - A - web_vars - B - comme vous le mettre dans tout autre domaine. Un autre domaine dans cette section est de qualité, qui permet pour la campaign_grade_random agent Suivant Appelez la mise à être utilisé. Ce paramètre de qualité va augmenter ou diminuer la probabilité que l'agent recevra l'appel. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3140,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Custom Utilisateur Fields -</B> Ces cinq champs peuvent être utilisés à des fins diverses, et ils peuvent être archivés dans les adresses formulaire web et des scripts comme user_custom_one et ainsi de suite. + <B>Custom Utilisateur Fields -</B> Ces cinq champs peuvent être utilisés à des fins diverses, et ils peuvent être archivés dans les adresses formulaire web et des scripts comme user_custom_one et ainsi de suite. Le Custom 5 champ peut être utilisé comme un champ de définir un certain nombre dialplan d'envoyer un appel à partir d'un AGENTDIRECT en groupe si l'utilisateur n'est pas disponible, vous avez juste besoin de mettre AGENTEXT dans le champ Message ou EXTENSION dans le AGENTDIRECT en groupe et le système va chercher la coutume cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3187,6 +4448,15 @@ if ($ADD==99999) <B>Charger des fiches -</B> Cette option et mise à 1 pour autoriser l'utilisateur à charger des fiches dans la table vicidial_list en utilisant le chargeur de fiches web. <?php } + if ($SScustom_fields_enabled > 0) + { + ?> + <BR> + <A NAME="vicidial_users-custom_fields_modify"> + <BR> + <B>Modifier les champs personnalisés -</B> Cette option, si mis à 1 permet à l'utilisateur de modifier les champs de listes personnalisées. + <?php + } ?> <BR> @@ -3323,13 +4593,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Rapports d'exportation -</B> Ce paramètre, s'il est à 1 permettra d'accéder à un gestionnaire de l'exportation des rapports sur l'appel RAPPORTS écran. La valeur par défaut est 0. Pour le rapport invite l'exportation, l'ordre suivant est utilisé pour les exportations: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Rapports d'exportation -</B> Ce paramètre si elle est définie à 1, permettre à un gestionnaire d'accéder à l'appel d'exportation et les rapports de plomb sur l'écran RAPPORTS. Par défaut est 0. Pour l'exportation Appels et mène des rapports, l'ordre des champs ci-dessous est utilisé pour les exportations: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> <BR> <B>Supprimer From Listes DNC -</B> Ce paramètre si la valeur 1 permettra à un manager pour supprimer des numéros de téléphone dans les listes du DNC dans le système VICIDIAL. + <BR> + <A NAME="vicidial_users-realtime_block_user_info"> + <BR> + <B>En temps réel Infos Message Bloquer -</B> Ce paramètre si elle est définie à 1 permet de bloquer les informations utilisateur et de la station ne sera pas affichée dans le rapport en temps réel. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Modifier niveau de l'utilisateur même -</B> Ce paramètre s'applique uniquement au niveau 9 utilisateurs. Si elle est activée elle permet à l'utilisateur de niveau 9 à modifier leurs paramètres propres ainsi que d'autres au niveau 9 utilisateurs. Par défaut est 1 pour activé. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Administrateur de données masquer plomb -</B> Ce paramètre s'applique uniquement au niveau 7, 8 et 9 utilisateurs. Si elle est activée elle remplace les données de plomb clients dans les nombreux rapports et des écrans dans le système avec Xs. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Administrateur masquer les données du téléphone -</B> Ce paramètre s'applique uniquement au niveau 7, 8 et 9 utilisateurs. Si elle est activée elle remplace les numéros de téléphone des clients dans les nombreux rapports et des écrans dans le système avec Xs. Les paramètres chiffres seront montrent que les chiffres X derniers du numéro de téléphone. Par défaut est 0 pour les handicapés. + @@ -3352,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Description de la campagne -</B> C'est un champ de note pour la campagne, il est optionel et ne peut contenir plus de 255 caractères. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cette campagne, ce qui permet d'administration visualisation de cette campagne ainsi que les listes assignés à cette campagne pour être limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin avec les autorisations des utilisateurs du groupe de campagne pour voir cette campagne. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -3368,10 +4663,20 @@ if ($ADD==99999) <B>Dernière campagne téléphonique Date -</B> Il s-agit de la dernière fois qu-un appel a été traitée par un mandataire inscrit dans cette campagne. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Maximum quotidien Statistiques -</B> Ce sont des statistiques qui sont générées par le système chaque jour pendant toute la journée jusqu'à ce que la minuterie de fin de journée, car il est réglé dans les paramètres système. Ces nombres sont générés à partir des grumes dans le système pour permettre l'affichage beaucoup plus rapide. Les stats sont inclus sont - Nombre total d'appels, les agents maximum, maximum des appels entrants, appels sortants maximum. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_rafraîchir"> <BR> <B>Rafraichissement des statistiques de la campagne -</B> Cette checkbox permet de forcer un rafraichissement des statistiques de vicidial, même si la campagne n'est pas active. + <BR> + <A NAME="vicidial_campaigns-realtime_agent_time_stats"> + <BR> + <B>Real-Time Temps Stats Agent -</B> Mettre cette option à quoi que ce soit, mais HANDICAPÉS permettra la collecte de statistiques en temps des agents pour aujourd'hui pour cette campagne, qui sont visibles au travers du rapport en temps réel. Les appels sont la moyenne appels traités par agent, attente est le temps moyen d'attente d'agent, le CUST est le temps moyen de clients discours, ACW est la moyenne Après le temps de travail Appel, PAUSE est le temps de pause en moyenne. Par défaut est DISABLED. + <BR> <A NAME="vicidial_campaigns-active"> <BR> @@ -3380,17 +4685,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Extension de mise en attente-</B> C'est ici que vous pouvez personnaliser la musique d'attente pour VICIDIAL. Assurez vous que l'extension est en place dans le fichier extension.conf et qu'elle pointe sur le fichier suivant. + <B>Parc de la Musique-sur-Hold -</B> C'est là que vous pouvez définir le contexte de la musique en attente pour cette campagne. Assurez-vous que vous sélectionnez une musique valable sur le contexte de maintien de la liste de sélection et que le contexte que vous avez sélectionné les fichiers valides a en elle. Par défaut est par défaut. <BR> <A NAME="vicidial_campaigns-park_file_name"> <BR> - <B>Fichier de mise en attente-</B> C'est ici que vous pouvez personnaliser la musique d'attente pour VICIDIAL. Assurez vous que le nom du fichier fasse moins de 10 caractères et qu'il soit bien en place dans le répertoire /var/lib/asterisk/sounds. + <B>Park File Name -</B> NOT USED. <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Formulaire Web -</B> C'est ici que que vous pouvez mettre une page web personnalisée qui sera ouverte quand l'utilisateur cliquera sur le bouton FORMULAIRE WEB. Pour personnaliser la chaîne de requête, après le formulaire Web, il suffit de commencer avec le formulaire web, VAR et puis l'URL que vous voulez utiliser, en remplaçant les variables avec les noms des variables que vous voulez utiliser - A - phone_number - B -- comme dans l'onglet SCRIPTS. + <B>Formulaire Web -</B> C'est ici que que vous pouvez mettre une page web personnalisée qui sera ouverte quand l'utilisateur cliquera sur le bouton FORMULAIRE WEB. Pour personnaliser la chaîne de requête, après le formulaire Web, il suffit de commencer avec le formulaire web, VAR et puis l'URL que vous voulez utiliser, en remplaçant les variables avec les noms des variables que vous voulez utiliser - A - phone_number - B -- comme dans l'onglet SCRIPTS. Si vous voulez utiliser des champs personnalisés dans un formulaire Web l'adresse, vous devez ajouter &CF_uses_custom_fields=Y dans le cadre de votre URL. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -3451,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Commence avec les fuseaux horaires de l-Est et l-Ouest de travaux <BR>   - DOWN TIMEZONE: Commence avec les fuseaux horaires de l-Ouest et travaille Est + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Commandez Liste Randomize -</B> Cette option vous permet de randomiser l'ordre des pistes dans la charge trémie dans les résultats définis par les critères énoncés ci-dessus. Par exemple, la liste de commande seront préservés, mais les résultats seront randomisés dans ce tri. Mettre cette option à Y activer cette fonctionnalité. Par défaut est N pour les handicapés. REMARQUE, si vous avez un grand nombre de conducteurs de cette option peut ralentir la vitesse du script trémie de chargement. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Commandez Liste secondaire -</B> Cette option vous permet de sélectionner l'ordre de tri second des fils de la charge trémie après l'Ordre et au sein de la liste des résultats définis par les critères énoncés ci-dessus. Par exemple, la liste de commande sera utilisé pour la première sorte de les fils, mais les résultats seront triés une seconde fois au sein de ce tri dans le même ensemble de l'Ordre de la première liste. Par exemple, si vous avez la liste de commandes mis à décomptage et vous avez seulement des pistes qui ont été tentées 1 et 2 fois, puis si vous avez l'ensemble de commande Liste secondaire à LEAD_ASCEND tous les fils 1 tentative sera triée par les plus anciens conducteurs premier et sera placée dans la trémie de cette façon. Par défaut est LEAD_ASCEND. REMARQUE, si vous avez un grand nombre de prospects en utilisant l'une des options CALLTIME peut ralentir la vitesse du script trémie de chargement. Si la liste de commandes Aléatoire est activée, cette option sera ignorée. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Niveau du distributeur -</B> C'est le nombre de fiches que le script VDhopper essaye de garder dans la table vicidial_hopper pour cette campagne. Si l'on lance le script VDhopper chaque minute, mettez juste au dessus du nombre de fiches que vous voulez traiter par minute. + <B>Niveau minimum Hopper -</B> C'est le nombre minimum de conduit le script VDhopper essaie de garder dans le tableau vicidial_hopper pour cette campagne. Si vous exécutez le script VDhopper chaque minute, faire ce peu supérieur au nombre de conducteurs vous passez par une minute. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Niveau Hopper automatique -</B> Mettre ce paramètre à Y permettra Vicidial pour ajuster automatiquement la trémie basé sur les paramètres que vous avez dans votre campagne. La formule qu'il utilise pour ce faire est:<BR>Number of Active Agents * Niveau de l'appel automatique * ( 60 seconds / Délai de tentative d'appel ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Multiplicateur Hopper automatique -</B> C'est multiplicateur pour l'Hopper Auto. La définition de cette moins de 1 fera l'algorithme Hopper Auto à charger moins que fils il le ferait normalement. La définition de cette supérieur à 1 fera l'algorithme Hopper Auto pour charger plus de prospects que normalement. Par défaut est 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Auto Trim Hopper -</B> Mettre ce paramètre à Y permettra Vicidial pour supprimer automatiquement l'excès mène à partir de la trémie. Par défaut est Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Hopper VLC Dup Vérifiez -</B> Un réglage à Y entraîne chaque piste étant insérée dans la trémie étant vérifiée par vendor_lead_code pour s'assurer qu'il n'y sont pas dupliquer conducteurs insérés avec le même vendor_lead_code. Cela est particulièrement utile lorsque la fonction Auto-Alt-numérotation avec MULTI_LEAD. Par défaut est N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Filtre de fiches -</B> C'est une méthode de filtrage de vos fiches utilisant un fragment de requête SQL. Utilisez cette fonction avec précaution, il est facile de stoper une comunication accidentellement avec le plus petit changement du statement SQL. La valeur par défaut est NONE. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Appelez le comte Limite -</B> Ceci impose une limite sur le nombre de tentatives d'appel pour les conducteurs composés dans cette campagne. Un plomb peut dépasser cette limite légèrement si le recyclage de plomb ou Auto-Alt-numérotation est activée. Par défaut est 0 pour aucune limite. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Appelez le comte cible -</B> Cette option est uniquement utilisée pour des fins de rapport et n'a aucun effet sur les pistes composés. Par défaut est 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -3474,18 +4819,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-dial_method"> <BR> - <B>Méthode d'appel -</B> Ce champ permet de définir la façon dont sont passés les appels. Si c'est MANUAL alors le auto_dial_level sera bloqué à 0 à moins que le méthode d'appel ne change. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Niveau de l'appel automatique if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode. ENTRANT_MAN permet à l'agent de mise manuel composer des appels de la liste d'une campagne tout en étant en mesure de prendre des appels entrants entre le manuel de composer des appels. + <B>Méthode d'appel -</B> Ce champ permet de définir la façon dont sont passés les appels. Si c'est MANUAL alors le auto_dial_level sera bloqué à 0 à moins que le méthode d'appel ne change. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Niveau de l'appel automatique if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode. INBOUND_MAN permet à l'agent de mise manuel composer des appels de la liste d'une campagne tout en étant en mesure de prendre des appels entrants entre le manuel de composer des appels. <BR> <A NAME="vicidial_campaigns-auto_dial_level"> <BR> <B>Niveau de l'appel automatique -</B> C'est ici que vous mettez combien de lignes VICIDIAL devrait utiliser par agent. 0 veut dire que l'appel automatique est désactivé et que l'agent doit cliquer pour appeler chaque numéro. Autrement VICIDIAL maintiendra le nombre de lignes égale au nombre d'agents actifs multiplié par le niveau de l'appel automatique pour arriver au nombres de lignes que cette campagne devrait permettre sur chaque serveur . La checkbox ADAPTER LE DEPASSEMENT vous permet de forcer un nouveau niveau d'appel même si la méthode d'appel est ADAPT. C'est utile s'il y a une variation dramatique dans la qualité des fiches et que vous voulez changer rigoureusement le dial_level manuellement. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Seuil Auto Level Dial -</B> Ce paramètre ne fonctionne qu'avec un ADAPT ou la méthode de rapport Dial, et il doit être réglé sur autre chose que HANDICAPÉS et le nombre de paramètre agents doit être supérieure à 0. Cette fonctionnalité vous permet de définir un nombre minimum d'agents que l'algorithme prédictif travailler. Si le nombre d'agents en deçà du nombre que vous avez défini, alors le niveau de numérotation ira à 1,0 jusqu'à plus d'agents connecter ou entrer dans l'état sélectionné. Logged-IN_AGENTS comptera tous les agents connectés à la campagne, NON-PAUSED_AGENTS comptera seulement les agents qui sont en attente ou en parlant, et WAITING_AGENTS comptera seulement des agents qui sont en attente d'un appel. Par défaut est DISABLED. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Valable seulement pour les contrôles -</B> Si ce champ est à Y les agents ayant pour statut INCALL ou QUEUE seront omis pour le calcul des appels à passer quand le mode d'appel n'est pas MANUAL. La valeur par défaut est N. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Disponible Seuil Tally seulement -</B> Ce paramètre ne fonctionne qu'avec un ADAPT ou la méthode de rapport Dial, disponible seulement Tally doit être réglé sur N, ce paramètre doit être réglé sur autre chose que HANDICAPÉS et le nombre de paramètre agents doit être supérieure à 0. Cette fonctionnalité vous permet de définir le nombre d'agents en dessous duquel Disponible Tally Seuls seront permis. Si le nombre d'agents en deçà du nombre que vous avez défini, puis la mise en Tally Disponible seulement au rendez-vous à Y temporairement jusqu'à ce que plus d'agents connecter ou entrer dans l'état sélectionné. Logged-IN_AGENTS comptera tous les agents connectés à la campagne, NON-PAUSED_AGENTS comptera seulement les agents qui sont en attente ou en parlant, et WAITING_AGENTS comptera seulement des agents qui sont en attente d'un appel. Par défaut est DISABLED. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -3509,7 +4864,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Différence cible du niveau d'appel -<\/B> Ce champ est utilisé pour définir quel nombre spécifique d'agents vous désiser avoir en attente d'appels ou d'appels en attente d'agents. Par exemple, si vous voulez avoir toujours en moyenne un agent de libre pour prendre des appels immediatement vous devriez mettre ceci à -1, si vous ciblez d'avoir un appel gardé en attente d'un agent vous devriez mettre ceci à 1. La valeur par default est 0. Ce champ n'est pas utilisé par les méthodes d'appels MANUAL et RATIO. + <B>Différence cible du niveau d'appel -</B> Ce champ est utilisé pour définir si vous souhaitez cibler ayant un nombre précis d'agents d'attente pour les appels ou les appels en attente pour les agents. Par exemple, si vous voulez toujours avoir en moyenne un agent libre de prendre les appels immédiatement, vous devez définir cette valeur à -1, si vous souhaitez cibler avoir toujours un appel en attente en attente d'un agent, vous devez définir cette valeur à 1. Par défaut est 0. Ce champ n'est pas utilisé dans le manuel ou les méthodes de numérotation INBOUND_MAN. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Composez méthode cible de différence de niveau -</B> Cette option vous permet de définir si le niveau cible cadran différence paramètre est appliqué uniquement sur le calcul du niveau de cadran ou également à la composition réelle sur chaque serveur de numérotation. Si vous exécutez une petite campagne avec des agents connectés sur de nombreux serveurs, vous voudrez peut-être utiliser l'option ADAPT_CALC_ONLY, parce que l'option CALLS_PLACED peut entraîner une diminution des appels en cours placés que deisred. Cette option n'est active que si la cible Différence Dial Level est réglé sur autre chose que 0. Par défaut est ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -3519,17 +4879,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>File d'attente de priorité - </B> Ce paramètre est utilisé pour définir l'ordre dans lequel les appels sortants à partir de cette campagne devrait être répondu en ce qui concerne les appels entrants si cette campagne est en mode mixte. + <B>File d'attente de priorité - </B> Ce paramètre est utilisé pour définir l'ordre dans lequel les appels sortants à partir de cette campagne devrait être répondu en ce qui concerne les appels entrants si cette campagne est en mode mixte. Nous ne recommandons pas la mise en appels entrants vers une plus grande priorité que les appels sortants de la campagne parce que les gens font escale dans s'attendre à attendre et les gens sont appelés attendre pour que quelqu'un soit là sur le téléphone. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> <BR> <B>Multiples campagne Drop Rate Group -</B> Cette fonctionnalité vous permet de définir une campagne comme un membre d-un groupe de la Campagne taux d-abandon, ou un groupe de campagnes dont l-homme appels répondus et les appels de chute pour toutes les campagnes dans le groupe seront combinés en un pourcentage partagée déposer, ou les taux d-abandon. Ceci vous permet d-exécuter plusieurs campagnes à la fois et plus facile à contrôler votre taux de chute. Ceci est particulièrement utile dans le Royaume-Uni où la réglementation permet cette méthode de calcul des taux d-abandon avec une campagne de groupement pour la même compagnie, même s-il ya plusieurs campagnes cette société est en marche pendant le jour même. Pour activer ce pour une campagne, il suffit de sélectionner un groupe de la liste. Il existe 10 groupes définis dans le système par défaut, vous pouvez contacter votre administrateur système d-ajouter d-autres. Par défaut est Disabled. + <BR> + <A NAME="vicidial_campaigns-inbound_queue_no_dial"> + <BR> + <B>Pas de file d'attente entrante Composez -</B> Cette fonctionnalité, si la valeur ENABLED vous permet d'empêcher sortant numérotation automatique de cette campagne s'il ya des appels entrants en attente dans la file d'attente qui font partie des groupes entrantes autorisées fixés dans cette campagne. Mettre cette option à ALL_SERVERS va changer l'algorithme pour calculer tous les appels entrants que les appels actifs sur ce serveur, même si elles sont sur un autre serveur qui permettra de réduire le risque de placer des appels sortants inutiles si vous avez des appels arrivant sur un autre serveur. Par défaut est DISABLED. + <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Appeler automatiquement le numéro alternatif -</B> Ce champ est utilisé pour appeler automatiquement le numéro alternatif si les méthodes d'appels RATIO ou ADAPT sont utilisées quand il n'y pas de réponse au numéro de téléphone principale d'une fiche, les statuts NA, B, DC et N. Cette option n'est pas utilisée pour la méthode d'appel MANUAL. EXTENDED suppléant nombres sont des nombres dans le système en dehors de la norme de l'écran principal de l'information. L'aide de vous pouvez avoir des centaines de numéros de téléphone pour un seul client record. + <B>Appeler automatiquement le numéro alternatif -</B> Ce champ est utilisé pour appeler automatiquement le numéro alternatif si les méthodes d'appels RATIO ou ADAPT sont utilisées quand il n'y pas de réponse au numéro de téléphone principale d'une fiche, les statuts NA, B, DC et N. Cette option n'est pas utilisée pour la méthode d'appel MANUAL. EXTENDED suppléant nombres sont des nombres dans le système en dehors de la norme de l'écran principal de l'information. L'aide de vous pouvez avoir des centaines de numéros de téléphone pour un seul client record. Utilisation MULTI_LEAD vous permet d'utiliser un câble séparé pour chaque numéro sur un compte client qui partagent tous une vendor_lead_code commune, et le type de numéro de téléphone pour chacun d'eux est défini avec une étiquette dans le domaine du propriétaire. Cette option permet de désactiver certaines options sur l'écran de la campagne Modifier et afficher un lien vers la page Multi-Alt Paramètres qui vous permet de définir quels types de numéros de téléphone, définis par l'étiquette de chaque plomb, sera composé et dans quel ordre. Cela va créer un filtre spécial de plomb et de modifier le champ Rang de tous les fils à l'intérieur des listes établies à cette campagne afin de les appeler dans l'ordre que vous avez spécifié. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -3539,14 +4904,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Campagne VDAD extension -</B> Ce champ permet une coutume VDAD transfert extension. Cela vous permet d'utiliser différentes méthodes de traitement des appels en fonction de votre campagne. - - 8364 - même que 8368 - - 8365 - Will seulement envoyer l'appel à un agent sur le même serveur que l'appel est en - - 8366 - Occasions-1 pour la presse et campagnes de sondage - - 8367 - Le premier à essayer d'envoyer l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Occasions de Answering Machine de détection après que, même comportement que 8368 - - 8373 - Occasions de Answering Machine de détection après cette même comportement que 8366 + <B>Routage Extension -</B> Ce champ permet à une extension de routage sortant personnalisé. Cela vous permet d'utiliser différentes méthodes de traitement des appels en fonction de la façon dont vous voulez acheminer les appels sortants grâce à votre campagne. Anciennement appelée l'extension VDAD Campagne. + <BR>- 8364 - même 8368 + <BR>- 8365 - Enverra l'appel uniquement à un agent sur le même serveur que l'appel est placé sur + <BR>- 8366 - Utilisé pour des campagnes de presse-1, de diffusion et d'enquête + <BR>- 8367 - Je vais essayer d'envoyer d'abord l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs + <BR>- 8368 - DEFAULT - Permet d'envoyer l'appel vers le prochain agent disponible, peu importe quel serveur ils sont sur + <BR>- 8369 - Utilisé pour Détection des répondeurs après que, même comportement que 8368 + <BR>- 8373 - Utilisé pour Détection des répondeurs après cette même comportement que 8366 + <BR>- 8374 - Utilisé pour des campagnes de presse-1, de diffusion et d'enquête avec Cepstral Text-to-speech + <BR>- 8375 - Utilisé pour Détection des répondeurs puis appuyez-1, de diffusion et d'enquête des campagnes avec Cepstral Text-to-speech <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -3581,13 +4948,23 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-drop_action"> <BR> - <B>Drop Action - </B> Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Inbound groupe qui est défini ci-dessous + <B>Drop Action - </B> Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Entrant groupe qui est défini ci-dessous <BR> <A NAME="vicidial_campaigns-safe_harbor_exten"> <BR> <B>Extension du port sûr -<\/B> C'est l'extension du dial plan où le fichier audio désiré est localisé sur le serveur. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Safe Harbour Audio -</B> Il s'agit du fichier audio rapide qui se joue, si l'action Drop est réglé sur AUDIO. Par défaut est buzz. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Coffre-fort Menu Appel port -</B> C'est le menu d'appel que l'appel est envoyé à si l'action Drop est réglé sur CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -3606,12 +4983,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-no_hopper_dialing"> <BR> - <B>N Hopper Dialing -</B> Si elle est activée, la trémie ne fonctionnera pas pour cette campagne. Cette option n-est disponible que lorsque la méthode du cadran est mis en mode manuel ou ENTRANT_MAN. Il est recommandé de ne pas activer cette option si vous avez une base très large de plomb, plus de 100.000 prospects. Avec pas d-appel Hopper, les caractéristiques suivantes ne fonctionnent pas: recyclage du plomb, auto-alt-numérotation, mélanger la liste, mise en ordre avec Xème NEW. Si vous souhaitez utiliser Propriétaire composer seulement vous devez avoir pas d-appel Hopper activé. Par défaut est N pour les handicapés. + <B>N Hopper Dialing -</B> Si elle est activée, la trémie ne fonctionnera pas pour cette campagne. Cette option n-est disponible que lorsque la méthode du cadran est mis en mode manuel ou INBOUND_MAN. Il est recommandé de ne pas activer cette option si vous avez une base très large de plomb, plus de 100.000 prospects. Avec pas d-appel Hopper, les caractéristiques suivantes ne fonctionnent pas: recyclage du plomb, auto-alt-numérotation, mélanger la liste, mise en ordre avec Xème NEW. Si vous souhaitez utiliser Propriétaire composer seulement vous devez avoir pas d-appel Hopper activé. Par défaut est N pour les handicapés. <BR> <A NAME="vicidial_campaigns-agent_dial_owner_only"> <BR> - <B>Propriétaire composer seulement -</B> Si elle est activée, l-agent ne recevra pistes qu-ils sont dans les paramètres de propriété pour. Si cela est réglé sur Utilisateur, puis l-agent doit être définie par l-utilisateur dans la base de données en tant que propriétaire de ce plomb. Si cela est défini au territoire, le propriétaire de la direction doit correspondre au territoire énumérées dans l-écran de Modification de l-utilisateur pour cet agent. Si ce réglage est à GROUPE_UTILISATEUR le propriétaire du nom de la sonde doit correspondre au groupe d-utilisateurs que l-agent est un membre de. Pour que cette fonction soit la méthode cadran doit être réglé en mode manuel ou ENTRANT_MAN Hopper et pas d-appel doit être activé. Par défaut est AUCUN pour les handicapés. + <B>Propriétaire composer seulement -</B> Si elle est activée, l-agent ne recevra pistes qu-ils sont dans les paramètres de propriété pour. Si cela est réglé sur Utilisateur, puis l-agent doit être définie par l-utilisateur dans la base de données en tant que propriétaire de ce plomb. Si cela est défini au territoire, le propriétaire de la direction doit correspondre au territoire énumérées dans l-écran de Modification de l-utilisateur pour cet agent. Si ce réglage est à GROUPE_UTILISATEUR le propriétaire du nom de la sonde doit correspondre au groupe d-utilisateurs que l-agent est un membre de. Pour que cette fonction soit la méthode cadran doit être réglé en mode manuel ou INBOUND_MAN Hopper et pas d-appel doit être activé. Par défaut est AUCUN pour les handicapés. <?php if ($SSuser_territories_active > 0) @@ -3658,7 +5035,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_first_audio_file"> <BR> - <B>Première Enquête Audio File - </B> Il s'agit du nom de fichier audio qui se joue dès que le client choisit le téléphone lors de l'exécution d'une étude campagne. + <B>Première Enquête fichier audio - </B> Il s'agit du nom de fichier audio qui se joue dès que le client choisit le téléphone lors de l'exécution d'une étude campagne. <BR> <A NAME="vicidial_campaigns-survey_dtmf_digits"> @@ -3678,17 +5055,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_opt_in_audio_file"> <BR> - <B>Enquête sur Opt-in Audio File - </B> Il s'agit du nom de fichier audio qui se joue lorsque le client a opté dans l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à optout. Après ce fichier audio est joué, le sondage de l'action ne soit prise. + <B>Enquête sur Opt-in fichier audio - </B> Il s'agit du nom de fichier audio qui se joue lorsque le client a opté dans l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à optout. Après ce fichier audio est joué, le sondage de l'action ne soit prise. <BR> <A NAME="vicidial_campaigns-survey_ni_audio_file"> <BR> - <B>Enquête Non Intéressé Audio File - </B> Il s'agit du nom de fichier audio qui se joue lorsque le client a choisi de l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à OptIn. Après ce fichier audio est joué, l'appel sera suspendu jusqu'à. + <B>Enquête Non Intéressé fichier audio - </B> Il s'agit du nom de fichier audio qui se joue lorsque le client a choisi de l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à OptIn. Après ce fichier audio est joué, l'appel sera suspendu jusqu'à. <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Enquête sur la méthode - </B> Cette option permet de définir ce qui se passe à un appel après que le client a opté en. AGENT_XFER enverra l'appel à la prochaine agent. MESSAGERIE VOCALE envoie l'appel à la boîte vocale qui est spécifié dans la boîte vocale domaine. EXTENSION envoie le client à l'extension définie dans le Enquête Xfer Extension domaine. Hangup se raccrocher le client. CAMPREC_60_WAV enverra au client d'avoir un enregistrement réalisé avec leur réponse, cet enregistrement sera placé dans un dossier nommé comme la campagne de l'intérieur de l'Enquête sur la campagne d'enregistrement Directory. + <B>Enquête sur la méthode - </B> Cette option permet de définir ce qui se passe à un appel après que le client a opté en. AGENT_XFER enverra l'appel à la prochaine agent. MESSAGERIE VOCALE envoie l'appel à la boîte vocale qui est spécifié dans la boîte vocale domaine. EXTENSION envoie le client à l'extension définie dans le Enquête Xfer Extension domaine. Hangup se raccrocher le client. CAMPREC_60_WAV enverra au client d'avoir un enregistrement réalisé avec leur réponse, cet enregistrement sera placé dans un dossier nommé comme la campagne de l'intérieur de l'Enquête sur la campagne d'enregistrement Directory. CALLMENU enverra au client dans le menu Appel défini dans la liste de sélection ci-dessous. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -3740,6 +5117,16 @@ if ($ADD==99999) <BR> <B>Agent d-affichage composable Leads -</B> Cette option si elle est activée affiche le nombre de pistes d-accès automatique disponibles dans la campagne dans l-écran de l-agent. Ce numéro est mis à jour dans le système une fois par minute et sera rafraîchie à l-écran tous les agents de quelques secondes. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Menu Appel Enquête -</B> Si la méthode est réglé sur CALLMENU, c'est le menu Appel que le client est envoyé à si elles optent en. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Enregistrement Enquête -</B> Si elle est activée, cela va démarrer l'enregistrement lorsque l'appel est répondu. Seulement recommandé si la méthode n'est pas réglé pour le transfert à un agent. Par défaut est N pour les handicapés. S'il est défini à Y_WITH_AMD même machine à répondre aux appels de messages détectés seront enregistrées. + <?php } ?> @@ -3753,6 +5140,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: ordonne suivant la dernière date à laquelle un agent a terminé un appel. L'agent AKA attendant le plus longtemps reçoit le premier appel. <BR>   - overall_user_level: ordonne par le user_level de l'agent comme défini dans la table vicidial_users, un user_level plus élévé recevra plus d'appels. <BR>   - campaign_rank : ordres par le rang donné à l'agent pour la campagne.Le plus haut à le plus bas. + <BR>   - campaign_grade_random: donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur. <BR>   - fewest_calls : ordres par le nombre d'appels reçus par un agent pource groupe d'arrivée spécifique. Moindres appels d'abord. <BR>   - longest_wait_time: commandes par la quantité de temps d-attente agent a été activement pour un appel. @@ -3766,6 +5154,11 @@ if ($ADD==99999) <BR> <B>Préfixe d'appel -</B> Ce champ autorise plus facilement à changer un chemin d'appel vers l'exterieur à travers une méthode differente sans devoir recharger Asterisk. La valeur par défaut 9 est basée sur 91NXXNXXXXXX dans le dial plan du fichier extensions.conf . + <BR> + <A NAME="vicidial_campaigns-manual_dial_prefix"> + <BR> + <B>Préfixe Manuel -</B> Ce champ optionnel vous permet de définir le préfixe doit être utilisé que lors d'un appel numérotation manuelle à partir de l'interface agent, comme l'utilisation de la fonction numérotation manuelle, ou Composez le numéro suivant dans la méthode lorsque la numérotation manuelle, ou numérotation manuelle nombre alt, ou prévue par l'utilisateur seulement rappels. Par défaut est vide pour les handicapés, qui utilisent le préfixe défini dans le champ ci-dessus. Cette option ne pas interférer avec l'option Préfixe 3way. + <BR> <A NAME="vicidial_campaigns-omit_phone_code"> <BR> @@ -3776,6 +5169,11 @@ if ($ADD==99999) <BR> <B>CallerID de la campagne -</B> Ce champ autorise à envoyer un numéro de callerId personnalisé sur les appels sortants. C'est le numéro de callerId que vous voullez montrer à la personne que vous appellez. La valeur par défaut est UNKNOW. Si vous utilisez des T1 ou E1s pour appeler vers l'extérieur cette option est seulement valable si vous utilisez des PRIs - ISDN T1s ou E1s - qui ont la fonction CallerId personnalisable activée, cela ne fonctionne pas avec le service Robbed-bit et les circuits -RBS-. Cela fonctionne aussi avec la plupart des fournisseurs VOIP -SIP ou trunks IAX- qui autorisent un callerId de sortie dynamique. Le callerID personnalisé ne s'applique qu'aux appels passés directement depuis la campagne VICIDIAL, n'importe quel appel avec une tierce personne ou transféré n'enverra pas le callerId personnalisé. NOTE: Parfois en mettant UNKWOWN ou PRIVATE dans ce champ c'est le callerId par défaut de votre ligne qui sera transmis pour les appels. Vous pouvez tester cela et mettre 0000000000 à la place dans le champs calleID si vous ne voulez pas envoyer votre CallerID. + <BR> + <A NAME="vicidial_campaigns-use_custom_cid"> + <BR> + <B>Personnalisé CallerID -</B> Lorsqu'il est réglé sur Y, cette option vous permet d'utiliser le domaine security_phrase dans le tableau vicidial_list que le CallerID d'envoyer lors de la passation pour chaque chef de file spécifique. Si ce champ n'a pas de CID en elle, puis la campagne CallerID défini ci-dessus sera utilisé à la place. Cette option permet de désactiver la liste CallerID Remplacer s'il ya un cadeau CID dans le domaine security_phrase. Par défaut est N. Lorsqu'il est réglé sur le code zonal vous avez la possibilité d'aller dans le sous-menu AC-CID et de définir plusieurs callerids être utilisés par indicatif régional. + <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -3789,13 +5187,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Nom du fichier d'enregistrement de la campagne -</B> Ce champs vous permet de personnaliser le nom de fichier pour l'enregistrement quand l'enregistrement de la campage est sur ONEDEMAND ou ALLCALLS. Les variables autorisées sont CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. La valeur par defaut est FULLDATE_AGENT et le nom du fichier ressemblerait à ceci : 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE ce qui ressemblerait à ceci : TESTCAMP_51020103108_3125551212 . 50 char max. + <B>Nom du fichier d'enregistrement de la campagne -</B> Ce champ vous permet de personnaliser le nom de l'enregistrement quand la campagne est ONDEMAND ou ALLCALLS. Les variables sont permis CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. La valeur par défaut est FULLDATE_AGENT et devrait ressembler à ceci 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui devrait ressembler à ceci TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>Délai d'enregistrement -</B> Uniquement pour les enregistrements ALLCALLS et ALLFORCE. Cette valeur est le nombre de secondes après lesquelles commence l'enregistrement des appels. La valeur par défaut est 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Appelez-notes par Appel -</B> La définition de cette option pour activer permettra aux agents d'entrer dans les notes pour chaque appel ils ont accès dans l'interface agent. Le champ de saisie des notes apparaît en dessous du champ de commentaires dans l'interface agent. En outre, si le Groupe de l'agent utilisateur est autorisé à afficher des journaux d'appels, puis l'agent sera en mesure d'afficher des notes d'appel passées pour une avance à tout moment. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Recherche de plomb Agent -</B> La définition de cette option pour activer permettra aux agents de rechercher des pistes et afficher des informations de plomb pendant la pause dans l'interface agent. En outre, si le Groupe de l'agent utilisateur est autorisé à afficher des journaux d'appels, puis l'agent sera en mesure d'afficher des notes d'appel passées pour toute avance qu'ils sont affichés sur les informations. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Méthode de recherche d'agent principal -</B> Si la recherche de plomb Agent est activé, ce paramètre définit l'endroit où l'agent ne sera autorisé à rechercher des pistes. Système va rechercher l'ensemble du système, sera CAMPAIGNLISTS chercher au cœur de toutes les listes actives au sein de la campagne, sera CAMPLISTS_ALL chercher au cœur de toutes les listes actives et inactives au sein de la campagne, LISTE va rechercher uniquement dans le ID de liste numérotation manuelle tel que défini dans la campagne . Par défaut est CAMPLISTS_ALL. Une de ces options avec USER_ en face ne recherche que dans les pistes qui ont le champ propriétaire correspondant de l'ID utilisateur de l'agent, les options avec GROUP_ en face ne recherche que dans les pistes qui ont le champ propriétaire correspondant au groupe d'utilisateurs que l'utilisateur est un membre de la, les options avec TERRITORY_ en face ne recherche que dans les pistes qui ont le champ propriétaire adéquation des territoires que l'agent a choisi. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -3804,7 +5217,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Consigne de lancement d'appel -</B> Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. + <B>Consigne de lancement d'appel -</B> Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. Si les champs de liste personnalisées sont activées sur votre système, formulaire s'ouvrira sur l'onglet FORMULAIRE lors de la connexion d'un appel à un agent. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -3814,17 +5227,47 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Quick Transfer Button -</B> Cette option permet d-ajouter un bouton de transfert rapide à l-écran de l-agent en dessous du bouton Transfer-Conf qui permettra un clic aveugles transfert d-appels à la sélectionnés en-groupe ou un numéro. IN_GROUP va envoyer des appels au groupe par défaut Xfer pour cette campagne, ou en-groupe s-il y avait un appel entrant. Les options prédéfinies vous enverrons les appels à la preset sélectionnée. Par défaut est N pour les handicapés. + <B>Quick Transfer Button -</B> Cette option permet d-ajouter un bouton de transfert rapide à l-écran de l-agent en dessous du bouton Transfer-Conf qui permettra un clic aveugles transfert d-appels à la sélectionnés en-groupe ou un numéro. IN_GROUP va envoyer des appels au groupe par défaut Xfer pour cette campagne, ou en-groupe s-il y avait un appel entrant. Les options prédéfinies vous enverrons les appels à la preset sélectionnée. Par défaut est N pour les handicapés. Les options verrouillés sont utilisés pour verrouiller la valeur de la touche de transfert rapide, même si l'agent utilise les fonctionnalités de conférence de transfert lors d'un appel avant d'utiliser le bouton de transfert rapide. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Transfert personnalisé Bouton 3-voies -</B> Cette option permet d'ajouter un bouton de transfert personnalisé à l'écran ci-dessous sur le bouton d'agent de transfert-Conf qui permettra d'un clic à trois voies des appels en utilisant le préréglage sélectionné ou sur le terrain. Les options seront PRESET_ passer des appels en utilisant la valeur définie prédéfinie. Les options seront field_ passer des appels en utilisant le numéro dans le champ sélectionné à partir du plomb. HANDICAPÉS ne sera pas afficher le bouton sur l'écran l'agent. Les options seront PARK_ garer le client avant de composer. Par défaut est DISABLED. L'option sera VIEW_PRESET il suffit d'ouvrir le cadre de transfert et le cadre prédéfini. L'option VIEW_CONTACTS va ouvrir une fenêtre de recherche de contacts, cela ne fonctionnera que si Presets Activer est réglé sur CONTACTS. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> <BR> <B>Préremplir Transfert Preset -</B> Cette option permet de remplir le champ Numéro de réseau commuté dans le cadre de transfert de conférence de l-écran de l-agent s-il est défini. Par défaut est N pour les handicapés. + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Activer Presets de transfert -</B> Cette option permettra aux présélections de menu sous de comparaître à la partie supérieure de la page de modification de la campagne, et aussi vous aurez la possibilité de spécifier prédéfinis numéros de numérotation pour les agents à utiliser dans le cadre de transfert de la conférence de l'interface de l'agent. Par défaut est DISABLED. CONTACTS est une option seulement si Information_sur_le_contact est activé sur votre système, qui est une fonction personnalisée. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Activer Presets de transfert -</B> Cette option permettra aux présélections de menu sous de comparaître à la partie supérieure de la page de modification de la campagne, et aussi vous aurez la possibilité de spécifier prédéfinis numéros de numérotation pour les agents à utiliser dans le cadre de transfert de la conférence de l'interface de l'agent. Par défaut est DISABLED. CONTACTS est une option seulement si Information_sur_le_contact est activé sur votre système, qui est une fonction personnalisée. + + <BR> + <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> + <BR> + <B>Masquer le numéro de transfert à composer -</B> Cette option permet de cacher le numéro à composer le terrain dans le cadre de transfert de la conférence de l'interface de l'agent. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call"> + <BR> + <B>Parc Appel IVR -</B> Cette option permettra à un agent de parquer un appel avec un bouton séparé IVR APPEL DU PARC sur leur interface de l'agent, si cette option est activée ou ENABLED_PARK_ONLY. L'option ENABLED_PARK_ONLY permettra à l'agent d'envoyer l'appel à parc, mais ne cliquez pas sur pour récupérer l'appel, comme l'option Activé. L'option ENABLED_BUTTON_HIDDEN permet à la fonction via l'API uniquement. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-ivr_park_call_agi"> + <BR> + <B>Parc Appel IVR AGI -</B> Si le champ Parc IVR Appel n'est pas désactivé, alors ce champ est utilisé comme la chaîne de l'application AGI que le client est envoyé. Il s'agit d'un réglage qui doit être définie par votre administrateur si possible. + <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Minuterie d-action -</B> Cette fonctionnalité vous permet de déclencher des actions après un certain laps de temps. D1 et D2 options DIAL va lancer un appel à la presets Transfer Conference Nombre et les envoyer à la session d-agent, ce n-est généralement utilisé pour les applications IVR AGI simple validation ou tout simplement pour jouer un message pré-enregistré. WebForm ouvrira l-adresse formulaire web. MESSAGE_ONLY va simplement afficher le message qui est dans le champ ci-dessous. AUCUNE désactive cette fonctionnalité et la valeur par défaut. + <B>Minuterie d-action -</B> Cette fonctionnalité vous permet de déclencher des actions après un certain laps de temps. D1 et D2 options DIAL va lancer un appel à la presets Transfer Conference Nombre et les envoyer à la session d-agent, ce n-est généralement utilisé pour les applications IVR AGI simple validation ou tout simplement pour jouer un message pré-enregistré. WebForm ouvrira l-adresse formulaire web. MESSAGE_ONLY va simplement afficher le message qui est dans le champ ci-dessous. AUCUNE désactive cette fonctionnalité et la valeur par défaut. HANGUP raccroche l'appel lorsque la minuterie est déclenchée, CALLMENU enverra l'appel au menu Appel spécifié dans le champ Destination minuterie d'action, EXTENSION enverra l'appel à l'extension qui est spécifié dans le champ Destination minuterie d'action, IN_GROUP enverra l'appel à l'en-groupe spécifié dans le champ Destination minuterie d'action. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -3836,11 +5279,46 @@ if ($ADD==99999) <BR> <B>Minuterie d-action Seconds -</B> Il s-agit de la quantité de temps après l-appel est connecté au client que l-action Timer est déclenchée. Par défaut est -1, qui est aussi inactive. + <BR> + <A NAME="vicidial_campaigns-timer_action_destination"> + <BR> + <B>Destination action minuterie -</B> Ce champ est l'endroit où vous spécifiez le menu Appel, Extension ou en groupe que vous voulez que l'appel envoyé à l'action si l'heure est défini CALLMENU, EXTENSION ou IN_GROUP. Par défaut est vide. + <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Rappels programmés -</B> Cette option autorise un agent à statuer un appel comme CALLBK et à choisir une date et une heure à laquelle la fiche sera réactivée. + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> + <BR> + <B>Rappels réguliers d'alerte -</B> Cette option permet de la ligne d'état rappels dans l'interface agent d'être rouge, clignote ou clignote en rouge quand il ya AGENTONLY prévue rappels qui ont frappé leur temps de déclenchement et la date. Par défaut est NONE pour la ligne d'état standard. Les options reporter s'arrête de clignoter et-ou l'affichage en rouge lorsque vous vérifiez les rappels, jusqu'à ce que le nombre de rappels des changements. + + <BR> + <A NAME="vicidial_campaigns-scheduled_callbacks_count"> + <BR> + <B>Rappels réguliers comte -</B> Cette option vous permet de définir si seuls rappels VIVANTS, l'utilisateur seulement rappels réguliers qui ont frappé leur date de déclenchement et le temps, ou les rappels ALL_ACTIVE, l'utilisateur ne les rappels qui sont actives dans le système ainsi que les rappels vivent, doivent be3 compté, il int la section d'alerte de rappel d'agent sur l'écran l'agent. Par défaut est ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Prévu rappels Jours Limite -</B> Cette option vous permet de réduire l'agent rappels réguliers de calendrier pour un nombre sélectionnable de jours à partir d'aujourd'hui, la totalité des 12 mois civils seront toujours affichées, mais seulement le nombre de jours sera sélectionnable. Par défaut est 0 pour un nombre illimité. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Prévu rappels Heures Bloquer -</B> Cette option vous permet de restreindre un rappel useronly prévu d'être affiché sur la liste de rappel jusqu'à ce que l'agent X heures après qu'elle a été définie. Par défaut est 0 pour pas de bloc. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Rappels réguliers bloc Calltime -</B> Cette option, si activée, permettra d'éviter le rappel prévu dans la liste de rappel d'agent d'être composé si elle est en dehors de la calltime prévue pour la campagne. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Mon défaut Checkbox rappels -</B> Cette option vous permet de prédéfinir la case à cocher Mon rappel sur l'écran de rappel agent programmé. Enregistrés seront cochez la case automatiquement pour chaque appel. Par défaut est désactivé. + <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -3851,6 +5329,26 @@ if ($ADD==99999) <BR> <B>Message de conclusion -<\/B> C'est un message spécifique à la campagne à afficher si le temps de conclusion est défini. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Désactiver l'écran Dispo -</B> Cette option vous permet de désactiver l'écran de la disposition dans l'interface agent. Le champ Désactiver Statut Dispo ci-dessous doit être rempli pour que cette option fonctionne. Par défaut est DISPO_ENABLED. L'option ne sera pas DISPO_SELECT_DISABLED désactiver l'écran de dispo complètement, mais afficher l'écran de dispo sans dispositions, cette option ne doit être utilisé si vous voulez forcer vos agents à utiliser votre logiciel de CRM qui enverra le statut du système via l'API. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Désactiver Statut Dispo -</B> Si l'option Désactiver l'écran est réglé sur Dispo DISPO_DISABLED, ce champ doit être rempli en jeu. Vous pouvez utiliser n'importe quel caractère que vous voulez pour ce domaine tant qu'il est de 1 à 6 caractères de longueur avec des lettres et des chiffres. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Les étiquettes de l'écran de l'agent -</B> Vous pouvez sélectionner un ensemble d'étiquettes d'écran agents à utiliser avec cette option. Par défaut est - SYSTEM-SETTINGS - pour les étiquettes par défaut. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Les champs d'affichage d'état -</B> Vous pouvez sélectionner les variables pour les appels seront affichés dans la ligne d'état de l'écran l'agent. CALLID affiche l'ID 20 caractères appel unique, LEADID affiche l'ID de plomb du système, ListId affiche l'ID de liste. Par défaut est CALLID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -3871,6 +5369,21 @@ if ($ADD==99999) <BR> <B>Activer les codes de la pause des agents -</B> Autorise les agents à sélectionner un code de pause quand il clique sur le bouton PAUSE dans vicidial.php. Les codes de pause sont définissable par campagne dans le bas de la vue détaillée de la campagne et sont stockés dans la table vicidial_agent_log. La valeur par défaut est N. Force va forcer les agents à choisir un code PAUSE si elles cliquez sur le bouton PAUSE. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Auto Pause pré-Appel de travail -</B> Dans l'auto-sélecteur de mode, ce paramètre si elle est activée seront mis à l'agent de pause automatiquement lorsque l'agent clique sur l'une des fonctions suivantes, qui les oblige à être en pause-Manuel Dial, Fast Dial, Recherche de plomb, Appelez-View Log, rappels Vérifiez, Entrez le code de pause. Par défaut est N pour inactive. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Auto Reprendre pré-Appel de travail -</B> Dans l'auto-sélecteur de mode, ce paramètre si elle est activée fixera l'agent à l'état actif automatiquement lorsque l'agent clique sur, ou annule, sur l'une des fonctions suivantes, qui les oblige à être en pause Dial-Manuel, Fast Dial, Recherche de plomb, Appelez Connectez-vous Voir, rappels Vérifiez, Entrez le code de pause. Par défaut est N pour inactive. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Auto Pause pré-Appel de code -</B> Si la fonction Auto Pause de travail fonction de pré-appel ci-dessus est active, et les codes de pause Agent est actif, ce paramètre sera le code de pause qui est utilisé lorsque l'agent est en pause pour ces activités. Par défaut est PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -3886,6 +5399,11 @@ if ($ADD==99999) <BR> <B>Agent Afficher Queue Count - </B> Si la valeur de Y, lorsque le client est en attente d'un agent, la file d'attente de demande d'affichage en haut de l'agent de l'écran devient rouge et indique le nombre d'appels en attente. Le défaut est Y. + <BR> + <A NAME="vicidial_campaigns-manual_dial_override"> + <BR> + <B>Composition manuelle Override -</B> Le réglage peut l'emporter sur les utilisateurs de réglage de la capacité numérotation manuelle pour les agents quand ils sont enregistrés dans cette campagne. NONE suivra la mise en utilisateurs, ALLOW_ALL permettra à tout agent connecté dans cette campagne pour passer des appels numérotation manuelle, DISABLE_ALL ne permettra à personne connecté à cette campagne pour passer des appels numérotation manuelle. Par défaut est NONE. + <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> <BR> @@ -3894,7 +5412,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Manuelle Filter - </B> Cela vous permet de filtrer les appels que les agents font en mode manuel composer pour cette campagne par une combinaison des éléments suivants: DNC - à coup sur, CAMPAIGNLISTES - le nombre doit être dans les listes pour la campagne, AUCUN - pas de filtre sur le cadran ou manuel rapide composer des listes. + <B>Manuelle Filter - </B> Cela vous permet de filtrer les appels que les agents font en mode manuel composer pour cette campagne par une combinaison des éléments suivants: DNC - à coup sur, CAMPAIGNLISTS - le nombre doit être dans les listes pour la campagne, AUCUN - pas de filtre sur le cadran ou manuel rapide composer des listes. CAMPLISTS_ALL - comportera des listes inactives dans la recherche pour le nombre. + + <BR> + <A NAME="vicidial_campaigns-manual_preview_dial"> + <BR> + <B>Dial Aperçu Manuel -</B> Cela permet à l'agent en mode numérotation manuelle pour voir le principal de l'information quand ils cliquez Composez le numéro suivant avant de composer activement l'appel téléphonique. Il ya un lien en option pour sauter la tête et de passer à la suivante si elle est sélectionnée. Par défaut est PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Composition manuelle API -</B> Cette option vous permet de définir l'API agent de faire soit un appel à la fois, STANDARD, ou la capacité de la file d'attente des appels numérotation manuelle et de les faire composer automatiquement une fois que l'agent va le mettre en pause ou est disponible pour prendre leur prochain appel à la option pour désactiver la numérotation automatique de ces appels, file d'attente ou QUEUE_AND_AUTOCALL qui est le même que file d'attente mais sans l'option pour désactiver la numérotation automatique de ces appels. Si un agent a plus d'un appel en file d'attente pour eux, ils verront le nombre de combien d'appels numérotation manuelle sont en file d'attente juste au-dessous sur le bouton Pause, ou Composez le bouton numéro suivant. Nous suggérons que si QUEUE est utilisé que vous envoyez en utilisant l'API actions de la preview = OUI option de sorte que vous ne sont pas reprises pour composer les appels de l'agent sans préavis. En outre, si vous utilisez file d'attente et fortement en utilisant les appels de numérotation manuelle à une méthode cadran MANUEL non, nous recommandons de régler le Pause agent après chaque option Appel à Y. par défaut est Standard. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Durée de l'appel Vérification manuelle -</B> Si cette option est activée, il va vérifier tous les appels numérotation manuelle pour s'assurer qu'ils sont dans les paramètres de temps d'appel fixés pour la campagne. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Composition manuelle CID -</B> Ceci définit si un agent des appels numérotation manuelle aura les paramètres de campagne CallerID utilisé, ou de leurs agents téléphoniques paramètres CallerID utilisé. Par défaut est CAMPAGNE. Si l'option Utiliser personnalisé campagne CID est activée ou de la Campagne liste Override réglage CID est utilisé, ce paramètre sera ignoré. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Message Téléphone Décalage horaire alerte -</B> Cette fonction manuelle cadran seule, si elle est activée, va afficher une alerte si le fuseau horaire pour le code postal de plomb, ou le code postal, est différente de la zone de temps de l'indicatif régional du numéro de téléphone pour le plomb. L'option OUTSIDE_CALLTIME_ONLY ne montrent l'alerte si les deux fuseaux horaires sont différents et l'un des fuseaux horaires est en dehors de la durée d'appel choisi pour la campagne. OUTSIDE_CALLTIME_PHONE ne fera que vérifier le fuseau horaire du numéro de téléphone de la tête et d'alerter si elle est en dehors du temps d'un appel local. OUTSIDE_CALLTIME_POSTAL ne fera que vérifier le fuseau horaire du code postal du plomb et d'alerter si elle est en dehors du temps d'un appel local. OUTSIDE_CALLTIME_BOTH va vérifier le code postal et le numéro de téléphone pour être dans le délai d'un appel local, même si elles sont dans le même fuseau horaire. Ces alertes seront afficher dans l'info journal des appels, Informations sur la liste des rappels, des résultats de recherche d'info, quand un chef de file est composé et quand un chef de file est visualisé. Par défaut est DISABLED. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -3904,13 +5447,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>3-Way Outbound Call CallerID - </B> Cela définit ce qui est envoyé en tant que sortant CallerID nombre de 3-way appels effectués par l'agent, la campagne utilise la campagne personnalisée CallerID, client utilise le numéro de client qui est actif sur les agents de l'écran et utilise les CallerID AGENT_PHONE le téléphone pour que l'agent est entré dans. AGENT_CHOOSE permet de choisir l'agent qui CallerID à utiliser pour les 3-way appels à partir d'une liste de choix. + <B>3-Way Outbound Call CallerID - </B> Cela définit ce qui est envoyé en tant que sortant CallerID nombre de 3-way appels effectués par l'agent, la campagne utilise la campagne personnalisée CallerID, client utilise le numéro de client qui est actif sur les agents de l'écran et utilise les CallerID AGENT_PHONE le téléphone pour que l'agent est entré dans. AGENT_CHOOSE permet de choisir l'agent qui CallerID à utiliser pour les 3-way appels à partir d'une liste de choix. CUSTOM_CID utilisera le CID personnalisé qui est défini dans le champ de la table security_phrase vicidial_list pour le plomb. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> <BR> <B>3-Way Call Préfixe de numérotation - </B> Cela définit ce qui est utilisé comme préfixe pour les 3-way appels, par défaut est vide de sorte que la campagne de préfixe est utilisé, passthru afin que vous puissiez entendre sonner est de 88. + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> + <BR> + <B>Logging Raccrocher à la clientèle 3-voies -</B> Si cette option est activée, le user_call_log se connectera quand un raccrochage à la clientèle jusqu'à s'ils raccrocher pendant un appel 3-way. En outre, cela peut permettre au Client d'action de raccrochage 3-way si l'on est defineed ci-dessous. Par défaut est Enabled. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> + <BR> + <B>Secondes hangup clientèle 3-voies -</B> Si le Client 3-way journalisation est activée, cette option vous permet de définir le nombre de secondes après le raccrochage client est détecté avant qu'il ne soit connecté et l'action à la clientèle en option raccrochage 3-way est exécuté. Par défaut est de 5 secondes. + + <BR> + <A NAME="vicidial_campaigns-customer_3way_hangup_action"> + <BR> + <B>Raccrocher à la clientèle d'action 3-voies -</B> Si le Client 3-way journalisation est activée, cette option vous permet d'avoir l'écran l'agent raccroche automatiquement sur l'appel et passer à l'écran DISPO si cette option est réglée sur DISPO. Par défaut est NONE. + <?php if ($SSqc_features_active > 0) { @@ -3983,6 +5541,31 @@ if ($ADD==99999) <BR> <B>Vtiger état des appels -</B> Si Vtiger intégration est activée dans les paramètres du système, puis utilisez ce paramètre pour définir si la situation du compte Vtiger sera mis à jour avec le statut de l-appel VICIDIAL après qu-il a été dispositioned. Par défaut est n. + <BR> + <A NAME="vicidial_campaigns-queuemetrics_callstatus"> + <BR> + <B>QM CallStatus Override -</B> Si l'intégration QueueMetrics est activée dans les paramètres du système, alors ce paramètre permet l'impérieuse des paramètres du système de réglage pour les entrées queue_log CallStatus. Par défaut est DISABLED qui utilisera le réglage du système. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>Environnement Téléphone QM -</B> Si l'intégration QueueMetrics est activée dans les paramètres du système, alors ce paramètre permet l'insertion de cette valeur de données dans le domaine de l'données4 queue_log pour les enregistrements d'activité des agents. Par défaut est vide pour les handicapés. + + <BR> + <A NAME="vicidial_campaigns-extension_appended_cidname"> + <BR> + <B>Extension Ajoutez CID -</B> Si elle est activée, les appels effectués à partir de cette campagne aura un espace et l'extension de téléphone de l'agent ajouté à la fin du nom de CallerID de l'appel avant qu'il ne soit envoyé à l'agent. Par défaut est N pour les handicapés. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>Groupement PLLB -</B> Connexion Téléphone Load Balancing Groupement, n'est autorisée que si il ya des serveurs d'agents multiples et les alias de téléphone sont présents sur le système. S'il est défini à ONE_SERVER_ONLY il va forcer tous les agents de cette campagne pour se connecter au même serveur. S'il est défini à CASCADE il regroupera connecté agents sur le même serveur jusqu'à ce que le numéro PLLB Limite Regroupement des agents sont atteints, alors le prochain agent va se connecter au serveur suivant avec le plus petit nombre d'agents. Si elle est désactivée le téléphone comportement standard alias de chaque agent de trouver le serveur avec le moins grand nombre de non-distance des agents connectés à elle sera utilisée. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>Limite Groupement PLLB -</B> Connexion Charge Téléphone Groupement Limite d'équilibrage. Si Groupement PLLB est réglé sur CASCADE, alors ce paramètre détermine le nombre d'agents acceptable dans chaque serveur pour cette campagne. Par défaut est 50. + <BR> <A NAME="vicidial_campaigns-crm_popup_login"> <BR> @@ -4003,6 +5586,11 @@ if ($ADD==99999) <BR> <B>Dispo Call Web -</B> Cette web adresse URL n-est pas perçu par l-agent, mais elle est appelée chaque fois qu-un appel est dispositioned par un mandataire si elle est peuplée. Utilise les mêmes variables que les champs de formulaire web et des scripts. DISPO et talk_time sont les variables que vous pouvez utiliser pour récupérer l-agent défini par la disposition de l-appel et le temps de parole effective en quelques secondes de l-appel. Cette URL ne peut être un chemin relatif. Par défaut est vide. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>Aucune URL Appel Agent -</B> Cette adresse URL Web n'est pas vu par l'agent, mais si elle est peuplée, il est appelé à chaque fois un appel qui n'est pas gérée par un agent est suspendu ou transféré. Utilise les mêmes variables que les champs du formulaire Web et les scripts. dispo peut être utilisée pour récupérer le système défini par la disposition de l'appel. Cette URL ne peut pas être un chemin relatif. Par défaut est vide. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4038,13 +5626,28 @@ if ($ADD==99999) <BR> <B>Agent Pause après chaque appel -</B> Cette option s-il est réglé sur Y se mettra en pause l-agent après chaque appel automatiquement. Par défaut est n. + <BR> + <A NAME="vicidial_campaigns-blind_monitor_warning"> + <BR> + <B>Attention Moniteur aveugles -</B> Cette option si elle est activée permettra à l'agent sais de diverses manières optionnelles si elles sont d'être aveugle contrôlée par quelqu'un. DISABLED signifie que cette fonction n'est pas active, alerte ne s'affiche une alerte à l'écran l'agent, AVIS publiera une note qui reste sur l'écran aussi longtemps que l'agent theyâ re objet d'un suivi, AUDIO jouera le nom de fichier défini ci-dessous lors d'un agent commence à être surveillés et les autres options sont combibnations des options susmentionnées. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_message"> + <BR> + <B>Avis aveugles Moniteur -</B> Tel est le message qui apparaîtra sur l'écran tandis que l'agent qu'ils sont surveillés si l'option est sélectionnée AVIS. Par défaut est -Someone is blind monitoring your session-. + + <BR> + <A NAME="vicidial_campaigns-blind_monitor_filename"> + <BR> + <B>Nom du moniteur aveugles -</B> Il s'agit du fichier audio qui jouera lors de la session des agents au début de la surveillance quelqu'un aveugler. Cette invite sera joué pour tout le monde lors de la session, y compris le client le cas échéant est présent. Par défaut est vide. + <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_LISTES TABLE</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTS TABLE</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>ID de la liste -</B> C'est le nom numérique de la liste, il n'est pas éditable après la première validation, il ne doit contenir que des nombres et contenir entre 2 et 8 caractères. Must be a number greater than 100. @@ -4106,13 +5709,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_lists-drop_inbound_group_override"> <BR> - <B>Drop Inbound Groupe Override -</B> Si ce champ est défini, dans ce groupe seront utilisées pour les appels sortants de cette liste de cette goutte de la campagne à l-étranger au lieu de la baisse du groupe fixé dans l-écran de détail de la campagne. Défaut n-est pas réglé. + <B>Drop Entrant Groupe Override -</B> Si ce champ est défini, dans ce groupe seront utilisées pour les appels sortants de cette liste de cette goutte de la campagne à l-étranger au lieu de la baisse du groupe fixé dans l-écran de détail de la campagne. Défaut n-est pas réglé. + + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Override formulaire Web - </ B> C'est l'adresse personnalisée que cliquant sur le bouton Formulaire Web dans Vicidial vous amène à des appels qui viennent sur cette liste. Si vous voulez utiliser des champs personnalisés dans un formulaire Web l'adresse, vous devez ajouter &CF_uses_custom_fields=Y dans le cadre de votre URL. <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>Xfer-Conf Nombre Override -</B> Ces cinq domaines pour vous permettre d-emporter les préréglages numéro de la conférence de transfert lorsque le plomb est de cette liste. Par défaut est vide. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Rapport d'inventaire -</B> Si le Rapport d'inventaire est activé sur votre système, cette option permettra de déterminer si cette liste est inclus dans le rapport ou non. Par défaut est O pour oui. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Réglage du fuseau horaire -</B> Cette option vous permet de définir la méthode de maintien de la recherche fuseau horaire actuel pour les fils de cette liste. Ce processus se fait uniquement la nuit de sorte que toute modification apportée ne sera pas immédiate. COUNTRY_AND_AREA_CODE est la valeur par défaut, et utiliser le code pays et l'indicatif régional du numéro de téléphone afin de déterminer le fuseau horaire de la tête. Postal_code utilisera le code postal si disponible afin de déterminer le fuseau horaire de la tête. NANPA_PREFIX ne fonctionne que dans les Etats-Unis et utiliser le code régional et le préfixe du numéro de téléphone afin de déterminer le fuseau horaire de la tête, mais ce n'est pas activée par défaut dans le système, donc s'il vous plaît assurez-vous que vous avez les données chargées sur le préfixe NANPA votre système avant de sélectionner cette option. OWNER_TIME_ZONE_CODE utilisera le abbraviation fuseau horaire standard chargé dans le domaine propriétaire du plomb afin de déterminer le fuseau horaire, dans les exemples USA sont AST, HNE, CST, MST, PST, AKST, TVH. Cette fonction doit être activée par votre administrateur système pour entrer en vigueur. + <BR> <A NAME="vicidial_list-dnc"> @@ -4123,7 +5741,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_ENTRANT_GROUPS TABLE</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_GROUPS TABLE</FONT></B><BR><BR> <A NAME="vicidial_inbound_groups-group_id"> <BR> <B>ID du groupe -</B> C'est le nom court du group entrant, il n'est pas éditable après la première initialisation, il doit contenir entre 2 est 20 caractères. @@ -4143,10 +5761,20 @@ if ($ADD==99999) <BR> <B>Active -</B> Cela détermine si ce groupe sera visible dans la boîte de sélection quand un agent se connecte à VICIDIAL. + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour ce groupe entrant, ce qui permet la visualisation de cette administration en groupe restreint par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce groupe en. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>En-Groupe Calldate -</B> Il s'agit de la dernière date et l'heure qu'un appel a été orientée vers ce groupe entrant. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Formulaire Web -</B> C'est l'adresse personnalisée qui, en cliquant sur le boutton WEB FORM dans VICIDIAL, sera prise pour les appels qui arrivent dans ce groupe. + <B>Formulaire Web -</B> C'est l'adresse personnalisée qui, en cliquant sur le boutton WEB FORM dans VICIDIAL, sera prise pour les appels qui arrivent dans ce groupe. Si vous voulez utiliser des champs personnalisés dans un formulaire Web l'adresse, vous devez ajouter &CF_uses_custom_fields=Y dans le cadre de votre URL. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4155,14 +5783,30 @@ if ($ADD==99999) <BR>   - random: ordonne par la valeur aléatoire de mise à jour dans la table vicidial_live_agents <BR>   - oldest_call_start: ordonne par la dernière date à laquelle un agent a passé un appel. Résultats des agents recevant globalement un nombre à peu près identique d'appels . <BR>   - oldest_call_finish: ordonne suivant la dernière date à laquelle un agent a terminé un appel. L'agent AKA attendant le plus longtemps reçoit le premier appel. + <BR>   - oldest_inbound_call_start: les commandes par la dernière fois qu'un agent a été envoyé un appel entrant. Résultats dans les agents recevant environ le même nombre d'appels globale. + <BR>   - oldest_inbound_call_finish: les commandes par la dernière fois un agent de terminer un appel entrant. Agent de AKA attente plus longue reçoit d'abord appeler. <BR>   - overall_user_level: ordonne par le user_level de l'agent comme défini dans la table vicidial_users, un user_level plus élévé recevra plus d'appels. <BR>   - inbound_group_rank : ordres par le rang donné à l'agent pour legroupe d'arrivée spécifique. Le plus haut à le plus bas. - <BR>   - fewest_calls : ordres par le nombre d'appels reçus par un agent pource groupe d'arrivée spécifique. Moindres appels d'abord. <BR>   - campaign_rank : ordres par le rang donné à l'agent pour la campagne.Le plus haut à le plus bas. + <BR>   - ingroup_grade_random: donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur par l'intérieur du groupe. + <BR>   - campaign_grade_random: donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur par la campagne. + <BR>   - fewest_calls : ordres par le nombre d'appels reçus par un agent pource groupe d'arrivée spécifique. Moindres appels d'abord. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: commandes par la quantité de temps d-attente agent a été activement pour un appel. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> NOTES: Pour ring_all, les agents qui utilisent les téléphones qui ont permis d'agent Le crochet auront leur téléphone sonne et le premier à répondre recevront l'appel et les informations sur l'écran l'agent. Depuis ring_all ignore le temps d'attente d'agent et le classement et fera appel à tout agent qui est disponible pour la file d'attente, nous ne recommandons pas d'utiliser cette méthode pour grandes files d'attente. Lorsque vous utilisez ring_all, agents connectés avec les téléphones qui ont de l'agent Crochet Sur désactivé devrez utiliser les appels en file d'attente et panneau de cliquer sur le lien APPEL TAKE pour prendre des appels en file d'attente. La quantité de temps au téléphone sonnera pour les agents ring_all est réglé sur le réglage On-Hook durée de sonnerie ou le temps le plus court anneau des téléphones qui seront appelés. Nous ne recommandons pas d'utiliser ring_all sur les files d'attente de haute volume d'appels, ou les files d'attente avec de nombreux agents. Procédé ring_all est destiné à être utilisé avec seulement quelques agents et le volume d'appels à faible dans les groupes. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>Temps Ring On-Hook -</B> Cette option n'est utilisée que pour les agents qui sont connectés avec des téléphones qui ont la fonction d'agent-sur-crochet activé. C'est le nombre de secondes que chaque tentative d'appel à l'agent se fera entendre pendant que le système va attendre une seconde et se mettent à sonner les téléphones des agents disponibles à nouveau. Ce champ peut être modifié si les téléphones des agents sont fixés à un moment anneau inférieur qui peut être nécessaire pour empêcher les appels d'être envoyé un message vocal téléphones. Par défaut est 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>On-Hook CID -</B> Cette option n'est utilisée que pour les agents qui sont connectés avec des téléphones qui ont la fonction d'agent-sur-crochet activé. Il s'agit de la identification de l'appelant qui s'affichera sur leurs téléphones agent lorsque les appels sonnent. GENERIC est un générique RINGAGENT00000000001 type de notification. Endogroupe montrera que l'en-groupe de l'appel est venu. CUSTOMER_PHONE n'affiche que le numéro de téléphone du client. CUSTOMER_PHONE_RINGAGENT montrera RINGAGENT_3125551212 avec le RINGAGENT dans le cadre du CID avec le numéro de téléphone du client. CUSTOMER_PHONE_INGROUP montrera les 10 premiers caractères de l'en-groupe suivi par le numéro de téléphone à la clientèle. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4177,10 +5821,15 @@ if ($ADD==99999) <BR> <B>Script campagne ->/B> Ce menu vous permet de choisir le script qui apparaîtra sur l'écran des agents pour cette campagne. Mettez NONE pour ne pas montrer de script pour cette campagne. + <BR> + <A NAME="vicidial_inbound_groups-ignore_list_script_override"> + <BR> + <B>Ignorer Override Script Liste-</B> Cette option vous permet d'ignorer l'ID de liste Override Script l'option pour les appels à venir dans ce groupe-En. Mettre ce paramètre à Y ignorera tous les paramètres de la liste ID du script. Par défaut est N. + <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Consigne de lancement d'appel -</B> Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. + <B>Consigne de lancement d'appel -</B> Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. Si les champs de liste personnalisées sont activées sur votre système, formulaire s'ouvrira sur l'onglet FORMULAIRE lors de la connexion d'un appel à un agent. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4190,7 +5839,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Minuterie d-action -</B> Cette fonctionnalité vous permet de déclencher des actions après un certain laps de temps. D1 et D2 options DIAL va lancer un appel à la presets Transfer Conference Nombre et les envoyer à la session d-agent, ce n-est généralement utilisé pour les applications IVR AGI simple validation ou tout simplement pour jouer un message pré-enregistré. WebForm ouvrira l-adresse formulaire web. MESSAGE_ONLY va simplement afficher le message qui est dans le champ ci-dessous. AUCUNE désactive cette fonctionnalité et la valeur par défaut. Ce paramètre remplace les paramètres de campagne. + <B>Minuterie d-action -</B> Cette fonctionnalité vous permet de déclencher des actions après un certain laps de temps. D1 et D2 options DIAL va lancer un appel à la presets Transfer Conference Nombre et les envoyer à la session d-agent, ce n-est généralement utilisé pour les applications IVR AGI simple validation ou tout simplement pour jouer un message pré-enregistré. WebForm ouvrira l-adresse formulaire web. MESSAGE_ONLY va simplement afficher le message qui est dans le champ ci-dessous. AUCUNE désactive cette fonctionnalité et la valeur par défaut. Ce paramètre remplace les paramètres de campagne. HANGUP raccroche l'appel lorsque la minuterie est déclenchée, CALLMENU enverra l'appel au menu Appel spécifié dans le champ Destination minuterie d'action, EXTENSION enverra l'appel à l'extension qui est spécifié dans le champ Destination minuterie d'action, IN_GROUP enverra l'appel à l'en-groupe spécifié dans le champ Destination minuterie d'action. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4202,6 +5851,11 @@ if ($ADD==99999) <BR> <B>Minuterie d-action Seconds -</B> Il s-agit de la quantité de temps après l-appel est connecté au client que l-action Timer est déclenchée. Par défaut est -1, qui est aussi inactive. + <BR> + <A NAME="vicidial_inbound_groups-timer_action_destination"> + <BR> + <B>Destination action minuterie -</B> Ce champ est l'endroit où vous spécifiez le menu Appel, Extension ou en groupe que vous voulez que l'appel envoyé à l'action si l'heure est défini CALLMENU, EXTENSION ou IN_GROUP. Par défaut est vide. + <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> @@ -4210,23 +5864,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_action"> <BR> - <B>Drop Action - </B> Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Inbound groupe qui est défini ci-dessous. + <B>Drop Action - </B> Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Entrant groupe qui est défini ci-dessous. <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Drop EXTEN - </B> Si l'action est goutte d'MESSAGE, c'est le cadran plan d'extension que l'appel sera envoyée si elle parvient à Temps avant abandon de l'appel. + <B>Drop EXTEN - </B> Si l'action est goutte d'MESSAGE, c'est le cadran plan d'extension que l'appel sera envoyée si elle parvient à Temps avant abandon de l'appel. Pour AGENTDIRECT dans les groupes, si l'utilisateur n'est pas disponible, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>Boîte vocale -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + <B>Boîte vocale -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Drop de transfert Group - </B> Si Drop action est fixée à IN_GROUP, l'appel sera envoyé à ce groupe d'arrivée si elle parvient Temps avant abandon de l'appel. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Menu déroulant Appel -</B> Si l'action chute est fixé à CALLMENU, l'appel sera envoyé à ce menu d'appel si elle atteint secondes de chute d'appels. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Transfert d'action CID -</B> Utilisé pour Drop, après les heures et les Non-agent-pas-de file d'attente des actions. C'est le numéro de l'appelant que l'appel utilise avant qu'il ne soit transféré à des extensions, des messages, la messagerie vocale ou des menus d'appel. Vous pouvez utiliser CLIENT dans ce domaine à utiliser le numéro de téléphone du client, ou CAMPAGNE à utiliser le premier numéro de permis Identifiant campagne appelant. Par défaut est CLIENT. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4245,22 +5909,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Après prolongation d'heures - la prolongation dialplan pour envoyerl'appel si l'action est placée à la PROLONGATION. Le défaut est8300. + <B>Après prolongation d'heures - la prolongation dialplan pour envoyerl'appel si l'action est placée à la PROLONGATION. Le défaut est8300. Pour AGENTDIRECT dans les groupes, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Après des heures Boîte vocale - la boîte de voicemail pour envoyerl'appel si l'action est placée à VOICEMAIL. + <B>Après des heures Boîte vocale - la boîte de voicemail pour envoyerl'appel si l'action est placée à VOICEMAIL. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>Après les heures d'ouverture de transfert Group - </B> Si l'action Après les heures d'ouverture est fixée à IN_GROUP, l'appel sera envoyé à cette arrivée du groupe si celui-ci entre dans le groupe en dehors de l'appel de temps défini pour le régime de groupe. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>After Hours Appel du menu -</B> Si après action Heures est réglé sur CALLMENU, l'appel sera envoyé à cette Menu Appel si elle pénètre à l'extérieur en groupe du régime du temps d'appel définie pour l'en-groupe. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>Agents n Queueing -</B> Si ce champ est réglé sur Y ou NO_PAUSED alors aucun appel ne sera mis dans la file d-attente pour cet en-groupe, si il n-ya pas d-agents connectés et les appels ira à l-agent Non Non action Queue. L-option NO_PAUSED enverra également pas les appelants en file d-attente s-il ya seulement une pause des agents dans l-en-groupe. Par défaut est n. + <B>Agents n Queueing -</B> Si ce champ est réglé sur Y ou NO_PAUSED alors aucun appel ne sera mis dans la file d-attente pour cet en-groupe, si il n-ya pas d-agents connectés et les appels ira à l-agent Non Non action Queue. L-option NO_PAUSED enverra également pas les appelants en file d-attente s-il ya seulement une pause des agents dans l-en-groupe. Par défaut est n. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale. Vous pouvez aussi mettre AGENTEXT dans ce domaine si elle est définie à l'extension et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -4272,6 +5941,21 @@ if ($ADD==99999) <BR> <B>Non Non Queue action de l-agent Valeur -</B> C-est la valeur pour l-action ci-dessus. Par défaut est nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Max Appelle la méthode -</B> Cette option peut permettre le maximum fonction simultanée des appels pour ce en groupe. S'il est défini à TOTAL, alors le nombre total d'appels étant traités par des agents et en file d'attente dans cet en-groupe ne sera pas autorisé à dépasser le nombre maximum Appels comte de lignes tel que défini ci-dessous. S'il est défini à IN_QUEUE, alors si le nombre d'appels en file d'attente pour les agents ne seront pas autorisés à dépasser le maximum Appels comte, peu importe combien d'appels sont des agents à cet effet dans-groupe. Par défaut est DISABLED. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Max appelle le comte -</B> Cette option doit être supérieure à 0 si vous souhaitez utiliser le Max Appels fonction Méthode. Par défaut est 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Max Appels d'action -</B> C'est l'action à prendre si le Max Appelle la méthode est activée et que le nombre d'appels dépasse ce qui est prévu ci-dessus dans le Max Appels Comptez réglage. Les appels au-dessus de ce montant sera envoyé à l'action, soit DROP, l'action ou l'action AFTERHOURS NO_AGENT_NO_QUEUE et sera enregistré comme un statut MAXCAL une raison raccrochage MaxCalls. Par défaut est NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -4297,6 +5981,16 @@ if ($ADD==99999) <BR> <B>Sur l'intervalle de message de sollicitation de prise - la durée ensecondes d'attendre avant de jouer dessus le message de sollicitationde tenir. Le défaut est 60. Pour désactiver l'invite en attente, réglez l'intervalle de 0. + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> + <BR> + <B>En attente Demander Non Bloquer -</B> La définition de cette option à Y permettra appels en ligne derrière un appel en attente, où l'invite à jouer est d'aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le message d'attente Nom Prompt joue à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N. + + <BR> + <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> + <BR> + <B>En attente secondes Prompt -</B> Ce champ doit être réglé sur le nombre de secondes que le nom de fichier en attente d'invite joue pour. Par défaut est 10. + <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> <BR> @@ -4307,35 +6001,160 @@ if ($ADD==99999) <BR> <B>Hold estimée Play Time - </B> Cela définit si l'appelant entend tenir les prévisions de temps avant qu'ils ne soient transférés à un agent. La valeur par défaut est N. Si le client est en attente et entend ce message d-estime détenir le temps, le temps minimum qui sera jouée est de 15 secondes. + <BR> + <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> + <BR> + <B>Calculer secondes Attente Estimation -</B> Ceci définit le nombre de secondes dans la file d'attente que le client doit attendre avant de le temps de maintien estimée sera calculée et éventuellement joué. Minimum est de 3 secondes, même s'il est réglé inférieur à 3. Par défaut est 0. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> + <BR> + <B>Estimation Tenez Nom minimum de temps -</B> Si le temps de maintien estimée est actif et il est calculé pour être égal ou inférieur au minimum de 15 secondes, alors ce fichier sera joué invite au lieu de l'annonce par défaut. Par défaut est vide pour inactive. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> + <BR> + <B>Estimation minimale Hold Time Demander Non Bloquer -</B> Si Hold Time estimée est actif et l'heure estimée de maintien Nom minimum champ ci-dessus est remplie, alors cette option pour autoriser les appels en file derrière un appel où l'invite à jouer est d'aller à un agent si l'on devient disponible pendant la lecture du message . Alors que l'invite est de jouer pour un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N. + + <BR> + <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> + <BR> + <B>Estimation secondes Hold Time minimum Prompt -</B> Ce champ doit être réglé sur le nombre de secondes que le nom de fichier en attente estimée Temps minimum invite joue pour. Par défaut est 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option"> + <BR> + <B>Attendre Option Temps -</B> Cela vous permet de donner aux clients des options pour sortir de la file d'attente si leur temps d'attente est plus le nombre de secondes indiquées ci-dessous. Par défaut est NONE. Si l'une des options PRESS_ est sélectionné, il jouera le nom de fichier de presse défini ci-dessous et donner au client l'option d'appuyer sur 1 sur leur téléphone à quitter la file d'attente et d'exécuter l'option sélectionnée. L'option PRESS_STAY enverra le client vers la file d'attente sans pour autant perdre leur place dans la ligne. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_second_option"> + <BR> + <B>Attendre Option Second Time -</B> Même que le champ Option temps d'attente ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 2. Par défaut est NONE. Si aucune option d'attente première fois est sélectionné, cette option ne sera pas offert. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_third_option"> + <BR> + <B>Attendre Option troisième fois -</B> Même que le champ Option temps d'attente ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 3. Par défaut est NONE. Si aucune option d'attente Deuxième temps est sélectionné, cette option ne sera pas offert. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> + <BR> + <B>Attendez quelques secondes Option Temps -</B> Si l'option temps d'attente est fixé à quelque chose, mais AUCUN, c'est le nombre de secondes que le client a été en attente dans la file d'attente qui va déclencher les options de temps d'attente. Par défaut est 120 secondes. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_exten"> + <BR> + <B>Attendre Extension Option Temps -</B> Si l'option temps d'attente est fixé à PRESS_EXTEN, c'est l'extension que le plan de numérotation téléphonique sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option. Pour AGENTDIRECT dans les groupes, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> + <BR> + <B>Attendre Callmenu Option Temps -</B> Si l'option temps d'attente est fixé à PRESS_CALLMENU, c'est le menu Appel que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> + <BR> + <B>Attendre la messagerie vocale Option Temps -</B> Si l'option temps d'attente est fixé à PRESS_VMAIL, c'est la boîte vocale que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> + <BR> + <B>Attendre transfert Option Temps En-Groupe -</B> Si l'option temps d'attente est fixé à PRESS_INGROUP, c'est le groupe entrant que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> + <BR> + <B>Attendre Nom de presse Heure Option -</B> Si l'option temps d'attente est fixé à l'une des options PRESS_, c'est le nom de fichier rapide qui se joue, si le temps d'attente des clients dépasse les secondes des temps d'attente Option de donner au client l'option d'appuyer sur 1, 2 ou 3 sur leur téléphone afin de fonctionner les options choisies temps d'attente de presse. Il est très important que vous inclure des options dans le fichier audio pour l'ensemble de vos options sélectionnées les temps d'attente, et que la longueur du fichier audio en quelques secondes est bien définie dans le domaine du fichier secondes ci-dessous ou il y aura des problèmes. Par défaut est à-être-appelé-back. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> + <BR> + <B>Attendre Appuyez sur Option No Time Bloquer -</B> La définition de cette option à Y permettra appels en ligne derrière un appel où l'attente Option Temps de presse Nom invite joue pour aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le temps d'attente Option Nom message Appuyez sur la lecture à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> + <BR> + <B>Les temps d'attente secondes Appuyez sur Option Nom de fichier -</B> Ce champ doit être réglé sur le nombre de secondes que le temps d'attente Appuyez sur Option Nom joue pour. Par défaut est 10. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> + <BR> + <B>Attendre Option Time After Nom de presse -</B> Si l'option temps d'attente est fixé à l'une des options PRESS_, c'est le nom de fichier rapide qui se joue après que le client a appuyé sur 1, 2 ou 3. + + <BR> + <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> + <BR> + <B>Attendre Option Temps liste de rappel ID -</B> Si l'option temps d'attente est fixé à PRESS_CID_CALLBACK, c'est l'ID de la liste de l'appel est ajouté à un nouveau chef de file si le client appuie sur la touche option lorsque présentés avec l'option. + + <BR> + <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> + <BR> + <B>Attendre Tenez priorité Option -</B> Si les deux options de temps estimé le protéger et attendre les options de temps sont actifs, ce paramètre sera de définir si un, l'autre ou les deux de ces fonctions sont actives. Par exemple, si l'option de maintien Durée estimée est fixé à 360, l'option temps d'attente est fixé à 120 et le client a été en attente pendant 120 secondes et il ya encore 400 secondes estimé la durée de rétention, puis ils sont tous deux actifs en même temps et ce paramètre sera vérifié pour voir quelles options seront offertes. Par défaut, c'est d'attendre que. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Hold Time Option - </B> Cela vous permet de spécifier le routage de l'appel, si les prévisions de tenir le temps est sur le montant de la seconde précisés ci-dessous. La valeur par défaut est NON. + <B>Estimation Option Temps de maintien - </B> Cela vous permet de spécifier le routage de l'appel, si les prévisions de tenir le temps est sur le montant de la seconde précisés ci-dessous. La valeur par défaut est NON. Si l'une des options PRESS_ est sélectionné, il jouera le nom de fichier de presse défini ci-dessous et donner au client l'option d'appuyer sur 1 sur leur téléphone à quitter la file d'attente et d'exécuter l'option sélectionnée. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_second_option"> + <BR> + <B>Tenez Option Second Time -</B> Même que le champ Option temps de maintien ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 2. Par défaut est NONE. Si aucune option de maintien première fois est sélectionné, cette option ne sera pas offert. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_third_option"> + <BR> + <B>Tenez Option troisième fois -</B> Même que le champ Option temps de maintien ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 3. Par défaut est NONE. Si aucune option Mise en attente Deuxième temps est sélectionné, cette option ne sera pas offert. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> <BR> <B>Hold Time Option secondes - </B> Si Hold Time Option est fixé à rien, mais AUCUNE, c'est le nombre de secondes de l'estimation du temps que vous maintenez le déclencheur tenir option. La valeur par défaut est 360 secondes. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> + <BR> + <B>Tenez minimum Option Temps -</B> Si l'option Hold Time est activé, c'est le nombre minimum de secondes de l'appel doit être en attente avant d'être présenté avec l'option temps de maintien. L'option temps de maintien sera immédiatement présenté à ce moment si le temps de maintien estimée est supérieure à la touche Option secondes la valeur temps. Par défaut est 0 secondes. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Hold Time Option Extension - </B> Si Hold Time Option est fixé à l'extension, c'est l'extension dialplan que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + <B>Hold Time Option Extension - </B> Si Hold Time Option est fixé à l'extension, c'est l'extension dialplan que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. Pour AGENTDIRECT dans les groupes, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> + <BR> + <B>Tenez Callmenu Option Temps -</B> Si l'option Hold Time est réglé sur CALL_MENU, c'est le menu Appel que l'appel sera envoyé à si le temps de maintien estimée dépasse les secondes touche Option Temps. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>Hold Time Option Boîte vocale - </B> Si Hold Time Option est fixé à la boîte vocale, il s'agit de la boîte vocale que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + <B>Hold Time Option Boîte vocale - </B> Si Hold Time Option est fixé à la boîte vocale, il s'agit de la boîte vocale que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> <BR> <B>Hold Time Option de transfert In-Group - </B> Si Hold Time Option est fixé à IN_GROUP, c'est l'arrivée du groupe que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> + <BR> + <B>Tenez Nom de presse Heure Option -</B> Si l'option Hold Time est réglé sur l'une des options PRESS_, c'est le nom de fichier rapide qui se joue, si le temps de maintien estimée dépasse les secondes touche Option Temps de donner au client l'option d'appuyer sur 1 sur leur téléphone afin de fonctionner le temps de maintien sélectionné Appuyez sur Option. Il est très important que ce fichier audio est de 10 secondes ou moins, ou il y aura des problèmes. Par défaut est à-être-appelé-back. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> + <BR> + <B>Maintenez Appuyez sur Option No Time Bloquer -</B> La définition de cette option à Y permettra appels en ligne derrière un appel où la touche Option Temps de presse Nom invite joue pour aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le temps de maintien Option Nom message Appuyez sur la lecture à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N. + + <BR> + <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> + <BR> + <B>Hold Time Seconds Appuyez sur Option Nom de fichier -</B> Ce champ doit être réglé sur le nombre de secondes que le temps de maintien de presse Option Nom joue pour. Par défaut est 10. + <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Hold Time Option Callback Filename - </B> Si Hold Time Option est fixé à CALLERID_CALLBACK, cette invite est le nom du fichier qui se joue avant l'appel est enregistré comme un nouveau chef de file de la liste ID spécifiées ci-dessous si l'estimation est supérieure à la fois tenir Hold Time Option Seconds. + <B>Tenez Option Time After Nom de presse -</B> Si l'option Hold Time est réglé sur l'une des options PRESS_ ou CALLERID_CALLBACK, c'est le nom de fichier rapide qui se joue après que le client a appuyé sur 1 ou l'appel a été ajouté à la liste de rappel. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -4365,7 +6184,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>En groupe d'enregistrement du fichier - </B> Ce champ peut passer outre à la campagne d'enregistrement nommage des fichiers système, sauf si elle est définie à AUCUNE. Les variables sont autorisés CAMPAGNE CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. La valeur par défaut est FULLDATE_AGENT et se présente comme suit 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui se présente comme suit TESTCAMP_51020103108_3125551212. 50 char max. La valeur par défaut est NON. + <B>In-Group Recording Filename -</B> This field will override the Enregistrement de la campagne Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. La valeur par défaut est FULLDATE_AGENT et devrait ressembler à ceci 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui devrait ressembler à ceci TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -4434,18 +6253,42 @@ if ($ADD==99999) <BR> <B>Dispo Call Web -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. + <BR> + <A NAME="vicidial_inbound_groups-add_lead_url"> + <BR> + <B>Ajouter plomb URL -</B> Cette adresse URL Web n'est pas vu par l'agent, mais il est appelé chaque fois qu'un chef de file est ajouté au système par le biais du processus de rapprochement. Par défaut est vide. Vous devez commencer cette URL avec VAR si vous voulez utiliser des variables, et bien sûr - A - et - B - autour de la variable réelle dans l'URL où vous souhaitez l'utiliser. Voici la liste des variables qui sont disponibles pour cette fonction. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>Aucune URL Appel Agent -</B> Cette adresse URL Web n'est pas vu par l'agent, mais si elle est peuplée, il est appelé à chaque fois un appel qui n'est pas gérée par un agent est suspendu ou transféré. Utilise les mêmes variables que les champs du formulaire Web et les scripts. dispo peut être utilisée pour récupérer le système défini par la disposition de l'appel. Cette URL ne peut pas être un chemin relatif. Par défaut est vide. + <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> <BR> <B>Groupe par défaut Alias - </B> Si vous avez permis à Groupe Alias pour la campagne que l'agent est entré dans ce groupe est l'alias qui est sélectionnée par défaut sur la première d'un appel provenant de l'arrivée de ce groupe quand l'agent choisit de utiliser un alias pour un groupe émetteur manuel appel. La valeur par défaut est None ou vide. + <BR> + <A NAME="vicidial_inbound_groups-extension_appended_cidname"> + <BR> + <B>Extension Ajoutez CID -</B> Si elle est activée, les appels à venir à partir de cet en-groupe disposera d'un espace et l'extension de téléphone de l'agent ajouté à la fin du nom de CallerID de l'appel avant qu'il ne soit envoyé à l'agent. Par défaut est N pour les handicapés. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_display"> + <BR> + <B>Affichage de l'état uniqueid -</B> Si elle est activée, lorsqu'un agent reçoit un appel à travers ce en groupe, ils verront le uniqueid de l'appel a ajouté à la ligne d'état dans leur interface de l'agent. L'option PREFIX va ajouter le préfixe défini coup au début de l'uniqueid à l'écran. Défaut est Disabled. Si il y avait déjà un UniqueId définie sur un appel entrant ce en groupe, puis le uniqueid original sera affiché. Si l'option PRESERVE est utilisé et l'appel est envoyé à un second agent, le préfixe uniqueid et affiché au premier agent sera également affiché au second agent. + + <BR> + <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> + <BR> + <B>Préfixe Statut uniqueid -</B> Si l'option PREFIX est sélectionné ci-dessus, alors c'est la valeur de ce préfixe. Par défaut est vide. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_ENTRANT_DIDS TABLE</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_INBOUND_DIDS TABLE</FONT></B><BR><BR> <BR> <A NAME="vicidial_inbound_dids-did_pattern"> <BR> @@ -4461,11 +6304,21 @@ if ($ADD==99999) <BR> <B>DID Active - </B> C'est le domaine où vous définissez la DID à l'entrée active ou non. La valeur par défaut est Y. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour ce n'a, ce qui permet d'administration de visualisation de ce ne restreint par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce fait. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> <B>Route DID - </B> Ce type de route que vous avez mis le DID à utiliser. EXTEN va envoyer des appels à l'extension en dessous, à la messagerie vocale vous envoyer des appels directement à la boîte vocale en dessous, AGENT envoie les appels vers un agent VICIDIAL s'ils sont identifiés, PHONE enverra l'appel d'un téléphone d'entrée, sélectionnez ci-dessous, vous IN_GROUP envoyer des appels directement à l'arrivée du groupe spécifié. La valeur par défaut est EXTEN. CALLMENU allez envoyer l-appel vers le menu Appel définie. + <BR> + <A NAME="vicidial_inbound_dids-record_call"> + <BR> + <B>Enregistrement de l'appel -</B> Cette option vous permet de définir les appels à venir dans ce fait pour être enregistrées. Y va enregistrer tout l'appel, Y_QUEUESTOP enregistrera l'appel jusqu'à ce que l'appel est hungup ou pénètre dans une file d'attente en groupe N ne sera pas enregistrer l'appel. Par défaut est N. + <BR> <A NAME="vicidial_inbound_dids-extension"> <BR> @@ -4519,7 +6372,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> Si IN_GROUP est sélectionné comme la Route de DID, alors c-est la gestion des appels de méthode utilisée pour ces appels. CID va ajouter un enregistrement nouveau chef de file à chaque appel en utilisant le CallerID que le numéro de téléphone, CIDLOOKUP va tenter de rechercher le numéro de téléphone par le CallerID dans l-ensemble du système, CIDLOOKUPRL va tenter de rechercher le numéro de téléphone par le CallerID dans une seule liste spécifiée , CIDLOOKUPRC va tenter de rechercher le numéro de téléphone par le CallerID dans toutes les listes qui appartiennent à la campagne déterminée, CLOSER est spécifié pour VICIDIAL Closer appels, ANI ajouter un enregistrement nouveau chef de file à chaque appel en utilisant l-ANI que le numéro de téléphone, ANILOOKUP va tenter de rechercher le numéro de téléphone par l-ANI dans le système tout entier, ANILOOKUPRL va tenter de rechercher le numéro de téléphone par l-ANI dans une seule liste spécifiée, XDIGITID va demander à l-appelant d-un code à quatre chiffres X avant l-appel sera mis en la file d-attente, VIDPROMPT va demander à l-appelant pour leur numéro d-identification et permettra de créer un dossier avec le nouveau chef de file CallerID que le numéro de téléphone et l-identifiant comme l-ID du vendeur, VIDPROMPTLOOKUP va tenter de rechercher l-ID dans l-ensemble du système, VIDPROMPTLOOKUPRL va tenter de rechercher l-ID de fournisseur par l-ID dans une seule liste spécifiée, VIDPROMPTLOOKUPRC va tenter de rechercher l-ID de fournisseur par l-ID dans l-ensemble des listes qui appartiennent à la campagne spécifié. Par défaut est CID. + <B>In-Group Call Manipuler Méthode -</B> Si IN_GROUP est sélectionné comme la Route de DID, alors c-est la gestion des appels de méthode utilisée pour ces appels. CID va ajouter un enregistrement nouveau chef de file à chaque appel en utilisant le CallerID que le numéro de téléphone, CIDLOOKUP va tenter de rechercher le numéro de téléphone par le CallerID dans l-ensemble du système, CIDLOOKUPRL va tenter de rechercher le numéro de téléphone par le CallerID dans une seule liste spécifiée , CIDLOOKUPRC va tenter de rechercher le numéro de téléphone par le CallerID dans toutes les listes qui appartiennent à la campagne déterminée, CLOSER est spécifié pour VICIDIAL Closer appels, ANI ajouter un enregistrement nouveau chef de file à chaque appel en utilisant l-ANI que le numéro de téléphone, ANILOOKUP va tenter de rechercher le numéro de téléphone par l-ANI dans le système tout entier, ANILOOKUPRL va tenter de rechercher le numéro de téléphone par l-ANI dans une seule liste spécifiée, XDIGITID va demander à l-appelant d-un code à quatre chiffres X avant l-appel sera mis en la file d-attente, VIDPROMPT va demander à l-appelant pour leur numéro d-identification et permettra de créer un dossier avec le nouveau chef de file CallerID que le numéro de téléphone et l-identifiant comme l-ID du vendeur, VIDPROMPTLOOKUP va tenter de rechercher l-ID dans l-ensemble du système, VIDPROMPTLOOKUPRL va tenter de rechercher l-ID de fournisseur par l-ID dans une seule liste spécifiée, VIDPROMPTLOOKUPRC va tenter de rechercher l-ID de fournisseur par l-ID dans l-ensemble des listes qui appartiennent à la campagne spécifié. Par défaut est CID. Si une méthode est utilisée avec CIDLOOKUP ALT, il va rechercher le domaine alt_phone pour le numéro de téléphone si aucune correspondance n'est trouvée pour le numéro de téléphone principal. Si une méthode est utilisée avec CIDLOOKUP ADDR3, il va rechercher le domaine address3 pour le numéro de téléphone si aucune correspondance n'est trouvée pour le numéro de téléphone principal et éventuellement le domaine alt_phone. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -4541,6 +6394,44 @@ if ($ADD==99999) <BR> <B>En-groupe Téléphone Code - </B> Si IN_GROUP est sélectionné en tant que DID route, alors ce téléphone est le code utilisé si un nouveau chef de file est créé. + <BR> + <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> + <BR> + <B>Nettoyez Nombre CID -</B> Ce champ vous permet de spécifier un certain nombre de chiffres à limiter le nombre d'appel entrant ID en mettant un R en face de le nombre de chiffres, par exemple pour limiter les 10 chiffres de droite, vous devez entrer dans R10. Vous pouvez également utiliser cette fonctionnalité pour supprimer seulement un chiffre de premier plan ou de chiffres en mettant un L devant les chiffres spécifiques que vous souhaitez supprimer, par exemple pour enlever un 1 comme le premier chiffre que vous entrez en L1. Par défaut est vide. Si plus d'une règle est prévue assurez-vous de les séparer par un espace et du R sera exécuté avant la L. + + <BR> + <A NAME="vicidial_inbound_dids-filter_inbound_number"> + <BR> + <B>Filtre Nombre entrants -</B> Cette option, si activée, vous permet de filtrer les appels à venir dans ce DID et les envoyer à une autre action si elles correspondent à un numéro de téléphone qui se trouve dans le groupe téléphone filtre ou une réponse URL si vous avez configuré un. Défaut est Disabled. GROUPE va chercher dans un groupe Téléphone filtre. URL enverra une URL et correspondra si un 1 est renvoyé. + + <BR> + <A NAME="vicidial_inbound_dids-filter_phone_group_id"> + <BR> + <B>Filtre ID Groupe Téléphone -</B> Si le champ Numéro de filtre entrant est réglé sur GROUPE, alors c'est l'ID du groupe Téléphone filtre qui aura ses numéros de recherche à la recherche d'un match à l'identification de l'appelant le numéro de l'appel entrant. + + <BR> + <A NAME="vicidial_inbound_dids-filter_url"> + <BR> + <B>URL Filter -</B> Si le champ Numéro de filtre entrant est réglé à l'URL, alors c'est l'adresse Web d'un script qui va chercher un système distant et retourner un 1 pour un match et un 0 pour aucun match. Seuls les deux variables sont disponibles à l'adresse si vous utilisez le préfixe VAR comme avec des adresses formulaire en ligne dans les campagnes, - A - phone_number - B - et - A - did_pattern - B - peut être utilisé dans l'URL pour indiquer l'ID de l'appelant de l'appelant et l'a fait que le client a appelé dans le. + + <BR> + <A NAME="vicidial_inbound_dids-filter_action"> + <BR> + <B>Action de filtrage -</B> Si le filtre est activé Nombre entrants et une correspondance est trouvée, alors c'est l'action qui doit être prise. C'est la même chose que la route que vous sélectionnez pour un SDA, et les réglages ci-dessous fonctionnent comme ils le font pour une norme de routage. + + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>La coutume voulait Champs - </ B> Ces cinq champs peuvent être utilisés à des fins diverses, la plupart ayant trait à la programmation personnalisée et des rapports. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID télécommande remplace extension de l'agent -</B><BR>Cette section vous permet d'activer DID d'avoir des remplacements de vulgarisation pour l'agent à distance acheminés par le biais de demande-groupes. Le début d'utilisateur doit être valide démarrage à distance de l'agent utilisateur ou si vous voulez l'extension Remplacer l'entrée de travailler pour tous les appels, vous pouvez utiliser --- Tous --- dans le champ Début de l'utilisateur. S'il ya des entrées multiples pour le même DID et l'utilisateur sur Démarrer, puis les entrées actives sera utilisé dans un procédé à la ronde. + @@ -4549,7 +6440,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENU TABLE</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>Menu ID -</B> Ceci est l-ID pour cette étape du menu d-appel. Ce sera également visible selon le contexte qui est utilisée dans le plan de numérotation pour cet appel menu. + <B>Menu ID -</B> Ceci est l-ID pour cette étape du menu d-appel. Ce sera également visible selon le contexte qui est utilisée dans le plan de numérotation pour cet appel menu. Voici une liste de phrases réservés qui ne peuvent pas être utilisés en tant que menu ID: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -4561,6 +6452,11 @@ if ($ADD==99999) <BR> <B>Menu rapide -</B> Ce champ contient le nom du fichier audio de l-invite à jouer au début de ce menu. Vous pouvez entrer propmts multiples dans ce domaine et invite les autres champs en les séparant par un caractère pipe. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -4601,10 +6497,20 @@ if ($ADD==99999) <BR> <B>Groupe de suivi -</B> Ceci est l-ID que vous pouvez utiliser pour suivre les appels vers ce menu d-appel lorsque l-on examine le Rapport IVR. La liste comprend CALLMENU par défaut ainsi que l-ensemble de l-En-Groupes. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>Connectez-vous Appuyer sur la touche -</B> Cette option si elle est activée vous connecterez la presse DTMF clé par l'appelant dans ce menu Appel. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Connectez-vous Champ -</B> Si l'option de presse Key Log est activé, ce paramètre optionnel peut permettre à la réponse aussi être stocké dans ce champ la liste. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. Par défaut est NONE pour personnes à mobilité réduite. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Valeur d-option -</B> Ce champ est l-endroit où vous définissez l-option de menu, les choix possibles sont: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Le timecheck option spéciale peut être utilisée que si vous avez menu Heure Départ activé et il ya un temps d-appel définis pour le menu. Pour supprimer une option, vient de mettre la route pour supprimer et l-option sera supprimée lorsque vous cliquez sur le bouton ENVOYER. + <B>Valeur d-option -</B> Ce champ est l-endroit où vous définissez l-option de menu, les choix possibles sont: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Le timecheck option spéciale peut être utilisée que si vous avez menu Heure Départ activé et il ya un temps d-appel définis pour le menu. Pour supprimer une option, vient de mettre la route pour supprimer et l-option sera supprimée lorsque vous cliquez sur le bouton ENVOYER. TIMEOUT vous permettra de mettre ce qui se passe à l'appel quand il arrive à expiration sans la participation de l'appelant. INVALID vous permettra de définir ce qui se passe lorsque l'appelant entre une option non valide. INVALID_2ND et 3e ne peut être active que si INVALID n'est pas utilisé, il faudra patienter jusqu'à l'entrée deuxième ou troisième invalide par l'appelant avant d'exécuter l'option. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -4626,15 +6532,45 @@ if ($ADD==99999) <BR> <B>Option Itinéraire valeur de contexte -</B> Ce champ est optionnel et utilisé uniquement pour l-option Itinéraires EXTENSION. + <BR> + <A NAME="vicidial_call_menu-ingroup_settings"> + <BR> + <B>Appelez le menu Réglages En-Groupe -</B> Si l'itinéraire est défini à l'endogroupe puis, il ya de nombreuses options que vous pouvez utiliser pour définir la manière dont l'appel est envoyé à la file d'attente en. En-Group est le groupe entrant que vous voulez l'appel à aller. Méthode La poignée est la façon dont vous voulez que l'appel à être manipulés, <a href="#vicidial_inbound_dids-call_handle_method">Cliquez ici pour voir une liste des méthodes disponibles poignée</a>. Méthode de recherche définit la manière dont la file d'attente se trouve le prochain agent, de recommander le laisser sur LB. ID de liste est la liste que le nouveau chef de file est inséré, même si la méthode n'est pas une méthode LOOKUP et le plomb ne se trouve pas. ID de la campagne est la campagne pour chercher des listes par le biais si l'un des méthodes RC est utilisé. Code de téléphone est l'entrée du champ phone_code pour le plomb qui est insérée avec. VID Entrez nom de fichier est utilisé si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio joué de demander au client d'entrer son identifiant. Nom du fichier VID Numéro d'identification est utilisée si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio jouée après la clientèle entre leur carte d'identité, quelque chose comme vous avez saisies. VID Confirmer nom de fichier est utilisé si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio joué afin de confirmer leur identité, quelque chose comme 1 COMMUNIQUÉ DE PRESSE POUR CONFIRMER ET 2 DE RETOURNER. Chiffres VID est utilisée si la méthode est définie à l'une des méthodes VIDPROMPT, si elle est définie à un certain nombre, c'est le nombre de chiffres qui doivent être saisies par le client lorsque vous êtes invité pour leur identité, s'il est réglé à vide ou X puis le client devra appuyer sur la livre ou le hachage pour terminer leur entrée sur leur carte d'identité. + <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dilplan Entrée -</B> Ce champ vous permet d-entrer dans tous les éléments de plan de numérotation que vous souhaitez pour le menu d-appel. + <B>Entrée personnalisée Dialplan -</B> Ce champ vous permet d-entrer dans tous les éléments de plan de numérotation que vous souhaitez pour le menu d-appel. + <BR><BR><BR><BR> + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> + <BR> + <B>Filtre ID Groupe Téléphone -</B> C'est l'ID du groupe Téléphone filtre qui est le conteneur pour un groupe de numéros de téléphone que vous pouvez avoir automatiquement fouillé quand un appel arrive dans un fichier. DID et l'envoyer à un autre itinéraire si il ya un match Ce champ doit être comprise entre 2 et 20 caractères et n'ont pas de ponctuation à l'exception de soulignement. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> + <BR> + <B>Filtre Nom du groupe Téléphone -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + + <BR> + <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> + <BR> + <B>Filtre Description du groupe Téléphone -</B> Ceci est la description du groupe Téléphone filtre, il est purement à des fins de notation et n'est pas un champ obligatoire. + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_REMOTE_AGENTS TABLE</FONT></B><BR><BR> @@ -4657,6 +6593,11 @@ if ($ADD==99999) <BR> <B>Extension externe -</B> C'est le numéro vers lequel vous voulez faire suivre l'appel. Assurez vous que c'est un numéro du dial plan et si vous avez besoin d'un 9 au début mettez le ici. Testez en appelant ce numéro depuis un téléphone du système. + <BR> + <A NAME="vicidial_remote_agents-extension_group"> + <BR> + <B>Groupe d'extension -</B> Si réglé sur autre chose que NONE ou vide cela surcharger le champ d'extension externe et d'utiliser les entrées de groupe de vulgarisation qui ont la même extension ID groupe. Par défaut est NONE pour désactiver. + <BR> <A NAME="vicidial_remote_agents-status"> <BR> @@ -4667,6 +6608,16 @@ if ($ADD==99999) <BR> <B>Campagne -</B> C'est ici que vous choisissez la campagne dans laquelle ces agents distants ce connecteront. Les appels entrants ont besoin d'une campagne de type CLOSER et de selectionner les campagnes entrantes ci-dessus dans laquelle vous voulez recevoir des appels. + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>On-Hook Agent -</B> Cette option est utilisée uniquement pour les appels entrants vont à cet agent à distance. Cette fonctionnalité sera appeler l'agent à distance et ne pas envoyer le client à l'agent à distance jusqu'à ce que la ligne est répondu. Par défaut est N pour les handicapés. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>Temps Ring On-Hook -</B> Cette option n'est utilisée que lorsque le champ Agent Sur-crochet ci-dessus est fixé à Y et alors seulement pour les appels entrants à venir à cet agent à distance. C'est le nombre de secondes que chaque tentative d'appel sonne pour essayer d'obtenir une réponse. Il est recommandé que vous définissez cette option sur quelques secondes inférieur à ce qu'il prend pour un appel à être envoyé vers la messagerie vocale. Par défaut est 15. + <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> <BR> @@ -4675,7 +6626,30 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTES</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABLE</FONT></B><BR><BR> + <A NAME="vicidial_extension_groups-extension_group_id"> + <BR> + <B>Groupe d'extension -</B> Ce champ est requis lorsque vous entrez l'ID du groupe que vous voulez cette extension pour être mis en. Pas d'espaces ni de caractères spéciaux à l'exception des lettres et des chiffres soulignent. + + <BR> + <A NAME="vicidial_extension_groups-extension"> + <BR> + <B>Extension -</B> Ce champ doit là où vous mettez l'extension que vous souhaitez plan de numérotation de l'agent à distance appelle à être envoyé à cette entrée du groupe d'extension. + + <BR> + <A NAME="vicidial_extension_groups-rank"> + <BR> + <B>Rank -</B> Ce champ vous permet de classer les entrées de groupe de vulgarisation qui partagent le groupe même extension. Par défaut est 0. + + <BR> + <A NAME="vicidial_extension_groups-campaign_groups"> + <BR> + <B>Groupes Campagnes -</B> Dans ce domaine, vous pouvez mettre une liste d'ID de campagne et ou ID de groupe entrants que vous souhaitez restreindre l'utilisation du groupe d'extension pour. Liste doivent être séparés par des tuyaux et un tuyau au début et à la fin de la chaîne. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>Les listes de cette campagne sont énumérées ici, leur activité est dénotée par le Y ou N et vous pouvez aller à l'écran de la liste en cliquant sur l'ID de la liste dans la première colonne.</B> @@ -4740,6 +6714,28 @@ if ($ADD==99999) + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR> + <A NAME="vicidial_xfer_presets"> + <BR> + <B>Si le réglage de la campagne pour les presets est ENABLED alors vous avez la possibilité de définir le transfert à la Conférence des préréglages qui seront disponibles à l'agent qui leur permet de 3-way appeler ces préréglages ou transférer des appels aveugles à ces numéros de présélection. Ces presets ont également une option pour cacher le numéro associé à chaque préréglage de l'agent.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN CID Indicatif régionalS</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Si le réglage du système pour le code zonal CID est activée et la mise en campagne pour une utilisation personnalisée CallerID est réglé sur le code zonal alors vous avez la possibilité de définir CID indicatif régional qui seront utilisés lors d'appels sortants à des fils dans cette campagne spécifique. Vous pouvez ajouter plusieurs callerIDs par indicatif régional et vous pouvez activer et désactiver à chacun en temps réel. Si plus d'un callerID est actif pour un indicatif régional spécifique, le système utilisera la callerid qui a été utilisé le moins de fois aujourd'hui. Si aucun callerIDs sont actifs pour le code zonal alors le CallerID campagne ou la liste prioritaire CallerID sera utilisé.</B> + + + + + <BR><BR><BR><BR> <B><FONT SIZE=3>VICIDIAL_USER_GROUPS TABLE</FONT></B><BR><BR> @@ -4775,14 +6771,66 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Le statut de mandataire Viewable Groupes -</B> Ceci est une liste sélectionnable de groupes d-utilisateurs et les fonctions utilisateur pour lequel les membres de ce groupe d-utilisateurs peuvent visualiser l-état des appels ainsi que le transfert vers l-intérieur de l-écran de l-agent. The All-GROUPES option permet aux utilisateurs de ce groupe à voir et à transférer des appels vers n-importe quel utilisateur sur le système. La CAMPAGNE AGENTS option permet aux utilisateurs de ce groupe à voir et à transférer des appels vers n-importe quel utilisateur dans la campagne à laquelle ils sont connectés à. + <B>Le statut de mandataire Viewable Groupes -</B> Ceci est une liste sélectionnable de groupes d-utilisateurs et les fonctions utilisateur pour lequel les membres de ce groupe d-utilisateurs peuvent visualiser l-état des appels ainsi que le transfert vers l-intérieur de l-écran de l-agent. The All-GROUPES option permet aux utilisateurs de ce groupe à voir et à transférer des appels vers n-importe quel utilisateur sur le système. La CAMPAGNE AGENTS option permet aux utilisateurs de ce groupe à voir et à transférer des appels vers n-importe quel utilisateur dans la campagne à laquelle ils sont connectés à. L'option non-logé-IN-AGENTS permet à tous les utilisateurs dans le système pour être affiché, même si elles ne sont pas enregistrés curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> <BR> <B>Le statut de mandataire Afficher Time -</B> Cette option définit si l-agent va voir la quantité de temps que les utilisateurs dans leur encadré agent ont été dans leur état actuel. Par défaut est N pour non ou handicapés. + <BR> + <A NAME="vicidial_user_groups-agent_call_log_view"> + <BR> + <B>Voir le journal de l'Agent d'appel -</B> Cette option définit si l'agent sera en mesure de voir leur journal d'appels pour les appels traités par le biais de l'écran l'agent Vicidial. Par défaut est N pour non ou désactivé. + + <BR> + <A NAME="vicidial_user_groups-agent_xfer_options"> + <BR> + <B>Options de transfert de l'agent -</B> Ces options permettent la désactivation des boutons spécifiques dans la section Transfert Conférence de l'interface de l'agent. Par défaut est O pour oui ou permis. + + <BR> + <A NAME="vicidial_user_groups-agent_fullscreen"> + <BR> + <B>Agent plein écran -</B> Cette option si elle est définie à Y définir la hauteur et la largeur de l'écran l'agent Vicidial à la taille de la fenêtre du navigateur web sans aucune indemnité pour la vue d 'agents, Appels en file d'attente ou de demande en vue de la session. Par défaut est N pour non ou désactivé. + + <BR> + <A NAME="vicidial_user_groups-allowed_reports"> + <BR> + <B>Rapports admis -</B> Si un utilisateur dans ce groupe est fixé à 7 niveau de l'utilisateur ou plus, cette fonction peut être utilisée pour restreindre les rapports que les utilisateurs peuvent visualiser. Par défaut est ALL. Si vous voulez sélectionner plus d'un rapport, puis appuyez sur la touche Ctrl de votre clavier pendant que vous sélectionnez les rapports. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Groupes d'utilisateurs autorisés -</B> Ceci est une liste sélectionnable de groupes d'utilisateurs à laquelle les membres de ce groupe d'utilisateurs peuvent visualiser et éventuellement modifier. Groupes d'utilisateurs peuvent restreindre l'accès à presque tous les aspects du système, à partir de DID entrants vers des téléphones à des boîtes vocales. Le - ALL - option permet aux utilisateurs de ce groupe à voir et à connecter à n'importe quel dossier sur le système si leurs autorisations d'utilisateur le permettent. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Durée des appels autorisés -</B> Ceci est une liste sélectionnable Durée des appels à laquelle les membres de ce groupe d'utilisateurs peuvent utiliser dans les campagnes, dans les groupes et les menus d'appel. Le - ALL - option permet aux utilisateurs de ce groupe à utiliser tous les temps d'appel dans le système. + + <?php + if (strlen($SSwebphone_url) > 5) + { + ?> + <BR> + <A NAME="vicidial_user_groups-webphone_url_override"> + <BR> + <B>Remplacer URL Webphone -</B> Ce paramètre vous permet de définir une URL webphone autre seulement pour les membres d'un groupe d'utilisateurs. Par défaut est vide. + + <BR> + <A NAME="vicidial_user_groups-webphone_systemkey_override"> + <BR> + <B>Webphone Key System Override -</B> Ce paramètre vous permet de définir une clé de remplacement webphone système juste pour les membres d'un groupe d'utilisateurs. Par défaut est vide. + + <BR> + <A NAME="vicidial_user_groups-webphone_dialpad_override"> + <BR> + <B>Webphone Dialpad Override -</B> Ce paramètre vous permet d'activer ou de désactiver le clavier sur le webphone seulement pour les membres d'un groupe d'utilisateurs. Défaut est Disabled. Toggle va permettre à l'utilisateur de visualiser et de cacher le clavier en cliquant sur un lien. TOGGLE_OFF par défaut pour ne pas montrer le clavier sur la première charge, mais permettra à l'utilisateur d'afficher le clavier en cliquant sur le lien clavier. + + <?php + } + if ($SSqc_features_active > 0) { ?> @@ -4817,14 +6865,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Commentaires du script -</B> C'est ici que vous entrez un commentaire pour le script Vicidial comme -changed to free upgrade on Sept 23- Max 255 caractères , min 2 caractères. + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Texte du script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Texte du script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + Vous pouvez également utiliser un IGNORENOSCROLL variable spéciale pour forcer les barres de défilement sur l'onglet script même si vous utilisez une iframe en son sein. <BR> <A NAME="vicidial_scripts-active"> @@ -4854,6 +6909,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>Commentaire du filtre -</B> C'est ici que vous placez les commmentaire du filtre vicidial comme -Appel toutes les fiches de Californie- max 255 characters, min 2. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>Filtre SQL -</B> C'est ici que vous mettez le fragment de requête SQL que vous voulez utiliser pour filtrer. Ne commencez pas ni ne finissez pas par AND, cela est automatiquement ajouté par le script cron. Exemple : called_count > 4 and called_count < 8 . @@ -4879,14 +6939,23 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>Commentaires de la période d'appel -</B> Vous pouvez y placer des commentaires sur la période d'appel de Vicidial comme-de 10h00 à 16h00 avec des restrictions-. Max 255 caractères. + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_call_times-ct_default_start"> - <B>Heures de début et de fin par défaut -</B> Ce sont les heures par défaut pendant lesquelles un appel est autorisé si l'heure de début de day-of-the-week n'est pas définie. 0 est minuit. Pour interdir complétement les appels mettez 2400 et mettez 2400 à l'heure de fin par défaut. Pour autoriser les appels 24h/24, remplissez les champs avec 0 pour le début et 2400 pour la fin. + <B>Heures de début et de fin par défaut -</B> Ce sont les heures par défaut pendant lesquelles un appel est autorisé si l'heure de début de day-of-the-week n'est pas définie. 0 est minuit. Pour interdir complétement les appels mettez 2400 et mettez 2400 à l'heure de fin par défaut. Pour autoriser les appels 24h/24, remplissez les champs avec 0 pour le début et 2400 pour la fin. Pour entrant seulement, vous pouvez également définir la durée d'appel d'arrêt supérieur à 2400 si vous voulez que le temps appel à aller au-delà de minuit. Donc, si vous voulez que votre temps d'appel à courir à partir de 6 h jusqu'à 2 h du matin le lendemain, vous mettriez 0600 que l'heure de début et 2600 que le temps d'arrêt. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> <B>Heures de début et de fin pour un jour -</B> Ce sont les heures de début et de fin personnalisés pour un jour. Les mêmes règles s'appliquent qu'aux heures de début et de fin par défaut. + <BR> + <A NAME="vicidial_call_times-default_afterhours_filename_override"> + <B>Après Nom Heures Override -</B> Ces champs vous permettent de remplacer le message après les heures pour les groupes entrants si elle est définie à quelque chose. Par défaut est vide. + <BR> <A NAME="vicidial_call_times-ct_state_call_times"> <B>Définitions des états des périodes d'appel -<\/B> C'est la liste des définitions spécifiques des périodes d'appels des états qui sont suivies dans cette définition de période d'appels. @@ -4909,6 +6978,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Nom Shift - </B> Il s'agit d'un nom descriptif de la Maj Définition. Ceci est un bref résumé de la définition Maj. max 50 caractères, un minimum de 2 caractères. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Start Time Shift - </B> Il est temps que la campagne commence à passer. Ne doivent être des chiffres, 9:30 AM serait 0930 et 5:00 PM serait 1700. @@ -4921,13 +6995,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Shift Weekdays - </B> Dans cette section, vous devriez choisir le jour de la semaine que ce changement est active. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Option Report -</B> Cette option permet ce changement spécifique à apparaître dans les rapports sélectionnés qui soutiennent cette option. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Rapport Rang -</B> Cette option vous permet de classer les changements dans les rapports sélectionnés qui soutiennent cette option. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio Store -</B> Cet utilitaire vous permet de télécharger des fichiers audio sur le serveur Web de sorte qu-ils puissent être distribués à tous les serveurs VICIDIAL dans un cluster multi-serveur. Une remarque importante, seulement deux types de fichiers audio fonctionne, les fichiers. Wav qui sont PCM 16bit 8k et les fichiers. GSM qui sont 8bit 8K. S-il vous plaît vérifier que vos fichiers sont correctement mis en forme avant de les télécharger ici. + <B>Audio Store -</B> Cet utilitaire vous permet de télécharger des fichiers audio vers le serveur Web de sorte qu'ils puissent être distribués à tous les serveurs Vicidial dans un cluster multi-serveur. Une remarque importante, seuls deux types de fichiers audio fonctionne, les fichiers. Wav qui sont PCM Mono 16 bits et 8k. Fichiers gsm qui sont 8k 8bit. S'il vous plaît vérifier que vos fichiers sont correctement mis en forme avant de les télécharger ici. @@ -4946,6 +7027,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Active -</B> Cette option vous permet de définir la musique d-attente à l-entrée active ou inactive. Inactifs va supprimer l-entrée à partir des fichiers conf. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Random Order -</B> Cette option vous permet de définir la lecture des fichiers audio dans un ordre aléatoire. Si elle est égale à N, alors l-ordre défini sera utilisé. @@ -4972,9 +7058,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Active -</B> Cette option vous permet de définir l-entrée de TTS à l-état actif ou inactif. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + + <BR> + <A NAME="vicidial_tts_prompts-tts_voice"> + <B>TTS Voix -</B> C'est là que vous définissez la voix pour être utilisé dans la génération TTS. Par défaut est Allison-8kHz. + <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Text -</B> Il s-agit du texte à la parole champ de données qui est envoyé à Cepstral pour la création du fichier audio à lire pour le client. vous pouvez utiliser Speech Synthesis Markup Language-SSML, dans ce domaine, par exemple, <break time='1000ms'/> pour une pause de 1 seconde. Vous pouvez également utiliser plusieurs variables telles que nom, prénom et titre en tant que variables VICIDIAL comme vous le faites dans un script: - Un prenom - - B -. Voici une liste des variables disponibles:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Text -</B> Il s-agit du texte à la parole champ de données qui est envoyé à Cepstral pour la création du fichier audio à lire pour le client. vous pouvez utiliser Speech Synthesis Markup Language-SSML, dans ce domaine, par exemple, <break time='1000ms'/> pour une pause de 1 seconde. Vous pouvez également utiliser plusieurs variables telles que le nom, prénom et titre en tant que variables Vicidial comme vous le faites dans un script: - A - prenom - B -. Si vous avez statiques fichiers audio que vous souhaitez utiliser en fonction de la valeur de l'un des domaines que vous pouvez utiliser aussi bien avec ceux C et D balises. Les noms de fichiers doivent être en minuscules et ils doivent être 8k 16bit pcm wav. Le nom de domaine doit être le même, mais sans le wav. Dans le nom du fichier. Par exemple - C ---- A - address3 - B ---- D - tout d'abord trouver la valeur pour address3, alors il serait tenter de trouver un fichier audio correspondant à celle de la valeur à mettre dans l'invite. Voici une liste des variables disponibles: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -4984,7 +7079,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_VOICEMAIL TABLE</FONT></B><BR><BR> <A NAME="vicidial_voicemail-voicemail_id"> <BR> - <B>Boîte vocale ID -</B> Il s-agit de la identifiant nombres de cette boîte aux lettres. Cela ne doit pas être un doublon d-un répondeur d-identification existant ou la boîte vocale d-ID d-un téléphone sur le système, au moins 2 caractères. + <B>ID vocale -</B> Il s-agit de la identifiant nombres de cette boîte aux lettres. Cela ne doit pas être un doublon d-un répondeur d-identification existant ou la boîte vocale d-ID d-un téléphone sur le système, au moins 2 caractères. <BR> <A NAME="vicidial_voicemail-fullname"> @@ -5002,12 +7097,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <B>Email -</B> Ce paramètre facultatif vous permet d-avoir les messages vocaux envoyés à un compte de messagerie, si votre système est configuré pour envoyer des email. Si ce champ est vide, alors pas de courriels seront envoyés. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Supprimer messagerie vocale après le courrier électronique -</B> Ce paramètre facultatif vous permet d-avoir les messages vocaux supprimés du système après avoir été envoyé par courriel Out. Par défaut est n. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Zone de messagerie vocale -</B> Ce paramètre vous permet de définir la zone que cette boîte vocale sera réglé lorsque le temps est enregistré pour un message. Par défaut est définie dans les paramètres système. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Options de la messagerie vocale -</B> Ce paramètre optionnel vous permet de définir les paramètres de messagerie vocale supplémentaires. Il est recommandé que vous laissez ce champ vide si vous ne savez ce que vous faites. <?php if ($SSoutbound_autodial_active > 0) @@ -5024,7 +7129,7 @@ if ($ADD==99999) <LI>Code vendeur de la fiche - montre dans le champ dID du vendeur de l'interface graphique <LI>Code source - usage interne uniquement pour les administrateurs et les administrateurs de la base de données <LI>Identifiant de la liste - le numéro de la liste dans laquelle seront ces fiches - <LI>Code du téléphone - le préfixe pour le numéro de téléphone - 1 pour les USA, 0144 pour le Royaume-Uni, 01161 pour l'Australie, etc + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Numéro de téléphone - doit contenir au moins 8 chiffres <LI>Titre - titre du client - Mr. Mme. Mlle., etc... <LI>Nom @@ -5048,6 +7153,15 @@ if ($ADD==99999) <BR>NOTES : La fonctionnalité de chargeur de fil d'exceler est permisepar une série de manuscrits de Perl et doit avoir un dossier en placecorrectement configuré de /etc/astguiclient.conf sur le web server.En outre, des modules d'un Perl de couples doivent être chargés pourelle pour travailler aussi bien - oLE-Storage_Lite-Storage_Lite et leBilan-ParseExcel. Vous pouvez vérifier les erreurs d'exécution dansces derniers en regardant votre dossier d'error_log d'apache. Enoutre, pour des contrôles de duplication contre le gampaignénumère, la liste qui a de nouveaux fils entrer dans lui doit êtrecréée dans le système avant que vous commenciez à charger lesfils. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Disposition personnalisée" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>ID modèle -</B> If the user has selected "Disposition personnalisée" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -5063,7 +7177,7 @@ if ($ADD==99999) <B><FONT SIZE=3>TABLE DES TELEPHONES</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Extension du téléphone -</B> C'est dans ce champ qu'il faut mettre le nom du téléphone comme il apparait dans Asterisk sans mettre le protocole ou le slash du début. Par exemple: pour le téléphone SIP SIP/test101 l'extension sera test101. De même pour les téléphones IAX2 assurez vous d'utiliser le nom complet du téléphone : pour IAX2/IAXphone1@IAXphone1 ce sera IAXphone1@IAXphone1. Pour les téléphones ZAP assurez vous de mettre le channel complet: pour Zap/25-1 ce sera 25-1. De plus, assurez vous d'avoir mis le bon protocole en dessous pour votre téléphone. + <B>Extension Téléphone -</B> Ce champ est l'endroit où vous mettez le nom téléphones tel qu'il apparaît à Asterisk pas y compris le protocole ou une barre oblique au début. Par exemple: pour le téléphone SIP SIP/test101 l'extension Téléphone serait test101. En outre, pour IAX2 téléphones: IAX2/IAXphone1 @ IAXphone1 serait IAXphone1. Pour Zap et dahdi joint channelbank ou FXS téléphones assurez-vous que vous mettez le numéro de canal complète sans le préfixe: Zap/25-1 serait 25-1. Une autre note, assurez-vous que vous définissez le champ ci-dessous Protocole correctement pour votre type de téléphone. <BR> <A NAME="phones-dialplan_number"> @@ -5075,11 +7189,24 @@ if ($ADD==99999) <BR> <B>Boîte vocale -</B> Ce champ est pour la boîte vocale vers laquelle iront les messages pour l'utilisateur de ce téléphone. Il est utilisé pour vérifier la présence de messages et pour permettre à l'utilisateur d'utiliser le bouton VOICEMAIL dans l'application astGUIclient. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Zone de messagerie vocale -</B> Ce paramètre vous permet de définir la zone que cette boîte vocale sera réglé lorsque le temps est enregistré pour un message. Par défaut est définie dans les paramètres système. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Options de la messagerie vocale -</B> Ce paramètre optionnel vous permet de définir les paramètres de messagerie vocale supplémentaires. Il est recommandé que vous laissez ce champ vide si vous ne savez ce que vous faites. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>CallerID sortant -</B> Ce champ est celui dans lequel vous entrez le numéro callerID que vous souhaitez voir apparaître lors d'appels externes passés depuis le client web astguiclient. Cela ne fonctionne pas avec RBS, non-PRI, T1/E1s. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -5098,12 +7225,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>Login -</B> login utilisé par l'utilisateur du téléphone pour se connecter aux applications clientes. + <B>Écran de connexion Agent -</B> La connexion utilisée pour l'utilisateur du téléphone pour se connecter à des applications clientes, comme l'écran d'agent Vicidial. <BR> <A NAME="phones-pass"> <BR> - <B>Mot de passe -</B> Le mot de passe utilisé par l'utilisateur du téléphone pour se connecter aux applications clientes. IMPORTANT, c-est le seul mot de passe pour le web Connexion Agent interface de téléphone, pour changer la sip.conf iax.conf ou mot de passe, ou secrets, pour cet appareil de téléphone que vous devez modifier le fichier de conf champ Secret plus bas sur cette page. + <B>Login Mot de passe -</B> Le mot de passe utilisé pour l'utilisateur du téléphone pour se connecter à des applications clientes basées sur le Web. IMPORTANT, c'est le seul mot de passe pour la connexion agent web interface téléphonique, de changer le sip.conf ou mot de passe iax.conf, ou secret, pour cet appareil de téléphone dont vous avez besoin de modifier le mot de passe d'inscription dans le champ suivant. + + <BR> + <A NAME="phones-conf_secret"> + <BR> + <B>Inscription Mot de passe -</B> C-est le secret ou mot de passe, pour le téléphone dans le IAX ou SIP auto-généré fichier de conf pour ce téléphone. La limite est de 20 caractères alphanumériques tiret de soulignement et acceptée. Par défaut est test. Anciennement appelé secret fichier de conf. Un mot de passe d'enregistrement forte doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro. + + <BR> + <A NAME="phones-is_webphone"> + <BR> + <B>Définir en tant que Webphone -</B> La définition de cette option à Y va tenter de charger un téléphone basé sur le Web lorsque l'agent se connecte à l'écran de leur agent. Par défaut est N. + + <BR> + <A NAME="phones-webphone_dialpad"> + <BR> + <B>Webphone Dialpad -</B> Ce paramètre vous permet d'activer ou de désactiver le clavier pour cette webphone. Par défaut est Y pour activé. Toggle va permettre à l'utilisateur de visualiser et de cacher le clavier en cliquant sur un lien. Cette fonctionnalité n'est pas disponible sur toutes les versions webphone. TOGGLE_OFF par défaut pour ne pas montrer le clavier sur la première charge, mais permettra à l'utilisateur d'afficher le clavier en cliquant sur le lien clavier. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Webphone Réponse automatique -</B> Ce paramètre permet au téléphone Web pour être automatiquement configuré pour répondre aux appels qui entrent en en le mettant à Y, ou d'avoir anneau appels en le mettant à défaut N. Y est. + + <BR> + <A NAME="phones-use_external_server_ip"> + <BR> + <B>Utilisez IP du serveur externe -</B> Si vous utilisez un téléphone Web, vous pouvez définir cette sur Y pour utiliser les serveurs IP externe pour vous inscrire à la place de l'adresse IP du serveur. Par défaut est vide. <BR> <A NAME="phones-status"> @@ -5169,6 +7321,11 @@ if ($ADD==99999) <BR> <B>Phone Ring Timeout -</B> Il s-agit de la quantité de temps, en secondes, que le téléphone sonne dans le plan de numérotation avant d-envoyer l-appel vers la messagerie vocale. Par défaut est de 60 secondes. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>Connexion Agent Sur-Crochet -</B> Cette option est utilisée uniquement pour les appels entrants vont à un agent connecté avec ce téléphone. Cette fonctionnalité sera appeler l'agent et ne pas envoyer le client à la session des agents jusqu'à ce que la ligne est répondu. Par défaut est N pour les handicapés. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -5245,9 +7402,14 @@ if ($ADD==99999) <B>Téléphone Contexte -</B> Tel est le contexte du plan de numérotation que ce téléphone se servira pour composer. Si vous utilisez un centre d-appel et que vous ne voulez pas que vos agents pour être en mesure de composer un numéro hors de l-application VICIDIAL par exemple, alors vous devez définir ce domaine à un contexte de plan de numérotation qui n-existe pas, quelque chose comme agent-nodial. par défaut est par défaut. <BR> - <A NAME="phones-conf_secret"> + <A NAME="phones-codecs_list"> <BR> - <B>Conf dossier secret -</B> C-est le secret ou mot de passe, pour le téléphone dans le IAX ou SIP auto-généré fichier de conf pour ce téléphone. La limite est de 20 caractères alphanumériques tiret de soulignement et acceptée. Par défaut est test. + <B>Codecs admis -</B> Vous pouvez définir une liste délimitée par des virgules des codecs d'être défini comme les codecs par défaut pour ce téléphone. Options pour les codecs comprennent ulaw, alaw, gsm, g729, speex, G722, G723, G726, ILBC, ... Certains de ces codecs ne sont pas disponibles sur votre système, comme g729 ou G726. Si le champ est vide, alors les codecs par défaut du système ou de l'entrée de téléphone ci-dessus celle-ci sera utilisée pour les codecs admissibles. Par défaut est vide. + + <BR> + <A NAME="phones-codecs_with_template"> + <BR> + <B>Codecs admis avec la matrice-</B> Mettre cette option à 1 comprendra les codecs définis ci-dessus, même si un modèle de fichier de conf est utilisé. Par défaut est 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -5340,12 +7502,12 @@ if ($ADD==99999) <B>Bouton de boîte vocale -</B> Mettre à true pour afficher le bouton VOICEMAIL et le nombre de messages dans astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_rafraîchir"> <BR> <B>Rafraichissement rapide -</B> Mettre à true pour activer un nouveau taux de rafraichissement de l'information dans astGUIclient. Par défaut ce taux est de 1000ms, 1 seconde. Si vous diminuez ce taux cela peu augmenter la charge système. <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_rafraîchir_rate"> <BR> <B>Taux de rafraichissement rapide -</B> en millisecondes. Utiliser seulement si le rafraichissement rapide est activé. Par défaut le taux est de 1000ms , 1 seconde. La diminution de ce taux peux augmenter la charge système. @@ -5437,12 +7599,12 @@ if ($ADD==99999) <BR> <A NAME="phones-template_id"> <BR> - <B>Template ID - </B> C'est le fichier de conf ID que ce modèle de téléphone utilisé pour la saisie des paramètres de son Asterisk. La valeur par défaut est - ABSENCE --. + <B>ID modèle - </B> C'est le fichier de conf ID que ce modèle de téléphone utilisé pour la saisie des paramètres de son Asterisk. La valeur par défaut est - ABSENCE --. <BR> <A NAME="phones-conf_override"> <BR> - <B>Conf Override Settings -</B> If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated. + <B>Conf Override Settings -</B> If populated, and the ID modèle is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated. <BR> <A NAME="phones-group_alias_id"> @@ -5489,6 +7651,11 @@ if ($ADD==99999) <BR> <B>Actif -</B> Mettre si le serveur Asterisk est actif ou non. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="servers-sysload"> <BR> @@ -5557,7 +7724,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf dossier secret -</B> C-est le secret ou mot de passe, pour le serveur dans l-auto-généré IAX fichier de conf pour ce serveur sur d-autres serveurs. La limite est de 20 caractères alphanumériques tiret de soulignement et acceptée. Par défaut est test. + <B>Conf dossier secret -</B> C-est le secret ou mot de passe, pour le serveur dans l-auto-généré IAX fichier de conf pour ce serveur sur d-autres serveurs. La limite est de 20 caractères alphanumériques tiret de soulignement et acceptée. Par défaut est test. Un secret conf forte du fichier doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro. <BR> <A NAME="servers-local_gmt"> @@ -5619,6 +7786,16 @@ if ($ADD==99999) <BR> <B>Autre enregistrement IP du serveur - </B> Ce paramètre est l'endroit où vous pouvez mettre une IP de serveur de nom de machine ou d'autres qui peuvent être utilisés à la place de la server_ip dans les liens d'enregistrements au sein de l'administration des pages Web. La valeur par défaut est vide. + <BR> + <A NAME="servers-external_server_ip"> + <BR> + <B>IP du serveur externe -</B> Ce paramètre est l'endroit où vous pouvez mettre une adresse IP du serveur ou nom de la machine qui peut être utilisé à la place de l'server_ip lorsque vous utilisez un webphone dans l'interface agent. Pour que cela fonctionne vous devez également avoir l'entrée téléphones configuré pour utiliser l'adresse IP du serveur externe. Par défaut est vide. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>Actif IP du serveur double -</B> Certains systèmes Vicidial faudrait mettre en place des serveurs Vicidial en paires. Ce paramètre est l'endroit où vous pouvez mettre l'IP du serveur d'un autre serveur Vicidial que ce serveur est jumelée avec. Par défaut est vide pour les handicapés. + <BR> <A NAME="servers-active_asterisk_server"> <BR> @@ -5659,6 +7836,11 @@ if ($ADD==99999) <BR> <B>Carrier Logging Active -</B> Ce paramètre vous permet d-enregistrer l-ensemble des codes de retour de raccrochage pour tout composant la liste des appels sortants que vous passez. Par défaut est N. + <BR> + <A NAME="servers-custom_dialplan_entry"> + <BR> + <B>Entrée personnalisée Dialplan -</B> Ce champ vous permet d'entrer dans tous les éléments plan de numérotation que vous souhaitez pour le serveur, les lignes seront ajoutées au contexte par défaut. + @@ -5669,13 +7851,18 @@ if ($ADD==99999) <B><FONT SIZE=3>vicidial_conf_templates TABLE</FONT></B><BR><BR> <A NAME="vicidial_conf_templates-template_id"> <BR> - <B>Template ID - </B> Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le modèle de configuration à travers le système. + <B>ID modèle - </B> Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le modèle de configuration à travers le système. <BR> <A NAME="vicidial_conf_templates-template_name"> <BR> <B>Nom du modèle - </B> C'est le nom descriptif du modèle de fichier de configuration d'entrée. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -5702,6 +7889,11 @@ if ($ADD==99999) <BR> <B>Carrier Description -</B> Ceci est mis dans les commentaires des fichiers de conf asterisk-dessus du plan de numérotation et des entrées de compte. Maximum 255 caractères. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -5710,7 +7902,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_server_carriers-template_id"> <BR> - <B>Template ID - </B> Ce champ facultatif permet de choisir un modèle de fichier de conf de ce transporteur entrée. + <B>ID modèle - </B> Ce champ facultatif permet de choisir un modèle de fichier de conf de ce transporteur entrée. <BR> <A NAME="vicidial_server_carriers-account_entry"> @@ -5810,16 +8002,46 @@ if ($ADD==99999) <BR> <B>URL de l'acceuil de l'administration -</B> C'est l'URL ou l'adresse du site web ou vous voulez aller quand vous cliquez sur le lien ACCUEIL en haut de la page admin.php. + <BR> + <A NAME="settings-admin_modify_rafraîchir"> + <BR> + <B>Administrateur Modifier Auto-Refresh -</B> C'est l'intervalle de rafraîchissement en secondes des écrans modifier dans ce interface d'administration. Un réglage à 0 sera le désactiver, il la mise en-dessous de 5 sera la plupart du temps faire des écrans de forçage inutilisables car ils se rafraîchira trop vite pour changer les champs. Cette option est utile dans les situations où plus d'un gestionnaire est le contrôle des paramètres sur une campagne active ou en groupe afin que les paramètres sont rafraîchies fréquemment. Par défaut est 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Admin No-Cache -</B> Si définie à 1 permet de régler toutes les pages d'administration du navigateur internet de no-cache, de sorte que chaque écran doit être rechargé à chaque fois qu'il est considéré, même si le clic de retour sur le navigateur. Par défaut est 0 pour les handicapés. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> <B>Permettez le fichier journal de transfert d'agent - cette optionnotera à un fichier journal des textes sur le webserver chaque foisqu'un appel est transféré à un agent. Le défaut est 0,neutralisé. + <BR> + <A NAME="settings-enable_agc_dispo_log"> + <BR> + <B>Activer Logfile Disposition Agent -</B> Cette option se connecter à un fichier journal texte sur le serveur web à chaque fois qu'un appel est rejetées par un agent. Par défaut est 0, désactivé. + <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Horloge en temps Fin de la journée - </B> Ce paramètre définit lorsque tous les utilisateurs sont automatiquement déconnecté du système timeclock. Fonctionne uniquement une fois par jour. ne doit être que 4 chiffres et 2 chiffres heures à 2 chiffres dans les minutes de 24 heures. La valeur par défaut est 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Par défaut locale GMT -</B> Ce paramètre définit ce qui sera utilisé par défaut lors de nouveaux téléphones et les serveurs sont ajoutés à l'aide de cette interface web d'administration. Par défaut est de -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Zone messagerie vocale par défaut -</B> Ce paramètre définit quelle zone sera utilisé par défaut lors de nouveaux téléphones et boîtes vocales sont créées. La liste des zones disponibles est directement pris à partir du fichier voicemail.conf. Par défaut est l'Est. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Agents Appels Réinitialiser -</B> Ce paramètre définit si l'utilisateur connecté et les agents actifs des appels téléphoniques des dossiers doivent être remis à zéro à la fin de la journée minuterie. Par défaut est 1 pour activé. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -5888,6 +8110,11 @@ if ($ADD==99999) <BR> <B>Sounds Web Directory -</B> Cette auto-générés nom du répertoire est créé au hasard par le système comme étant le lieu que le magasin audio seront conservés. Tous les fichiers audio se trouver dans ce répertoire. + <BR> + <A NAME="settings-admin_web_directory"> + <BR> + <B>Annuaire Web Admin -</B> Il s'agit du répertoire que votre contenu web administation, comme admin.php, sont po par défaut est Vicidial. Pour déterminer votre répertoire web d'administration, il est tout ce qui est entre le nom de domaine et le admin.php dans l'URL de cette page, sans les barres obliques de début et de fin. + <BR> <A NAME="settings-active_voicemail_server"> <BR> @@ -5911,7 +8138,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Permettant de personnaliser le plan d-appel Entrées -</B> Cette option vous permet de saisir des lignes sur mesure plan de numérotation dans CALL Menus. Par défaut est 0 pour inactif. + <B>Permettant de personnaliser le plan d-appel Entrées -</B> Cette option vous permet d'entrer des lignes personnalisées plan de numérotation dans les menus d'appels, serveurs et les paramètres système. Par défaut est 0 pour inactif. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>Limite Groupement PLLB -</B> Connexion Charge Téléphone Groupement Limite d'équilibrage. Si Groupement PLLB est réglé sur CASCADE au niveau de la campagne, alors ce paramètre détermine le nombre d'agents acceptable sur chaque serveur dans toutes les campagnes. Par défaut est 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Générer les extensions de téléphone de la Croix-Server -</B> Cette option si elle est définie à 1, générer des entrées pour chaque plan de numérotation de téléphone sur un système multi-serveur. Par défaut est 0 pour inactif. <BR> <A NAME="settings-user_territories_active"> @@ -5928,11 +8165,142 @@ if ($ADD==99999) <BR> <B>Activer TTS Intégration -</B> Ce paramètre vous permet d-activer l-intégration Text To Speech avec Cepstral. Ce n-est actuellement disponible pour les campagnes Enquête sortants type. Par défaut est 0 pour les handicapés. + <BR> + <A NAME="settings-callcard_enabled"> + <BR> + <B>Activer CallCard -</B> Ce paramètre permet les fonctions CallCard avec Vicidial pour permettre aux appelants d'utiliser les numéros de broches et card_ids qui ont un solde de minutes et les soldes peuvent avoir temps de conversation agent sur les appels des clients vers des groupes déduits. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="settings-custom_fields_enabled"> + <BR> + <B>Activer les champs de liste personnalisés -</B> Ce paramètre permet la liste personnalisée fonction des champs qui permet de champs de données personnalisés à définir dans l'interface Web d'administration sur une base par liste et alors ces champs disponibles dans un onglet formulaire à l'agent dans l'interface web agent. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Permettre des appels de test de la campagne -</B> Ce paramètre permet la possibilité d'entrer un code de téléphone et numéro de téléphone dans les champs au bas de l'écran Détail de la campagne et placer un appel téléphonique à ce numéro comme s'il s'agissait d'une avance en cours d'auto-composé dans le système. Le numéro de téléphone sera stocké en tant que nouveau chef de file dans la liste ID cadran liste manuelle. La campagne doit être activé pour que cette fonctionnalité soit activée, et il est recommandé que les listes affectés à la campagne tous être mis à l'état inactif. Le préfixe de numérotation, délai d'attente de numérotation et toutes les fonctions de numérotation autres connexes, à l'exception de la DNC et des options d'achat de temps, aura une incidence sur la numérotation du nombre d'essai. L'appel téléphonique sera placé sur le serveur sélectionné comme serveur de messagerie vocale dans les paramètres du système. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Activer Statistiques liste élargie -</B> Ce réglage permet à deux colonnes supplémentaires pour être affichés sur la plupart des tables de la Liste des dégradation de situation sur la liste et la modification des pages de modification de la campagne. La pénétration est définie comme étant la pour cent des conducteurs qui sont au niveau ou au-dessus de la limite de comptage des appels et la campagne ou le statut est marqué comme complété. Par défaut est 1 pour activé. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Activer le code zonal de la campagne CID -</B> Ce paramètre permet la possibilité de définir spécifiques sortants numéros callerid à être utilisés par campagne. Par défaut est 1 pour activé. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Activer télécommande remplace extension de l'agent -</B> Ce réglage permet d'avoir DID remplacements de vulgarisation pour l'agent à distance acheminés par le biais de demande-groupes. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Contacts Enabled -</B> Ce paramètre permet les contacts dans la sous-section Admin qui permet à un gestionnaire d'ajouter, modifier ou supprimer des contacts dans le système qui peuvent être utilisés dans le cadre d'un transfert personnalisé dans une campagne où un agent peut rechercher des contacts par Prénom Nom ou au bureau numéro, puis sélectionnez l'une des nombreux numéros associés à ce contact. Cette fonction est souvent utilisée par les opérateurs ou dans les fonctions de standard où l'utilisateur aurait besoin de transférer un appel vers un téléphone non-agent. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="settings-first_login_trigger"> + <BR> + <B>Trigger connecter d'abord -</B> Ce paramètre permet la configuration initiale de l'écran du serveur pour être montré à l'administrateur lors de leur première session dans le système. + + <BR> + <A NAME="settings-default_phone_registration_password"> + <BR> + <B>Mot de passe par défaut d'inscription Téléphone -</B> C'est le mot de passe d'enregistrement par défaut utilisée lors de nouveaux téléphones sont ajoutés au système. Par défaut est test. + + <BR> + <A NAME="settings-default_phone_login_password"> + <BR> + <B>Login Mot de passe par défaut Téléphone -</B> C'est le téléphone de connexion par défaut mot de passe utilisé lors web nouveaux téléphones sont ajoutés au système. Par défaut est test. + + <BR> + <A NAME="settings-default_server_password"> + <BR> + <B>Mot de passe par défaut du serveur -</B> C'est le mot de passe par défaut du serveur utilisé lorsque de nouveaux serveurs sont ajoutés au système. Par défaut est test. + + <BR> + <A NAME="settings-slave_db_server"> + <BR> + <B>Database Server esclave -</B> Si vous avez un serveur base de données MySQL esclave puis entrez l'adresse IP locale de ce serveur ici. Cette option n'est actuellement utilisé que par les rapports sélectionnés dans l'option suivante et n'a rien à voir avec la configuration automatique de MySQL réplication maître-esclave. Par défaut est vide pour les handicapés. + + <BR> + <A NAME="settings-reports_use_slave_db"> + <BR> + <B>Rapports d'utiliser DB Slave -</B> Cette option vous permet de sélectionner les rapports que vous souhaitez utiliser la base de données ont esclave MySQL tel que défini dans l'option ci-dessus au lieu de la base de données master que votre système en direct Vicidial est exécuté. Vous devez mettre en place la réplication MySQL esclave avant que vous pouvez activer cette option. Par défaut est vide pour les handicapés. + + <BR> + <A NAME="settings-default_field_labels"> + <BR> + <B>Les étiquettes de champs par défaut -</B> Ces 19 champs vous permettent de définir le nom tel qu'il apparaîtra dans l'interface agent de Vicidial ainsi que la page de modification administrative plomb. Par défaut est vide, ce qui va utiliser les valeurs par défaut codées en dur dans l'interface agent de. Vous pouvez également définir une étiquette à --- --- CACHER pour cacher l'étiquette et le champ. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Masquer Label dans des journaux d'appels -</B> Si une étiquette est fixée à --- CACHER --- puis les journaux d'appels d'agents, si elle est activée sur la campagne, seront toujours visibles sur le terrain et des données à moins que cette option est activée par défaut est à Y. N. + <BR> <A NAME="settings-qc_features_active"> <BR> <B>Caractéristiques QC Active - </B> Cette option vous permet d'activer ou désactiver le contrôle de la qualité ou QC fonctionnalités. La valeur par défaut est 0 pour les inactifs. + <BR> + <A NAME="settings-default_webphone"> + <BR> + <B>Webphone par défaut -</B> Si définie à 1, cette option fera tous les nouveaux téléphones ont créés Définir en tant que jeu Webphone à défaut Y. est égal à 0. + + <BR> + <A NAME="settings-webphone_systemkey"> + <BR> + <B>Key System Webphone -</B> Si votre système ou votre fournisseur l'exige, c'est là la clé du système pour le webphone doit être inscrit po par défaut est vide. + + <BR> + <A NAME="settings-default_codecs"> + <BR> + <B>Codecs par défaut -</B> Vous pouvez définir une liste délimitée par des virgules des codecs d'être défini comme les codecs par défaut pour tous les systèmes. Options pour les codecs comprennent ulaw, alaw, gsm, g729, speex, G722, G723, G726, ILBC, ... Par défaut est vide. + + <BR> + <A NAME="settings-custom_dialplan_entry"> + <BR> + <B>Entrée personnalisée Dialplan -</B> Ce champ vous permet d'entrer dans tous les éléments plan de numérotation que vous souhaitez pour l'ensemble des serveurs Asterisk, les lignes seront ajoutées au contexte par défaut. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Recharger Dialplan Sur les serveurs -</B> Cette option vous permet de forcer un rechargement de la dialplan sur tous les serveurs Asterisk dans le cluster. Si vous avez fait des changements dans l'entrée personnalisé Dialplan ci-dessus vous devez définir cette valeur à 1 et se soumettre à ces changements ont entrera en vigueur sur les serveurs. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Non-Réponse Connexion -</B> Cette option vous connecter les appels à composition automatique qui ne sont pas répondu à une table séparée. Par défaut est N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>DID journal de l'Agent -</B> Cette option enregistre l'arrivée des appels DID long avec un en-groupe et l'ID utilisateur, le cas échéant, à une table séparée. Par défaut est N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt-Server Log DB -</B> C'est le serveur de log alternatif base de données. Cette option est facultative, et permet à certains journaux soient écrits à une base de données distincte. Par défaut est vide. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Alt-Log tableaux -</B> Ce sont les tableaux qui sont disponibles pour la connexion sur le serveur de base de données journal alternatif. Par défaut est vide. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>IP par défaut du serveur externe -</B> Si définie à 1, cette option fera tous les nouveaux téléphones ont créés Utilisez IP du serveur externe mis à Y. par défaut est 0. + + <BR> + <A NAME="settings-qc_features_active"> + <BR> + <B>URL Webphone -</B> C'est l'URL de la webphone qui sera utilisé avec ce système si elle est activée dans le dossier des téléphones qui est un agent à l'aide. Par défaut est vide. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -5973,6 +8341,31 @@ if ($ADD==99999) <BR> <B>QueueMetrics EnterQueue Prepend -<\/B> Ce champ est utilisé pour autorisé à ajouter un des champs des données de vicidial_list devant le numéro de téléphone du client pour personnaliser les rapports QueueMetrics. La valeur par défaut est NONE pour ne pas peupler n'importe quoi. + <BR> + <A NAME="settings-queuemetrics_loginout"> + <BR> + <B>QueueMetrics connecter-Out -</B> Cette option affecte la manière dont Vicidial va enregistrer les connexions et déconnexions d'un agent dans le queue_log. Par défaut est la norme à utiliser la norme AGENTLOGIN AGENTLOGOFF, CALLBACK utilisera AGENTCALLBACKLOGIN et AGENTCALLBACKLOGOFF que QM va analyser différemment, AUCUN ne sera pas journaliser toutes les connexions et déconnexions dans queue_log. + + <BR> + <A NAME="settings-queuemetrics_callstatus"> + <BR> + <B>QueueMetrics CallStatus -</B> Cette option si elle est définie à 0 ne sera pas mis dans l'entrée en CALLSTATUS queue_log quand un agent de dispositions d'un appel. Par défaut est 1 pour activé. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics addMember Enabled -</B> Cette option si elle est définie à 1 générera ADDMEMBER2 et les entrées dans removeMember queue_log. Par défaut est 0 pour les handicapés. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>Code de QueueMetrics Pause Dispo -</B> Cette option, si peuplée, vous permet de définir si un code de pause dispo est entré en queue_log quand un agent est en état de dispo. Par défaut est vide pour les handicapés. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>Téléphone QueueMetrics Environnement Téléphone Append -</B> Cette option, si elle est activée, va ajouter le login de téléphone d'agent à l'enregistrement données4 dans la table du journal file d'attente si le domaine de l'environnement de la campagne est peuplée Téléphone. Par défaut est 0 pour les handicapés. + <BR> <A NAME="settings-enable_vtiger_integration"> <BR> @@ -6009,7 +8402,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUSES TABLE</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Par l'utilisation des statuts de système, vous pouvez avoir desstatuts qui existent pour la campagne et le dans-groupe. Le statutdoit être 1-6 caractères de longueur, la description doit être 2-30caractères de longueur et sélectionnable définit si elle apparaîtdans VICIDIAL comme disposition d'agent. Human_answered le champ estemployé en calculant le pourcentage de baisse, ou le taux d'abandon.L'arrangement human_answered à Y emploiera ce statut en comptant lesappels humain-répondus. L'option de catégorie vous permet de grouperplusieurs statuts dans un catogy qui peut être employé pourl'analyse statistique. Il ya également 5 autres paramètres qui définiront le type de statut: vente, DNC, contact client, pas intéressé, impossible.</B> + <B>Par l'utilisation des statuts de système, vous pouvez avoir desstatuts qui existent pour la campagne et le dans-groupe. Le statutdoit être 1-6 caractères de longueur, la description doit être 2-30caractères de longueur et sélectionnable définit si elle apparaîtdans VICIDIAL comme disposition d'agent. Human_answered le champ estemployé en calculant le pourcentage de baisse, ou le taux d'abandon.L'arrangement human_answered à Y emploiera ce statut en comptant lesappels humain-répondus. L'option de catégorie vous permet de grouperplusieurs statuts dans un catogy qui peut être employé pourl'analyse statistique. Il ya également 5 autres paramètres qui définiront le type de statut: vente, DNC, contact client, pas intéressé, impossible, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS TABLE</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a par campagne basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Label ID écran -</B> Ce champ doit être d'au moins 2 caractères et pas plus de 20 caractères de long, sans espaces ni de caractères spéciaux. Il s'agit du N qui sera utilisé pour identifier l'étiquette écran à travers le système. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Nom du Label écran -</B> Il s'agit du nom descriptif de l'entrée étiquette écran. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Groupe d'utilisateurs d'administration -</B> C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Masquer Label dans des journaux d'appels -</B> Si une étiquette est fixée à --- CACHER --- puis les journaux d'appels d'agents, si elle est activée sur la campagne, seront toujours visibles sur le terrain et des données à moins que cette option est activée par défaut est à Y. N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Les étiquettes de champs par défaut -</B> Ces 19 champs vous permettent de définir le nom tel qu'il apparaîtra dans l'interface agent de Vicidial ainsi que la page de modification administrative plomb. Par défaut est vide, ce qui va utiliser les valeurs par défaut codées en dur dans l'interface agent de. Vous pouvez également définir une étiquette à --- --- CACHER pour cacher l'étiquette et le champ. @@ -6021,6 +8447,58 @@ if ($ADD==99999) <B>Par l'utilisation des catégories de statut de système, vous pouvezgrouper ensemble des statuts pour tenir compte de l'analysestatistique sur un groupe de statuts. L'identification de catégoriedoit être 2-20 caractères de longueur sans les espaces, le nom doitêtre 2-50 caractères de longueur, la description est facultative etl'affichage de TimeonVDAD définit si ce statut sera un de jusqu'à 4statuts qui peuvent être calculés et montrés le temps sur lerapport de temps réel de VDAD.</B> La vente et la catégorie Dead Lead Catégorie sont tous deux utilisés par le système de liste de suggestions lors de l'analyse de la liste des statistiques. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Créer un nouveau modèle - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Supprimertemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "Supprimer le modèle". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>ID modèle -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Nom du modèle -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>description du modèle -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>ID de la liste -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Colonnes highlighted in blue are standard columns from the vicidial_list table. Colonnes highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "SOUMETTRE TEMPLATE" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Maximum du système des rapports statistiques</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Ces statistiques sont mises en cache totaux qui sont stockés sur chaque journée de en temps réel par le biais des processus back-end. Pour les appels entrants, les appels totaux par en-groupe sont calculés pour chaque appel qui pénètre dans le processus qui calcule. Pour les chefs d'accusation ensemble du système, les totaux sont générés à partir des entrées de journal ainsi que d'autres totaux en groupe et de la campagne. Ces totaux peuvent ne pas s'additionner à cause des paramètres que vous avez dans votre système ainsi que lorsque l'appel est raccroché. + + <?php if ($SSqc_features_active > 0) { @@ -6030,7 +8508,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL QC ÉTAT DES CODES</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>Le contrôle de la qualité au sein du système-QC VICIDIAL a son propre ensemble de codes distincts de ceux dans le traitement des appels de fonctions VICIDIAL. QC statuse codes doit être comprise entre 2 et 8 caractères et ne contiennent pas de caractères spéciaux, comme un espace ou du côlon. Le code de statut QC description doit être comprise entre 2 et 30 caractères.</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -6070,12 +8548,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -6085,7 +8564,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -6110,13 +8589,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Montrer le nombre de fiches désactivées</B> -<BR><BR>\n"; echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n"; - echo "<B>LISTES:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>STATUSES:</B> $dial_statuses<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -6140,6 +8621,8 @@ 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'; @@ -6198,13 +8681,22 @@ if ($ADD==7111111) $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'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -6214,6 +8706,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6272,10 +8766,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6335,6 +8832,15 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -6355,8 +8861,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_rafraîchir > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
    "; + } ###################################################################################################### @@ -6398,34 +8906,25 @@ if ($ADD=="1") } else { - echo "Numéro d'utilisateur : $NWB#vicidial_users-user$NWE\n"; + echo "Numéro d'utilisateur : $NWB#vicidial_users-user$NWE\n"; } - echo "Mot de passe:$NWB#vicidial_users-pass$NWE\n"; + + echo "Mot de passe:$NWB#vicidial_users-pass$NWE     Force: \n"; + echo "Nom complet: $NWB#vicidial_users-full_name$NWE\n"; echo "Niveau de l'utilisateur: $NWB#vicidial_users-user_level$NWE\n"; echo "Groupe utilisateur: $NWB#vicidial_users-phone_login$NWE\n"; echo "Mot de passe du téléphone: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -6472,9 +8971,11 @@ if ($ADD=="1A") } else { - echo "Numéro d'utilisateur : $NWB#vicidial_users-user$NWE\n"; + echo "Numéro d'utilisateur : $NWB#vicidial_users-user$NWE\n"; } - echo "Mot de passe:$NWB#vicidial_users-pass$NWE\n"; + + echo "Mot de passe:$NWB#vicidial_users-pass$NWE     Force: \n"; + echo "Nom complet: $NWB#vicidial_users-full_name$NWE\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6482,7 +8983,7 @@ if ($ADD=="1A") echo "Source Utilisateur: \n"; + echo "\n"; echo "
    \n"; if ($voi_count > 0) { @@ -6542,15 +9044,18 @@ if ($ADD==11) } 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"; @@ -6619,10 +9124,12 @@ if ($ADD==11) echo "$scripts_list"; echo "$NWB#vicidial_campaigns-campaign_script$NWE\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
    Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
    Description de la campagne: $NWB#vicidial_campaigns-campaign_description$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_campaigns-user_group$NWE
    Actif: $NWB#vicidial_campaigns-active$NWE
    Extension du parc: $NWB#vicidial_campaigns-park_ext$NWE
    Nom du fichier de mise en attente: $NWB#vicidial_campaigns-park_file_name$NWE
    Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
    Parc de la Musique-sur-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
    Autoriser les closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
    Niveau de l'appel automatique:
    Niveau minimum Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Niveau de l'appel automatique: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
    Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
    Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
    Heure d'appel locale: $NWB#vicidial_campaigns-local_call_time$NWE
    Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
    Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
    \n"; } @@ -6671,7 +9178,7 @@ if ($ADD==12) echo "Campagne De Source :$NWB#vicidial_lists-list_description$NWE\n"; echo "Campagne: \n"; } echo "\n"; - echo "\n"; + echo "\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) + { + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; 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_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_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 ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE PAS SUPPRIMER - Ce numéro de téléphone n'est pas dans la liste Groupe Téléphone filtre: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE SUPPRIMÉ: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE PAS AJOUTÉE - Ce numéro de téléphone est déjà dans la liste Groupe Téléphone filtre: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE AJOUTÉE: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
    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 Groupe:
    Numéros de téléphone:

    (un numéro de téléphone par ligne seulement)
    $NWB#vicidial_list-dnc$NWE
    Ajouter ou Supprimer:
    \n"; + + if ($LOGuser_level >= 9) + { + echo "
    Download numbers in this list to a file:
    \n"; + echo "\n"; + echo "
    \n"; + } + } @@ -6953,17 +9576,23 @@ if ($ADD==1111) echo "
    Nom du groupe: $NWB#vicidial_inbound_groups-group_name$NWE
    Couleur du groupe: $NWB#vicidial_inbound_groups-group_color$NWE
    Actif: $NWB#vicidial_inbound_groups-active$NWE
    Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_inbound_groups-user_group$NWE
    Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Boîte vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Affichage de l'enseigne: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    \n"; } @@ -7012,7 +9641,7 @@ if ($ADD==1211) echo "Source ID du groupe: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; echo "A Description:$NWB#vicidial_inbound_dids-did_description$NWE\n"; + echo "Groupe d'utilisateurs d'administration: $NWB#vicidial_inbound_dids-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7084,7 +9717,7 @@ if ($ADD==1411) echo "Source DID: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Nom du menu: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Groupe d'utilisateurs d'administration: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -7192,7 +9829,7 @@ if ($ADD==1611) echo "Menu Source: \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Filtre ID Groupe Téléphone: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Filtre Nom du groupe Téléphone: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filtre Description du groupe Téléphone: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7232,7 +9901,7 @@ if ($ADD==11111) echo "
    AJOUTER UN NOUVEL AGENT DISTANT
    \n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7512,6 +10245,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7531,7 +10268,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
    Début des ID utilisateurs: (nombres seulement, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Début des ID utilisateurs: (nombres seulement, incremented, doit être un utilisateur existant Vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Nombre de lignes: (nombres seulement)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP du serveur: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + echo "
    Ajouter une entrée du groupe d'extension\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Groupe d'extension: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Extension: (nombres seulement)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Groupes Campagnes: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -7339,12 +10048,19 @@ if ($ADD==1111111) echo "
    Nom du script: (titre du script)$NWB#vicidial_scripts-script_name$NWE
    Commentaires du script: $NWB#vicidial_scripts-script_comments$NWE
    Actif: $NWB#vicidial_scripts-active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_scripts-user_group$NWE
    Texte du script: "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -7452,6 +10177,10 @@ if ($ADD==11111111) } echo "
    Nom du filtre: (courte description du filtre)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Commentaires du filtre: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_lead_filters-user_group$NWE
    Filtre Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -7481,6 +10210,10 @@ if ($ADD==111111111) echo "
    Identifiant de la période d'appels: (pas d'espace ni de ponctuation)$NWB#vicidial_call_times-call_time_id$NWE
    Nom de la période d'appels: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
    Commentaires de la période d'appels: $NWB#vicidial_call_times-call_time_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_call_times-user_group$NWE
    Les options pour l'heure et le jour apparaitront une fois que vous aurez créé la période d'appels
    State Call Time State: (pas d'espace ni de ponctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
    Nom de la période d'appels d'état: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
    Commentaires de la période d'appels d'état: $NWB#vicidial_call_times-call_time_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_call_times-user_group$NWE
    Les options pour l'heure et le jour apparaitront une fois que vous aurez créé la période d'appels
    \n"; echo ""; @@ -7541,6 +10278,10 @@ if ($ADD==131111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -7554,6 +10295,7 @@ if ($ADD==131111111) echo "Vendredi
    \n"; echo "Samedi
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Shift ID: (pas d'espace ni de ponctuation)$NWB#vicidial_shifts-shift_id$NWE
    Shift Nom: (brève description de l'évolution)$NWB#vicidial_shifts-shift_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_shifts-user_group$NWE
    Start Time Shift:\n"; echo "   End Time Shift:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Option Report: $NWB#vicidial_shifts-report_option$NWE
    \n"; } @@ -7571,7 +10313,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -7594,32 +10336,36 @@ if ($ADD==11111111111) echo "
    \n"; if ($voi_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"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\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 du téléphone: Auto-Generated $NWB#phones-extension$NWE
    Téléphone Extension:Auto-Generated $NWB#phones-extension$NWE
    Extension du téléphone: $NWB#phones-extension$NWE
    Téléphone Extension:$NWB#phones-extension$NWE
    Nuémro dans le dial plan: (chiffres seulement)$NWB#phones-dialplan_number$NWE
    Boîte vocale: (chiffres seulement)$NWB#phones-voicemail_id$NWE
    CallerID sortant: (chiffres seulement)$NWB#phones-outbound_cid$NWE
    Adresse IP du téléphone: (optional)$NWB#phones-phone_ip$NWE
    Adresse IP de l'ordinateur: (optional)$NWB#phones-computer_ip$NWE
    IP du serveur:
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    IP du serveur: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Mot de passe:$NWB#phones-pass$NWE
    Écran de connexion Agent: $NWB#phones-login$NWE
    Login Mot de passe: $NWB#phones-pass$NWE
    Inscription Mot de passe: $NWB#phones-conf_secret$NWE     Force:
    Etat: $NWB#phones-status$NWE
    Compte actif: $NWB#phones-active$NWE
    Type de téléphone: $NWB#phones-phone_type$NWE
    Nom complet: $NWB#phones-fullname$NWE
    Compagnie: $NWB#phones-company$NWE
    Image: $NWB#phones-picture$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Protocole client: $NWB#phones-protocol$NWE
    GMT local: (Ne PAS ajuster pour DST)$NWB#phones-local_gmt$NWE
    GMT local: (Ne PAS ajuster pour DST)$NWB#phones-local_gmt$NWE
    \n"; } @@ -7637,7 +10383,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7649,6 +10395,10 @@ if ($ADD==12111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -7668,7 +10418,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
    Alias ID:$NWB#phones-alias_id$NWE
    Alias Nom: $NWB#phones-alias_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    Téléphone Connexions List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7683,6 +10433,10 @@ if ($ADD==13111111111) echo "
    Nombre CallerID: $NWB#phones-caller_id_number$NWE
    CallerID Nom: $NWB#phones-caller_id_name$NWE
    Actif:
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    \n"; @@ -7714,6 +10468,10 @@ if ($ADD==111111111111) echo "
    Adresse IP du serveur: $NWB#servers-server_ip$NWE
    Actif: $NWB#servers-active$NWE
    Version d'Asterisk: $NWB#servers-asterisk_version$NWE
    Groupe d'utilisateurs d'administration: $NWB#servers-user_group$NWE
    \n"; } @@ -7740,8 +10498,12 @@ if ($ADD==131111111111) echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Template ID: $NWB#vicidial_conf_templates-template_id$NWE
    ID modèle: $NWB#vicidial_conf_templates-template_id$NWE
    Nom du modèle: $NWB#vicidial_conf_templates-template_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_conf_templates-user_group$NWE
    Template Sommaire: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -7760,7 +10522,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; echo "\n"; @@ -7824,13 +10576,63 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) + { + echo "
    \n"; echo ""; @@ -7772,10 +10534,14 @@ if ($ADD==141111111111) echo "
    Carrier ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Nom du transporteur: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Description: $NWB#vicidial_server_carriers-carrier_description$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_server_carriers-user_group$NWE
    Inscription à cordes: $NWB#vicidial_server_carriers-registration_string$NWE
    Template ID:
    ID modèle:
    Dialplan Entrée: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP du serveur: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; + echo ""; + + echo "
    Ajouter le transporteur COPIE\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
    Carrier ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Nom du transporteur: $NWB#vicidial_server_carriers-carrier_name$NWE
    IP du serveur: $NWB#vicidial_server_carriers-server_ip$NWE
    Transporteur de source: $NWB#vicidial_server_carriers-carrier_id$NWE
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### if ($ADD==151111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7842,6 +10644,10 @@ if ($ADD==151111111111) echo "
    TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
    TTS Nom: $NWB#vicidial_tts_prompts-tts_name$NWE
    Actif:
    Groupe d'utilisateurs d'administration: $NWB#vicidial_tts_prompts-user_group$NWE
    \n"; @@ -7860,7 +10666,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -7872,6 +10678,10 @@ if ($ADD==161111111111) echo "
    Musique en attente d-identification: $NWB#vicidial_music_on_hold-moh_id$NWE
    Musique d-attente Nom: $NWB#vicidial_music_on_hold-moh_name$NWE
    Random Order:
    Groupe d'utilisateurs d'administration: $NWB#vicidial_music_on_hold-user_group$NWE
    \n"; @@ -7890,7 +10700,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "
    \n"; echo ""; @@ -7899,11 +10709,86 @@ if ($ADD==171111111111) echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    Boîte vocale ID: $NWB#vicidial_voicemail-voicemail_id$NWE
    ID vocale: $NWB#vicidial_voicemail-voicemail_id$NWE
    Pass: $NWB#vicidial_voicemail-pass$NWE
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Actif:
    Email:$NWB#vicidial_voicemail-email$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_voicemail-user_group$NWE
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette 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 "
    Ajouter une étiquette ECRAN NEW\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    Label ID écran: $NWB#vicidial_screen_labels-label_id$NWE
    Nom du Label écran: $NWB#vicidial_screen_labels-label_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_screen_labels-user_group$NWE
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette 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 "
    Ajouter une étiquette ECRAN NEW\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Nom: $NWB#contact_information$NWE
    Prénom: $NWB#contact_information$NWE
    Nombre Bureau: $NWB#contact_information$NWE
    Nombre de cellules: $NWB#contact_information$NWE
    Nombre d'autres 1: $NWB#contact_information$NWE
    Nombre d'autres 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Groupe: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; @@ -7932,9 +10817,7 @@ if ($ADD==1111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Numéro de la conférence: (chiffres seulement)$NWB#conferences-conf_exten$NWE
    IP du serveur: $NWB#conferences-server_ip$NWE
    \n"; @@ -7963,9 +10846,7 @@ if ($ADD==11111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Numéro de la conférence: (chiffres seulement)$NWB#conferences-conf_exten$NWE
    IP du serveur: $NWB#conferences-server_ip$NWE
    \n"; @@ -8018,10 +10899,10 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
    UTILISATEUR NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    le nom et le mot de passe doivent contenir au moins 2 caractères\n"; echo "
    Vous devez sélectionner un groupe d-utilisateurs\n"; } @@ -8118,6 +10999,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8205,7 +11096,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8296,10 +11187,10 @@ if ($ADD=="2A") {echo "
    UTILISATEUR NON AJOUTE - il y a déjà un utilisateur dans le système avec ce numéro d'utilisateur\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) { echo "
    UTILISATEUR NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    le nom et le mot de passe doivent contenir au moins 2 caractères\n"; echo "\n"; } @@ -8342,7 +11233,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8400,6 +11291,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8487,7 +11388,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -8600,12 +11501,30 @@ if ($ADD==21) { echo "
    CAMPAGNE AJOUTEE: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8664,13 +11583,31 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_rafraîchir,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) 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_rafraîchir,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -8682,6 +11619,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8726,7 +11669,7 @@ if ($ADD==22) { echo "
    STATUT DE LA CAMPAGNE AJOUTE: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -8967,6 +11910,176 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PRESET PAS AJOUTÉE - il ya déjà une entrée pour cette campagne avec ce preset\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
    PRESET PAS AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Indicatif régional CID PAS AJOUTÉE - il ya déjà une entrée pour cette campagne avec ce CID
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    Indicatif régional CID PAS AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \n"; + } + else + { + echo "
    Indicatif régional CID AJOUTÉE: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    Indicatif régional CID PAS SUPPRIMER - cette entrée n'existe pas
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    Indicatif régional CID PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \n"; + } + else + { + echo "
    Indicatif régional CID Vues: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 "
    Indicatif régional CID NOT MODIFIED - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \n"; + } + else + { + echo "Indicatif régional CID mise à jour: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9013,7 +12126,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTES', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9066,19 +12179,22 @@ if ($ADD==2111) } 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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GROUPE AJOUTE: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD ENTRANT GROUP', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9131,16 +12247,22 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GROUPE AJOUTE: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='COPY', record_id='$group_id', event_code='ADMIN GROUPE D'ARRIVÉE DE COPY', event_sql=\"$SQL_log\", event_notes='';"; + $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='GROUPE ADMINE D'ARRIVÉE DE COPY', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -9178,7 +12300,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9223,7 +12345,7 @@ if ($ADD==2411) } 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) 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 from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9271,31 +12393,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    CALL MENU SANS ADDITION - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    CALL MENU SANS ADDITION - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + 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 SANS ADDITION - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Appel menu ID doit être comprise entre 2 et 50 caractères de long et ne contiennent aucune ' '.\n"; + echo "
    ID Menu Appel ne pouvez pas utiliser des mots réservés: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
    CALL MENU SANS ADDITION - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Appel menu ID doit être comprise entre 2 et 50 caractères de long et ne contiennent aucune ' '.\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_query($stmt, $link); - echo "
    CALL MENU AJOUTEE: $menu_id $menu_name\n"; + echo "
    CALL MENU AJOUTEE: $menu_id $menu_name\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9324,34 +12460,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    CALL MENU SANS ADDITION - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    CALL MENU SANS ADDITION - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + 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 SANS ADDITION - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Appel menu ID doit être comprise entre 2 et 50 caractères de long et ne contiennent aucune ' '.\n"; + echo "
    ID Menu Appel ne pouvez pas utiliser des mots réservés: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
    CALL MENU SANS ADDITION - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Appel menu ID doit être comprise entre 2 et 50 caractères de long et ne contiennent aucune ' '.\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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
    CALL MENU AJOUTEE: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    TÉLÉPHONE filtre de groupe PAS AJOUTÉE - il ya déjà un groupe TÉLÉPHONE FILTRE dans le système avec cet ID\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
    PHONE FILTER GROUPE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    ID Group Téléphone filtre doit être comprise entre 2 et 20 caractères de longueur et ne contiennent pas ' '.\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_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
    CALL MENU AJOUTEE: $menu_id - $menu_name\n"; + echo "
    TÉLÉPHONE filtre de groupe AJOUTÉE: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + $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 AJOUTER LE FILTRE PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9369,30 +12558,94 @@ if ($ADD==21111) {echo "
    AGENT DISTANT NON AJOUTE - il y a déjà un agent distant avec cet identifiant\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    AGENTS DISTANTS NOT ADDED - vous devez utiliser un utilisateur valide que l'user_start pour les agents à distance\n";} + else { - echo "
    AGENT DISTANT NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    AGENTS DISTANTS NOT ADDED - votre nombre de chevauchements de lignes avec un autre agent à distance\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    AGENT DISTANT NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
    AGENT DISTANT AJOUTE: $user_start\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    ENTRÉE DU GROUPE D'EXTENSION PAS AJOUTÉE - il ya déjà une entrée de groupe d'extension avec ces valeurs\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
    ENTRÉE DU GROUPE D'EXTENSION PAS AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
    AGENT DISTANT AJOUTE: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
    ENTRÉE DU GROUPE extension ajoutée: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9428,9 +12681,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; + $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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
    GROUPE D'UTILISATEURS AJOUTE: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -9556,7 +12834,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
    SCRIPT AJOUTE: $script_id\n"; @@ -9609,7 +12887,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9649,7 +12927,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9689,7 +12967,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9753,7 +13031,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -9818,7 +13096,7 @@ if ($ADD==21111111111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    PHONE NOT ADDED - there is already a Boîte vocale ID in the system with this ID\n";} + {echo "
    PHONE NOT ADDED - there is already a ID vocale 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)) @@ -9830,7 +13108,7 @@ if ($ADD==21111111111) { echo "
    TELEPHONE AJOUTE\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9879,7 +13157,7 @@ if ($ADD==22111111111) { echo "
    PHONE ALIAS AJOUTÉS\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9920,7 +13198,7 @@ if ($ADD==23111111111) { echo "
    GROUPE ALIAS AJOUTÉS\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -9957,7 +13235,7 @@ if ($ADD==211111111111) { echo "
    SERVEUR AJOUTE\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10054,7 +13332,7 @@ if ($ADD==231111111111) { echo "
    CONF TEMPLATE AJOUTÉS\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10090,7 +13368,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10109,6 +13387,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    CARRIER pas ajouté - il ya déjà un transporteur dans le système avec cette ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
    CARRIER pas ajouté - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
    CARRIER COPIE AJOUTÉE\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_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10129,7 +13446,7 @@ if ($ADD==251111111111) { echo "
    TTS Entry Ajoutée\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10165,7 +13482,7 @@ if ($ADD==261111111111) { echo "
    MUSIC ON HOLD Entry Ajoutée\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10208,7 +13525,7 @@ if ($ADD==271111111111) { echo "
    La boîte vocale AJOUTEE\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -10233,6 +13550,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    LABEL ECRAN PAS AJOUTÉE - il ya déjà une étiquette dans le système avec cet ID\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
    LABEL ECRAN PAS AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
    LABEL supplémentaire de l'écran\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Contact non AJOUTÉE - il ya déjà un contact dans le système avec ce nom et le numéro\n";} + else + { + if (strlen($last_name) < 2) + {echo "
    Contact non AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
    Contact ajouté\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -10296,7 +13693,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -10320,7 +13717,7 @@ if ($ADD==221111111111111) { echo "
    STATUT DE SYSTÈME SUPPLÉMENTAIRE: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10461,11 +13858,11 @@ if ($ADD=="4A") } echo "
    UTILISATEUR MODIFIE - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -10513,6 +13910,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10600,7 +14007,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10694,7 +14101,7 @@ if ($ADD=="4B") } echo "
    UTILISATEUR MODIFIE - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10746,6 +14153,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10833,7 +14250,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10921,7 +14338,7 @@ if ($ADD==4) { echo "
    UTILISATEUR MODIFIE: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10973,6 +14390,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11060,7 +14487,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -11141,6 +14568,7 @@ if ($ADD==41) 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'; @@ -11169,6 +14597,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -11183,32 +14613,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
    LISTES D'ACTIFS MODIFIES"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Testez des appels sortants';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
    "; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
    LISTES D'ACTIFS MODIFIES"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -11220,77 +14739,124 @@ if ($ADD==41) } else { - echo "
    CAMPAGNE MODIFIEE: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'ENTRANT_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
    CAMPAIGN NOT MODIFIED - S'il vous plaît attendre la page entière à se charger avant de soumettre le formulaire\n"; } else { - if ($dial_level_override > 0) + echo "
    CAMPAGNE MODIFIEE: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
    REINITIALISATION DU DISTRIBUTEUR DE FICHES DE LA CAMPAGNE\n"; - echo "
    - Attendre 1 minute avant l'appel du numéro suivant\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_rafraîchir='$campaign_stats_rafraîchir',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
    REINITIALISATION DU DISTRIBUTEUR DE FICHES DE LA CAMPAGNE\n"; + echo "
    - Attendre 1 minute avant l'appel du numéro suivant\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -11343,7 +14909,7 @@ if ($ADD==42) { echo "
    LE STATUT FAIT SUR COMMANDE DE CAMPAGNE A MODIFIÉ: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11450,6 +15016,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -11472,7 +15040,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11521,7 +15089,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -11712,7 +15280,7 @@ if ($ADD=='40A') { echo "
    SONDAGE SETTINGS mise à jour: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11798,7 +15366,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -11832,7 +15400,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -11906,7 +15474,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -11999,56 +15567,128 @@ if ($ADD==49) ###################### -# ADD=411 submit list modifications to the system +# ADD=401 modify campaign preset in the system ###################### -if ($ADD==411) +if ($ADD==401) { - if ($LOGmodify_lists==1) + if ($LOGmodify_campaigns==1) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    LISTE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    le nom de la liste doit contenir au moins 2 caractères\n"; + echo "
    PRESET PAS MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 { - if (strlen($reset_time) < 4) {$reset_time='';} + echo "
    PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; - echo "
    LISTE MODIFIEE: $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' where list_id='$list_id';"; + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTES', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } - if ($reset_list == 'Y') + +###################### +# 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) { - echo "
    REINITIALISATION LIST-CALLED-STATUS\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTES', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
    ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
    LISTE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    le nom de la liste doit contenir au moins 2 caractères\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
    LISTE MODIFIEE: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
    REINITIALISATION LIST-CALLED-STATUS\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
    ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -12067,84 +15707,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
    GROUPE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    le nom et la couleur du groupe doivent contenir au moins 2 caractères\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
    UTILISATEURS NOT MODIFIED - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', 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_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
    GROUPE MODIFIE: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; } } else { - echo "Vous n'avez pas la permission de voir cette page\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
    GROUPE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    le nom et la couleur du groupe doivent contenir au moins 2 caractères\n"; + } + else + { + if ($form_end != 'END') + { + echo "
    GROUP NOT MODIFIED - S'il vous plaît attendre la page entière à se charger avant de soumettre le formulaire\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
    GROUPE MODIFIE: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -12169,7 +15909,7 @@ if ($ADD==4311) { echo "
    DID mise à jour: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12209,12 +15949,12 @@ if ($ADD==4511) { echo "
    CALL MENU mise à jour: $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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -12231,27 +15971,35 @@ if ($ADD==4511) 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["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"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -12292,7 +16040,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -12334,32 +16082,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
    AGENT DISTANT NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\n"; + echo "
    FILTER PHONE GROUPE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Filtre Nom du groupe Téléphone and ID 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' where remote_agent_id='$remote_agent_id';"; + $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_query($stmt, $link); - echo "
    AGENTS DISTANTS MODIFIES\n"; + echo "
    GROUPE DE TÉLÉPHONE filtre modifié\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12369,10 +16117,108 @@ if ($ADD==41111) echo "Vous n'avez pas la permission de voir cette 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    AGENTS DISTANTS NOT MODIFIED - vous devez utiliser un utilisateur valide que l'user_start pour les agents à distance\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    AGENTS DISTANTS NOT MODIFIED - votre nombre de chevauchements de lignes avec un autre agent à distance\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    AGENT DISTANT NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    AGENTS DISTANTS MODIFIES\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette 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 "
    ENTRÉE DU GROUPE D'EXTENSION PAS MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + echo "
    ENTRÉE DU GROUPE D'EXTENSION mise à jour\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12390,117 +16236,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Vous n'êtes pas autorisé à modifier votre propre groupe d'utilisateurs\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - - $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' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - echo "
    GROUPE D'UTILISATEURS MODIFIE\n"; + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GROUPE D'UTILISATEURS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "
    GROUPE D'UTILISATEURS MODIFIE\n"; - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GROUPE D'UTILISATEURS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -12532,7 +16413,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
    SCRIPT MODIFIE\n"; @@ -12574,7 +16455,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
    FILTRE MODIFIE\n"; @@ -12630,7 +16511,7 @@ if ($ADD==411111111) $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' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    PERIODE D'APPELS MODIFIEE\n"; @@ -12686,7 +16567,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    PERIODE D'APPELS D'ETAT MODIFIEE\n"; @@ -12715,7 +16596,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -12737,7 +16618,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
    MAJ mise à jour\n"; @@ -12766,14 +16647,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
    TELEPHONE NON MODIFIE - il y a déjà un téléphone dans le système avec cette extension/server\n";} else { @@ -12783,7 +16664,7 @@ if ($ADD==41111111111) { echo "
    TELEPHONE MODIFIE: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_rafraîchir='$enable_fast_rafraîchir', fast_rafraîchir_rate='$fast_rafraîchir_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12814,7 +16695,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12827,7 +16708,7 @@ if ($ADD==42111111111) { echo "
    PHONE ALIAS mise à jour: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12854,7 +16735,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -12867,7 +16748,7 @@ if ($ADD==43111111111) { echo "
    GROUPE ALIAS mise à jour: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12901,14 +16782,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
    SERVEUR NOT MODIFIED - there is already a server in the system with this server_id\n";} else { $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
    SERVEUR NON MODIFIE - il y a déjà un serveur dans le système avec cet ID\n";} else { @@ -12916,7 +16797,7 @@ if ($ADD==411111111111) {echo "
    SERVEUR NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13019,7 +16900,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
    CONF TEMPLATE MODIFIED: $template_id\n"; @@ -13048,7 +16929,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -13056,7 +16937,7 @@ if ($ADD==441111111111) {echo "
    CARRIER PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -13088,7 +16969,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -13096,7 +16977,7 @@ if ($ADD==451111111111) {echo "
    TTS entrée n-est pas à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
    TTS entrée modifiée: $tts_id\n"; @@ -13125,7 +17006,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -13158,7 +17039,7 @@ if ($ADD==461111111111) {echo "
    MUSIC ON HOLD entrée n-est pas à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -13226,7 +17107,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -13234,7 +17115,7 @@ if ($ADD==471111111111) {echo "
    La boîte vocale PAS MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -13265,6 +17146,87 @@ if ($ADD==471111111111) } +###################### +# 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 "
    LABEL écran n'est pas mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + echo "
    LABEL écran modifié: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette 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 non mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $linkALT); + + echo "
    CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN Modifier un contact', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -13278,7 +17240,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    CONFERENCE NON MODIFIEE - il y a déjà une conférence dans le système avec cette extension-serveur\n";} else { @@ -13288,7 +17250,7 @@ if ($ADD==4111111111111) { echo "
    CONFERENCE MODIFIEE: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13315,7 +17277,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    VICIDIAL CONFERENCE NON MODIFIEE - il y a déjà une conférence dans le système avec cette extension-serveur\n";} else { @@ -13325,7 +17287,7 @@ if ($ADD==41111111111111) { echo "
    VICIDIAL CONFERENCE MODIFIEE: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13352,11 +17314,37 @@ if ($ADD==411111111111111) echo "
    REGLAGES DU SYSTEME VICIDIAL MODIFIES\n"; - $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';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_rafraîchir='$admin_modify_rafraîchir',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -13378,7 +17366,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13421,7 +17409,7 @@ if ($ADD==421111111111111) { echo "
    LE STATUT DE SYSTÈME A MODIFIÉ: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13449,7 +17437,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -13672,7 +17660,7 @@ if ($ADD==53) else { echo "
    CONFIRMATION DE L'EFFACEMENT DE VDAC: $campaign_id\n"; - echo "

    Cliquez ici pour effacer les plus vieux enregistrements LIVE dans VDAC pour $campaign_id


    \n"; + echo "

    Cliquez ici pour effacer les plus vieux enregistrements LIVE dans VDAC pour $campaign_id


    \n"; } # go to campaign modification below @@ -13770,6 +17758,28 @@ if ($ADD==5511) $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 "
    GROUPE DE TÉLÉPHONE FILTRE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
    FILTRE CONFIRMATION DE SUPPRESSION DE TÉLÉPHONE DU GROUPE: $filter_phone_group_id\n"; + echo "

    Cliquez ici pour supprimer le groupe TÉLÉPHONE FILTRE $filter_phone_group_id


    \n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13792,6 +17802,28 @@ if ($ADD==51111) $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 "
    ENTRÉE DU GROUPE D'EXTENSION PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    extension_id be at least 1 characters in length\n"; + } + else + { + echo "
    GROUPE D'EXTENSION DE SUPPRESSION D'ENTRÉE DE CONFIRMATION: $extension_id\n"; + echo "

    Cliquez ici pour supprimer l'entrée du groupe d'extension $extension_id


    \n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14025,7 +18057,7 @@ if ($ADD==531111111111) if (strlen($template_id) < 2) { echo "
    CONF TEMPLATE pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Template ID être d'au moins 2 caractères\n"; + echo "
    ID modèle être d'au moins 2 caractères\n"; } else { @@ -14113,7 +18145,7 @@ if ($ADD==571111111111) if (strlen($voicemail_id) < 2) { echo "
    La boîte vocale pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Boîte vocale ID be at least 2 characters in length\n"; + echo "
    ID vocale be at least 2 characters in length\n"; } else { @@ -14124,6 +18156,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
    LABEL ECRAN PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Label ID be at least 2 characters in length\n"; + } + else + { + echo "
    CONFIRMATION DE SUPPRESSION D'ÉCRAN LABEL: $label_id - $label_name\n"; + echo "

    Cliquez ici pour supprimer l'étiquette d'écran $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 PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
    Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
    CONTACT Confirmation de suppression: $contact_id - $first_name - $last_name\n"; + echo "

    Cliquez ici pour supprimercontact $contact_id - $first_name - $last_name


    \n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -14193,27 +18269,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Vous n'êtes pas autorisé à modifier votre propre utilisateur\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    SUPPRESSION DE L'UTILISATEUR CONFIRMEE: $user\n"; - echo "

    \n"; + echo "
    SUPPRESSION DE L'UTILISATEUR CONFIRMEE: $user\n"; + echo "

    \n"; + } } - $ADD='0'; # go to user list } @@ -14232,44 +18315,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + echo "
    ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14307,7 +18399,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -14318,6 +18410,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -14357,7 +18450,7 @@ if ($ADD==62) if ($DB) {echo "\n
    VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -14407,7 +18500,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -14418,55 +18511,139 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; - if ($DB) {echo "
    $stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
    $stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
    $stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
    $stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -14514,7 +18691,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14563,7 +18740,7 @@ if ($ADD==65) { echo "
    RECYCLAGE DES FICHES DE LA CAMPAGNE SUPPRIME: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14594,7 +18771,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14610,12 +18787,12 @@ if ($ADD==66) { echo "
    STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF SUPPRIME: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14657,7 +18834,7 @@ if ($ADD==67) { 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';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14688,7 +18865,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -14704,12 +18881,12 @@ if ($ADD==68) { echo "
    STATUT D'APPEL POUR CETTE CAMPAGNE SUPPRIME: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14731,6 +18908,51 @@ if ($ADD==68) $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 "
    PRESET CAMPAGNE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14746,11 +18968,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
    ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    SUPPRIMER LES FICHES DE LA LISTE DE LA TABLE VICIDIAL_LIST\n"; @@ -14761,7 +18983,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTES', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -14787,7 +19009,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -14799,6 +19021,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -14830,7 +19055,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14863,7 +19088,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -14884,6 +19109,42 @@ if ($ADD==6511) $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 "
    GROUPE DE TÉLÉPHONE FILTRE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    FILTRE DE SUPPRESSION DU GROUPE DE TÉLÉPHONE REMPLI: $filter_phone_group_id\n"; + echo "

    \n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14917,6 +19178,41 @@ if ($ADD==61111) $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 "
    ENTRÉE DU GROUPE D'EXTENSION PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Suppression de la commande EXTENSION groupe a achevé: $extension_id\n"; + echo "

    \n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -14932,21 +19228,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Vous n'êtes pas autorisé à modifier votre propre groupe d'utilisateurs\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GROUPE D'UTILISATEURS', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GROUPE D'UTILISATEURS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    SUPPRESSION DU GROUPE D'UTILISATEURS TERMINEE: $user_group\n"; - echo "

    \n"; + echo "
    SUPPRESSION DU GROUPE D'UTILISATEURS TERMINEE: $user_group\n"; + echo "

    \n"; + } } - $ADD='100000'; # go to user group list } @@ -14965,7 +19268,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14999,7 +19302,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15033,7 +19336,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15067,7 +19370,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -15125,7 +19428,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15160,7 +19463,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -15196,7 +19499,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15229,7 +19532,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15263,7 +19566,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15333,7 +19636,7 @@ if ($ADD==631111111111) if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
    CONF TEMPLATE pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Template ID être d'au moins 2 caractères\n"; + echo "
    ID modèle être d'au moins 2 caractères\n"; } else { @@ -15346,7 +19649,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15384,7 +19687,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -15420,7 +19723,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15456,7 +19759,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -15485,11 +19788,11 @@ if ($ADD==671111111111) if ( (strlen($voicemail_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
    La boîte vocale pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; - echo "
    Boîte vocale ID be at least 2 characters in length\n"; + echo "
    ID vocale be at least 2 characters in length\n"; } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15515,6 +19818,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
    LABEL ECRAN PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    SUPPRESSION LABEL écran Terminé: $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 PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Supprimer un contact', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

    \n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -15603,10 +19979,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_rafraîchir=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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15683,8 +20065,30 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
    Vous n'avez pas les permissions pour modifier cet utilisateur: $user\n"; } @@ -15700,14 +20104,25 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 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"; @@ -15756,6 +20172,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15775,18 +20192,22 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -15808,6 +20229,12 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; #9BB9FB @@ -15830,6 +20257,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15855,6 +20287,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -15862,8 +20307,17 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } - echo "\n"; + echo "\n"; echo "
    Numéro d'utilisateur : $user$NWB#vicidial_users-user$NWE
    Mot de passe:$NWB#vicidial_users-pass$NWE
    Mot de passe:$NWB#vicidial_users-pass$NWE     Force:
    Forcer Changer mot de passe: $NWB#vicidial_users-force_change_password$NWE
    Nom complet: $NWB#vicidial_users-full_name$NWE
    Niveau de l'utilisateur: $NWB#vicidial_users-user_level$NWE
    Groupe utilisateur:
    Login du téléphone: $NWB#vicidial_users-phone_login$NWE
    Mot de passe du téléphone: $NWB#vicidial_users-phone_pass$NWE
    Actif: $NWB#vicidial_users-active$NWE
    ID vocale: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
    Email:$NWB#vicidial_users-optional$NWE
    Utilisateur Code: $NWB#vicidial_users-optional$NWE
    Main Territoire: $NWB#vicidial_users-optional$NWE
    OPTIONS DE L'INTERFACE DE L'AGENT:
    L'agent choisit les Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Agent Choisissez Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agent Choisir Territoires: $NWB#vicidial_users-agent_choose_territories$NWE
    Alter Agent Client Téléphone Override:$NWB#vicidial_users-alter_custphone_override$NWE
    Agent de l'exécution Shift Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Agent Call Log Voir Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Override Recherche Agent principal: $NWB#vicidial_users-agent_lead_search_override$NWE
    Alerte Enabled: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    Permettez Alertes: $NWB#vicidial_users-allow_alerts$NWE
    Contact Recherche Preset: $NWB#vicidial_users-preset_contact_search$NWE
    Rangs De Campagne :$NWB#vicidial_users-campaign_ranks$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKcampaigns_list"; echo "
    \n"; echo "
    Groupes entrants: $NWB#vicidial_users-closer_campaigns$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKgroups_list"; echo "
    \n"; echo "
    OPTIONS RAPPORT ADMIN:
    En temps réel Infos Message Bloquer: $NWB#vicidial_users-realtime_block_user_info$NWE
    Administrateur de données masquer plomb: $NWB#vicidial_users-admin_hide_lead_data$NWE
    Administrateur masquer les données du téléphone: $NWB#vicidial_users-admin_hide_phone_data$NWE
    OPTIONS DE L'INTERFACE D'ADMINISTRATION:
    Rapports d'exportation: $NWB#vicidial_users-export_reports$NWE
    Supprimer From Listes DNC: $NWB#vicidial_users-delete_from_dnc$NWE
    Modifier les champs personnalisés: $NWB#vicidial_users-custom_fields_modify$NWE
    Modifier les campagnes: $NWB#vicidial_users-modify_sections$NWE
    Détails de la campagne: $NWB#vicidial_users-campaign_detail$NWE
    Supprimer les campagnes: $NWB#vicidial_users-delete_campaigns$NWE
    Modifier la période d'appelss: $NWB#vicidial_users-modify_call_times$NWE
    SupprimerPériodes d'appels: $NWB#vicidial_users-delete_call_times$NWE
    Modifier les serveurs: $NWB#vicidial_users-modify_sections$NWE
    Modifier Shifts: $NWB#vicidial_users-modify_sections$NWE
    ModifierMobiles: $NWB#vicidial_users-modify_sections$NWE
    ModifierCarriers: $NWB#vicidial_users-modify_sections$NWE
    ModifierLabels: $NWB#vicidial_users-modify_sections$NWE
    ModifierStatuts: $NWB#vicidial_users-modify_sections$NWE
    ModifierBoîte vocale: $NWB#vicidial_users-modify_sections$NWE
    ModifierAudio Store: $NWB#vicidial_users-modify_sections$NWE
    ModifierMusique d-attente: $NWB#vicidial_users-modify_sections$NWE
    ModifierTTS: $NWB#vicidial_users-modify_sections$NWE
    ModifierContacts: $NWB#vicidial_users-modify_sections$NWE
    CallCard accès: $NWB#vicidial_users-modify_sections$NWE
    Agent API d'accès:$NWB#vicidial_users-vdc_agent_api_access$NWE
    Ajouter Log timeclock Record: $NWB#vicidial_users-add_timeclock_log$NWE
    Supprimer timeclock journal Record: $NWB#vicidial_users-delete_timeclock_log$NWE
    Shift Manager exécution Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    Modifier niveau de l'utilisateur même: $NWB#vicidial_users-modify_same_user_level$NWE
    \n"; if ($LOGdelete_users > 0) @@ -15877,7 +20331,7 @@ if ($ADD==3) echo "

    Cliquez ici pour les rappels reservés à cet utilisateur\n"; if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce record
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration de ce disque\n"; } } } @@ -15902,6 +20356,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_rafraîchir=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -15912,6 +20371,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -15919,16 +20388,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -15978,7 +20450,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_rafraîchir = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -16060,13 +20532,82 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Paramètres";} + else + {$ALTmultiDISABLE=0; $ALTmultiLINK='';} + + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -16077,7 +20618,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -16105,7 +20646,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -16149,7 +20690,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -16180,7 +20721,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -16204,9 +20745,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -16229,6 +20772,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -16248,9 +20816,13 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -16263,6 +20835,14 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16271,7 +20851,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
    $row[0]: Basic   Basic Détail StatutsHotKeysSondagePause Codes Presets moins de/font>AC-CIDQC Real-Time Real-Time
    \n"; echo ""; + $SYSTEMRELEASE_graph.=" "; + $AGENTRELEASE_graph.=" "; + $SALES_graph.=" "; + $DNCS_graph.=" "; + $NAS_graph.=" "; + $DROPS_graph.=" "; + $LOGINTIME_graph.=" "; + $PAUSETIME_graph.=" "; + } + $CALLS_graph.="
    \n"; @@ -16284,19 +20864,31 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; @@ -16325,139 +20917,200 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + 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"; @@ -16665,24 +21328,32 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + 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"; if ($SSoutbound_autodial_active > 0) { @@ -16727,37 +21410,65 @@ if ($ADD==31) } 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"; @@ -16776,6 +21487,11 @@ if ($ADD==31) } 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"; @@ -16789,9 +21505,21 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -16799,16 +21527,22 @@ if ($ADD==31) { echo "\n"; } - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -16857,13 +21591,46 @@ if ($ADD==31) 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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { @@ -16885,6 +21652,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
    ID de la campagne: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID de la campagne: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
    Description de la campagne: $NWB#vicidial_campaigns-campaign_description$NWE
    Campagne Changement Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Campagne Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Actif: $NWB#vicidial_campaigns-active$NWE
    Extension du parc: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
    Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
    \n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
    Actif: $NWB#vicidial_campaigns-active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_campaigns-user_group$NWE
    Parc de la Musique-sur-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulaire Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulaire Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Formulaire Web Public: $NWB#vicidial_campaigns-web_form_target$NWE
    Autoriser les closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Add A Dial Etat:
    Ajouter un statut Composer pour appeler:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Ordre de la liste: $NWB#vicidial_campaigns-lead_order$NWE
    Liste Mix:
    Ordre de la liste: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtre de la fiche: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Commandez Liste Randomize: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
    Commandez Liste secondaire: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
    Liste Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Filtre de la fiche: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Drop Lockout Time: $NWB#vicidial_campaigns-drop_lockout_time$NWE
    Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
    Appelez le comte Limite: $NWB#vicidial_campaigns-call_count_limit$NWE
    Forcer la réinitialisation du distributeur de fiches: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Appelez le comte cible: $NWB#vicidial_campaigns-call_count_target$NWE
    Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
    Niveau minimum Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Niveau Hopper automatique: $NWB#vicidial_campaigns-use_auto_hopper$NWE
    Multiplicateur Hopper automatique: $NWB#vicidial_campaigns-hopper_level$NWE
    Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
    Hopper VLC Dup Vérifiez: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
    Forcer la réinitialisation du distributeur de fiches: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
    Niveau de l'appel automatique: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPTER LE DEPASSEMENT
    Valable seulement pour les contrôles: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Seuil Auto Level Dial: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
    Valable seulement pour les contrôles: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Disponible Seuil Tally seulement: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
    Pourcentage limite d'abandon: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
    Transferts concurents: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Composez méthode cible de différence de niveau: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
    Transferts concurents: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    File d'attente de priorité:$NWB#vicidial_campaigns-drop_rate_group$NWE
    Pas de file d'attente entrante Composez: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    Appeler automatiquement le numéro alternatif: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    Appeler automatiquement le numéro alternatif: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
    Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
    Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
    Heure d'appel locale:
    Préfixe de numérotation: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Préfixe Manuel: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Omettre le phone code: $NWB#vicidial_campaigns-omit_phone_code$NWE
    CallerID de la campagne: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Personnalisé CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Exten VDAD de la campagne: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Routage Extension:$NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Extension d'enregistrement de la campagne: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
    Délai d'enregistrement: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
    Appelez-notes par Appel: $NWB#vicidial_campaigns-per_call_notes$NWE
    Recherche de plomb Agent: $NWB#vicidial_campaigns-agent_lead_search$NWE
    Méthode de recherche d'agent principal: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
    Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
    Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
    Message de répondeur: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
    Message de répondeur: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -16711,15 +21382,27 @@ if ($ADD==31) echo "
    numéro de Transfer-Conf 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Quick Transfer Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Activer Presets de transfert: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Masquer le numéro de transfert à composer: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Quick Transfer Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Transfert personnalisé Bouton 3-voies: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
    Préremplir Transfert Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Minuterie d-action: $NWB#vicidial_campaigns-timer_action$NWE
    Parc Appel IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Minuterie d-action Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Parc Appel IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Minuterie d-action Seconds: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Minuterie d-action: $NWB#vicidial_campaigns-timer_action$NWE
    Minuterie d-action Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Minuterie d-action Seconds: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Destination action minuterie: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Rappels de service programmés: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Rappels réguliers d'alerte: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Rappels réguliers comte: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Prévu rappels Jours Limite: $NWB#vicidial_campaigns-callback_days_limit$NWE
    Prévu rappels Heures Bloquer: $NWB#vicidial_campaigns-callback_hours_block$NWE
    Rappels réguliers bloc Calltime: $NWB#vicidial_campaigns-callback_list_calltime$NWE
    Mon défaut Checkbox rappels: $NWB#vicidial_campaigns-my_callback_option$NWE
    Temps avant abandon de l'appel: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Drop d'action:$NWB#vicidial_campaigns-drop_action$NWE
    Drop d'action:$NWB#vicidial_campaigns-drop_action$NWE
    Extension du port sûr: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
    Boîte vocale: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Safe Harbour Audio: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
    Coffre-fort Menu Appel port: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
    Boîte vocale: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Drop de transfert du Groupe:$NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Désactiver l'écran Dispo: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
    Désactiver Statut Dispo: $NWB#vicidial_campaigns-disable_dispo_status$NWE
    Temps de conclusion: $NWB#vicidial_campaigns-wrapup_seconds$NWE
    Message de conclusion: $NWB#vicidial_campaigns-wrapup_message$NWE
    Utiliser la liste DNC interne: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Utiliser la liste DNC interne: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Utilisez la liste de campagne DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    Utilisez la liste de campagne DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    AgentCodes De PauseActif: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
    Campagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Auto Pause pré-Appel de travail: $NWB#vicidial_campaigns-auto_pause_precall$NWE
    Auto Reprendre pré-Appel de travail: $NWB#vicidial_campaigns-auto_resume_precall$NWE
    Auto Pause pré-Appel de code: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
    Campagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_rafraîchir$NWE
    Real-Time Temps Stats Agent: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Désactiver la modification des données d'un client$NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Désactiver Alter clientèle Téléphone:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agent d-affichage composable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
    Les étiquettes de l'écran de l'agent: $NWB#vicidial_campaigns-screen_labels$NWE
    Les champs d'affichage d'état: $NWB#vicidial_campaigns-status_display_fields$NWE
    Agent Chef de file d'attente d'affichage:$NWB#vicidial_campaigns-display_queue_count$NWE
    Agent Pause après chaque appel: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Composition manuelle Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Identification Manuelle De Liste De Cadran :$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Manuelle Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manuelle Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Dial Aperçu Manuel: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Durée de l'appel Vérification manuelle: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
    Composition manuelle API: $NWB#vicidial_campaigns-api_manual_dial$NWE
    Composition manuelle CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
    Message Téléphone Décalage horaire alerte: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
    Agent de copie d'écran du Presse-papiers: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    Agent Screen Extended Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
    3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way Call Préfixe de numérotation: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Logging Raccrocher à la clientèle 3-voies: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Secondes hangup clientèle 3-voies: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Raccrocher à la clientèle d'action 3-voies: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Groupe Alias permis: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    Environnement Téléphone QM: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
    Groupement PLLB: $NWB#vicidial_campaigns-pllb_grouping$NWE
    Limite Groupement PLLB: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
    CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Popup Adresse: $NWB#vicidial_campaigns-crm_login_address$NWE
    CRM Popup Adresse: $NWB#vicidial_campaigns-crm_login_address$NWE
    Début de l-appel Web: $NWB#vicidial_campaigns-start_call_url$NWE
    Début de l-appel Web: $NWB#vicidial_campaigns-start_call_url$NWE
    Dispo Call Web: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Dispo Call Web: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Aucune URL Appel Agent: $NWB#vicidial_campaigns-na_call_url$NWE
    Extension Ajoutez CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Attention Moniteur aveugles: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Avis aveugles Moniteur: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Nom du moniteur aveugles: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    \n"; @@ -16904,6 +21673,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -16911,6 +21681,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -16919,14 +21691,14 @@ if ($ADD==31) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -16971,8 +21743,6 @@ if ($ADD==31) echo "\n"; echo "
    ID DE LA LISTENOM DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIF

    \n"; - echo "
    \n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -16981,13 +21751,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

    \n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
    Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
    STATUTS dans les listes ACTIFS POUR CETTE CAMPAGNE:\n"; + echo " - CACHER
    "; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ETATNOM DU STATUTAPPELENON APPELEDIALABLEPENETRATION
    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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 "
    ETATNOM DU STATUTAPPELENON APPELE
    $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]."
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]    
    TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "MONTRER STATUTS DE PLOMB DANS CETTE CAMPAGNE

    "; + } + + + + echo "
    \n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - CACHER

    "; } else @@ -16996,7 +21948,7 @@ if ($ADD==31) echo " - MONTRER

    "; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -17007,9 +21959,36 @@ if ($ADD==31) echo "Cliquez ici pour voir une VDAD rapport de cette campagne

    \n"; } echo "Cliquez ici pour voir les rappels réservés de cette campagne

    \n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Testez des appels sortants: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


    \n"; + } + else + { + echo "Test de l'appel désactivé

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

    Cliquez ici pour voir Admin chages à cette campagne
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration à cette campagne\n"; } echo "
    \n"; } @@ -17020,7 +21999,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -17037,17 +22016,45 @@ if ($ADD==31) echo "
    \n"; echo "
    STATUTS PERSONNALISES DANS CETTE CAMPAGNE:   $NWB#vicidial_campaign_statuses$NWE
    \n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + echo "
    ETATDESCRIPTIONSELECTIONABLERÉPONSE HUMAINECATÉGORIEMODIFY-DELETE
    \n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -17062,42 +22069,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
    S
    T
    A
    T
    U
    S
    DESCRIPTIONCATÉGORIE
    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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "SUPPRIMER\n"; - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "SUPPRIMER\n"; + } + else + { + echo "SUPPRIMER\n"; + } echo "
    \n"; + echo "
    AJOUTER UN NOUVEAU STATUT DE CAMPAGNE PERSONNALISE
    \n"; echo "\n"; echo "\n"; echo "Etat:   \n"; echo "Description:   \n"; - echo "Selectionnable:  
    \n"; - echo "Réponse de l'homme:   \n"; + echo "Selectionnable:   \n"; + echo "Réponse de l'homme:  
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Catégorie :\n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17163,7 +22180,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -17176,7 +22193,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -17302,7 +22319,7 @@ if ($ADD==31) echo "
    RACCOURCI CLAVIERETATDESCRIPTIONSUPPRIMER
    \n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -17342,7 +22359,7 @@ if ($ADD==31) ##### 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -17367,7 +22384,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -17380,7 +22397,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -17434,7 +22451,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -17453,17 +22470,155 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    CODES DE PAUSEFACTURABLEMODIFIERSUPPRIMER
    Enquête Non Intéressé Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
    Enquête sur Opt-in audio de dossier: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
    Enquête Non Intéressé fichier audio: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
    Enquête sur la méthode: $NWB#vicidial_campaigns-survey_method$NWE
    Enquête sur la méthode: $NWB#vicidial_campaigns-survey_method$NWE
    Etude de non-réponse de l'action: $NWB#vicidial_campaigns-survey_no_response_action$NWE
    Enquête Non Intéressé Etat: $NWB#vicidial_campaigns-survey_ni_status$NWE
    Enquête sur la campagne d'enregistrement du répertoire: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
    Boîte vocale: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
    Menu Appel Enquête: $NWB#vicidial_campaigns-survey_menu_id$NWE
    Enregistrement Enquête: $NWB#vicidial_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_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + + echo "

    $presets_to_print PRESETS pour cette campagne:   $NWB#vicidial_xfer_presets$NWE
    \n"; + + echo "
    ADD NEW PRESET -
    \n"; + echo "\n"; + echo "\n"; + echo "Nom du paramètre prédéfini: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Masquer numéro:  \n"; + echo "
    \n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # PRESET NAMENUMERODTMFCACHERMODIFIERSUPPRIMER
    $o $rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  SUPPRIMER
    \n"; + } + + + ##### CAMPAIGN Indicatif régional CID ##### + if ($SUB==202) + { + echo "

    CIDS indicatif régional pour cette campagne:   $NWB#vicidial_campaign_cid_areacodes$NWE
    \n"; + if ($use_custom_cid != 'Indicatif régional') + {echo "
    The campaign setting Personnalisé CallerID is not set to Indicatif régional!
    ";} + 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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 "
    #Indicatif régionalCID NUMÉRODESCRIPTIONACTIFCALLSSUPPRIMER
      $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   SUPPRIMER
    \n"; + echo "

    \n"; + + echo "
    ADD NEW indicatif régional 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 "DECONNECTER TOUS LES AGENTS DE CETTE CAMPAGNE

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

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

    \n"; if ($LOGdelete_campaigns > 0) { @@ -17490,6 +22645,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_rafraîchir=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17500,8 +22660,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -17526,9 +22696,10 @@ if ($ADD==34) $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_stats_rafraîchir = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -17536,13 +22707,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + if ($auto_alt_dial == 'MULTI_LEAD') + {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Paramètres";} + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -17560,7 +22738,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -17581,7 +22759,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -17592,7 +22770,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -17622,14 +22800,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -17644,15 +22822,18 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: $campaign_id: Vue basique Vue détaillée Liste Mix Ecran temps réel Ecran temps réel  
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -17679,137 +22860,164 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
    ID de la campagne: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID de la campagne: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
    Description de la campagne: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
    Campagne Changement Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Actif: $NWB#vicidial_campaigns-active$NWE
    Extension du parc: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
    Groupe d'utilisateurs d'administration: $user_group $NWB#vicidial_campaigns-user_group$NWE
    Parc de la Musique-sur-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Formulaire Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Autoriser les closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Groupe De Transfert De Défaut :$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    Add A Dial Etat:
    Ajouter un statut Composer pour appeler:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Ordre de la liste: $NWB#vicidial_campaigns-lead_order$NWE
    Liste Mix:
    Ordre de la liste: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtre de la fiche: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Liste Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
    Filtre de la fiche: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Niveau minimum Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
    Forcer la réinitialisation du distributeur de fiches: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
    Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
    Niveau de l'appel automatique: \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
    ID DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIFLAST CALL DATEMODIFIER
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
    ID DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIFLAST CALL DATEMODIFIER
    $row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]MODIFIER

    \n"; + echo "
    \n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

    \n"; + + + if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) ) + { + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]MODIFIER

    \n"; - echo "
    \n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

    \n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - CACHER

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

    "; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Cette campagne a $hopper_leads fiches dans le distributeur de fiches

    \n"; - echo "Cliquez ici pour voir quelles fiches sont dans le distributeur à l'instant

    \n"; - echo "Cliquez ici pour voir une VDAD rapport de cette campagne

    \n"; + echo "
    STATUTS dans les listes ACTIFS POUR CETTE CAMPAGNE:\n"; + echo " - CACHER
    "; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
    ETATNOM DU STATUTAPPELENON APPELE
    $CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "MONTRER STATUTS DE PLOMB DANS CETTE CAMPAGNE

    "; + } + + + 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 " - CACHER

    "; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - MONTRER

    "; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Cette campagne a $hopper_leads fiches dans le distributeur de fiches

    \n"; + echo "Cliquez ici pour voir quelles fiches sont dans le distributeur à l'instant

    \n"; + echo "Cliquez ici pour voir une VDAD rapport de cette campagne

    \n"; } echo "Cliquez ici pour voir les rappels réservés de cette campagne

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

    Cliquez ici pour voir Admin chages à cette campagne
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration à cette campagne\n"; } echo "
    \n"; @@ -18022,24 +23342,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
    \n"; echo "
    GRADES D'AGENT POUR CETTE CAMPAGNE :
    \n"; - echo "\n"; - echo "\n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
    USER     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

    \n"; @@ -18076,7 +23397,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -18095,7 +23416,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
    ATTENTION, nous recommandons que la liste Mix pour les utilisateurs avancés, S-il vous plaît lire le manuel VICIDIAL Manager
    \n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -18104,7 +23425,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -18303,341 +23624,403 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
    \n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + 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 ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LISTES FAITES SUR COMMANDE DE STATUTS DE CAMPAGNE :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTES FAITES SUR COMMANDE DE STATUTS DE CAMPAGNE :\n"; + echo "
    CAMPAIGNNOMSTATUSESMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNOMSTATUSESMODIFIER
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY STATUSES
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUSES
    \n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LISTES DE LA CAMPAGNE HOTKEYS :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTES DE LA CAMPAGNE HOTKEYS :\n"; + echo "
    CAMPAIGNNOMHOTKEYSMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNOMHOTKEYSMODIFIER
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY HOTKEYS
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
    \n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LE FIL DE CAMPAGNE RÉUTILISENT DES LISTES :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LE FIL DE CAMPAGNE RÉUTILISENT DES LISTES :\n"; + echo "
    CAMPAIGNNOMLE FIL RÉUTILISEMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNOMLE FIL RÉUTILISEMODIFIER
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY LE FIL RÉUTILISE
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LE FIL RÉUTILISE
    \n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LISTES DE CADRAN DU FIL AUTO-ALT DE CAMPAGNE :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTES DE CADRAN DU FIL AUTO-ALT DE CAMPAGNE :\n"; + echo "
    CAMPAIGNNOMAUTO-ALT DIALMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNOMAUTO-ALT DIALMODIFIER
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NONE";} - echo "MODIFY AUTO-ALT DIAL
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
    \n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LISTES DES CODES DE PAUSE D'AGENT DE CAMPAGNE :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTES DES CODES DE PAUSE D'AGENT DE CAMPAGNE :\n"; + echo "
    CAMPAIGNNOMCODES DE PAUSEMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAIGNNOMCODES DE PAUSEMODIFIER
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY CODES DE PAUSE
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY CODES DE PAUSE
    \n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
    \n"; + { + echo "
    \n"; + echo ""; + + echo "
    LISTES DE MÉLANGE DE LISTE DE CAMPAGNE :\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    CAMPAIGNNOMLIST MIXMODIFIER
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
    \n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; + + echo "
    \n"; echo ""; -echo "
    LISTES DE MÉLANGE DE LISTE DE CAMPAGNE :\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTE DE CAMPAGNE PRESET:\n"; + echo "
    CAMPAIGNNOMLIST MIXMODIFIER
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -18645,23 +24028,97 @@ echo "\n"; while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; + $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 (eregi("1$|3$|5$|7$|9$", $o)) + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
    CAMPAIGNNOMPRESETSMODIFIER
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PRESETS
    \n"; + } + + + +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
    \n"; + echo ""; + + echo "
    LISTE DE CAMPAGNE indicatif régional CID:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "$row[0] "; $p++; } - if ($p<1) - {echo "NONE";} echo ""; - echo "\n"; + echo "\n"; + + $k++; $o++; } -echo "
    CAMPAIGNNOMCUSTOM CIDAC-CIDSMODIFIER
    $campaigns_id_list[$o]
    $campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -18671,17 +24128,15 @@ echo "
    MODIFY LIST MIX
    MODIFY AC-CIDS
    \n"; -} - - + echo "
    \n"; + } @@ -18693,10 +24148,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_rafraîchir=1; + } echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -18834,19 +24306,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -18715,9 +24175,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18726,10 +24190,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18738,13 +24203,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -18757,7 +24223,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -18791,7 +24257,7 @@ if ($ADD==311) echo "
    Description de la liste: $NWB#vicidial_lists-list_description$NWE
    Campagne:
    Message de répondeur Override: audio chooser $NWB#vicidial_lists-am_message_exten_override$NWE
    Drop Inbound Groupe Override:
    Drop Entrant Groupe Override: $NWB#vicidial_lists-drop_inbound_group_override$NWE
    Formulaire Web: $NWB#vicidial_lists-web_form_address$NWE
    Formulaire Web Two: $NWB#vicidial_lists-web_form_address$NWE
    numéro de Transfer-Conf 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    numéro de Transfer-Conf 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    numéro de Transfer-Conf 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Rapport d'inventaire: $NWB#vicidial_lists-inventory_report$NWE
    Réglage du fuseau horaire: $NWB#vicidial_lists-time_zone_setting$NWE
    \n"; echo "
    \n"; echo "
    STATUTS DANS CETTE LISTE:
    \n"; - echo "\n"; - echo "\n"; + + if ($SSexpanded_list_stats > 0) + { + echo "
    ETATNOM DU STATUTAPPELENON APPELE
    \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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ETATNOM DU STATUTAPPELENON APPELEDIALABLEPENETRATION
    \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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18900,15 +24411,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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 "
    ETATNOM DU STATUTAPPELENON APPELE
    $CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    $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]."
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]    
    TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; unset($lead_list); @@ -18918,7 +24467,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -18957,7 +24506,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -18979,67 +24528,142 @@ if ($ADD==311) echo "
    \n"; echo "
    Guichet unique de cette liste:
    \n"; - echo "
    GMT OFFSET NOW (heure locale)APPELENON APPELE
    \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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
    OWNERAPPELENON APPELE
    \n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
    OWNERAPPELENON APPELERESET
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    \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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
    OWNERAPPELENON APPELE
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
    TOTAL$lead_list[count]

    \n"; unset($lead_list); @@ -19052,7 +24676,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -19114,7 +24738,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -19231,7 +24855,16 @@ if ($ADD==311) echo "
    \n"; - echo "

    Cliquez ici pour voir tous les CallBack Détient dans cette liste

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

    Les champs personnalisés définis pour cette liste: $rowx[0]
    \n"; + } + + echo "

    Cliquez ici pour voir tous les CallBack Détient dans cette liste
    \n"; echo "

    Cliquez ici pour télécharger la liste

    \n"; if ($LOGdelete_lists > 0) @@ -19240,7 +24873,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à cette liste
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration à cette liste\n"; } } else @@ -19260,10 +24893,16 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_rafraîchir=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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19333,9 +24972,85 @@ if ($ADD==3111) $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]; + + ##### 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_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + $Wmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -19346,6 +25061,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -19356,6 +25073,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -19408,6 +25132,10 @@ if ($ADD==3111) {$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 @@ -19417,17 +25145,29 @@ if ($ADD==3111) echo "
    MODIFIER UN ENREGISTREMENT DE GROUPES: $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"; if ($SSenable_second_webform > 0) { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19469,41 +25218,49 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19617,7 +25440,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -19655,23 +25478,33 @@ if ($ADD==3111) 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"; ##### 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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -19695,7 +25528,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19721,7 +25554,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19734,7 +25567,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19767,16 +25600,16 @@ if ($ADD==3111) } echo "
    ID du groupe: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
    Nom du groupe: $NWB#vicidial_inbound_groups-group_name$NWE
    Couleur du groupe: $NWB#vicidial_inbound_groups-group_color$NWE
    Actif: $NWB#vicidial_inbound_groups-active$NWE
    Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    En-Groupe Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
    \n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
    Groupe d'utilisateurs d'administration: $NWB#vicidial_inbound_groups-user_group$NWE
    Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Formulaire Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Formulaire Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
    File d'attente de priorité: $NWB#vicidial_inbound_groups-queue_priority$NWE
    Temps Ring On-Hook: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
    On-Hook CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
    Affichage de l'enseigne: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Ignorer Override Script Liste: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    DTMF Transfert-Conf 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    numéro de Transfer-Conf 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Minuterie d-action: $NWB#vicidial_inbound_groups-timer_action$NWE
    Minuterie d-action: $NWB#vicidial_inbound_groups-timer_action$NWE
    Minuterie d-action Message: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Minuterie d-action Seconds: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Destination action minuterie: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Temps avant abandon de l'appel: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Drop d'action:$NWB#vicidial_inbound_groups-drop_action$NWE
    Drop d'action:$NWB#vicidial_inbound_groups-drop_action$NWE
    Extension d'abandon: $NWB#vicidial_inbound_groups-drop_exten$NWE
    Boîte vocale: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Boîte vocale: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Drop de transfert du Groupe:
    Drop Transfer Group: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
    Menu déroulant Appel:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
    Temps D'Appel :$NWB#vicidial_inbound_groups-call_time_id$NWE
    Après Action D'Heures :$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Transfert d'action CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
    Après Nom de fichier De Message D'Heures : audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Après Action D'Heures :$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Après Nom de fichier De Message D'Heures : audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Après Prolongation D'Heures :$NWB#vicidial_inbound_groups-after_hours_exten$NWE
    Après Des Heures Boîte vocale : voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Après Des Heures Boîte vocale : voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Après les heures d'ouverture de transfert de Groupe:
    After Hours Transfer Group: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
    After Hours Appel du menu:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
    Agents n Queueing: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
    Non Non Queue action de l-agent: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -19534,9 +25291,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID de la liste: "; echo "
    ID de la campagne: audio chooser\n"; + echo "fichier audio: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -19578,37 +25335,103 @@ if ($ADD==3111) echo "
     
    Nom de fichier Bienvenu De Message : audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Max Appelle la méthode: $NWB#vicidial_inbound_groups-max_calls_method$NWE
    Max appelle le comte: $NWB#vicidial_inbound_groups-max_calls_count$NWE
    Max Appels d'action: $NWB#vicidial_inbound_groups-max_calls_action$NWE
    Nom de fichier Bienvenu De Message : audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Play Message de bienvenue:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    Musique Sur Le Contexte De Prise : moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Musique Sur Le Contexte De Prise : moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Sur Le Nom de fichier De Message de sollicitation De Prise : audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Sur Le Nom de fichier De Message de sollicitation De Prise : audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    Sur L'Intervalle De Message de sollicitation De Prise :$NWB#vicidial_inbound_groups-prompt_interval$NWE
    En attente Demander Non Bloquer: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    En attente secondes Prompt: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Jouer en ligne Lieu:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Hold estimée Play Time:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Hold Time Option:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Calculer secondes Attente Estimation: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Estimation Tenez Nom minimum de temps: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Estimation minimale Hold Time Demander Non Bloquer: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Estimation secondes Hold Time minimum Prompt: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Attendre Option Temps: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Attendre Option Second Time: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Attendre Option troisième fois: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Attendez quelques secondes Option Temps: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Attendre Extension Option Temps: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Attendre Callmenu Option Temps: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Attendre la messagerie vocale Option Temps: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Attendre transfert Option Temps En-Groupe: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Attendre Nom de presse Heure Option: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Attendre Appuyez sur Option No Time Bloquer: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Les temps d'attente secondes Appuyez sur Option Nom de fichier: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Attendre Option Time After Nom de presse: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Attendre Option Temps liste de rappel ID: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Attendre Tenez priorité Option: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Estimation Option Temps de maintien: $NWB#vicidial_inbound_groups-hold_time_option$NWE
    Tenez Option Second Time: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Tenez Option troisième fois: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Hold Time Option Seconds:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Tenez minimum Option Temps: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Hold Time Option Extension:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Hold Time Option de messagerie vocale: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Tenez Callmenu Option Temps: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Hold Time Option de messagerie vocale: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Hold Time Option de transfert en groupe:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
    Hold Time Option Callback Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Tenez Nom de presse Heure Option: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Maintenez Appuyez sur Option No Time Bloquer: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Seconds Appuyez sur Option Nom de fichier: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Tenez Option Time After Nom de presse: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Hold Time Option Callback Liste ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Agent d-alerte Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Agent d-alerte Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    L'Alerte D'Agent Retardent :$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
    Stats Pourcentage des appels dans les X secondes 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
    Début de l-appel Web: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Début de l-appel Web: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Dispo Call Web: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Dispo Call Web: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Ajouter plomb URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Aucune URL Appel Agent: $NWB#vicidial_inbound_groups-na_call_url$NWE
    Extension Ajoutez CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Affichage de l'état uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Préfixe Statut uniqueid: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
     
    Inbound Groupe QC Paramètres:
    Entrant Groupe QC Paramètres:
    \n"; - echo "

    \n"; + echo "


    \n"; ### list of agent rank or skill-level for this inbound group - echo "
    \n"; - echo "
    AGENT RANKS FOR THIS ENTRANT GROUP:
    \n"; - echo "\n"; - echo "\n"; + echo "
    \n"; + echo "
    AGENT RANKS FOR THIS INBOUND GROUP:
    \n"; + echo "
    USER     RANK     CALLS TODAY
    \n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19786,26 +25619,215 @@ if ($ADD==3111) $rowx=mysql_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_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + $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_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='VALIDER') + { + $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 = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_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_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ( ($ARIG_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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_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 (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + $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 "
    USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

    \n"; + echo "$users_output"; - echo "

    \n"; + echo "

    \n"; echo "Cliquez ici pour voir un rapport de ce groupe d'entrants

    \n"; + echo "Cliquez ici pour voir les agents connectés à ce groupe entrant

    \n"; + echo "
    \n"; - echo "DIDS USING THIS IN-GROUP:
    \n"; + echo "DIDS D'UTILISER CE GROUPE EN:
    \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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -19817,10 +25839,10 @@ if ($ADD==3111) } echo "

    \n"; - echo "CALL MENUS USING THIS IN-GROUP:
    \n"; + echo "CALL MENUS D'UTILISER CE GROUPE EN:
    \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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -19835,7 +25857,7 @@ if ($ADD==3111) echo "CAMPAGNES DE PERMETTRE DANS CE GROUPE:
    \n"; echo "
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19850,12 +25872,12 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; + # echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; echo "

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

    Cliquez ici pour voir Admin chages à ce groupe en\n"; + echo "

    Cliquez ici pour voir les changements d'administration à cette En-Groupe\n"; } } else @@ -19863,6 +25885,7 @@ if ($ADD==3111) echo "Vous n'avez pas la permission de voir cette page\n"; exit; } + } @@ -19875,13 +25898,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19986,7 +26072,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20008,7 +26094,7 @@ if ($ADD==3311) 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_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $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 "
    \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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19905,9 +25933,36 @@ if ($ADD==3311) $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 order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19920,53 +25975,79 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\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') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\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 "
    Modifier un DID RECORD:$row[0]
    \n"; @@ -19976,7 +26057,12 @@ if ($ADD==3311) echo "
    DID Extension:$NWB#vicidial_inbound_dids-did_pattern$NWE
    A Description:$NWB#vicidial_inbound_dids-did_description$NWE
    Actif: $NWB#vicidial_inbound_dids-did_active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_inbound_dids-user_group$NWE
    Route de DID:$NWB#vicidial_inbound_dids-did_route$NWE
    Enregistrement de l'appel: $NWB#vicidial_inbound_dids-record_call$NWE
    Extension:$NWB#vicidial_inbound_dids-extension$NWE
    Extension Contexte:$NWB#vicidial_inbound_dids-exten_context$NWE
    Boîte vocale: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    In-ID du groupe: $NWB#vicidial_inbound_dids-group_id$NWE
    In-Call Groupe Handle Méthode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    In-Call Groupe Handle Méthode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    En groupe Agent Méthode de recherche:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    In-Liste du groupe ID:$NWB#vicidial_inbound_dids-list_id$NWE
    En-groupe ID de la campagne:$NWB#vicidial_inbound_dids-campaign_id$NWE
    En-groupe Téléphone Code:$NWB#vicidial_inbound_dids-phone_code$NWE
    Nettoyez Nombre CID: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Filtre Nombre entrants: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filtre ID Groupe Téléphone: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    URL Filter: $NWB#vicidial_inbound_dids-filter_url$NWE
    Action de filtrage: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Extension:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Extension Contexte:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter Boîte vocale: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    Filter Téléphone Extension:$NWB#vicidial_inbound_dids-phone$NWE
    Filter IP du serveur: $NWB#vicidial_inbound_dids-server_ip$NWE
    Filter Appel du menu: $NWB#vicidial_inbound_dids-menu_id$NWE
    Filter Utilisateur Agent:$NWB#vicidial_inbound_dids-user$NWE
    Filter Unavailable Action utilisateur:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
    Filter Utilisateur Settings En Route-Group:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
    Filter In-ID du groupe: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter In-Call Groupe Handle Méthode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter En groupe Agent Méthode de recherche:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter In-Liste du groupe ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter En-groupe ID de la campagne:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter En-groupe Téléphone Code:$NWB#vicidial_inbound_dids-phone_code$NWE
    Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
    \n"; echo "

    \n"; echo "
    Cliquez ici pour voir un rapport de trafic pour cette DID

    \n"; + echo "
    Cliquez ici pour voir la liste des enregistrements et des appels pour ce DID
    \n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    VOIR AVEZ télécommande remplace EXTENSION agent pour cette DID\n"; + } if ($LOGdelete_dids > 0) { echo "

    SUPPRIMER CETTE DID\n"; } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce DID\n"; + echo "

    Cliquez ici pour voir les changements d'administration à cette DID\n"; } } else @@ -20041,6 +26188,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
    \n"; + echo ""; + + echo "
    DISTANCE LISTE DES AGENTS DE VULGARISATION SURPASSEMENTS:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    DIDNOMRA-EXTENSMODIFIER
    $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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/ModifierDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    SAVIEZ-REMOTE OVERRIDE extension de l'agent PAS AJOUTÉE - il ya déjà une entrée pour ce DID avec cette extension RA
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    SAVIEZ-REMOTE OVERRIDE extension de l'agent PAS AJOUTÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \n"; + } + else + { + echo "
    SAVIEZ-REMOTE OVERRIDE extension de l'agent AJOUTÉE: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    Extension DID Remote Agent OVERRIDE PAS SUPPRIMER - cette entrée n'existe pas
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    Extension DID Remote Agent OVERRIDE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies
    \n"; + } + else + { + echo "Extension DID Remote Agent OVERRIDE mise à jour: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/ModifierDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_rafraîchir=1; + } + echo "
    \n"; + echo ""; + echo "

    Télécommande remplace EXTENSION agent pour cette DID:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTEXTENSIONDESCRIPTIONACTIFCALLSSUPPRIMER
      $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   SUPPRIMER
    \n"; + echo "

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

    \n"; + + echo "

    MODIFIER LE PRÉSENT DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administration à cette DID
    \n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -20049,10 +26496,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_rafraîchir=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -20066,6 +26518,9 @@ if ($ADD==3511) $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]; echo "
    MODIFIER UN APPEL Record menu: $menu_id
    \n"; @@ -20074,6 +26529,10 @@ if ($ADD==3511) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20110,6 +26569,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -20141,7 +26612,7 @@ if ($ADD==3511) $dtmf_list = ""; echo " "; - echo "   Handle Method: \n"; - echo "
    Search Method: "; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; + echo "
    Méthode de recherche: \n"; echo "   ID de la liste: "; echo "
    ID de la campagne: \n"; echo "   Phone Code: "; + echo "
      VID Entrez Nom: audio chooser"; + echo "
      Nom du fichier VID Numéro d'identification: audio chooser"; + echo "
      VID Confirmer Nom: audio chooser"; + echo "   Chiffres VID: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -20220,7 +26700,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "fichier audio: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -20244,12 +26724,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
    Menu ID: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
    Nom du menu: $NWB#vicidial_call_menu-menu_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_call_menu-user_group$NWE
    Menu rapide: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
    Menu Timeout: $NWB#vicidial_call_menu-menu_timeout$NWE
    Menu prompt timeout: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
    Connectez-vous Appuyer sur la touche: $NWB#vicidial_call_menu-dtmf_log$NWE     Connectez-vous Champ: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
    Appel du menu Options:
    Custom Dialplan Entrée:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Entrée personnalisée Dialplan:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Custom Dialplan Entrée: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Entrée personnalisée Dialplan: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    \n"; echo "

    \n"; - echo "DIDS USING THIS CALL MENU:
    \n"; + echo "DIDS UTILISER CE MENU APPEL:
    \n"; echo "\n"; - $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -20312,7 +26792,7 @@ if ($ADD==3511) echo "

    \n"; - echo "CALL MENUS USING THIS CALL MENU:
    \n"; + echo "CALL MENUS UTILISER CE MENU APPEL:
    \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';"; @@ -20335,7 +26815,7 @@ if ($ADD==3511) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir chages Admin à ce menu d-appel\n"; + echo "

    Cliquez ici pour voir les changements d'administration à ce menu APPEL\n"; } } else @@ -20355,10 +26835,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20368,38 +26853,232 @@ if ($ADD==31111) $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]; - echo "
    MODIFIER UN ENREGISTREMENT D'AGENT DISTANT: $row[0]
    \n"; - echo "\n"; - echo "\n"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; + $rsltx=mysql_query($stmt, $link); + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
    MODIFIER UN ENREGISTREMENT D'AGENT DISTANT: $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 "
    Début des ID utilisateurs: (nombres seulement, incremented, doit être un utilisateur existant Vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Nombre de lignes: (nombres seulement)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP du serveur: $NWB#vicidial_remote_agents-server_ip$NWE
    Extension externe: (numéro du dial plan pour atteindre les agents)$NWB#vicidial_remote_agents-conf_exten$NWE
    Groupe d'extension: $NWB#vicidial_remote_agents-extension_group$NWE
    Etat: $NWB#vicidial_remote_agents-status$NWE
    Campagne: $NWB#vicidial_remote_agents-campaign_id$NWE
    On-Hook Agent: $NWB#vicidial_remote_agents-on_hook_agent$NWE
    Temps Ring On-Hook: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE
    \n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "
    Groupes entrants: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; + echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    IL YA $didraext_count DID télécommande remplace extension de l'agent pour cet agent DISTANCE\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

    SUPPRIMER CET AGENT DISTANT\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administration à cet agent à distance
    \n"; + } + } + else + { + echo "Démarrer l'utilisateur pour cet agent distant n'existe pas: $user_start\n"; + exit; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=3711 modify filter phone group info in the system +###################### + +if ($ADD==3711) + { + if ($LOGmodify_dids==1) + { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_rafraîchir=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + $user_group = $row[3]; + + echo "
    Modifier le groupe Téléphone filtre: $filter_phone_group_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 "
    Début des ID utilisateurs: (nombres seulement, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Nombre de lignes: (nombres seulement)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP du serveur: $NWB#vicidial_remote_agents-server_ip$NWE
    Extension externe: (numéro du dial plan pour atteindre les agents)$NWB#vicidial_remote_agents-conf_exten$NWE
    Etat: $NWB#vicidial_remote_agents-status$NWE
    Campagne: $NWB#vicidial_remote_agents-campaign_id$NWE
    Groupes entrants: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    Filtre ID Groupe Téléphone: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Filtre Nom du groupe Téléphone: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filtre Description du groupe Téléphone: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; - echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

    Numéros de ce groupe Téléphone filtre: $row[0]"; - if ($LOGdelete_remote_agents > 0) + if ($LOGdelete_dids > 0) { - echo "

    SUPPRIMER CET AGENT DISTANT\n"; + echo "

    Supprimer ce groupe TÉLÉPHONE FILTRE\n"; } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à cette télécommande agent
    \n"; + echo "

    Cliquez ici pour télécharger les numéros de téléphone dans ce groupe filtre\n"; + + echo "

    Cliquez ici pour voir les changements d'administrateur pour ce groupe de téléphone du filtre\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_rafraîchir=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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
    Modifier une entrée GROUPE D'EXTENSION: $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 "
    Groupe d'extension: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Extension: (nombres seulement)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Groupes Campagnes: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Appelez le comte Aujourd'hui: $call_count_today
    Durée dernier appel: $last_call_time
    ID Last Call: $last_callerid
    \n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

    Supprimer cette rubrique GROUPE D'EXTENSION\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administration to this extension group entry
    \n"; } } else @@ -20418,158 +27097,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

    Cliquez ici pour voir tous les CallBack Détient dans ce groupe d'utilisateurs

    \n"; - echo "

    Cliquez ici pour voir le statut timeclock pour ce groupe d'utilisateurs

    \n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - - echo ""; - - echo "
    MODIFIER UN ENREGISTREMENT DE GROUPE D'UTILISATEURS\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - echo "\n"; + echo "
    Groupe: (pas d'espace ni de ponctuation)$NWB#vicidial_user_groups-user_group$NWE
    Description: (Description du groupe)$NWB#vicidial_user_groups-group_name$NWE
    Force timeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift exécution: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campagnes autorisées:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; - echo "$campaigns_list
     "; - echo "
    Groupe de changements:
    $NWB#vicidial_user_groups-group_shifts$NWE
    \n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " 1) and ($modify_rafraîchir_set < 1) ) { - if (ereg(" $shift_id_value ", $GROUP_shifts)) - { - echo " CHECKED"; - } - $p++; + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_rafraîchir=1; } - echo "> $shift_id_value - $shift_name_value
    \n"; - $o++; - } - echo "
     
    \n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
    \n"; - echo "
    UTILISATEURS APPARTENANT A CE GROUPE D'UTILISATEURS: $users_to_print
    \n"; - 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + echo "
    MODIFIER UN ENREGISTREMENT DE GROUPE D'UTILISATEURS\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 "
    Groupe: (pas d'espace ni de ponctuation)$NWB#vicidial_user_groups-user_group$NWE
    Description: (Description du groupe)$NWB#vicidial_user_groups-group_name$NWE
    Force timeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Shift exécution: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campagnes autorisées:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; + echo "$campaigns_list
     "; + echo "
    Le statut de mandataire Viewable Groupes:
    $NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
    \n"; - echo "ALL-GROUPS - All user groups in the system
    \n"; - echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; - - $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo "
    Groupe de changements:
    $NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) { - if (ereg(" $vgroups_id_value ", $VGROUP_vgroups)) + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
    \n"; + $o++; } - echo "> $vgroups_id_value - $vgroups_name_value
    \n"; - $o++; - } - echo "
     
    Le statut de mandataire Afficher Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    QC permis Campagnes:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; - echo "$qc_campaigns_list"; echo "
     
    QC permis l'arrivée des groupes:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; - echo "$qc_groups_list"; + + + echo "
    Le statut de mandataire Viewable Groupes:
    $NWB#vicidial_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 - Tous les utilisateurs du système, même pas les utilisateurs inscrits
    \n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } echo "
     
    \n"; + echo "
    Le statut de mandataire Afficher Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Voir le journal de l'Agent d'appel: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agent Autoriser Xfer consultatif: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Autoriser Xfer Override Dial: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    \n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
    USERFULL NAMENIVEAUACTIF
    Agent Autoriser Xfer message vocal: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Autoriser Xfer aveugles: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Autoriser Dial Avec Xfer clientèle: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Autoriser Xfer Parc Dial Client: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent plein écran: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Rapports admis: $NWB#vicidial_user_groups-allowed_reports$NWE
    Remplacer URL Webphone: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone Key System Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    $rowx[0]$rowx[1]$rowx[2]$rowx[3]

    \n"; + if ($SSqc_features_active > 0) + { + echo "
    QC permis Campagnes:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; + echo "$qc_campaigns_list"; + echo "
     
    QC permis l'arrivée des groupes:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; + echo "$qc_groups_list"; + echo "
     
    Groupes d'utilisateurs autorisés:
    $NWB#vicidial_user_groups-admin_viewable_groups$NWE
    \n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
    \n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

    SUPPRIMER CE GROUPE \n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Cliquez ici pour voir Admin chages à ce groupe d'utilisateurs\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } + echo "
     
    Durée des appels autorisés:
    $NWB#vicidial_user_groups-admin_viewable_call_times$NWE
    \n"; + echo "ALL-CALLTIMES - Toutes les heures d'appels dans le système
    \n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
    \n"; + echo "
    UTILISATEURS APPARTENANT A CE GROUPE D'UTILISATEURS: $users_to_print
    \n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    USERFULL NAMENIVEAUACTIF
    $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 "
    Ajouter ou supprimer des en-groupe sélectionné pour les utilisateurs actifs dans ce groupe d'utilisateurs
    \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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Groupe:
    \n"; + echo "
    \n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

    Cliquez ici pour voir tous les CallBack Détient dans ce groupe d'utilisateurs

    \n"; + echo "

    Cliquez ici pour voir le statut timeclock pour ce groupe d'utilisateurs

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

    SUPPRIMER CE GROUPE \n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administrateur pour ce groupe d'utilisateurs\n"; + } } } else @@ -20588,32 +27439,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFIER UN SCRIPT
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    ID du script: $script_id$NWB#vicidial_scripts-script_name$NWE
    Nom du script: (titre du script)$NWB#vicidial_scripts-script_name$NWE
    Commentaires du script: $NWB#vicidial_scripts-script_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_scripts-user_group$NWE
    Actif: $NWB#vicidial_scripts-active$NWE
    Texte du script:

    Prévisualisation du script
    "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -20681,10 +27556,10 @@ if ($ADD==3111111) echo "


    \n"; - echo " CAMPAIGNS USING THIS SCRIPT:
    \n"; + echo " CAMPAGNES utilisant ce script:
    \n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20696,10 +27571,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " IN-GROUPS USING THIS SCRIPT:
    \n"; + echo " In-groups en utilisant ce script:
    \n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20711,10 +27586,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; + echo " Remplacements LISTE utilisant ce script:
    \n"; echo "\n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20725,17 +27600,15 @@ if ($ADD==3111111) $o++; } - echo "
    \n"; - - if ($LOGdelete_scripts > 0) { echo "

    SUPPRIMER CE SCRIPT\n"; } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages de ce script
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration de ce script
    \n"; } + } else { @@ -20753,30 +27626,42 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFIER UN FILTRE\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    ID du filtre:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
    Nom du filtre: (courte description du filtre)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Commentaires du filtre: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_lead_filters-user_group$NWE
    Filtre Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20805,7 +27690,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce filtre
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration à ce filtre
    \n"; } } else @@ -20817,13 +27702,18 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_rafraîchir=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -20869,10 +27759,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_rafraîchir=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20894,6 +27789,15 @@ if ($ADD==311111111) $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]; echo ""; @@ -20901,17 +27805,22 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - 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; @@ -20931,7 +27840,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20941,10 +27850,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -20970,7 +27879,7 @@ if ($ADD==311111111) echo "CAMPAGNES UTILISANT CETTE PERIODE D'APPELS:
    \n"; echo "
    Identifiant de la période d'appels: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Nom de la période d'appels: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
    Commentaires de la période d'appels: $NWB#vicidial_call_times-call_time_comments$NWE
    Début par défaut: Fin par défaut: $NWB#vicidial_call_times-ct_default_start$NWE
    Début le dimanche: Fin le dimanche: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le lundi: Fin le lundi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le mardi: Fin le mardi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le mercredi: Fin le mercredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Jeudi Start: Fin le jeudi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le vendredi: Fin le vendredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le samedi: Fin le samedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_call_times-user_group$NWE
    Début par défaut: Fin par défaut: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le dimanche: Fin le dimanche: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le lundi: Fin le lundi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le mardi: Fin le mardi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le mercredi: Fin le mercredi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Jeudi Start: Fin le jeudi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le vendredi: Fin le vendredi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Début le samedi: Fin le samedi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20982,10 +27891,10 @@ if ($ADD==311111111) } echo "
    \n"; - echo "ENTRANT GROUPS USING THIS CALL TIME:
    \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';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21005,7 +27914,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce temps de garde\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this call time\n"; } } else @@ -21024,10 +27933,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_rafraîchir=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -21049,6 +27963,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -21056,10 +27971,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21074,7 +27994,7 @@ if ($ADD==3111111111) echo "PERIODE D'APPELS UTILISANT CET ETAT DE PERIODE D'APPELS:
    \n"; echo "
    Identifiant de la période d'appels: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
    Nom de la période d'appels d'état: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
    Commentaires de la période d'appels d'état: $NWB#vicidial_call_times-call_time_comments$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_call_times-user_group$NWE
    Début par défaut: Fin par défaut: $NWB#vicidial_call_times-ct_default_start$NWE
    Début le dimanche: Fin le dimanche: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Début le lundi: Fin le lundi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    \n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21106,18 +28026,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -21147,6 +28075,10 @@ if ($ADD==331111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -21174,6 +28106,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Samedi
    \n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    Shift ID:$shift_id
    Shift Nom: (brève description de l'évolution)$NWB#vicidial_shifts-shift_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_shifts-user_group$NWE
    Start Time Shift:\n"; echo "   End Time Shift:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Option Report: $NWB#vicidial_shifts-report_option$NWE
    Rapport Rang: $NWB#vicidial_shifts-report_rank$NWE
    \n"; @@ -21181,7 +28124,7 @@ if ($ADD==331111111) echo "Groupes d'utilisateurs UTILISANT CE SHIFT:
    \n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21201,7 +28144,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce changement\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this shift\n"; } } else @@ -21218,12 +28161,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_rafraîchir=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21231,11 +28179,18 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21258,6 +28236,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21273,11 +28252,12 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21292,8 +28272,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21309,8 +28289,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; - echo "
    Extension du téléphone: $NWB#phones-extension$NWE (Agent Screen Login du téléphone)
    Téléphone Extension:$NWB#phones-extension$NWE
    Nuémro dans le dial plan: (chiffres seulement)$NWB#phones-dialplan_number$NWE
    Boîte vocale: (chiffres seulement)$NWB#phones-voicemail_id$NWE
    CallerID sortant: (chiffres seulement)$NWB#phones-outbound_cid$NWE
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    Adresse IP du téléphone: (optional)$NWB#phones-phone_ip$NWE
    Adresse IP de l'ordinateur: (optional)$NWB#phones-computer_ip$NWE
    IP du serveur: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Mot de passe:$NWB#phones-pass$NWE
    Écran de connexion Agent: $NWB#phones-login$NWE
    Login Mot de passe: $NWB#phones-pass$NWE
    Inscription Mot de passe: $NWB#phones-conf_secret$NWE     Force:
    Définir en tant que Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Webphone Réponse automatique: $NWB#phones-webphone_auto_answer$NWE
    Utilisez IP du serveur externe: $NWB#phones-use_external_server_ip$NWE
    Etat: $NWB#phones-status$NWE
    Compte actif: $NWB#phones-active$NWE
    Type de téléphone: $NWB#phones-phone_type$NWE
    Nom complet: $NWB#phones-fullname$NWE
    Email: $NWB#phones-email$NWE
    Supprimer messagerie vocale après le courrier électronique: $NWB#phones-delete_vm_after_email$NWE
    Zone de messagerie vocale: $NWB#phones-voicemail_timezone$NWE
    Options de la messagerie vocale: $NWB#phones-voicemail_options$NWE
    Compagnie: $NWB#phones-company$NWE
    Image: $NWB#phones-picture$NWE
    Nouveaux messages: $row[14]$NWB#phones-messages$NWE
    Protocole client: $NWB#phones-protocol$NWE
    GMT local: (Ne PAS ajuster pour DST)$NWB#phones-local_gmt$NWE
    Phone Ring Timeout: $NWB#phones-phone_ring_timeout$NWE
    On-Hook Agent: $NWB#phones-on_hook_agent$NWE
    Login du manager: $NWB#phones-ASTmgrUSERNAME$NWE
    Mot de passe du manager: $NWB#phones-ASTmgrSECRET$NWE
    Utilisateur par défaut de VICIDIAL: $NWB#phones-login_user$NWE
    Extension de VmailDump: $NWB#phones-voicemail_dump_exten$NWE
    Extension du context: $NWB#phones-ext_context$NWE
    Téléphone Contexte: $NWB#phones-phone_context$NWE
    Conf dossier secret: $NWB#phones-conf_secret$NWE
    Codecs admis: $NWB#phones-codecs_list$NWE
    Codecs admis avec la matrice: $NWB#phones-codecs_with_template$NWE
    Cannal d'envoi DTMF: $NWB#phones-dtmf_send_extension$NWE
    Groupe d'appels sortants: $NWB#phones-call_out_number_group$NWE
    Localisation du navigateur: $NWB#phones-client_browser$NWE
    Répertoire d'installation: $NWB#phones-install_directory$NWE
    URL du CallerID: $NWB#phones-local_web_callerID_URL$NWE
    URL par défaut de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
    Log des appels: $NWB#phones-AGI_call_logging_enabled$NWE
    Queue activée: $NWB#phones-QUEUE_ACTION_enabled$NWE
    Popup du CallerID: $NWB#phones-CallerID_popup_enabled$NWE
    Bouton de la boîte vocale: $NWB#phones-voicemail_button_enabled$NWE
    Rafraichissement rapide: $NWB#phones-enable_fast_refresh$NWE
    Taux du rafraichissement rapide: (in ms)$NWB#phones-fast_refresh_rate$NWE
    Rafraichissement rapide: $NWB#phones-enable_fast_rafraîchir$NWE
    Taux du rafraichissement rapide: (in ms)$NWB#phones-fast_rafraîchir_rate$NWE
    MySQL persistant: $NWB#phones-enable_persistant_mysql$NWE
    Appel automatique du numéro suivant: $NWB#phones-auto_dial_next_number$NWE
    Arrêter l'enregistrement après chaque appel: $NWB#phones-VDstop_rec_after_each_call$NWE
    Mot de passe DBY: (SecondaireDB Secret)$NWB#phones-DBY_pass$NWE
    Port DBY: (SecondaireDB Port)$NWB#phones-DBY_port$NWE
    Template ID:
    ID modèle:
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21366,6 +28357,10 @@ if ($ADD==32111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Alias ID:$row[0] $NWB#phones-alias_id$NWE
    Alias Nom: $NWB#phones-alias_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    Téléphones Logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; @@ -21379,15 +28374,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -21405,7 +28401,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce téléphone alias\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this phone alias\n"; } } else @@ -21422,12 +28418,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_rafraîchir=1; + } echo "
    LOGINEXTENSIONSERVERPROTOCOLIP
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21437,6 +28438,10 @@ if ($ADD==33111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21450,7 +28455,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce groupe alias\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this group alias\n"; } } else @@ -21469,10 +28474,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_rafraîchir=1; + } echo "
    Alias Groupe ID: $row[0] $NWB#phones-group_alias_id$NWE
    Nom du groupe Alias: $NWB#phones-group_alias_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#phones-user_group$NWE
    Nombre CallerID: $NWB#phones-caller_id_number$NWE
    CallerID Nom: $NWB#phones-caller_id_name$NWE
    Actif:
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -21546,7 +28564,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21555,8 +28573,10 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21565,6 +28585,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21514,6 +28524,10 @@ if ($ADD==311111111111) $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]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21532,6 +28546,10 @@ if ($ADD==311111111111) echo "
    Système de charge: $sysload - $cpu%   $NWB#servers-sysload$NWE
    Live Chaînes: $channels_total   $NWB#servers-channels_total$NWE
    Disk Usage: $disk_usage   $NWB#servers-disk_usage$NWE
    Groupe d'utilisateurs d'administration: $NWB#servers-user_group$NWE
    Version d'Asterisk: $NWB#servers-asterisk_version$NWE
    Nombre max de trunks VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
    Utilisateur de mise à jour manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Utilisateur manager pour l'écoute: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Utilisateur manager pour l'envoi: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf dossier secret: $NWB#servers-conf_secret$NWE
    Conf dossier secret: $NWB#servers-conf_secret$NWE     Force:
    GMT local: (Ne PAS ajuster pour DST)$NWB#servers-local_gmt$NWE
    VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
    Extension AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
    Logs du serveur: $NWB#servers-vd_server_logs$NWE
    Sortie des AGI: $NWB#servers-agi_output$NWE
    Carrier Logging Actif: $NWB#servers-carrier_logging_active$NWE
    Enregistrement Web Link: $NWB#servers-recording_web_link$NWE
    Enregistrement Web Link: $NWB#servers-recording_web_link$NWE
    Alternate Recording IP du serveur: $NWB#servers-alt_server_ip$NWE
    IP du serveur externe: $NWB#servers-external_server_ip$NWE
    Actif IP du serveur double: $NWB#servers-active_twin_server_ip$NWE
    Active Server Asterisk: $NWB#servers-active_asterisk_server$NWE
    Active Server Agent: $NWB#servers-active_agent_login_server$NWE
    Générer des fichiers de conf: $NWB#servers-generate_vicidial_conf$NWE
    Mise à jour de sons: $NWB#servers-sounds_update$NWE
    VICIDIAL Recording Limit: $NWB#servers-vicidial_recording_limit$NWE
    Entrée personnalisée Dialplan: $NWB#servers-custom_dialplan_entry$NWE
    Entrée personnalisée Dialplan: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; @@ -21575,7 +28605,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -21622,7 +28652,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21654,7 +28684,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21752,7 +28782,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce serveur\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this server\n"; } } else @@ -21771,23 +28801,33 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_rafraîchir=1; + } echo "
    CAMPAGNE Malles RESTRICTION DELETE
    \n"; echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; + $user_group = $row[3]; echo "
    A MODIFIER CONF TEMPLATE RECORD: $row[0]
    \n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Template ID: $template_id
    ID modèle: $template_id
    Nom du modèle: $NWB#vicidial_conf_templates-template_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_conf_templates-user_group$NWE
    Template Sommaire: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -21802,7 +28842,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21833,7 +28873,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -21864,7 +28904,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce modèle de conf
    \n"; + echo "

    Cliquez ici pour voir les changements d'administration to this conf template\n"; } } else @@ -21881,12 +28921,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_rafraîchir=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; echo "\n"; @@ -21962,7 +28998,7 @@ if ($ADD==341111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages à ce transporteur\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this carrier\n"; } } else @@ -21979,18 +29015,25 @@ if ($ADD==341111111111) if ($ADD==351111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_tts==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=351111111111&tts_id=$tts_id"; + $modify_footer_rafraîchir=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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -21900,6 +28945,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
    MODIFIER UN SUPPORT D'ENREGISTREMENT: $row[0]\n"; echo "\n"; @@ -21909,10 +28955,14 @@ if ($ADD==341111111111) echo "
    Carrier ID: $carrier_id
    Nom du transporteur: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Description: $NWB#vicidial_server_carriers-carrier_description$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_server_carriers-user_group$NWE
    Inscription à cordes: $NWB#vicidial_server_carriers-registration_string$NWE
    Template ID:
    ID modèle:
    Dialplan Entrée: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP du serveur: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -22013,7 +29062,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir chages Admin à cette entrée TTS\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this TTS entry\n"; } } else @@ -22030,18 +29079,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; + $user_group = $row[5]; echo "
    MODIFIER UN RECORD TTS: $tts_id\n"; echo "\n"; @@ -22000,6 +29043,12 @@ if ($ADD==351111111111) echo "
    TTS ID: $tts_id
    TTS Nom: $NWB#vicidial_tts_prompts-tts_name$NWE
    Actif: $NWB#vicidial_tts_prompts-active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_tts_prompts-user_group$NWE
    TTS Voix: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Text: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -22050,6 +29105,12 @@ if ($ADD==361111111111) echo "
    \n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -22091,7 +29152,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir chages d-administration pour cette musique en attente d-entrée\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this Musique d-attente entry\n"; } } else @@ -22108,12 +29169,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_rafraîchir=1; + } echo "
    Musique en attente d-identification: $moh_id
    Musique d-attente Nom: $NWB#vicidial_music_on_hold-moh_name$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_music_on_hold-user_group$NWE
    Actif: $NWB#vicidial_music_on_hold-active$NWE
    Random Order: $NWB#vicidial_music_on_hold-random$NWE
    \n"; echo "\n"; +echo "\n"; +echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -22124,18 +29190,43 @@ if ($ADD==371111111111) $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]; echo "
    MODIFIER UN messagerie vocale: $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"; @@ -22149,7 +29240,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir chages Admin à cette boîte de messagerie vocale\n"; + echo "

    Cliquez ici pour voir les changements d'administration to this voicemail box\n"; } } else @@ -22160,6 +29251,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_rafraîchir=1; + } + echo "
    Boîte vocale ID: $voicemail_id
    ID vocale: $voicemail_id
    Mot de passe:$NWB#vicidial_voicemail-pass$NWE
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Email:$NWB#vicidial_voicemail-email$NWE
    Actif: $NWB#vicidial_voicemail-active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_voicemail-user_group$NWE
    Supprimer messagerie vocale après le courrier électronique: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
    Zone de messagerie vocale: $NWB#vicidial_voicemail-voicemail_timezone$NWE
    Options de la messagerie vocale: $NWB#vicidial_voicemail-voicemail_options$NWE
    Nouveaux messages: $messages
    Anciens messages: $old_messages
    \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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $user_group = $row[23]; + + echo "
    Modifier l'étiquette ÉCRAN: $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#vicidial_screen_labels-label_name$NWE
    Actif: $NWB#vicidial_screen_labels-active$NWE
    Groupe d'utilisateurs d'administration: $NWB#vicidial_screen_labels-user_group$NWE
    Masquer Label dans des journaux d'appels: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
    Titre Label: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Nom Étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Moyen-étiquette initiale: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Nom de la dernière étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Étiquette Adresse1: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Étiquette Adresse2: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Étiquette Address3: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Ville d'étiquettes: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etat d'étiquettes: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Provinced'étiquettes: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Étiquette Code postal: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Code de plomb étiquette du vendeur: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Sexe étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Numéro de téléphone d'étiquettes: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Code de Téléphone étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Téléphone Alt étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Phrase Label Security: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Email étiquette: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Commentaires étiquettes: $NWB#vicidial_screen_labels-default_field_labels$NWE
    \n"; + + echo "
    \n"; + + + echo "


    \n"; + echo " CAMPAGNES UTILISANT CE LABEL ÉCRAN:
    \n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
    $row[0] $row[1]


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

    SUPPRIMER CETTE ETIQUETTE ECRAN\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administration à cette étiquette écran
    \n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette 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_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_rafraîchir=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_query($stmt, $linkALT); + $row=mysql_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 "
    Modifier un contact: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
    Nom: $NWB#contact_information$NWE
    Prénom: $NWB#contact_information$NWE
    Nombre Bureau: $NWB#contact_information$NWE
    Nombre de cellules: $NWB#contact_information$NWE
    Nombre d'autres 1: $NWB#contact_information$NWE
    Nombre d'autres 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Groupe: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; + + echo "
    \n"; + + if ($LOGast_delete_phones > 0) + { + echo "

    Supprimer ce contact\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Cliquez ici pour voir les changements d'administration à ce contact\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -22168,6 +29476,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_rafraîchir=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -22214,6 +29527,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_rafraîchir=1; + } echo "\n"; echo "\n"; +echo "
    \n"; echo ""; @@ -22261,10 +29579,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_rafraîchir=1; + } 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"; @@ -22452,15 +29904,138 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + 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"; @@ -22478,6 +30053,16 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + + } -echo "\n"; - - -} - echo "
    \n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22312,6 +29688,66 @@ if ($ADD==311111111111111) $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_rafraîchir = $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]; echo "
    MODIFIER LES REGLAGES DU SYSTEME VICIDIAL\n"; echo "\n"; @@ -22322,6 +29758,10 @@ if ($ADD==311111111111111) echo "
    DB Schema Update Date: $db_schema_update_date
    Auto Utilisateur-add Value: $auto_user_add_value
    Date d'installation: $install_date
    Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
    Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
    Utiliser Non-Latin: $NWB#settings-use_non_latin$NWE
    Webroot éditable: $NWB#settings-webroot_writable$NWE
    Affichage de la désactivation d'un agent VICIDIAL: $NWB#settings-vicidial_agent_disable$NWE
    Autoriser les messages SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
    URL de l'accueil de l'administration: $NWB#settings-admin_home_url$NWE
    Administrateur Modifier Auto-Refresh: $NWB#settings-admin_modify_rafraîchir$NWE
    Admin No-Cache: $NWB#settings-nocache_admin$NWE
    Permettez Le Fichier journal De Transfert D'Agent: $NWB#settings-enable_agc_xfer_log$NWE
    Activer Logfile Disposition Agent: $NWB#settings-enable_agc_dispo_log$NWE
    Horloge en temps Fin de la journée:$NWB#settings-timeclock_end_of_day$NWE
    Par défaut locale GMT: (Ne PAS ajuster pour DST)$NWB#settings-default_local_gmt$NWE
    Zone messagerie vocale par défaut: $NWB#settings-default_voicemail_timezone$NWE
    Agents Appels Réinitialiser: $NWB#settings-agents_calls_reset$NWE
    Dernière timeclock Auto Déconnection: $timeclock_last_reset_date
    Agent Header Screen Format Date:
    Central Sound Control Actif: $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
    Annuaire Web Admin: $NWB#settings-admin_web_directory$NWE
    Active Server Boîte vocale: $NWB#settings-active_voicemail_server$NWE
    Permettant de personnaliser le plan d-appel Entrées: $NWB#settings-allow_custom_dialplan$NWE
    Limite Groupement PLLB: $NWB#settings-pllb_grouping_limit$NWE
    Générer les extensions de téléphone de la Croix-Server: $NWB#settings-generate_cross_server_exten$NWE
    Territoires utilisateur Actif: $NWB#settings-user_territories_active$NWE
    Activer Webform Deuxième: $NWB#settings-enable_second_webform$NWE
    Activer TTS Intégration: $NWB#settings-enable_tts_integration$NWE
    Activer CallCard: $NWB#settings-callcard_enabled$NWE
    Activer les champs de liste personnalisés: $NWB#settings-custom_fields_enabled$NWE
    Permettre des appels de test de la campagne: $NWB#settings-test_campaign_calls$NWE
    Activer Statistiques liste élargie: $NWB#settings-expanded_list_stats$NWE
    Activer le code zonal de la campagne CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
    Activer télécommande remplace extension de l'agent: $NWB#settings-did_ra_extensions_enabled$NWE
    Enable Contacts: $NWB#settings-contacts_enabled$NWE
    Trigger connecter d'abord: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Mot de passe par défaut d'inscription Téléphone: $NWB#settings-default_phone_registration_password$NWE     Force:
    Login Mot de passe par défaut Téléphone: $NWB#settings-default_phone_login_password$NWE     Force:
    Mot de passe par défaut du serveur: $NWB#settings-default_server_password$NWE     Force:
    Database Server esclave: $NWB#settings-slave_db_server$NWE
    Rapports d'utiliser DB Slave: $NWB#settings-reports_use_slave_db$NWE
    Entrée personnalisée Dialplan: $NWB#settings-custom_dialplan_entry$NWE
    Recharger Dialplan Sur les serveurs: $NWB#settings-reload_dialplan_on_servers$NWE
    Entrée personnalisée Dialplan: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Masquer Label dans des journaux d'appels: $NWB#settings-label_hide_field_logs$NWE
    Titre Label: $NWB#settings-default_field_labels$NWE
    Nom Étiquette: $NWB#settings-default_field_labels$NWE
    Moyen-étiquette initiale: $NWB#settings-default_field_labels$NWE
    Nom de la dernière étiquette: $NWB#settings-default_field_labels$NWE
    Étiquette Adresse1: $NWB#settings-default_field_labels$NWE
    Étiquette Adresse2: $NWB#settings-default_field_labels$NWE
    Étiquette Address3: $NWB#settings-default_field_labels$NWE
    Ville d'étiquettes: $NWB#settings-default_field_labels$NWE
    Etat d'étiquettes: $NWB#settings-default_field_labels$NWE
    Provinced'étiquettes: $NWB#settings-default_field_labels$NWE
    Étiquette Code postal: $NWB#settings-default_field_labels$NWE
    Code de plomb étiquette du vendeur: $NWB#settings-default_field_labels$NWE
    Sexe étiquette: $NWB#settings-default_field_labels$NWE
    Numéro de téléphone d'étiquettes: $NWB#settings-default_field_labels$NWE
    Code de Téléphone étiquette: $NWB#settings-default_field_labels$NWE
    Téléphone Alt étiquette: $NWB#settings-default_field_labels$NWE
    Phrase Label Security: $NWB#settings-default_field_labels$NWE
    Email étiquette: $NWB#settings-default_field_labels$NWE
    Commentaires étiquettes: $NWB#settings-default_field_labels$NWE
    QC Active Caractéristiques: $NWB#settings-qc_features_active$NWE
    Pull QC Dernière Heure: $qc_last_pull_time
    Codecs par défaut: $NWB#settings-default_codecs$NWE
    Webphone par défaut: $NWB#settings-default_webphone$NWE
    IP par défaut du serveur externe: $NWB#settings-default_external_server_ip$NWE
    URL Webphone: $NWB#settings-webphone_url$NWE
    Key System Webphone: $NWB#settings-webphone_systemkey$NWE
    Non-Réponse Connexion: $NWB#settings-noanswer_log$NWE
    DID journal de l'Agent: $NWB#settings-did_agent_log$NWE
    Alt-Server Log DB: $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 Mot de passe:$NWB#settings-alt_log_server_ip$NWE
    Alt-Log tableaux: $NWB#settings-tables_use_alt_log_db$NWE
    Activer le log des QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
    IP du serveur QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
    Nom de la base de données QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
    QueueMetrics connecter-Out: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallEtat: $NWB#settings-queuemetrics_callstatus$NWE
    QueueMetrics addMember Enabled: $NWB#settings-queuemetrics_addmember_enabled$NWE
    Code de QueueMetrics Pause Dispo: $NWB#settings-queuemetrics_dispo_pause$NWE
    Téléphone QueueMetrics Environnement Téléphone Append: $NWB#settings-queuemetrics_pe_phone_append$NWE
    Activer Vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Cliquez ici pour synchroniser les utilisateurs avec Vtiger\n"; @@ -22494,7 +30079,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Cliquez ici pour voir Admin chages pour les réglages du système\n"; + echo "

    Cliquez ici pour voir les changements d'administration to the system settings\n"; } } else @@ -22515,15 +30100,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_rafraîchir=1; + } echo "
    \n"; echo ""; echo "
    \n"; echo "STATUTS DE VICIDIAL DANS CE SYSTÈME :  $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -22540,8 +30142,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -22562,15 +30163,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -22598,14 +30197,16 @@ if ($ADD==321111111111111) echo "
    AJOUTEZ LE NOUVEAU STATUT DE SYSTÈME
    \n"; echo "\n"; echo "Etat:   \n"; - echo "Description:
    \n"; + echo "Description:   \n"; echo "Selectionnable:   \n"; - echo "Réponse de l'homme:   \n"; + echo "Réponse de l'homme:
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Catégorie :\n"; echo "
    ETATDESCRIPTIONSELECT-
    ABLE
    L'HOMME
    REPONSE
    CATÉGORIEMODIFY/DELETE
    S
    T
    A
    T
    U
    S
    DESCRIPTIONCATÉGORIE
    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 "\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])) @@ -22581,15 +30189,6 @@ if ($ADD==321111111111111) { echo "SUPPRIMER\n"; } - - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
    \n"; echo ""; @@ -22677,7 +30283,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -22741,6 +30347,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_rafraîchir_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_rafraîchir=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -22829,7 +30440,7 @@ if ($ADD==550) echo "
    Niveau de l'utilisateur:
    Groupe utilisateur: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23186,6 +30801,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -23210,6 +30826,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -23217,6 +30834,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -23225,7 +30844,7 @@ if ($ADD==100) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23233,7 +30852,7 @@ if ($ADD==100) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23166,6 +30780,7 @@ if ($ADD==10) echo "CAMPAIGN ID
    NOM
    ACTIVE   GROUP   DIAL PROCEDE  
    $row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -23265,7 +30884,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23292,7 +30911,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23301,7 +30919,7 @@ if ($ADD==1000) echo "
    ID DE LA LISTENOM DE LA LISTENOM DE LA LISTEDESCRIPTIONRTIMEABOUTIT COUNT
    "; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -23329,6 +30948,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23347,18 +30967,20 @@ if ($ADD==1300) echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -23312,6 +30930,7 @@ if ($ADD==1000) echo "NOMPRIORITÉACTIFGROUPE ADMINTIMECOLORMODIFIER $row[1] $row[2] $row[3] $row[6] $row[4]  MODIFIER
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); - echo "
    ENTRANT DID LISTINGS:\n"; + echo "
    INBOUND DID LISTINGS:\n"; echo "
    \n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23374,7 +30996,9 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23391,7 +31015,7 @@ if ($ADD==1500) echo "
    #DIDDESCRIPTIONACTIFGROUPE ADMINROUTERECMODIFIER
    $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -23416,6 +31041,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -23431,6 +31057,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -23442,6 +31069,72 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
    \n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -23400,6 +31024,7 @@ if ($ADD==1500) echo "
    MENU IDNOMGROUPPROMPTTIMEOUTOPTIONS
    $menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
    \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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
    Filtrer les listings Group Téléphone:\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=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    FPG IDFPG NAMEDESCRIPTIONGROUPE ADMINPHONES COUNTMODIFIER
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFIER
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFIER
    \n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23450,7 +31143,28 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23479,6 +31194,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23487,6 +31203,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23461,6 +31175,7 @@ if ($ADD==10000) echo "LINESSERVEUR   CONF-EXTEN   GROUP   STATUS   CAMPAIGN   MODIFIER
    $row[4] $row[5] $row[6] $row[7]MODIFIER
    \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_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
    LISTE DES GROUPES D'EXTENSION:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    GROUPEXTENSIONRANK   RESTRICT   COUNT   LAST CALL   LAST ID   MODIFIER
    $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]MODIFIER
    \n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -23495,7 +31258,7 @@ if ($ADD==100000) echo "
    \n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -23534,7 +31297,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23557,6 +31321,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23573,7 +31338,7 @@ if ($ADD==10000000) echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -23544,6 +31307,7 @@ if ($ADD==1000000) echo "SCRIPT IDNom du scriptACTIVE   GROUPE ADMIN   MODIFIER
    $row[0] $row[1] $row[2] $row[3]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23594,6 +31360,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23610,7 +31377,10 @@ if ($ADD==100000000) echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -23582,6 +31347,7 @@ if ($ADD==10000000) echo "
    FILTER IDFILTER NAMEGROUPE ADMINMODIFIER
    $row[0] $row[1] $row[2]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23635,6 +31406,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23650,7 +31422,7 @@ if ($ADD==1000000000) echo "
    \n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -23621,6 +31391,7 @@ if ($ADD==100000000) echo "CALLTIME NOMDémarrage par défautDEFAULT STOPGROUPE ADMINMODIFIER
    $row[1] $row[2] $row[3] $row[4] MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23677,6 +31450,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23692,7 +31466,7 @@ if ($ADD==130000000) echo "
    \n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -23662,6 +31434,7 @@ if ($ADD==1000000000) echo "CALLTIME NOMDémarrage par défautDEFAULT STOPGROUPE ADMINMODIFIER
    $row[2] $row[3] $row[4] $row[5] MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23719,6 +31494,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23747,7 +31523,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -23761,6 +31537,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23779,7 +31556,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -23795,7 +31573,7 @@ if ($ADD==12000000000) echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -23704,6 +31478,7 @@ if ($ADD==130000000) echo "SHIFT STARTSHIFT LONGUEURSEMAINEGROUPE ADMINMODIFIER
    $row[2] $row[3] $row[4] $row[5] MODIFIER
    ETATNOMVMAILGROUPLIENS
    $row[5] $row[6] $row[7]$row[8]$row[8]$row[9]MODIFIER | STATISTIQUES
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23818,6 +31597,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23833,7 +31613,7 @@ if ($ADD==13000000000) echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23805,6 +31583,7 @@ if ($ADD==12000000000) echo "ALIAS IDAliasTÉLÉLISTE DE TELEPHONESE ConnexionsGROUPMODIFIER
    $row[0]$row[1]$row[2]$row[3]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23860,6 +31641,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23875,7 +31657,7 @@ if ($ADD==100000000000) echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -23845,6 +31625,7 @@ if ($ADD==13000000000) echo "CID NUMÉROCID NOMACTIFGROUPE ADMINMODIFIER
    $row[2]$row[3]$row[4]$row[5]MODIFIER
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -23921,15 +31703,16 @@ if ($ADD==130000000000) echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); echo "
    CONF TEMPLATE LISTEAGES:\n"; echo "
    \n"; echo ""; - echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23942,6 +31725,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23957,7 +31741,7 @@ if ($ADD==140000000000) echo "
    Template IDID modèleNom du modèleGROUPE ADMINMODIFIER
    $row[0]$row[1]$row[2]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23986,6 +31771,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24002,7 +31788,7 @@ if ($ADD==150000000000) echo "
    \n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -23970,6 +31754,7 @@ if ($ADD==140000000000) echo "ProtocolInscriptionActiveGROUPE ADMINMODIFIER
    $row[3]$row[4]$row[5]$row[6]MODIFIER
    "; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24030,7 +31818,9 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24047,7 +31837,7 @@ if ($ADD==160000000000) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24012,7 +31798,9 @@ if ($ADD==150000000000) echo "TTS IDTTS NomActiveTTS VoixTTS TextGROUPE ADMINMODIFIER
    $row[0]$row[1]$row[2]$row[4]$row[3]$row[5]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24076,6 +31867,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24092,7 +31884,7 @@ if ($ADD==170000000000) echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -24058,6 +31848,7 @@ if ($ADD==160000000000) echo "MOH NameActiveRandom OrderGROUPE ADMINMODIFIER
    $row[1]$row[2]$row[3]$row[4]MODIFIER
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -24122,6 +31915,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -24130,6 +31924,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -24105,6 +31897,7 @@ if ($ADD==170000000000) echo "Nouveaux messagesAnciens messagesDeleteGROUPE ADMINMODIFIER
    $row[3]$row[4]$row[5]$row[6]MODIFIER
    \n"; + echo ""; + + $stmt="SELECT label_id,label_name,active,user_group from vicidial_screen_labels $whereLOGadmin_viewable_groupsSQL order by label_id"; + $rslt=mysql_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
    Les étiquettes de l'écran de l'agent:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    LABEL IDNameActiveGROUPE ADMINMODIFIER
    $row[0]$row[1]$row[2]$row[3]MODIFIER
    \n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24284,6 +32181,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24305,7 +32203,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    NOMNombre BureauBU NameDepartmentGroupJob TitleLocationMODIFIER
    $row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFIER
    \n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -24230,7 +32126,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24244,6 +32140,7 @@ if ($ADD==700000000000000) echo "
    SECTIONTYPERECORD IDGROUPDESCRIPTIONGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24369,6 +32268,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -24387,73 +32287,90 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
    \n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -24314,7 +32212,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -24328,6 +32226,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGROUPDESCRIPTIONGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_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"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPTIONGOTO
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + $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 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    ADMIN CHANGE LOG: Section Records - $category - $stage\n"; + echo "
    \n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $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')";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
    \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=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + 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 "Vous n'avez pas la permission de voir cette page\n"; + exit; } - echo "


    \n"; - echo "\n"; - echo "
    \n"; } @@ -24463,53 +32380,66 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
    ADMIN CHANGE LOG: Record Détail - $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"; - $row[9] = eregi_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]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; - echo "\n"; - echo "
    \n"; + 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_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
    ADMIN CHANGE LOG: Record Détail - $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] = eregi_replace("',","' ,",$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]
    GROUPE ADMIN: $row[11]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; + echo "\n"; + echo "
    \n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; } } @@ -24524,7 +32454,7 @@ if ($ADD==999999) 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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -24546,13 +32476,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -24564,54 +32500,104 @@ if ($ADD==999999)
          - Real-Time Rapports
    -
    - Inbound and Outbound Calling Rapports
    -
      -
    • Inbound Report -
    • Inbound Service Level Report -
    • Inbound Résumé Hourly Report -
    • Inbound DID Report -
    • Inbound IVR Report -
    • Outbound Calling Report -
    • Outbound Summary Interval Report -
    • Fronter - Closer Report - - Real-Time Rapports
      \n"; + echo "
        \n"; + if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$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 Campagne Summary/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Real-Time Campagne Summary\n";} + echo "

      \n"; + echo "Inbound and Outbound Calling Rapports
      \n"; + echo "
        \n"; + if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$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 RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Rapport entrant par DID\n";} + if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound Service Level Report\n";} + if ( (preg_match("/Inbound Résumé Hourly Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound Résumé Hourly Report\n";} + if ( (preg_match("/Inbound Daily Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound Daily Report\n";} + if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound DID Report\n";} + if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Inbound IVR Report\n";} + if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Outbound Calling Report\n";} + if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Outbound Summary Interval Report\n";} + if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + echo "
      • Outbound IVR Report"; + if ($LOGexport_reports >= 1) + { + if ( (preg_match("/Appels d'exportation Rapport/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo " - Export";} + } + echo "\n"; + } + if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Fronter - Closer Report\n";} + if ( (preg_match("/Listes Statuts De Campagne Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Listes Statuts De Campagne Report\n";} + if ( (preg_match("/Campagne Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Campagne Status List Report\n";} + # echo "
      • AGENT SPREADSHEET PERFORMANCE\n"; + if ( ( (preg_match("/Dialer Rapport d'inventaire/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) and ($inventory_report_count > 0) ) + {echo "
      • Dialer Rapport d'inventaire\n";} + if ($LOGexport_reports >= 1) { - echo "
      • Appels d'exportation Rapport\n"; + if ( (preg_match("/Appels d'exportation Rapport/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Appels d'exportation Rapport\n";} + if ( (preg_match("/Pistes d'exportation Rapport/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
      • Pistes d'exportation Rapport\n";} } - ?> -
      + echo "
    \n"; + echo "
    \n"; + echo "      \n"; + echo "\n"; + echo "Agent Rapports
    \n"; + echo "
      \n"; + if ( (preg_match("/Agent Time Détails/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Agent Time Détails\n";} + if ( (preg_match("/Agent Status Détail/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Agent Status Détail\n";} + if ( (preg_match("/Agent Performance Détail/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Agent Performance Détail\n";} + if ( (preg_match("/Team Performance Détail/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Team Performance Détail\n";} + if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Single Agent Daily\n";} + if ( (preg_match("/Statistiques utilisateur/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Statistiques utilisateur\n";} + if ( (preg_match("/Utilisateur Feuille de temps/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Utilisateur Feuille de temps\n";} + echo "

    \n"; + echo "Time Clock Rapports
    \n"; + echo "
    \n"; + echo "Other Rapports and Links
    \n"; + echo "
      \n"; + if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Server Performance Report\n";} -
    -       - - Agent Rapports
    -
    - Time Clock Rapports
    -
    - Other Rapports and Links
    -
      -
    • Server Perforrmance Report - = 9) + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + {echo "
    • Maximum System Stats\n";} + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) ) { echo "
    • Administration Change Log\n"; } @@ -24623,58 +32609,117 @@ if ($ADD==999999) { echo "
    • VtigerCRM Home\n"; } - if ($list_update_count > 0) + if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) ) { echo "
    • List Update Stats\n"; } - ?> -
    -
    - - -
    
    -		
    -		 $o)
    +		if ($SScallcard_enabled > 0)
     			{
    -			$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";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			$o++;
    +			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) )
    +				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERDESCRIPTIONIPACTLOADCHANDISKSORTANTENTRANT
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Rapports Links/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$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;
    +			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";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				else
    +					{
    +					if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) )
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					else
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					}
    +				echo "\n";
    +				$o++;
    +				}
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +
    +				$stmt="SELECT NOW();";
    +				$rslt=mysql_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    SERVEUR -DESCRIPTIONIPACTLOADCHANDISKTIME
    SERVEUR +DESCRIPTIONIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      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 RAPPORTS/",$LOGallowed_reports)) ) ) + { + echo "

      Utilitaire Admin\n"; + } + } } else { @@ -24682,6 +32727,463 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    + "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -186,12 +309,33 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; + + ### Log search + echo "
    \n"; + echo "
    "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
    + \n"; + echo "   \n"; + } +##### END admin links ##### + + +###################### +# ADD=999997 - user force change password page +###################### +if ($ADD==999997) + { + $show_form=1; + if ($stage=='VALIDER') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGEMENT DE MOT DE PASSE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Mot de passe a été mis à jour, vous pouvez maintenant continuer\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    CHANGEMENT DE MOT DE PASSE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Nouveau mot de passe:     Force:
    Vous êtes tenu de changer votre mot de passe avant de pouvoir continuer à l'administration. Un mot de passe fort est à la fois minuscules et majuscules, ainsi que au moins un numéro. Votre mot de passe doit être de 2 à 20 caractères de long et ne peut pas contenir tous les caractères qui ne sont pas des lettres ou des numéros. Assurez-vous que ce mot de passe est quelque chose que vous pouvez vous rappeler, parce que dès que vous effectuez cette modification, vous serez invité à saisir votre nouveau mot de passe pour vous reconnecter à l'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=='VALIDER') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |1|" . strlen($pass);} + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='UTILISATEURS', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Les mots de passe ont été mis à jour, vous pouvez maintenant continuer sur dans l'administration.

    Vous voudrez peut-être commencer par lire le manuel Gestionnaire Vicidial disponible à l'adresse vicidial.org (il ya une version gratuite disponible)\n"; + } + } + } + } + if ($show_form > 0) + { + echo "
    \n"; + echo ""; + + echo "
    Bienvenue à Vicidial, écran de configuration initiale

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    Vous êtes tenu de changer votre mot de passe avant de pouvoir continuer à l'administration. Un mot de passe fort est à la fois minuscules et majuscules, ainsi que au moins un numéro. Votre mot de passe doit être de 2 à 20 caractères de long et ne peut pas contenir tous les caractères qui ne sont pas des lettres ou des numéros. Assurez-vous que ce mot de passe est quelque chose que vous pouvez vous rappeler, parce que dès que vous avez terminé cet écran de configuration initiale, vous serez invité à saisir votre nouveau mot de passe à nouveau de se reconnecter à l'administration
    Nouveau mot de passe:     Force:
     
    Les trois prochaines mots de passe par défaut sont définis dans la section Paramètres système, et vous pouvez les changer après que vous les définir ici. Il s'agit d'une bonne idée de faire ces mots de passe fort pour que personne ne peut pirater vos comptes de téléphone et des appels téléphoniques lieu sans que vous sachiez. Le mot de passe d'enregistrement par défaut utilisée lors de nouveaux téléphones sont ajoutés au système en tant que SIP ou IAX mot de passe téléphone VOIP. Le téléphone de connexion par défaut mot de passe utilisé lors web nouveaux téléphones sont ajoutés au système, comme le mot de passe de téléphone que l'agent aurait utiliser dans l'interface agent Vicidial. Le mot de passe par défaut du serveur utilisé lorsque de nouveaux serveurs sont ajoutés au système pour les serveurs de communiquer les uns avec les autres.
    Mot de passe par défaut d'inscription Téléphone:     Force:
    Login Mot de passe par défaut Téléphone:     Force:
    Mot de passe par défaut du serveur:     Force:
     
    Les deux prochaines paramètres sont également définis dans la section Paramètres système, et vous pouvez les changer après que vous les définir ici. Vous devez régler le défaut local GMT avec le fuseau horaire que vos agents veulent être po La zone de messagerie vocale est la liste des fuseaux horaires boîte vocale que les messages vocaux seront enregistrés avec le temps lorsque de nouveaux messages sont laissés.
    Par défaut locale GMT: (Ne PAS ajuster pour DST)$NWB#settings-default_local_gmt$NWE
    Zone messagerie vocale par défaut: $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 "
    Bienvenue à Vicidial: page de copyright, marque et de licence

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   Le Call Center Suite Vicidial est maintenue par le ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" est une marque déposée de la ViciDial Group. Voici notre politique d'utilisation des marques
    License:   Le Call Center Suite Vicidial est publié sous la AGPLv2 licence open source
    Source Code:   Le Centre Vicidial Appel Suite logicielle est disponible pour téléchargement, et pour l'utilisation, exempt du coût. Vous pouvez télécharger le facile à installer ViciBox CD ISO version, ou seulement l' le code source
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Continuer sur la configuration initiale

      \n"; + } + } +##### END copyright trademark license page ##### + + +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Page cachée utilitaires - Si vous ne savez pas ce que ces utilitaires, vous ne devriez pas les utiliser

    \n"; + echo "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$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 Détail/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $campaign_name = $rowx[0]; + } + else + {echo "Not found"; exit;} + } + + echo "
    Administration: Maximum Stats Détail for $stage $modify_link$campaign_id
    - $campaign_name   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Vous n'avez pas la permission de voir cette 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Vous n'avez pas la permission de voir cette page";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + echo "
    \n"; @@ -24695,24 +33197,127 @@ echo "
    \n"; echo "

    "; echo "VERSION: $admin_version
    "; -echo "CONSTRUCTION: $build
    \n"; - +echo "CONSTRUCTION: $build\n"; +if (!preg_match("/_CONSTRUCTION_/",$SShosted_settings)) + {echo "
    © 2012 ViciDial Group
    ";} +echo "\n"; ?>
    - - 1) and ($modify_footer_rafraîchir > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_rafraîchir > 1) and ($modify_footer_rafraîchir > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Il ya $complete_leads fils terminés dans ces listes\n";} + } + else + { + echo "aucun statut d'appel selectionnés pour cette campagne\n"; + } + } + else + { + echo "pas de listes actives pour cette campagne\n"; + } + } +else + { + echo "pas de listes actives pour cette campagne\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -25035,7 +33640,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -25047,8 +33658,11 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; - echo "Cette campagne a $active_leads fiches à appeler dans ces listes\n"; + if ($DB > 0) {echo "|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {echo "Cette campagne a $active_leads fiches à appeler dans ces listes\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_campaign_multi_alt.php new file mode 100644 index 00000000..e66a3e73 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: campagne multi-Alt-Leads +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Cette campagne n'est pas réglé sur Auto-Alt-Dial MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_VALIDER") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-plomb Paramètres Auto Alt numérotation Formulaire<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_VALIDER>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS CAMPAGNE: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>APPELE</td><td>NON APPELE</td><td>SELECTED</td><td>OLD RANK</td><td>NEW RANK</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>SOUS TOTAUX</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Commandez Liste Randomize: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Commandez Liste secondaire: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Version: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_header.php index 2daa478c..283c6219 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,25 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -27,15 +46,23 @@ if($short_header) ?> <TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR> <TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22>   </TD> + <?php if ($reports_only_user < 1) { + ?> <TD>   <A HREF="admin.php" ALT="Utilisateurs"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Utilisateurs</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10" ALT="Campagnes"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Campagnes</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100" ALT="Listes"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Listes</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=1000000" ALT="Scripts"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Scripts</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000000" ALT="Filtres"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Filtres</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=1000" ALT="In-Groups"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>In-Groups</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=1000" ALT="Inbound"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Inbound</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=100000" ALT="Groupes d'utilisateurs"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Groupes d'utilisateurs</B></A>   </TD> <TD>   <A HREF="admin.php?ADD=10000" ALT="Agents distants"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Agents distants</B></A>   </TD> - <TD>   <A HREF="admin.php?ADD=10000000000" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <TD>   <A HREF="admin.php?ADD=999998" ALT="Admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Admin</B></A>   </TD> + <?php + } + else + { ?> + <TD width=600>     </TD> + <?php } ?> <TD>   <A HREF="admin.php?ADD=999999" ALT="Rapports"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Rapports</B></A>   </TD> </TR> </TABLE> @@ -319,41 +346,99 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_rafraîchir > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_rafraîchir;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("rafraîchir_countdown").innerHTML = "<font color=black> screen rafraîchir in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_rafraîchir_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -519,22 +604,47 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) ) } + + +### Javascript for shift end-time calculation and display +if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) + { + ?> + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + <?php + } + + +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -546,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -558,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -570,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -622,13 +732,17 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 if (selected_route=='INGROUP') { if (value_context.length < 10) - {value_context = 'CID,LB,998,TESTCAMP,1';} - var value_context_split = value_context.split(","); - var IGhandle_method = value_context_split[0]; - var IGsearch_method = value_context_split[1]; - var IGlist_id = value_context_split[2]; - var IGcampaign_id = value_context_split[3]; - var IGphone_code = value_context_split[4]; + {value_context = 'CID,LB,998,TESTCAMP,1,,,,';} + var value_context_split = value_context.split(","); + var IGhandle_method = value_context_split[0]; + var IGsearch_method = value_context_split[1]; + var IGlist_id = value_context_split[2]; + var IGcampaign_id = value_context_split[3]; + var IGphone_code = value_context_split[4]; + var IGvid_enter_filename = value_context_split[5]; + var IGvid_id_number_filename = value_context_split[6]; + var IGvid_confirm_filename = value_context_split[7]; + var IGvid_validate_digits = value_context_split[8]; if (route == selected_route) { @@ -640,14 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Manipuler Méthode: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 BORDER=0 ALT="AIDE" ALIGN=TOP></a>'; + new_content = new_content + '<BR>Méthode de recherche: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID de la liste: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID de la campagne: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + new_content = new_content + "<BR>   VID Entrez Nom: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   Nom du fichier VID Numéro d'identification: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   VID Confirmer Nom: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   Chiffres VID: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -667,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "fichier audio: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -782,14 +901,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -799,14 +922,19 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Manipuler Méthode: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Méthode de recherche: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID de la liste: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID de la campagne: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; + // new_content = new_content + "<BR>   VID Entrez Nom: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   Nom du fichier VID Numéro d'identification: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   VID Confirmer Nom: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   Chiffres VID: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + } if (selected_route=='DID') { @@ -826,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "fichier audio: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,15 +1020,46 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_rafraîchir > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_rafraîchir_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_fr/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">French <img src=\"../agc/images/fr.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?> <CENTER> @@ -911,6 +1070,8 @@ $SSenable_tts_integration = $row[1]; <IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="VICIDIAL logo"> <B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR> <TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160> + <?php if ($reports_only_user < 1) { + ?> <!-- UTILISATEURS NAVIGATION --> <TR WIDTH=160><TD <?php echo $users_hh ?> WIDTH=160> <a href="<?php echo $ADMIN ?>?ADD=0"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $users_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $users_bold ?>Utilisateurs</a> @@ -966,6 +1127,10 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -989,31 +1154,56 @@ $SSenable_tts_integration = $row[1]; ?> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Pause Codes</a></TD> - <?php } + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>> Presets moins de/a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- LISTES NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { ?> <TR><TD ALIGN=LEFT <?php echo $lists_hh ?>><a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $lists_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $lists_bold ?>Listes</a></TD></TR> <?php - if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Ajouter-Supprimer numéro Du DNC';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Ajouter-Supprimer Nombre DNC';} + else {$DNClink = 'Ajouter un numéro de DNC';} ?> - <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Voir les listes </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle liste </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Rechercher une fiche </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> - </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./new_listloader_superL.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Charger de nouvelles fiches </a> - </TD></TR> - <?php } + <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Voir les listes </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle liste </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Rechercher une fiche </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle piste </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Charger de nouvelles fiches </a> + <?php + if ($SScustom_fields_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Liste Champs Personnalisés </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copier les champs personnalisés </a> + <?php + } + ?> + </TD></TR> + <?php + } } ?> <!-- SCRIPTS NAVIGATION --> @@ -1051,30 +1241,50 @@ $SSenable_tts_integration = $row[1]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> In-Groups </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Entrant </a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Nombre FPG Ajouter-Supprimer';} + else {$FPGlink = 'Ajouter un numéro de GJ';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Voir les In-Groups </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter un nouveau In-Group </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Dans-Groupe De Copie</a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Dans-Groupe De Copie</a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Voir DiDs </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle DID </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopieDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopieDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Afficher Appel Menus </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter un nouveau menu d-appel </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copiez Appel du menu </a> + <HR> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Téléphone Groupes Filter </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter un groupe Téléphone filtre </a> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> <?php } ?> @@ -1109,12 +1319,16 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Voir les agents distants </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter un nouvel agent distant </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Groupes d'extension </a> + </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter un groupe d'extension </a> </TD></TR> <?php } ?> <!-- ADMIN NAVIGATION --> <TR><TD <?php echo $admin_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> + <a href="<?php echo $ADMIN ?>?ADD=999998"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $admin_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $admin_bold ?> Admin </a> </TD></TR> <?php if (strlen($admin_hh) > 1) @@ -1135,6 +1349,8 @@ $SSenable_tts_integration = $row[1]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1145,6 +1361,10 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1164,6 +1384,8 @@ $SSenable_tts_integration = $row[1]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Conférences </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> Réglages du système</a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Les étiquettes d'écran </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>>Statuts De Système</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1186,7 +1408,23 @@ $SSenable_tts_integration = $row[1]; </TR> <?php } + if ($SScallcard_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cc_sh ?>>   + <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cc_fc ?> SIZE=<?php echo $header_font_size ?>> CallCard Admin </a></TD> + </TR> + + <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } + } ?> <!-- RAPPORTS NAVIGATION --> <TR><TD <?php echo $reports_hh ?>> @@ -1202,7 +1440,7 @@ $SSenable_tts_integration = $row[1]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>ACCUEIL</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Horloge en temps</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Déconnection</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>ACCUEIL</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Horloge en temps</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Déconnection</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1245,12 +1483,16 @@ $SSenable_tts_integration = $row[1]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copier Un Transporteur </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Afficher TTS Entrées </a>   |   <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle entrée TTS </a></TD></TR> <?php } + if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { + ?> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Générer nouveaux numéros </a></TD></TR> + <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> <TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Afficher MOH Entrées </a>   |   <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajouter une nouvelle entrée MOH </a></TD></TR> @@ -1263,6 +1505,14 @@ $SSenable_tts_integration = $row[1]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Réglages du système</a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Les étiquettes d'écran </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajoutez un contrôle Label écran </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ajout d'un contact </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Statuts De Système</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Catégories De Statut</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Codes d'état QC</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..ab252306 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"AIDE\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- VERSION: $version CONSTRUCTION: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Statut du fichier courant:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Charger les fiches depuis ce fichier:
    ID de la liste Override: + +
    Téléphone Code Override: + +
    Disposition du fichier à utiliser:Standard Format    Disposition personnalisée    Custom Template
    Modèle personnalisé à utiliser: générateur de modèle
    Vérification des doublons dans les fiches:
    USA-Canada Check:
    Consultation du fuseau horaire de la fiche:
            
            RETOUR A L'ADMINISTRATION         Old Lead Loader     LIST LOADER 4th Gen-     VERSION:     CONSTRUCTION:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID de la liste Override:
    Téléphone Code Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSION:     CONSTRUCTION: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    En coursfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Indicatif régional/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Indicatif régional"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    En cours$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Indicatif régional/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Indicatif régional"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    En cours$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Indicatif régional/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Indicatif régional"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    En cours$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColonneDonnées du fichier
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Dimanche March to First Dimanche November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Dimanche March to First Dimanche November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Dimanche, to 6=Samedi) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # heure locale calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Dimanche April to Last Dimanche October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in April and last Dimanche in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # heure locale calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Dimanche March to Last Dimanche October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in March and last Dimanche in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Dimanche October to Last Dimanche March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in October and last Dimanche in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Dimanche October to Last Dimanche March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and last Dimanche in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Dimanche in October to First Dimanche in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and first Dimanche in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Dimanche October to Third Dimanche March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and third Dimanche in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Dimanche in September to First Dimanche in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in September and first Dimanche in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Dimanche October to Last Dimanche February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Dimanche October to Last Dimanche February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_third_gen.php new file mode 100644 index 00000000..6d67658c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"AIDE\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Charger les fiches depuis ce fichier:
    ID de la liste Override: + +
    Téléphone Code Override: + +
    Disposition du fichier à utiliser:Standard Format    Disposition personnalisée
    Vérification des doublons dans les fiches:
    USA-Canada Check:
    Consultation du fuseau horaire de la fiche:
            
            RETOUR A L'ADMINISTRATION         Old Lead Loader     LIST LOADER 3rd Gen-     VERSION:     CONSTRUCTION:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    ID de la liste Override:
    Téléphone Code Override:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSION:     CONSTRUCTION: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    En coursfile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Indicatif régional/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Indicatif régional"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    En cours$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Indicatif régional/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Indicatif régional"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    En cours$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColonneDonnées du fichier
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Dimanche March to First Dimanche November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Dimanche March to First Dimanche November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Dimanche, to 6=Samedi) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # heure locale calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Dimanche April to Last Dimanche October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in April and last Dimanche in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # heure locale calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Dimanche March to Last Dimanche October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in March and last Dimanche in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Dimanche October to Last Dimanche March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in October and last Dimanche in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Dimanche October to Last Dimanche March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and last Dimanche in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Dimanche in October to First Dimanche in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and first Dimanche in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Dimanche October to Third Dimanche March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Dimanche in October and third Dimanche in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Dimanche in September to First Dimanche in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Dimanche in September and first Dimanche in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Dimanche October to Last Dimanche February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Dimanche October to Last Dimanche February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # heure locale calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # heure locale calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_lists_custom.php new file mode 100644 index 00000000..dd5698c9 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Listes de champ personnalisés +<?php + +################################################################################ +##### BEGIN help section +if ($action == "AIDE") + { + ?> + + + +
    +
    +
    + ViciDial Listes de champ personnalisés Help +

    + + +
    + Étiquette de zone - C'est l'identificateur de champ de base de données pour ce champ. Ce doit être un identifiant unique dans les champs personnalisés pour cette liste. Ne pas utiliser les espaces ou la ponctuation pour ce domaine. max 50 caractères, un minimum de 2 caractères. Vous pouvez également inclure les champs par défaut Vicidial dans une configuration de champ personnalisé, et vous les voir en rouge dans la liste. Ces champs ne seront pas ajoutés à la table de la base liste personnalisée, l'interface agent au lieu référence à la table vicidial_list directement. Les étiquettes que vous pouvez utiliser afin d'inclure les fieds par défaut sont - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Nom du champ - C'est le nom du champ tel qu'il apparaîtra à un agent par le biais de leur interface. Vous pouvez utiliser des espaces dans ce domaine, mais aucun signe de ponctuation caractères, maximum de 50 caractères et un minimum de 2 caractères. +

    + +
    +
    + Description du champ - La description de ce champ tel qu'il apparaîtra dans l'interface d'administration. Ce champ est facultatif avec un maximum de 100 caractères. +

    + +
    +
    + Rang de terrain - L'ordre dans lequel ces champs est affiché à l'agent le plus faible d'en haut vers le plus haut sur le fond. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Aide de terrain - Champ optionnel, si vous le remplir, l'agent sera en mesure de voir ce texte quand ils cliquent sur un lien d'aide à côté du champ dans leur interface de l'agent. +

    + +
    +
    + Type de champ - Cette option définit le type de champ qui sera affiché. TEXTE est un formulaire d'inscription standard unique en ligne, AREA est une zone de texte multi-lignes, SELECT est une sélection unique menu déroulant, MULTI est une boîte multi-sélection, la radio est une liste de boutons radio, où une seule option peut être sélectionné, CHECKBOX est une liste de cases à cocher où plusieurs options peuvent être sélectionnées, DATE est un calendrier jour mois année popup où l'agent peut sélectionner la date et l'heure est une boîte de sélection du temps. La valeur par défaut est TEXT. Pour les options SELECT, MULTI, RADIO et CHECKBOX vous devez définir les valeurs des options ci-dessous dans le champ Options de la boîte. AFFICHAGE affiche uniquement et ne pas permettre la modification par l'agent. SCRIPT également afficher uniquement, mais vous êtes en mesure d'utiliser des variables de script comme dans la fonction de scripts. Champs script va aussi afficher uniquement le contenu dans les options, et non pas le nom du champ comme le type d'affichage ne. HIDDEN ne sera pas affiché l'agent sur le terrain, mais permettra le terrain pour avoir des données importées en elle et exportées hors de l', ainsi que le rendre disponible à l'onglet script et l'adresse de formulaire Web. READONLY affichera la valeur des données dans le domaine, mais ne permettra pas à l'agent de modifier les données. CACHERBLOB est similaire à l'exception du type HIDDEN stockage de données sur la base de données est un type BLOB, approprié pour des données binaires ou des données qui doit être garanti. +

    + +
    +
    + Options pour les champs - Pour la touche SELECT, MULTI, RADIO et les types de champs case, vous devez définir les valeurs des options dans cette boîte. Vous devez mettre une liste de l'étiquette possibilité séparées par des virgules et texte de l'option ici à chaque option un sa propre ligne. La première valeur ne devrait pas avoir des espaces, et ni les valeurs devraient avoir aucun signe de ponctuation. Par exemple - electric_meter, compteur électrique +

    + +
    +
    + Position Option - Pour les types de terrain CheckBox et RADIO seulement, s'il est réglé sur HORIZONTAL les options apparaissent sur la même ligne éventuellement retour à la ligne ci-dessous si il ya beaucoup d'options. Si la valeur Vertical, il y aura seulement une option par ligne. Par défaut est HORIZONTAL. +

    + +
    +
    + Taille du champ - Ce réglage signifie des choses différentes en fonction de ce que le type de champ est. Pour les champs texte, la taille est le nombre de caractères qui apparaîtra dans le domaine. Pour les champs ZONE, la taille est la largeur de la zone de texte en caractères. Pour les champs MULTI, ce paramètre définit le nombre d'options à afficher dans la liste sélection multiple. Pour SELECT, RADIO, CHECKBOX, DATE et HEURE ce paramètre est ignoré. +

    + +
    +
    + Champ Max - Ce réglage signifie des choses différentes en fonction de ce que le type de champ est. Pour le texte, les champs cachés et READONLY, la taille est le nombre maximum de caractères autorisés dans le domaine. Pour les champs AREA, ce champ définit le nombre de lignes de texte visible dans la zone de texte. Pour MULTI, SELECT, RADIO, CHECKBOX, DATE et HEURE ce paramètre est ignoré. +

    + +
    +
    + Par défaut le terrain - Ce champ optionnel vous permet de définir quelle est la valeur à attribuer à un champ si rien n'est chargé dans ce domaine. Par défaut est NULL, qui désactive la fonction par défaut. Pour les types de champ DATE, la valeur par défaut est toujours mis à jour à moins qu'un nombre est mis en auquel cas la date sera celle de nombreux jours, plus ou moins aujourd'hui. Pour les types de champ Heure, la valeur par défaut est toujours mis à l'heure actuelle du serveur sauf si un nombre est mis en auquel cas le temps sera que plusieurs minutes plus ou moins de temps en cours. +

    + +
    +
    + Coût de terrain - Ce champ en lecture seule vous indique quel est le coût de ce champ est dans le tableau champ personnalisé pour cette liste. Il n'y a pas de limite pour le nombre de champs personnalisés que vous pouvez avoir dans une liste, mais le total du coût de tous les champs de la liste doit être inférieure à 65000. Cela permet généralement pour des centaines de champs, mais si vous spécifiez plusieurs champs de texte qui sont des centaines ou des milliers de caractères de longueur, vous pouvez atteindre cette limite rapidement. Si vous avez besoin que beaucoup de texte dans un champ, vous devez choisir un type de région, qui sont stockés différemment et ne pas utiliser l'espace de table autant. +

    + +
    +
    + Champ obligatoire - Si réglé sur Y, ce champ forcer l'agent à entrer du texte ou sélectionner une option pour ce domaine. Par défaut est N. +

    + +
    +
    + Position Nom du champ - S'il est défini à GAUCHE, ce nom de champ apparaît à gauche du champ, si elle est définie de la page le nom du champ prendra toute la ligne et apparaissent au-dessus du champ. Par défaut est laissé. +

    + +
    +
    + Option de copie - Lors de la copie des définitions de champs d'une liste à l'autre, vous avez quelques options pour le fonctionnement du processus de copie. APPEND ajoute les champs qui ne sont pas présents dans la liste de destination, si il ya des étiquettes sur le terrain correspondant à ceux volonté est resté inchangé, pas de données de champs personnalisés seront supprimés ou modifiés en utilisant cette option. UPDATE met à jour les champs communs field_label dans la liste de destination pour les définitions des champs de la liste source. des données de champs personnalisés peuvent être modifiées ou perdues en utilisant cette option. REMPLACER va supprimer tous les champs personnalisés existants dans la liste de destination et de les remplacer par des champs personnalisés à partir de la liste des sources, toutes les données de champs personnalisés seront supprimés à l'aide de cette option. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "ERREUR: les champs personnalisés ne sont pas actifs sur ce système\n"; + exit; + } + + +$NWB = "   \"AIDE\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Copier les champs à une autre liste
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    La liste des ID pour copier les champs De:
    La liste des ID pour copier les champs pour:
    Option de copie: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_VALIDER") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "ERREUR: Vous ne pouvez pas copier les champs à la même liste: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "ERREUR: la liste Source n'a pas de champs personnalisés\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCCÈS: Champ personnalisé supprimé - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCCÈS: Champ personnalisé Ajouté - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "ERREUR: La table n'existe pas custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCCÈS: champ personnalisé de modification - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERREUR: Champ n'existe pas\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERREUR: La table n'existe pas custom_$list_id\n
    ";} + else + { + echo "

    CLIQUEZ ICI pour confirmer la suppression ce champ personnalisé: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERREUR: Champ n'existe pas\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERREUR: La table n'existe pas custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCCÈS: Champ personnalisé supprimé - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "ERREUR: Vous ne pouvez pas utiliser des mots réservés pour les étiquettes sur le terrain - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Vous devez entrer dans les options sur le terrain lors de l'ajout d'un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "ERREUR: Champ existe déjà pour cette liste - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCCÈS: Champ personnalisé Ajouté - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_VALIDER") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERREUR: Champ n'existe pas\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERREUR: La table n'existe pas\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Vous devez entrer dans les options sur le terrain lors de mettre à jour un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCCÈS: champ personnalisé de modification - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    Modifierchamp personnalisés: ID de la liste $list_id         "; + echo "Les dossiers de cette table personnalisée: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### RÉSUMÉ DES CHAMPS ### + echo "
    RÉSUMÉ DES CHAMPS:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Il ya no custom fields for this list
    TOTALS: $o             $total_cost    


    \n"; + + + ### EXEMPLE DE FORMULAIRE DE MESURE ### + echo "\n"; + echo "
    EXEMPLE DE FORMULAIRE DE MESURE:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Il ya no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='CACHERBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### MODIFIER LES CHAMPS ### + echo "
    MODIFIER LES CHAMPS EXISTANTS:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Étiquette de zone $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Rang de terrain $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Nom du champ $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Position Nom du champ $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Description du champ $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Aide de terrain $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Type de champ $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Options pour les champs $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Position Option $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Taille du champ $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Champ Max $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Par défaut le terrain $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Champ obligatoire $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Ajouter un nouveau champ MESURE POUR CETTE LISTE:
    New Rang de terrain:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Étiquette de zone: $NWB#vicidial_lists_fields-field_label$NWE
    Nom du champ: $NWB#vicidial_lists_fields-field_name$NWE
    Position Nom du champ: $NWB#vicidial_lists_fields-name_position$NWE
    Description du champ: $NWB#vicidial_lists_fields-field_description$NWE
    Aide de terrain: $NWB#vicidial_lists_fields-field_help$NWE
    Type de champ: $NWB#vicidial_lists_fields-field_type$NWE
    Options pour les champs: $NWB#vicidial_lists_fields-field_options$NWE
    Position Option: $NWB#vicidial_lists_fields-multi_position$NWE
    Taille du champ: $NWB#vicidial_lists_fields-field_size$NWE
    Champ Max: $NWB#vicidial_lists_fields-field_max$NWE
    Par défaut le terrain: $NWB#vicidial_lists_fields-field_default$NWE
    Champ obligatoire: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Aller à la page de modification liste pour cette liste

    \n"; + + echo "  Cliquez ici pour voir les changements d'administration à cette listes custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    LISTE LISTE avec des champs personnalisés COUNT:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    ID DE LA LISTENOM DE LA LISTEACTIFCAMPAIGNCUSTOM FIELDSMODIFIER
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]MODIFIER LES CHAMPS
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); + } + else + { + echo "ECHEC de la vérification de la fiche pour l'id $lead_id       $NOW_TIME\n

    \n"; +# echo "Close this window\n

    \n"; + } - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    Informations sur l'appel: $first_name $last_name - $phone_number

    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_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"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPTIONGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATE TABLE custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTER TABLE custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='CACHERBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="MONTRER COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTER TABLE custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTER TABLE custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='CACHERBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTER TABLE custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_modify_lead.php index 89f23747..5cb8d55d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,19 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -48,8 +61,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -118,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -130,9 +149,15 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -140,26 +165,35 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -169,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -185,50 +219,137 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Ville'; +$label_state = 'State'; +$label_province = 'Province'; +$label_postal_code = 'Code Postal'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexe'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Commentaires'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Modification de l'enregistrement de la fiche + +
    ADMINISTRATION: Modification de l'enregistrement de la fiche
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "Le plomb a été ajouté: $lead_id

    \n"; + $end_call=0; + } + else + {echo "ERREUR: pas encore ajouté de plomb, s'il vous plaît revenir en arrière et regarder ce que vous avez entré

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Informations modifiées

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -248,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -258,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -306,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -315,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -324,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -332,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -366,179 +521,365 @@ else $alts_output .= "
    $row[4]
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $u++; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; - echo "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $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 from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "CACHERLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + $entry_list_id = $row[34]; + + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Ajouter une nouvelle piste\n";} + else + {echo "
    Informations sur l'appel: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID de la liste: $list_id
    Nom:   \n"; - echo " Prénom:
    Adresse1 :
    Adresse2 :
    Adresse3 :
    Ville :
    Etat:   \n"; - echo " Code postal:
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    Province:
    NOTES:   $rowA[0]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} + + if ($LOGadmin_hide_lead_data != '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"; + } + 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"; + } + + if ($lead_id != 'NEW') + { echo "\n"; + echo "(with $list_campaign statuses)\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + } + else + { + echo "\n"; + } - + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) + { echo "\n"; - echo "
    Lead ID: $lead_id     ID de la liste: $list_id
    Fronter: $tsr     Called Count: $called_count
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    Pays : $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    Pays :
    Main Phone :
    Téléphone alternatif :
    Email :
    Sécurité:
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    Commentaires :
    $label_comments :
    Disposition: (with $log_campaign statuses)
    Modifiervicidial log
    Modifieragent log
    Modifiercloser log
    Add closer log record
    \n"; - echo "


    \n"; + } + echo "
    \n"; + echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') + { + echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "APPELS VERS CETTE FICHE:\n"; + echo "
    \n"; + echo "Callback Détails:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $CB_to_print = mysql_num_rows($rslt); @@ -625,135 +983,376 @@ else echo "New Callback Owner UtilisateurID: \n"; echo "
    \n"; } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Commentaires: + + +
    + + + + +
    + +
    + + No Callback records found
    \n"; } + } - } - else - { - echo "ECHEC de la vérification de la fiche pour l'id $lead_id       $NOW_TIME\n

    \n"; -# echo "Close this window\n

    \n"; - } - - - - echo "

    \n"; - - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENSION SUPPLEANT DE NUMEROS DE TELEPHONE POUR CE PLOMB:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - echo "APPELS VERS CETTE FICHE:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) + echo "
    Si vous voulez changer ce fil à un rappel prévu, d'abord changer la disposition à CBHOLD, puis le soumettre et vous serez en mesure de fixer la date et l'heure de rappel.
    \n"; + } + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    \n"; + + echo "

    \n"; + + echo "
    \n"; + + if ($c > 0) + { + echo "EXTENSION SUPPLEANT DE NUMEROS DE TELEPHONE POUR CE PLOMB:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="MONTRER TABLES LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "CHAMPS SUR MESURE POUR CE FIL:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if (eregi("http",$location)) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo "
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # CAMPAGNEDATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modifierchanges to this lead\n"; + } + + echo "\n"; } - - - echo "
    \n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_search_lead.php index 3e88dfc2..78d5057a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -22,6 +22,13 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -39,6 +46,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} @@ -54,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -71,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -91,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -141,13 +219,58 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Ville'; +$label_state = 'State'; +$label_province = 'Province'; +$label_postal_code = 'Code Postal'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexe'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Commentaires'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
    \n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
    \n"; echo "\n"; echo "\n"; @@ -156,16 +279,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
    Recherche de fiches Options:
    Vendor ID(code vendeur de la fiche):   $label_vendor_lead_code(code vendeur de la fiche):  
     
    Home Numéro de téléphone:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Nom:   $label_first_name:  
    Prénom:   $label_last_name:  
     
    Log Search Options:
    Lead ID:  
     
    $label_phone_number Dialed:  
     
    \n"; echo "\n
    \n"; echo "\n"; @@ -200,9 +344,249 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Il ya no outbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  CAMPAIGN  CALL DATE  ETAT  USER  ID DE LA LISTE  LENGTH  DIAL
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
    \n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Il ya no inbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + 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 ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  INGROUP  CALL DATE  ETAT  USER  ID DE LA LISTE  LENGTH  
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
    \n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "Il ya no inbound did calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #DID  PHONE  DID ID  CALL DATE  
    $o$row[0]$row[1]$row[2]$row[3]
    \n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


    \nNOUVELLE RECHERCHE"; + + echo "\n\n\n


    \ntemps d'exécution du script: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -210,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -244,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -261,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -277,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -301,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -334,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "CACHERLEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -364,7 +811,15 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_fr/audio_store.php index 4f8941ea..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/audio_store.php @@ -1,17 +1,20 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -125,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -191,8 +194,28 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +300,26 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +327,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +360,18 @@ if ($action == "MANUALUPLOAD")
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

    -audio file list
    +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav) +

    All spaces will be stripped from uploaded audio file names

    +audio file list
    + + + +




    \n"; + +echo "


    Click here to see a log of the uploads to the audio store
    \n"; + +?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_fr/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_fr/call_report_export.php index f4599238..35dde7b4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,22 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -42,45 +58,132 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} 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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = "Appels d'exportation Rapport"; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Login ou mot de passe invalide or no export report permission: |$PHP_AUTH_USER|\n"; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +213,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -197,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -218,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Il ya no outbound calls during this time period for these parameters\n"; exit; } else @@ -236,9 +354,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -248,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Il ya no inbound calls during this time period for these parameters\n"; exit; } else @@ -266,9 +403,28 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -282,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORTATION DE RAPPORT ENGAGE', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -299,9 +455,50 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,13 +535,243 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="MONTRER TABLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Il ya no calls during this time period for these parameters\n"; exit; } } @@ -360,7 +787,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -375,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -390,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -405,7 +832,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +862,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +882,9 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -480,10 +909,14 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Appels d'exportation Rapport"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; @@ -498,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lundi week start </script> <?php @@ -514,13 +947,49 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lundi week start </script> <?php + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>champ personnalisés:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Campagnes:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -532,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Groupes entrants:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Listes:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -559,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Statuts:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -571,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Groupes d'utilisateurs:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_fr/callcard_admin.php new file mode 100644 index 00000000..b19fd9ac --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSION: <?php echo $version ?> CONSTRUCTION: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"AIDE\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Détail<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Etat: </td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Groupe: </td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Commentaires: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create Utilisateur/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate Utilisateur/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used Utilisateur/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void Utilisateur/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ETAT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>NOMBRE</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Il ya $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>NOMBRE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>NOMBRE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Groupe: </td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ETAT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     VERSION: <?php echo $version ?>     CONSTRUCTION: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_fr/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
    "; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "
    \n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_fr/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_fr/dbconnect.php index dca45485..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/dbconnect.php @@ -1,58 +1,71 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) -{ -$DBCagc = file("/etc/astguiclient.conf"); -foreach ($DBCagc as $DBCline) { - $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); - if (ereg("^PATHlogs", $DBCline)) - {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} - if (ereg("^PATHweb", $DBCline)) - {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} - if (ereg("^VARserver_ip", $DBCline)) - {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} - if (ereg("^VARDB_server", $DBCline)) - {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} - if (ereg("^VARDB_database", $DBCline)) - {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} - if (ereg("^VARDB_user", $DBCline)) - {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} - if (ereg("^VARDB_pass", $DBCline)) - {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} - if (ereg("^VARDB_port", $DBCline)) - {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; } -} -else -{ -#defaults for DB connection -$VARDB_server = 'localhost'; -$VARDB_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -if (!$link) { +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { die('MySQL connect ERROR: ' . mysql_error()); -} + } mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/fcstats.php index bea37962..3d28dcb5 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -33,18 +39,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "In-Group Fronter-Closer Stats Report\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFIER | RAPPORTS \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           TÉLÉCHARGER | MODIFIER | RAPPORTS
    Afficher as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK VALIDER\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK VALIDER\n";
     }
     
     else
    @@ -167,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -185,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -216,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| AGENT                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALS FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| AGENT                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -246,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -270,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -309,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -324,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -354,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -369,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -397,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -425,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -449,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -532,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -546,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -591,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -613,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/functions.php b/agc_2-X/trunk/LANG_www/vicidial_fr/functions.php index f3a6e7b7..c53d60b0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "  
    \"AIDE\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/group_hourly_stats.php index 9f7c508b..4436bacd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTAL $status $hour_calls $total_calls $day_calls
    TOTAL $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Veuillez entrez le groupe pour lequel vous souhaitez avoir les statistiques horaires :
    \n"; - echo "\n"; - echo "group: \n"; +echo "group:
    \n"; - echo "status:   (example: XFER)
    \n"; - echo "date with hour:   (example: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "status:   (example: XFER)
    \n"; +echo "date with hour:   (example: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \ntemps d'exécution du script: $RUNtime se exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_fr/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_fr/lead_report_export.php new file mode 100644 index 00000000..036af440 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = "Pistes d'exportation Rapport"; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Il ya no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Il ya no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="MONTRER TABLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Il ya no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Pistes d'exportation Rapport</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Ce rapport rassemble les informations de plomb pour les appels émis dans la plage de dates sélectionnée. Un plomb est seulement exporté une fois, peu importe combien d'appels ont été traités. Le statut de plomb actuelle est utilisée.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lundi week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lundi week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>champ personnalisés:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campagnes:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Groupes entrants:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Listes:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Statuts:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Groupes d'utilisateurs:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_fr/leadloader_template_display.php new file mode 100644 index 00000000..2e817ac0 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/line.js b/agc_2-X/trunk/LANG_www/vicidial_fr/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_fr/list_download.php index 8dfb9682..ea3cd2fe 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Il n'y a pas les numéros de téléphone figurant sur la liste: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Campagne DNC list validation ##### + $event_code_type='CAMPAIGN DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Il n'y a pas conduit dans la liste DNC Campagne: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Il n'y a pas conduit dans ce groupe de téléphone du filtre: $group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "Il ya no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTS') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTS') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTS') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="MONTRER TABLES LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTS') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_fr/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_fr/listloaderMAIN.php index e4f74657..41efb37f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_fr/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_fr/new_listloader_superL.php index 3d489dad..8f94d3fe 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -30,11 +30,16 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -127,22 +132,29 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -171,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -203,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -348,6 +360,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <form action=<?php echo $PHP_SELF ?> method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> <input type=hidden name='leadfile_name' value="<?php echo $leadfile_name ?>"> +<input type=hidden name='DB' value="<?php echo $DB ?>"> <?php if ($file_layout!="custom") { ?> <table align=center width="700" border=0 cellpadding=5 cellspacing=0 bgcolor=#D9E6FE> <tr> @@ -384,7 +397,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <tr> <td align=center colspan=2><input type=submit value="VALIDER" name='submit_file'>        <input type=button onClick="javascript:document.location='new_listloader_superL.php'" value="RECHARGER" name='reload_page'></td> </tr> - <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">RETOUR A L'ADMINISTRATION</a></font></td><td align=right><font size=1>LIST LOADER-     VERSION: <?php echo $version ?>     CONSTRUCTION: <?php echo $build ?>     </td></tr> + <tr><td align=left><font size=1>         <a href="admin.php?ADD=100" target="_parent">RETOUR A L'ADMINISTRATION</a>         <a href="./admin_listloader_third_gen.php">3rd Gen Lead Loader</a>     </font></td><td align=right><font size=1>LIST LOADER-     VERSION: <?php echo $version ?>     CONSTRUCTION: <?php echo $build ?>     </td></tr> </table> <?php } ?> @@ -398,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -409,7 +422,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "<center><font face='arial, helvetica' size=3 color='#009900'><B>En cours$delim_name-delimited file...\n"; @@ -445,7 +458,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +478,36 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +519,69 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +708,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +719,54 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -642,9 +778,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -666,7 +802,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; { print "<BR><BR>DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override<BR><BR>\n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +810,13 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>En coursCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +844,6 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +864,112 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1094,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1107,53 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "<!-- $affected_rows|$custom_SQL_query -->";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -905,9 +1164,9 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -919,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTES', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -930,9 +1189,9 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -941,8 +1200,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1210,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1244,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1264,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1428,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,21 +1443,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1181,9 +1479,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1194,10 +1492,10 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1504,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1512,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1230,8 +1528,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>En coursCSV file... \n"; @@ -1258,7 +1556,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1576,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1740,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,21 +1754,31 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTE</font><b>\n"; + } + else + { + print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n"; + } + } $bad++; } $total++; @@ -1452,9 +1789,9 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1464,6 +1801,7 @@ if ($leadfile) { print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; } else { + ##### BEGIN field chooser ##### print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>"; flush(); print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n"; @@ -1472,15 +1810,67 @@ if ($leadfile) { print " <th><font class='standard' color='white'>Données du fichier</font></th>\r\n"; print " </tr>\r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MONTRER TABLES LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1488,8 +1878,8 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1536,10 +1926,10 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1937,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1945,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1571,8 +1961,8 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>En coursCSV file... \n"; @@ -1617,6 +2007,8 @@ if ($leadfile) { print "</table>\r\n"; # } print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>"; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>"; @@ -1638,7 +2030,7 @@ exit; function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { -require("dbconnect.php"); +global $link; $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_fr/non_agent_api.php index faecfc20..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -31,10 +38,40 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -129,6 +166,139 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +306,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -186,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -201,13 +372,76 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -216,23 +450,22 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -260,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -280,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -515,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Real-Time Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Rapport Choisissez Options d-affichage"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "Rechargez maintenant"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       MODIFIER | \n";} +else + {echo "       MODIFIER | \n";} + +echo "SUMMARY \n"; + + +echo "       rafraîchir: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       CACHER GROUPE D'UTILISATEURS";} +else + {echo "       VIEW GROUPE D'UTILISATEURS";} +if ($SERVdisplay>0) + {echo "       CACHER SERVEUR INFO";} +else + {echo "       MONTRER SERVEUR INFO";} +if ($CALLSdisplay>0) + {echo "       CACHER WAITING CALLS";} +else + {echo "       MONTRER WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       CACHER IN-GROUP STATS";} +else + {echo "       MONTRER IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       CACHER PHONES";} +else + {echo "       MONTRER PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       CACHER CUSTPHONES";} +else + {echo "       MONTRER CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_fr/remote_dispo.php index e0ab9c21..fee1b308 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_fr/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_fr/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_edit.php index 3f045e39..ed6a4226 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_report.php index 8c020fc4..e94e93b3 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,12 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -38,36 +44,60 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'UtilisateurHorloge en temps Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +106,49 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -83,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -99,49 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE>UtilisateurHorloge en temps Report - -<?php +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -161,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -187,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE BORDER=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE BORDER=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lundi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lundi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Groupes d'utilisateurs:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Groupes d'utilisateurs:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Utilisateur:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">RAPPORTS</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Afficher as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "UtilisateurHorloge en temps Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Utilisateur:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Time range: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&VALIDER=$VALIDER&file_download=1\">TÉLÉCHARGER</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">RAPPORTS</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="UtilisateurHorloge en temps Report $NOW_TIME\n"; + +$CSV_text.="\"UtilisateurHorloge en temps Report - $NOW_TIME\"\n"; +$CSV_text.="\"Time range: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -301,92 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Time range: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"FAIT APPEL Hangup STATS\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} - -$TOThours = $TOTdbHOURS; -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; - -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_status.php index 953a0f9f..fc23b397 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -10,9 +10,14 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -33,25 +38,41 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +$report_name = 'Groupe utilisateurHorloge en temps Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,13 +89,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -86,35 +112,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else - { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -131,18 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Horloge en temps Status -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -162,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Horloge en temps Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GROUPE D'UTILISATEURS</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Horloge en temps Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GROUPE D'UTILISATEURS</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -228,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -247,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -291,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -311,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR GROUPE D'UTILISATEURS: $user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR GROUPE D'UTILISATEURS: $user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[TÉLÉCHARGER]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR GROUPE D'UTILISATEURS: $user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPAIGN\"\n"; $o=0; $s=0; @@ -338,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -380,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALS</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -429,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</td></tr>\n"; +$MAIN.="<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -459,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -478,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -501,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -520,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_fr/user_group_bulk_change.php index b079b0e1..24cee95e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Groupe utilisateur $old_group Utilisateurs changed to the $group Groupe utilisateur<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Utilisateurs changed to the $group Groupe utilisateur<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_fr/user_stats.php index 96647b68..4a3ef6c9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -20,34 +20,65 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'Statistiques utilisateur'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -62,6 +93,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -72,12 +105,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,28 +129,83 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; + +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL RAPPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Vous n'êtes pas autorisé à consulter ce rapport: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -119,17 +213,17 @@ else +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -?> -<html> -<head> +if ($did > 0) + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} +else + {$HEADER.="<title>ADMINISTRATION: $report_name";} -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: Statistiques utilisateur -<?php ##### BEGIN Set variables to make header show properly ##### @@ -148,402 +242,472 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Statistiques utilisateur for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; +if ($did > 0) + {$MAIN.="<B>   DID Call Stats for $user";} +else + {$MAIN.="<B>   Statistiques utilisateur for $user";} +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -<?php +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="</script>\n"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lundi week start -</script> -<?php - -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lundi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lundi week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Feuille de temps</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">Utilisateur Status</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifier un utilisateur</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utilisateur multiple day status detail report</a>"; -echo "</center>\n"; - - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; - -echo "<br><center>\n"; - -##### vicidial agent talk time and status ##### - -echo "<B>AGENT TEMPS DE CONVERSATION ET ETAT:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ETAT</td><td align=right><font size=2>NOMBRE</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +$MAIN.="<center>\n"; +if ($did > 0) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModifierDID</a>\n"; } - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) +else { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Feuille de temps</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">Utilisateur Status</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Modifier un utilisateur</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utilisateur multiple day status detail report</a>"; + } +$MAIN.="</center>\n"; + + +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +$MAIN.="<br><center>\n"; + + +if ($did < 1) + { + ##### vicidial agent talk time and status ##### + $MAIN.="<B>AGENT TEMPS DE CONVERSATION ET ETAT:     <a href='$download_link&file_download=1'>[TÉLÉCHARGER]</a></B>\n"; + + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ETAT</td><td align=right><font size=2>NOMBRE</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"AGENT TEMPS DE CONVERSATION ET ETAT\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>TOTAL DES APPELS</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>AGENT HEURE DE CONNECTION/DECONNECTION:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - } - - $total_calls = ($total_calls + $row[0]); + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; $o++; - } + } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + $call_hours_minutes = sec_convert($total_sec,'H'); -echo "<tr><td><font size=2>TOTAL</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>TOTAL DES APPELS</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"TOTAL DES APPELS\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; -echo "</TABLE></center>\n"; + + ##### Login and Déconnection time from vicidial agent interface ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>AGENT HEURE DE CONNECTION/DECONNECTION:     <a href='$download_link&file_download=2'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $CSV_text2.="\"AGENT HEURE DE CONNECTION/DECONNECTION\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPAIGN\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) + { + $event_start_seconds = $row[1]; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; + } + else + { + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + $MAIN.="<tr><td><font size=2>TOTAL</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; + + $MAIN.="</TABLE></center>\n"; -##### vicidial_timeclock log records for user ##### + ##### vicidial_timeclock log records for user ##### -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; + $MAIN.="<br><br>\n"; -echo "<center>\n"; + $MAIN.="<center>\n"; -echo "<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK HEURE DE CONNECTION/DECONNECTION:     <a href='$download_link&file_download=3'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK HEURE DE CONNECTION/DECONNECTION\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {$MAIN.="|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); + + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTAL </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; + + + + ##### closer in-group selection logs ##### + + $MAIN.="<br><br>\n"; + + $MAIN.="<center>\n"; + + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPAIGN\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; + + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) + $MAIN.="</TABLE><BR><BR>\n"; + + + ##### vicidial agent outbound calls for this time period ##### + + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + + if ($LOGadmin_hide_phone_data != '0') { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + if ($DB > 0) {echo "CACHERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; + } - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + $MAIN.="</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>SORTANT CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### -echo "<B>ENTRANT/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[TÉLÉCHARGER]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +722,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -565,130 +739,181 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALS</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALS\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + $MAIN.="<B>Activité de l'agent Pour cette période: (10000 record limit)     <a href='$download_link&file_download=7'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>ces champs sont en quelques secondes </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"Activité de l'agent Pour cette période: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPAIGN\",\"PAUSE CODE\"\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; + } + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALS</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALS\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; + + $MAIN.="</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[TÉLÉCHARGER]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -704,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -717,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -725,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -732,84 +962,234 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; - + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } - -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL SORTANT CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "CACHERPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } + } + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### -echo "</TABLE><BR><BR>\n"; + $MAIN.="<B>LEAD RECHERCHES POUR CETTE PÉRIODE: (10000 record limit)     <a href='$download_link&file_download=10'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"LEAD RECHERCHES POUR CETTE PÉRIODE: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[TÉLÉCHARGER]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2> CAMPAGNE</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPAIGN\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_fr/user_status.php index e658f0ec..73fc4130 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,12 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -64,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -98,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -106,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -132,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -154,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -270,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -338,48 +370,114 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; + $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_pe_phone_append = $row[8]; } ##### 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=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_fr/user_territories.php index 92006655..4d76b7bc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/user_territories.php @@ -40,8 +40,8 @@ if (isset($_GET["batch"])) {$batch=$_GET["batch"];} elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: Territoires utilisateur ne sont pas actifs sur ce système\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Login ou mot de passe invalide: |$USER|$PASS|\n"; exit; } } @@ -138,8 +138,8 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> -<title>ADMINISTRATION: User Territories +<!-- VERSION: <?php echo $version ?> CONSTRUCTION: <?php echo $build ?> --> +<title>ADMINISTRATION: Utilisateur Territoires <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Changer Territoire Propriétaire<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propriétaire:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,12 +175,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propriétaire:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; echo "</TABLE></center>\n"; exit; } @@ -194,7 +194,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i if ( (strlen($accountid)<1) or (strlen($user)<1) ) { - echo "ERROR: Account ID and User must be filled in<BR>\n"; + echo "ERROR: Account ID and Utilisateur must be filled in<BR>\n"; } else { @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Dû ajouter territoire utilisateur: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Territoire propriétaire a changé: $user $territory<BR>\n"; + echo "Enregistrements modifiés: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,13 +299,13 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">Liste des territoires</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Ajouter Territoire</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Ajouter un utilisateur Territoire</a></TD> <? if ($enable_vtiger_integration > 0) { ?> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territoire Owner</a></TD> <? $colspan='4'; } ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"AIDE\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,10 +350,10 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Changer Territoire Propriétaire<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territoire: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Propriétaire:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,12 +387,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Propriétaire:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; echo "</TABLE></center>\n"; } ### END change territory owner in the system @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territoire et l-utilisateur doivent être remplis<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Dû ajouter territoire utilisateur: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Territoire propriétaire a changé: $user $territory       Enregistrements modifiés: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Ajouter un utilisateur Territoire<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -550,7 +550,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territoire: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -567,7 +567,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$territories_list"; echo "</select></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Level: </td><td align=left><select size=1 name=level><option>TOP_AGENT</option><option>STANDARD_AGENT</option><option>BOTTOM_AGENT</option></select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add user territory page @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territoire, d-utilisation et de niveau doivent être remplis<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: cet utilisateur sur le territoire est déjà dans le système<BR>\n"; } else { @@ -600,7 +600,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Added: $user $territory<BR>\n"; + echo "Utilisateur Territoire Added: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territoire, d-utilisation et de niveau doivent être remplis<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: cet utilisateur sur le territoire n-est pas dans le système<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "Utilisateur Territoire de modification: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territoire et l-utilisateur doivent être remplis<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: cet utilisateur sur le territoire n-est pas dans le système<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "Territoire d-utilisateur supprimé: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -706,12 +706,12 @@ if ($action == "ADD_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Ajouter Territoire<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territoire: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Description du territoire: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add territory page @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territoire et du territoire La description doit être rempli<BR>\n"; } else { @@ -731,14 +731,14 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: il ya déjà un territoire dans le système avec ce nom<BR>\n"; } else { $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; $rslt=mysql_query($stmt, $link); - echo "Territory Added: $territory<BR>\n"; + echo "Ajouté le territoire: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Territoire doit être rempli<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Ce territoire n-est pas dans le système avec ce nom<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Territoire Supprimé: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territoire et du territoire La description doit être rempli<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Ce territoire n-est pas dans le système avec ce nom<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Territoire de modification: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Modifier Territoire<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territoire: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Description du territoire: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -882,13 +882,13 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rsltV); $vtiger_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Comptes: </td><td align=left><B>$vtiger_count</B></td></tr>"; } - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=VALIDER value=VALIDER></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Utilisateurs in this Territoire:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">SUPPRIMER</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Supprimer ce territoire</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Territoire non trouvé: $territory<BR>\n"; } } ### END modify territory page @@ -986,7 +986,7 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Lister tous les territoires:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>Utilisateur Territoires     VERSION: <?php echo $version ?>     CONSTRUCTION: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_fr/vdremote.php index 1c9aa459..68b31db6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_fr/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/vicidial_sales_viewer.php b/agc_2-X/trunk/LANG_www/vicidial_fr/vicidial_sales_viewer.php index 607b4d09..b095b7ea 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/vicidial_sales_viewer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/vicidial_sales_viewer.php @@ -88,7 +88,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; <input type="hidden" name="list_ids"> <table border=0 cellpadding=5 cellspacing=0 align=center width=600> <tr> - <th colspan=3><font class="standard_bold">Vicidial SORTANT recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> + <th colspan=3><font class="standard_bold">Vicidial OUTBOUND recent sales report               </font><font class="standard"><a href="admin.php?ADD=999999">Back to Admin</a></font> <BR></th> </tr> <tr bgcolor='#CCCCCC'> diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_fr/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome.php index f49512ce..39793970 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Bienvenue\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_demo.php index 238cf5cf..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "   \n"; echo "\n"; +echo "\n"; +echo "
    Bienvenue
     
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_languages.php index d53707a9..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,12 @@ echo "  
    "; echo "   Chinese(T) Agent Login"; +echo "
    "; +echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; @@ -78,6 +84,9 @@ echo "  
    "; echo "   French Administration"; +echo "
    "; +echo "   Brazilian Portuguese Administration"; echo "
    \n"; echo "
     
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_fr/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_fr/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_fr/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php index 2beb8ff2..9abe7d9c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1756 - Added download option +# 111103-2300 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -36,6 +39,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -49,7 +56,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -68,18 +75,18 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -93,26 +100,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -120,107 +149,118 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] = $row[0]; $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; + $group=''; + } -echo "\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; -echo "
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICA | REPORT \n"; -echo "
    \n\n"; +$MAIN.="\n"; +$MAIN.=" "; +$MAIN.="\n"; +$MAIN.="   "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | MODIFICA | REPORT"; +$MAIN.="\n"; +$MAIN.="\n\n"; -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if (!$group)
     	{
    -	echo "\n\n";
    -	echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
     	}
     
     else
    @@ -305,10 +345,13 @@ if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
     	$DURATIONday++;
     	}
     
    -echo "Inbound Service Level Report                      $NOW_TIME\n";
    -echo "\n";
    -echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +$MAIN.="Inbound Service Level Report                      $NOW_TIME\n";
    +$MAIN.="\n";
    +$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
     #echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +$CSV_text.="\"Inbound Service Level Report\",\"$NOW_TIME\"\n";
    +$CSV_text.="\n";
    +$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
     
     $d=0;
     while ($d < $DURATIONday)
    @@ -414,7 +457,7 @@ $TOTintervals = $j;
     ### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
     $stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$MAIN.="$stmt\n";}
     $records_to_grab = mysql_num_rows($rslt);
     $i=0;
     while ($i < $records_to_grab)
    @@ -533,12 +576,40 @@ while ($j < $TOTintervals)
     
     ###################################################
     ### TOTALS SUMMARY SECTION ###
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    -echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    -echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    -echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$ASCII_text.="|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
    +$ASCII_text.="| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
    +$ASCII_text.="| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
    +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
    +$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTEMPO MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
     
    +
    +$graph_stats=array();
    +$max_drops=1;
    +$max_droppct=1;
    +$max_avgdrops=1;
    +$max_hold=1;
    +$max_holdpct=1;
    +$max_avgholds=1;
    +$max_avgholdstotal=1;
    +$max_calls=1;
    +$max_totalcalltime=1;
    +$max_avgcalltime=1;
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    DROPSDROP %AVG DROP(s)HOLDHOLD %AVG HOLD(s) HOLDAVG HOLD(s) TOTALCALLSTOTAL CALLTEMPO MIN:SECAVG CALLTIME SECONDS

     


    "; +$graph_header=""; +$DROPS_graph=$graph_header.""; +$DROPPCT_graph=$graph_header.""; +$AVGDROPS_graph=$graph_header.""; +$HOLD_graph=$graph_header.""; +$HOLDPCT_graph=$graph_header.""; +$AVGHOLDS_graph=$graph_header.""; +$AVGHOLDSTOTAL_graph=$graph_header.""; +$CALLS_graph=$graph_header.""; +$TOTALCALLTIME_graph=$graph_header.""; +$AVGCALLTIME_graph=$graph_header.""; $d=0; while ($d < $DURATIONday) { @@ -582,9 +653,32 @@ while ($d < $DURATIONday) else { $totCALLSavgDATE[$d] = 0; - $totTIME_MS=' '; + $totTIME_MS=' 0:00'; } + if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);} + if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);} + if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);} + if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);} + if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);} + if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);} + if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);} + if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);} + if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);} + if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);} + $graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]"); + $graph_stats[$d][1]=trim($totDROPSdate[$d]); + $graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d])); + $graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d])); + $graph_stats[$d][4]=trim($totQUEUEdate[$d]); + $graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d])); + $graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d])); + $graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d])); + $graph_stats[$d][8]=trim($totCALLSdate[$d]); + $graph_stats[$d][9]=trim($totCALLSsecDATE[$d]); + $graph_stats[$d][10]=trim($totTIME_MS); + $graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d])); + $totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]); $totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]); $totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]); @@ -595,7 +689,8 @@ while ($d < $DURATIONday) $totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]); $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); - echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n"; + $CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n"; $d++; } @@ -649,9 +744,60 @@ else $FtotQUEUE = sprintf("%6s", $totQUEUE); $FtotCALLS = sprintf("%6s", $totCALLS); -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; -echo "| TOTALI | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; -echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$ASCII_text.="| TOTALI | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n"; +$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n"; +$CSV_text.="\"TOTALI\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n"; + + + for ($d=0; $d"; + $DROPPCT_graph.=" "; + $AVGDROPS_graph.=" "; + $HOLD_graph.=" "; + $HOLDPCT_graph.=" "; + $AVGHOLDS_graph.=" "; + $AVGHOLDSTOTAL_graph.=" "; + $CALLS_graph.=" "; + $TOTALCALLTIME_graph.=" "; + $AVGCALLTIME_graph.=" "; + } + $DROPS_graph.="
    INBOUND SERVICE LIVELLO REPORT
    ESITODROPS
    DROP %
    AVG DROP(s)
    HOLD
    HOLD %
    AVG HOLD(s) HOLD
    AVG HOLD(s) TOTAL
    CALLS
    TOTAL CALLTEMPO MIN:SEC
    AVG CALLTIME SECONDS
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    TOTAL:".trim($FtotDROPS)."
    "; + $DROPPCT_graph.="
    TOTAL:".trim($FtotDROPSpct)."%
    "; + $AVGDROPS_graph.="
    TOTAL:".trim($FtotDROPSavg)."
    "; + $HOLD_graph.="
    TOTAL:".trim($FtotQUEUE)."
    "; + $HOLDPCT_graph.="
    TOTAL:".trim($FtotQUEUEpct)."%
    "; + $AVGHOLDS_graph.="
    TOTAL:".trim($FtotQUEUEavg)."
    "; + $AVGHOLDSTOTAL_graph.="
    TOTAL:".trim($FtotQUEUEtot)."
    "; + $CALLS_graph.="
    TOTAL:".trim($FtotCALLS)."
    "; + $TOTALCALLTIME_graph.="
    TOTAL:".trim($totTIME_MS)."
    "; + $AVGCALLTIME_graph.="
    TOTAL:".trim($FtotCALLSavg)."
    "; + $JS_text="\n"; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } @@ -904,12 +1134,15 @@ echo "+-------------------------------------+-------+-------+ +---------------- ######### CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT -echo "\n"; -echo "---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RISPOSTA (SEC) |\n"; -echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE RISPOSTA (SEC) |\n"; +$MAIN.="| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; + +$CSV_text.="\"INVITO HOLD TIME RIPARTIZIONE IN SECONDI\"\n"; +$CSV_text.="\"TIME 15-MIN INT\",\"CALLS\",\"0 (seconds)\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\"AVG TIME BEFORE RISPOSTA(SEC)\"\n"; $APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0; $h=0; @@ -991,8 +1224,8 @@ while ($h < $TOTintervals) $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} - echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; - + $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; + $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $h++; } @@ -1017,19 +1250,49 @@ $APhd121 = sprintf("%4s", $APhd121); while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} -echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; -echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; -echo "+-------------+-------+-----------------------------------------+ +------+\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; +$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; +$MAIN.="+-------------+-------+-----------------------------------------+ +------+\n"; +$CSV_text.="\" TOTAL\",\"$ALLcalls\",$APhd__0\",\"$APhd_20\",\"$APhd_40\",\"$APhd_60\",\"$APhd_80\",\"$APhd100\",\"$APhd120\",\"$APhd121\",\"$totQUEUEavg\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSER_service_level_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + } } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php index a900089a..f1e354b8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -31,6 +31,10 @@ # 100802-2347 - Added User Group Allowed Reports option validation # 100913-1634 - Added DID option to select by DIDs instead of In-groups # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1759 - Added download option +# 111103-0632 - Added MAXCAL as a drop status +# 111103-2003 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -55,6 +59,10 @@ if (isset($_GET["DID"])) {$DID=$_GET["DID"];} elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -65,11 +73,13 @@ if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Inbound Report'; $db_source = 'M'; +# $test_table_name="vicidial_closer_log"; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -88,13 +98,13 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -105,14 +115,14 @@ if ($gmt_conf_ct > 0) } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -126,26 +136,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -153,22 +185,24 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name,8 from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; if ($DID=='Y') - {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids order by did_pattern;";} + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; $LISTgroups[$i]='---NONE---'; $i++; $groups_to_print++; +$groups_string='|'; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; $LISTgroup_ids[$i] = $row[2]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -177,9 +211,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -192,11 +229,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -207,137 +245,137 @@ while ($i < $statcats_to_print) $vsc_count[$i] = 0; $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; -require("admin_header.php"); +#require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "Date:
    \n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Date:
    \n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo " to "; +$MAIN.=" to "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="\n"; if ($DID=='Y') - {echo "Inbound DIDs: \n";} + {$MAIN.="Inbound DIDs: \n";} else - {echo "Gruppi Inbound: \n";} -echo "\n"; -echo "\n"; +$MAIN.="\n"; -echo "\n"; -echo "           "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           "; if ($DID!='Y') { - echo "MODIFICA | "; - echo "IVR REPORT | \n"; + $MAIN.="MODIFICA | "; + $MAIN.="IVR REPORT | \n"; } -echo "REPORT | "; -echo "\n"; +$MAIN.="REPORT | "; +$MAIN.="\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +#$MAIN.="\n";
    +$MAIN.="Shift: \n";
    +$MAIN.="
    Visualizzare as:  "; +$MAIN.="\n
    "; +$MAIN.="   \n"; +$MAIN.="
    \n"; +$MAIN.="\n\n"; +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    +	$MAIN.="\n\n";
     	if ($DID=='Y')
    -		{echo "PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK INVIA\n";}
    +		{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK INVIA\n";}
     	else
    -		{echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";}
    +		{$MAIN.="SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";}
     	}
     
     else
    @@ -366,16 +404,16 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
    -
    +$MAIN.="Inbound Call Stats: $group_string          $NOW_TIME        DOWNLOAD\n";
     
    +$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
     
     
     if ($DID=='Y')
     	{
    -	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL);";
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$dids_to_print = mysql_num_rows($rslt);
     	$i=0;
     	while ($i < $dids_to_print)
    @@ -390,7 +428,7 @@ if ($DID=='Y')
     
     	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$unids_to_print = mysql_num_rows($rslt);
     	$i=0;
     	while ($i < $unids_to_print)
    @@ -403,25 +441,30 @@ if ($DID=='Y')
     	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
     
     	if ($DB > 0)
    -		{echo "|$did_SQL|$unid_SQL|\n";}
    +		{$MAIN.="|$did_SQL|$unid_SQL|\n";}
     
     	}
     
     if ($group_ct > 1)
     	{
    -	echo "\n";
    -	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="---------- MULTI-GROUP BREAKDOWN:\n";
    +
    +	$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
    +
     	if ($DID=='Y')
     		{
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    -		echo "| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"DID\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
     		}
     	else
     		{
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    -		echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -		echo "+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$ASCII_text.="| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
    +		$CSV_text1.="\"IN-GROUP\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
     		}
     
     	$i=0;
    @@ -431,7 +474,7 @@ if ($group_ct > 1)
     		$DIDunid_SQL='';
     		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$Sdids_to_print = mysql_num_rows($rslt);
     		if ($Sdids_to_print > 0)
     			{
    @@ -441,7 +484,7 @@ if ($group_ct > 1)
     
     		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$DIDunids_to_print = mysql_num_rows($rslt);
     		$k=0;
     		while ($k < $DIDunids_to_print)
    @@ -459,7 +502,7 @@ if ($group_ct > 1)
     			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    @@ -468,7 +511,7 @@ if ($group_ct > 1)
     			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    @@ -477,8 +520,9 @@ if ($group_ct > 1)
     			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
     			}
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$ASCII_text.="$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    +		if ($row[0]>$max_value) {$max_value=$row[0];}
     
     		$groupDISPLAY =	sprintf("%20s", $group[$i]);
     		$gTOTALcalls =	sprintf("%7s", $row[0]);
    @@ -493,19 +537,68 @@ if ($group_ct > 1)
     			}
     		$gDROPpercent =	sprintf("%6s", $gDROPpercent);
     
    -		echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
    +		$CSV_text1.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gDROPcalls\",\"$gDROPpercent%\",\"$gIVRcalls\"\n";
    +		$graph_data_ary[$i][0]=$groupDISPLAY;
    +		$graph_data_ary[$i][1]=$gTOTALcalls;
    +		$graph_data_ary[$i][2]=$gDROPcalls;
    +		$graph_data_ary[$i][3]=$gDROPpercent;
    +		$graph_data_ary[$i][4]=$gIVRcalls;
    +
     		$i++;
     		}
     
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
     
     	}
     
    +	if ($report_display_type=="HTML") {
    +		$max_value=1;
    +		$graph_height=240;
    +		$scale = 1;
    +		$w=0;
    +		for ($i=0; $i$max_value) {$max_value=$graph_data_ary[$i][1];}
    +			if ($graph_data_ary[$i][1]>0) {$w++;}
    +		}
    +		$scale = $graph_height / $max_value;
     
    -echo "\n";
    -echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- TOTALI\n";
     
    +		$GRAPH_text.="";
    +		for ($d=0; $d0) {
    +				$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]); 
    +				$GRAPH_text.="  \n";
    +			}
    +		}
    +		$GRAPH_text.="
    MULTI-GROUP BREAKDOWN
    GRUPPOIVRS / DROPS / CALLS
    ".$graph_data_ary[$d][0]."
    ".$graph_data_ary[$d][3]."% drops
     
    \n"; + if ($graph_data_ary[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][1]."
    • "; + if ($graph_data_ary[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][2]."
    • "; + } + if ($graph_data_ary[$d][4]>0) { + $GRAPH_text.="
    • ".$graph_data_ary[$d][4]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; + + + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + +$MAIN.="\n"; +$MAIN.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- TOTALI\n"; + +$CSV_text1.="\n\"Intervallo Di Tempo:\",\"$query_date_BEGIN\",\"to\",\"$query_date_END\"\n\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);"; if ($DID=='Y') @@ -513,16 +606,16 @@ if ($DID=='Y') $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; if ($DID=='Y') { - $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') and uniqueid IN($unid_SQL);"; + $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowy=mysql_fetch_row($rslt); $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; @@ -531,7 +624,7 @@ if ($DID=='Y') $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $rowx=mysql_fetch_row($rslt); $TOTALcalls = sprintf("%10s", $row[0]); @@ -563,15 +656,22 @@ else } -echo "Totale chiamate a prendere in questo gruppo: $TOTALcalls\n"; -echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; -echo "Answered Calls: $RISPOSTAEDcalls $RISPOSTAEDpercent%\n"; -echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; -echo "Calls taken into the IVR for this In-Gruppo: $IVRcalls\n"; +$MAIN.="Totale chiamate a prendere in questo gruppo: $TOTALcalls\n"; +$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n"; +$MAIN.="Answered Calls: $RISPOSTAEDcalls $RISPOSTAEDpercent%\n"; +$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n"; +$MAIN.="Calls taken into the IVR for this In-Gruppo: $IVRcalls\n"; +$CSV_text1.="\"Totale chiamate a prendere in questo gruppo:\",\"$TOTALcalls\"\n"; +$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n"; +$CSV_text1.="\"Answered Calls:\",\"$RISPOSTAEDcalls\",\"$RISPOSTAEDpercent%\"\n"; +$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n"; +$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n"; -echo "\n"; -echo "---------- ABBATTUTE\n"; +$MAIN.="\n"; +$MAIN.="---------- ABBATTUTE\n"; + +$CSV_text1.="\n\"DROPS\"\n"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);"; if ($DID=='Y') @@ -579,7 +679,7 @@ if ($DID=='Y') $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $DROPcalls = sprintf("%10s", $row[0]); @@ -609,10 +709,11 @@ else $DROP_RISPOSTAEDpercent = round($DROP_RISPOSTAEDpercent, 0); } -echo "Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent% drop/answered: $DROP_RISPOSTAEDpercent%\n"; -echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; - +$MAIN.="Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent% drop/answered: $DROP_RISPOSTAEDpercent%\n"; +$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n"; +$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_RISPOSTAEDpercent%\"\n"; +$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n"; if (strlen($group_SQL)>3) @@ -621,20 +722,20 @@ if (strlen($group_SQL)>3) { $stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $Sanswer_sec_pct_rt_stat_one = $row[0]; $Sanswer_sec_pct_rt_stat_two = $row[1]; - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $answer_sec_pct_rt_stat_one = $row[0]; - $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');"; + $stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $answer_sec_pct_rt_stat_two = $row[0]; @@ -649,14 +750,21 @@ if (strlen($group_SQL)>3) } } } -echo "\n"; -echo "---------- CUSTOM INDICATORS\n"; -echo "GDE (Answered/Llamadas totales tomadas in to this In-Group): $RISPOSTAEDpercent%\n"; -echo "ACR (Dropped/Answered): $DROP_RISPOSTAEDpercent%\n"; +$MAIN.="\n"; +$MAIN.="---------- CUSTOM INDICATORS\n"; +$MAIN.="GDE (Answered/Llamadas totales tomadas in to this In-Group): $RISPOSTAEDpercent%\n"; +$MAIN.="ACR (Dropped/Answered): $DROP_RISPOSTAEDpercent%\n"; + +$CSV_text1.="\n\"CUSTOM INDICATORS\"\n"; +$CSV_text1.="\"GDE (Answered/Llamadas totales tomadas in to this In-Group):\",\"$RISPOSTAEDpercent%\"\n"; +$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_RISPOSTAEDpercent%\"\n"; + if ($DID!='Y') { - echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; - echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $MAIN.="TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered): $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered): $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; } @@ -664,7 +772,7 @@ if ($DID!='Y') $q=0; $stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -681,7 +789,7 @@ while ($p < $statuses_to_print) } $stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $p=0; while ($p < $statuses_to_print) @@ -699,8 +807,10 @@ while ($p < $statuses_to_print) ############################## ######### CALL QUEUE STATS -echo "\n"; -echo "---------- QUEUE STATS\n"; +$MAIN.="\n"; +$MAIN.="---------- QUEUE STATS\n"; + +$CSV_text1.="\n\"QUEUE STATS\"\n"; $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);"; if ($DID=='Y') @@ -708,7 +818,7 @@ if ($DID=='Y') $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $QUEUEcalls = sprintf("%10s", $row[0]); @@ -738,9 +848,13 @@ else $average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds); } -echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; -echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; -echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; +$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n"; +$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n"; +$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n"; + +$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n"; +$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n"; +$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n"; @@ -749,11 +863,15 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds $TOTALcalls = 0; -echo "\n"; -echo "---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI DOWNLOAD\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"INVITO HOLD TIME RIPARTIZIONE IN SECONDI\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;"; if ($DID=='Y') @@ -761,9 +879,11 @@ if ($DID=='Y') $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$hd_5=0; $hd10=0; $hd15=0; $hd20=0; $hd25=0; $hd30=0; $hd35=0; $hd40=0; $hd45=0; $hd50=0; $hd55=0; $hd60=0; $hd90=0; $hd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -806,9 +926,81 @@ $hd99 = sprintf("%5s", $hd99); $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"$hd30\",\"$hd35\",\"$hd40\",\"$hd45\",\"$hd50\",\"$hd55\",\"$hd60\",\"$hd90\",\"$hd99\",\"$TOTALcalls\"\n"; + + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## @@ -816,11 +1008,14 @@ echo "+------------------------------------------------------------------------- $BDdropCALLS = 0; -echo "\n"; -echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; if ($DID=='Y') @@ -828,9 +1023,11 @@ if ($DID=='Y') $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; +$dd_0=0; $dd_5=0; $dd10=0; $dd15=0; $dd20=0; $dd25=0; $dd30=0; $dd35=0; $dd40=0; $dd45=0; $dd50=0; $dd55=0; $dd60=0; $dd90=0; $dd99=0; + while ($i < $reasons_to_print) { $row=mysql_fetch_row($rslt); @@ -873,10 +1070,82 @@ $dd99 = sprintf("%5s", $dd99); $BDdropCALLS = sprintf("%10s", $BDdropCALLS); -echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; -echo "+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n"; + +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + ############################## @@ -884,19 +1153,22 @@ echo "+------------------------------------------------------------------------- $BDansweredCALLS = 0; -echo "\n"; -echo " CALL RISPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; -echo " +-------------------------------------------------------------------------------------------+------------+\n"; -echo " | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.=" CALL RISPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n"; +$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; -$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; +$CSV_text2.="\n\"CALL RISPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n"; +$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; if ($DID=='Y') { - $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;"; + $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -1080,35 +1352,111 @@ $answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $ $answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |"; $answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |"; $answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |"; -echo "INTERVAL | $answeredTOTALs\n"; -echo "INT % | $answeredINT_PERCENT\n"; -echo "CUMULATIVE| $answeredCUMULATIVE\n"; -echo "CUM % | $answeredCUM_PERCENT\n"; -echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n"; -echo "----------+-------------------------------------------------------------------------------------------+------------+\n"; +$ASCII_text.="INTERVAL | $answeredTOTALs\n"; +$ASCII_text.="INT % | $answeredINT_PERCENT\n"; +$ASCII_text.="CUMULATIVE| $answeredCUMULATIVE\n"; +$ASCII_text.="CUM % | $answeredCUM_PERCENT\n"; +$ASCII_text.="CUM ANS % | $answeredCUM_ANS_PERCENT\n"; +$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text2.="\"INTERVAL\",\"$ad_0\",\"$ad_5\",\"$ad10\",\"$ad15\",\"$ad20\",\"$ad25\",\"$ad30\",\"$ad35\",\"$ad40\",\"$ad45\",\"$ad50\",\"$ad55\",\"$ad60\",\"$ad90\",\"$ad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"INT %\",\"$pad_0\",\"$pad_5\",\"$pad10\",\"$pad15\",\"$pad20\",\"$pad25\",\"$pad30\",\"$pad35\",\"$pad40\",\"$pad45\",\"$pad50\",\"$pad55\",\"$pad60\",\"$pad90\",\"$pad99\"\n"; +$CSV_text2.="\"CUMULATIVE\",\"$Cad_0\",\"$Cad_5\",\"$Cad10\",\"$Cad15\",\"$Cad20\",\"$Cad25\",\"$Cad30\",\"$Cad35\",\"$Cad40\",\"$Cad45\",\"$Cad50\",\"$Cad55\",\"$Cad60\",\"$Cad90\",\"$Cad99\",\"$BDansweredCALLS\"\n"; +$CSV_text2.="\"CUM %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15\",\"$pCad20\",\"$pCad25\",\"$pCad30\",\"$pCad35\",\"$pCad40\",\"$pCad45\",\"$pCad50\",\"$pCad55\",\"$pCad60\",\"$pCad90\",\"$pCad99\"\n"; +$CSV_text2.="\"CUM ANS %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n"; +if ($report_display_type=="HTML") { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + if ($DID=='Y') + { + $stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;"; + $ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;"; + $mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;"; + } + if ($DB) {$GRAPH_text.=$stmt."\n";} + $ms_rslt=mysql_query($ms_stmt, $link); + $ms_row=mysql_fetch_row($ms_rslt); + $max_seconds=$ms_row[0]; + if ($max_seconds>90) {$max_seconds=91;} + for ($i=0; $i<=$max_seconds; $i++) { + $sec_ary[$i]=0; + } + $mc_rslt=mysql_query($mc_stmt, $link); + $mc_row=mysql_fetch_row($mc_rslt); + $max_calls=$ms_row[0]; + if ($max_calls<=10) { + while ($maxcalls%5!=0) { + $maxcalls++; + } + } else if ($max_calls<=100) { + while ($maxcalls%10!=0) { + $maxcalls++; + } + } else if ($max_calls<=1000) { + while ($maxcalls%50!=0) { + $maxcalls++; + } + } else { + while ($maxcalls%500!=0) { + $maxcalls++; + } + } + $rslt=mysql_query($stmt, $link); + + $GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### CALL HANGUP REASON STATS $TOTALcalls = 0; -echo "\n"; -echo "---------- INVITO hangup MOTIVO STATS\n"; -echo "+----------------------+------------+\n"; -echo "| HANGUP REASON | CALLS |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- INVITO hangup MOTIVO STATS DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| HANGUP REASON | CALLS |\n"; +$ASCII_text.="+----------------------+------------+\n"; -$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;"; +$CSV_text3.="\n\"INVITO hangup MOTIVO STATS\"\n"; +$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;"; if ($DID=='Y') { - $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason;"; + $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $reasons_to_print = mysql_num_rows($rslt); $i=0; while ($i < $reasons_to_print) @@ -1117,34 +1465,80 @@ while ($i < $reasons_to_print) $TOTALcalls = ($TOTALcalls + $row[0]); - $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $REASONcount = sprintf("%10s", $row[0]); + while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} # if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} - echo "| $reason | $REASONcount |\n"; + $ASCII_text.="| $reason | $REASONcount |\n"; + $CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $i++; } $TOTALcalls = sprintf("%10s", $TOTALcalls); -echo "+----------------------+------------+\n"; -echo "| TOTAL: | $TOTALcalls |\n"; -echo "+----------------------+------------+\n"; - +$ASCII_text.="+----------------------+------------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; +$CSV_text3.="\"TOTAL:\",\"$TOTALcalls\"\n"; +if ($report_display_type=="HTML") + { + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { + if ($row[0]>$high_ct) {$high_ct=$row[0];} + $ct_ary[$i][0]=$row[0]; + $ct_ary[$i][1]=$row[1]; + $i++; + } + $GRAPH_text="
    \n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i".$ct_ary[$i][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    INVITO hangup MOTIVO STATS
    REASON CALLS
    \"\"".$ct_ary[$i][0]."
    TOTALE CHIAMATE:".trim($TOTALcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     ##############################
     #########  CALL STATUS STATS
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL STATUS STATS\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    -echo "| STATUS | DESCRIZIONE          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL STATUS STATS       DOWNLOAD\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +$ASCII_text.="| STATUS | DESCRIZIONE          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
    +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
    +
    +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTOTAL TIMEAVG TIMECALLS/HR

     


    "; + +$CSV_text4.="\n\"CALL STATUS STATS\"\n"; +$CSV_text4.="\"STATUS\",\"DESCRIZIONE\",\"CATEGORIA\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n"; + ## get counts and time totals for all statuses in this campaign @@ -1154,9 +1548,22 @@ if ($DID=='Y') $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); $i=0; + +######## GRAPHING ######### +$max_calls=1; +$max_total_time=1; +$max_avg_time=1; +$max_callshr=1; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TOTALTIME_graph=$graph_header.""; +$AVGTIME_graph=$graph_header.""; +$CALLSHOUR_graph=$graph_header.""; +########################### + while ($i < $statuses_to_print) { $row=mysql_fetch_row($rslt); @@ -1184,6 +1591,16 @@ while ($i < $statuses_to_print) $STATUSavg_sec = ($row[2] / $STATUScount); $STATUSavg = sec_convert($STATUSavg_sec,'H'); + if ($row[0]>$max_calls) {$max_calls=$row[0];} + if ($row[2]>$max_total_time) {$max_total_time=$row[2];} + if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;} + if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;} + $graph_stats[$i][1]=$row[0]; + $graph_stats[$i][2]=$row[2]; + $graph_stats[$i][3]=$STATUSavg_sec; + $graph_stats[$i][4]=$STATUSrate; + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} $STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);} @@ -1204,9 +1621,11 @@ while ($i < $statuses_to_print) $statcat = sprintf("%-60s", $statcat_list[$RAWstatus]); while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');} } + $graph_stats[$i][0]="$status - $status_name - $statcat"; - echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $ASCII_text.="| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n"; + $CSV_text4.="\"$status\",\"$status_name\",\"$statcat\",\"$STATUScount\",\"$STATUShours\",\"$STATUSavg\",\"$STATUSrate\"\n"; $i++; } @@ -1234,19 +1653,68 @@ $TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTAL $TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);} $TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);} -echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; -echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; -echo "+------------------------------------------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n"; +$ASCII_text.="| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n"; +$ASCII_text.="+------------------------------------------------------+------------+------------+----------+----------+\n"; + +####### + $JS_onload="onload = function() {\n"; + $JS_onload.="\tDrawCSSGraph('CALLS', '1');\n"; + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + + for ($d=0; $d"; + $TOTALTIME_graph.=" "; + $AVGTIME_graph.=" "; + $CALLSHOUR_graph.=" "; + } + $CALLS_graph.="
    CALL STATUS STATS
    ESITOCALLS
    TOTAL TIME
    AVG TIME
    CALLS/HR
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    TOTAL:".trim($TOTALcalls)."
    "; + $TOTALTIME_graph.="
    TOTAL:".trim($TOTALhours)."
    "; + $AVGTIME_graph.="
    TOTAL:".trim($TOTALavg)."
    "; + $CALLSHOUR_graph.="
    TOTAL:".trim($TOTALrate)."
    "; + $JS_text.="\n"; +######## + + +$CSV_text4.="\"TOTAL:\",\"\",\"\",\"$TOTALcalls\",\"$TOTALhours\",\"$TOTALavg\",\"$TOTALrate\"\n"; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### STATUS CATEGORY STATS -echo "\n"; -echo "---------- CUSTOM STATUS CATEGORIA STATS\n"; -echo "+----------------------+------------+--------------------------------+\n"; -echo "| CATEGORIA | CALLS | DESCRIZIONE |\n"; -echo "+----------------------+------------+--------------------------------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- CUSTOM STATUS CATEGORIA STATS
    DOWNLOAD\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| CATEGORIA | CALLS | DESCRIZIONE |\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; + +$CSV_text5.="\n\"CUSTOM STATUS CATEGORIA STATS\"\n"; +$CSV_text5.="\"CATEGORIA\",\"CALLS\",\"DESCRIZIONE\"\n"; $TOTCATcalls=0; $r=0; @@ -1259,7 +1727,8 @@ while ($r < $statcats_to_print) $CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);} $CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);} - echo "| $category | $CATcount | $CATname |\n"; + $ASCII_text.="| $category | $CATcount | $CATname |\n"; + $CSV_text5.="\"$category\",\"$CATcount\",\"$CATname\"\n"; } $r++; @@ -1267,9 +1736,56 @@ while ($r < $statcats_to_print) $TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);} -echo "+----------------------+------------+--------------------------------+\n"; -echo "| TOTAL | $TOTCATcalls |\n"; -echo "+----------------------+------------+\n"; +$ASCII_text.="+----------------------+------------+--------------------------------+\n"; +$ASCII_text.="| TOTAL | $TOTCATcalls |\n"; +$ASCII_text.="+----------------------+------------+\n"; + +$CSV_text5.="\"TOTAL\",\"$TOTCATcalls\"\n"; + +if ($report_display_type=="HTML") + { + $ct_ary=""; + $r=0; $i=0; + $high_ct=0; + while ($r < $statcats_to_print) + { + if ($vsc_id[$r] != 'UNDEFINED') + { + if ($vsc_count[$r]>$high_ct) {$high_ct=$vsc_count[$r];} + $ct_ary[$i][0]=$vsc_count[$r]; + $ct_ary[$i][1]=$vsc_id[$r]."
    ".$vsc_name[$r]; + $i++; + } + $r++; + } + + $GRAPH_text="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + for ($i=0; $i0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;} + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    CUSTOM STATUS CATEGORIA STATS
    CATEGORIA CALLS
    ".$ct_ary[$i][1]."\"\"".$ct_ary[$i][0]."
    TOTAL:".trim($TOTCATcalls)."
    \n"; + $GRAPH_text.="
    \n";
    +	$MAIN.=$GRAPH_text;
    +	}
    +else 
    +	{
    +	$MAIN.=$ASCII_text;
    +	}
     
     
     ##############################
    @@ -1277,11 +1793,15 @@ echo "+----------------------+------------+\n";
     
     $TOTALcalls = 0;
     
    -echo "\n";
    -echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    -echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text="\n";
    +$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN       DOWNLOAD\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
    +
    +$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
    +$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
    +
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
     if ($DID=='Y')
    @@ -1289,7 +1809,7 @@ if ($DID=='Y')
     	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
     	}
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$ASCII_text.="$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
     $i=0;
     while ($i < $positions_to_print)
    @@ -1332,10 +1852,80 @@ $qp99 =	sprintf("%5s", $qp99);
     
     $TOTALcalls =		sprintf("%10s", $TOTALcalls);
     
    -echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    -echo "+-------------------------------------------------------------------------------------+------------+\n";
    +$ASCII_text.="| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
    +$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
     
    +$CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"$qp_7\",\"$qp_8\",\"$qp_9\",\"$qp10\",\"$qp15\",\"$qp20\",\"$qp25\",\"$qp99\",\"$TOTALcalls\"\n";
     
    +if ($report_display_type=="HTML") 
    +	{
    +	$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
    +	$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;"; 
    +	$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
    +	if ($DID=='Y')
    +		{
    +		$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
    +		$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;"; 
    +		$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
    +		}
    +	if ($DB) {$GRAPH_text.=$stmt."\n";}
    +	$ms_rslt=mysql_query($ms_stmt, $link);
    +	$ms_row=mysql_fetch_row($ms_rslt);
    +	$max_position=$ms_row[0];
    +	if ($max_position>25) {$max_position=26;}
    +	for ($i=1; $i<=$max_position; $i++) {
    +		$sec_ary[$i]=0;
    +	}
    +
    +	$mc_rslt=mysql_query($mc_stmt, $link);
    +	$mc_row=mysql_fetch_row($mc_rslt);
    +	$max_calls=$ms_row[0];
    +	if ($max_calls<=10) {
    +		while ($maxcalls%5!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=100) {
    +		while ($maxcalls%10!=0) {
    +			$maxcalls++;
    +		}
    +	} else if ($max_calls<=1000) {
    +		while ($maxcalls%50!=0) {
    +			$maxcalls++;
    +		}
    +	} else {
    +		while ($maxcalls%500!=0) {
    +			$maxcalls++;
    +		}
    +	}
    +	$rslt=mysql_query($stmt, $link);
    +	
    +	$GRAPH_text="
    \n"; + $GRAPH_text.=""; + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ############################## ######### USER STATS @@ -1345,11 +1935,27 @@ $TOTcalls=0; $TOTtime=0; $TOTavg=0; -echo "\n"; -echo "---------- STATISTICHE OPERATORE\n"; -echo "+--------------------------+------------+------------+--------+\n"; -echo "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text="\n"; +$ASCII_text.="---------- STATISTICHE OPERATORE DOWNLOAD\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| AGENT | CALLS | TIME H:M:S |AVERAGE |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; + +$CSV_text7.="\n\"AGENT STATS\"\n"; +$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n"; + + +$max_calls=1; +$max_timehms=1; +$max_average=1; +$graph_stats=array(); +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSTIME H:M:SAVERAGE

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$TIMEHMS_graph=$graph_header.""; +$AVERAGE_graph=$graph_header.""; $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; if ($DID=='Y') @@ -1357,7 +1963,7 @@ if ($DID=='Y') $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -1380,13 +1986,22 @@ while ($i < $users_to_print) $USERtotTALK = $row[3]; $USERavgTALK = $row[4]; + if ($row[2]>$max_calls) {$max_calls=$row[2];} + if ($row[3]>$max_timehms) {$max_timehms=$row[3];} + if ($row[4]>$max_average) {$max_average=$row[4];} + $graph_stats[$i][0]="$row[0] - $row[1]"; + $graph_stats[$i][1]=$row[2]; + $graph_stats[$i][2]=$row[3]; + $graph_stats[$i][3]=$row[4]; + $USERtotTALK_MS = sec_convert($USERtotTALK,'H'); $USERavgTALK_MS = sec_convert($USERavgTALK,'H'); $USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $ASCII_text.="| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + $CSV_text7.="\"$user - $full_name\",\"$USERcalls\",\"$USERtotTALK_MS\",\"$USERavgTALK_MS\"\n"; $i++; } @@ -1407,18 +2022,61 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -echo "+--------------------------+------------+------------+--------+\n"; -echo "| TOTALE Operatori: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; -echo "+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +$ASCII_text.="| TOTALE Operatori: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n"; +$ASCII_text.="+--------------------------+------------+------------+--------+\n"; +for ($d=0; $d"; + $TIMEHMS_graph.=" "; + $AVERAGE_graph.=" "; +} +$CALLS_graph.="
    AGENT STATS
    AGENTCALLS
    TIME H:M:S
    AVERAGE
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    TOTAL:".trim($TOTALcalls)."
    "; +$TIMEHMS_graph.="
    TOTAL:".trim($TOTtime)."
    "; +$AVERAGE_graph.="
    TOTAL:".trim($TOTavg)."
    "; +$JS_text.="\n"; +$GRAPH_text=$GRAPH; + +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } + +$CSV_text7.="\"TOTALE Operatori: $TOTagents\",\"$TOTcalls\",\"$TOTtime\",\"$TOTavg\"\n"; ############################## ######### TIME STATS -echo "\n"; -echo "---------- STATISTICHE TEMPO\n"; +$MAIN.="\n"; +$MAIN.="---------- STATISTICHE TEMPO DOWNLOAD\n"; -echo "\n"; +$CSV_text9.="\"TIME STATS\"\n\n"; + +$MAIN.="\n"; ############################## @@ -1430,7 +2088,7 @@ if ($DID=='Y') $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $calls_to_print = mysql_num_rows($rslt); $j=0; while ($j < $calls_to_print) @@ -1441,7 +2099,7 @@ while ($j < $calls_to_print) $Cepoch[$j] = $row[2]; $Cdate[$j] = $row[3]; $Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day -# echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; +# $MAIN.="|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n"; $j++; } @@ -1456,7 +2114,7 @@ while ($j < $calls_to_print) { $Ftotal[$i]++; if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} - if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j])) + if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) { $BDansweredCALLS++; $Fanswer[$i]++; @@ -1514,8 +2172,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } -echo "\n"; -echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IN-GROUP\n"; +$ASCII_text.="\n"; +$ASCII_text.="GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IN-GROUP\n"; + $k=1; $Mk=0; @@ -1544,10 +2203,17 @@ while ($k <= 102) } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; -#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; -echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; +#$ASCII_text.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; +$ASCII_text.="| HOUR |$call_scale| DROPS | TOTAL |\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + +$CSV_text9.="\"HOUR\",\"DROPS\",\"TOTAL\"\n"; + +$max_calls=1; +$graph_stats=array(); +$GRAPH_text=""; + $ZZ = '00'; $i=0; @@ -1565,6 +2231,7 @@ while ($i <= 96) $h=0; if ($hour < 10) {$hour = "0$hour";} $time = "+$hour$ZZ+"; + #$CSV_text9.="$hour$ZZ,"; } if ($h == 1) {$time = " 15 ";} if ($h == 2) {$time = " 30 ";} @@ -1579,9 +2246,12 @@ while ($i <= 96) else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;} + $ASCII_text.="| $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"0\"\n"; + } } else @@ -1595,12 +2265,14 @@ while ($i <= 96) { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| 0 | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\","; + $k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| 0 | $hour_count[$i] |\n"; + $CSV_text9.="\"0\",\"$hour_count[$i]\"\n"; } else @@ -1611,38 +2283,77 @@ while ($i <= 96) $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + $hour_count[$i]+=0; + $drop_count[$i]+=0; + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} - echo "D"; $char_counter++; - $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} - echo "X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 102) {echo " "; $char_counter++;} - echo "| $drop_count[$i] | $hour_count[$i] |\n"; + $ASCII_text.="|$time|"; + $CSV_text9.="\"$time\",\"\""; + $k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;} + $ASCII_text.="D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;} + $ASCII_text.="X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;} + while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;} + $ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n"; + $CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n"; + } } + $graph_stats[$i][0]="$time"; + $graph_stats[$i][1]=trim($hour_count[$i]); + $graph_stats[$i][2]=trim($drop_count[$i]); + if (trim($hour_count[$i])>$max_calls) {$max_calls=trim($hour_count[$i]);} $i++; $h++; } -echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; +$ASCII_text.="+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n"; + +for ($d=0; $d\n"; + } +} +$GRAPH_text.="
    GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP
    HOURDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="


    "; +if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } +else + { + $MAIN.=$ASCII_text; + } ##### Answered wait time breakdown -echo "\n"; -echo "---------- CALL RISPOSTAED TIME BREAKDOWN IN SECONDS\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="\n"; +$MAIN.="---------- CALL RISPOSTAED TIME BREAKDOWN IN SECONDS DOWNLOAD\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; + +$CSV_text8.="\n\"CALL RISPOSTAED TIME BREAKDOWN IN SECONDS\"\n"; +$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -1709,7 +2420,8 @@ while ($i <= 96) $adB99[$i] = sprintf("%5s", $adB99[$i]); $Fanswer[$i] = sprintf("%10s", $Fanswer[$i]); - echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $MAIN.="|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n"; + $CSV_text8.="\"$time\",\"$adB_0[$i]\",\"$adB_5[$i]\",\"$adB10[$i]\",\"$adB15[$i]\",\"$adB20[$i]\",\"$adB25[$i]\",\"$adB30[$i]\",\"$adB35[$i]\",\"$adB40[$i]\",\"$adB45[$i]\",\"$adB50[$i]\",\"$adB55[$i]\",\"$adB60[$i]\",\"$adB90[$i]\",\"$adB99[$i]\",\"$Fanswer[$i]\"\n"; $i++; $h++; @@ -1717,22 +2429,52 @@ while ($i <= 96) $BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; -echo "|TOTALI| | $BDansweredCALLS |\n"; -echo "+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$MAIN.="|TOTALI| | $BDansweredCALLS |\n"; +$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n"; +$CSV_text8.="\"TOTALI\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"$BDansweredCALLS\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; +$MAIN.=""; +$MAIN.="
    "; + +$MAIN.=""; + +if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; +} else { + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; +} + } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php index b2a1da18..6f3073c6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1806 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -43,10 +46,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -55,14 +62,14 @@ $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} -$report_name = 'Inbound Summary Hourly Report'; +$report_name = 'Inbound Sintesi Resoconto'; $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -81,12 +88,12 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $gmt_conf_ct = mysql_num_rows($rslt); $dst = date("I"); if ($gmt_conf_ct > 0) @@ -97,14 +104,14 @@ if ($gmt_conf_ct > 0) } $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -113,31 +120,53 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -145,14 +174,15 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$exclude_rolloverSQL=''; +$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; if (eregi("YES",$exclude_rollover)) - {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +$groups_string='|'; #$LISTgroups[$i]='---NONE---'; #$i++; #$groups_to_print++; @@ -161,6 +191,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $groups_string .= "$LISTgroups[$i]|"; $i++; } @@ -169,9 +200,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -184,11 +218,12 @@ else $group_SQL = eregi_replace(",$",'',$group_SQL); # $group_SQL = "group_id IN($group_SQL)"; } +if (strlen($group_SQL)<3) {$group_SQL="''";} $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $statcats_to_print = mysql_num_rows($rslt); $i=0; while ($i < $statcats_to_print) @@ -200,9 +235,9 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $times_to_print = mysql_num_rows($rslt); $i=0; while ($i < $times_to_print) @@ -213,134 +248,134 @@ while ($i < $times_to_print) $i++; } -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); + # require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; + $MAIN.="\n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Date:
    \n"; + $MAIN.=""; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'query_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; + $MAIN.=" \n"; - echo " to "; + $MAIN.=" to "; - ?> - - \n"; + $MAIN.=" var o_cal = new tcal ({\n"; + $MAIN.=" // form name\n"; + $MAIN.=" 'formname': 'vicidial_report',\n"; + $MAIN.=" // input name\n"; + $MAIN.=" 'controlname': 'end_date'\n"; + $MAIN.=" });\n"; + $MAIN.=" o_cal.a_tpl.yearscroll = false;\n"; + $MAIN.=" // o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; + $MAIN.=" \n"; - echo "
      \n"; - echo "\n"; - echo "Inbound Groups:
    \n"; - echo "
      \n"; + $MAIN.="\n"; + $MAIN.="Gruppi Inbound:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "           "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "   Exclude Outbound Drop Groups:
    "; - echo "   \n"; - echo "
                          "; - echo "\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="MODIFICA | "; + $MAIN.="REPORT"; + $MAIN.="\n"; + $MAIN.="
      Visualizzare as: "; + $MAIN.="\n
    "; + $MAIN.="   Exclude Outbound Drop Groups:
    "; + $MAIN.="   \n"; + $MAIN.="
                          "; + $MAIN.="\n"; - echo "
    \n"; + $MAIN.="
    \n"; - echo "Call Time:
    \n"; - echo "\n"; $o=0; while ($times_to_print > $o) { - if ($call_times[$o] == $shift) {echo "\n";} - else {echo "\n";} + if ($call_times[$o] == $shift) {$MAIN.="\n";} + else {$MAIN.="\n";} $o++; } - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
     	}
     
     else
    @@ -354,7 +389,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -397,18 +432,48 @@ else
     	$query_date_END = "$end_date 23:59:59";
     
     
    -	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
    +	$MAIN .= "Inbound Sintesi Resoconto: $group_string          $NOW_TIME\n";
    +	$CSV_main.="Inbound Sintesi Resoconto:,$NOW_TIME\n";
     
     
    +	$JS_text.="\n";
    +
     	if ($costformat > 0)
     		{
    -		echo "
    \n"; + $ASCII_text.="
    \n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_CLOSERsummary_hourly_$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH; + $MAIN.=$sub_GRAPH; + } + else + { + $MAIN.=$ASCII_text; + $MAIN.=$SUBoutput; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); echo "$MAIN"; - echo "$SUBoutput"; +# echo "$SUBoutput"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo ""; + echo "
    "; + + echo ""; + + } + } - - ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_DIDstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_DIDstats.php new file mode 100644 index 00000000..9da0e79c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_DIDstats.php @@ -0,0 +1,1083 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90601-1443 - First build +# 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1809 - Added download option +# 111104-1133 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound DID Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$groups_string='|'; +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_patterns[$i] = $row[1]; + $group_names[$i] = $row[2]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } +if (strlen($group_SQL)<3) {$group_SQL="''";} + + + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +if ($DB > 0) + { + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; + } + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + + +$MAIN.="
    to
    "; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="\n

    "; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | MODIFICA | REPORT \n"; +$MAIN.="
    \n"; +$MAIN.="
    \n"; + +$MAIN.="
    ";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK INVIA\n";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +	#	$time_BEGIN=$AM_shift_BEGIN;
    +	#	$time_END=$AM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
    +	#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +	#	$time_BEGIN=$PM_shift_BEGIN;
    +	#	$time_END=$PM_shift_END;
    +	#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
    +	#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound DID Report                      $NOW_TIME\n";
    +	$MAIN.="\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
    +	#$MAIN.="Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +
    +	$CSV_text1.="\"Inbound DID Report\",\"$NOW_TIME\"\n\n";
    +	$CSV_text1.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"\n\n";
    +
    +	$d=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) );
    +		$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
    +
    +		if ($EQsec < $SQsec)
    +			{
    +			$dEQepoch = ($dEQepoch + 86400);
    +			}
    +
    +		$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +		$d++;
    +		}
    +
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### BUILD HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $j;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select UNIX_TIMESTAMP(call_date),extension from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  did_id IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	$extension[0]='';
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$dt[$i] =			0;
    +		$ut[$i] =			($row[0] - $SQepochDAY);
    +		$extension[$i] =	$row[1];
    +		while($ut[$i] >= 86400) 
    +			{
    +			$ut[$i] = ($ut[$i] - 86400);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +
    +		$i++;
    +		}
    +
    +	### Find default route
    +	$default_route='';
    +	$stmt="select did_route from vicidial_inbound_dids where did_pattern='default';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$MAIN.="$stmt\n";}
    +	$Drecords_to_grab = mysql_num_rows($rslt);
    +	if ($Drecords_to_grab > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$default_route =	$row[0];
    +		}
    +
    +	###################################################
    +	### TOTALI DID SUMMARY SECTION ###
    +	if (strlen($extension[0]) > 0)
    +		{
    +		$ASCII_text.="DID Summary:\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="| DID                | DESCRIZIONE                    | ROUTE      | CALLS      |\n";
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +
    +		$CSV_text1.="\"DID Summary:\"\n";
    +		$CSV_text1.="\"DID\",\"DESCRIZIONE\",\"ROUTE\",\"CALLS\"\n";
    +
    +		$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + + $stats_array = array_group_count($extension, 'desc'); + $stats_array_ct = count($stats_array); + + $d=0; + $max_calls=1; + while ($d < $stats_array_ct) + { + $stat_description = ' *** default *** '; + $stat_route = $default_route; + + $stat_record_array = explode(' ',$stats_array[$d]); + $stat_count = ($stat_record_array[0] + 0); + $stat_pattern = $stat_record_array[1]; + if ($stat_count>$max_calls) {$max_calls=$stat_count;} + $graph_stats[$d][0]=$stat_count; + $graph_stats[$d][1]=$stat_pattern; + + $stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';"; + $rslt=mysql_query($stmt, $link); + $details_to_grab = mysql_num_rows($rslt); + if ($details_to_grab > 0) + { + $row=mysql_fetch_row($rslt); + $stat_description = $row[0]; + $stat_route = $row[1]; + } + + $totCALLS = ($totCALLS + $stat_count); + $stat_pattern = sprintf("%-18s", $stat_pattern); + $stat_description = sprintf("%-30s", $stat_description); + while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} + $stat_route = sprintf("%-10s", $stat_route); + $stat_count = sprintf("%10s", $stat_count); + + $CSV_text1.="\"$stat_pattern\",\"$stat_description\",\"$stat_route\",\"$stat_count\"\n"; + + $stat_pattern = "$stat_pattern"; + + $ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    DID Summary:
    DIDCALLS
    \"\"".$graph_stats[$d][0]."
    TOTALE CHIAMATE:".trim($totCALLS)."
    \n";
    +
    +			$FtotCALLS =	sprintf("%10s", $totCALLS);
    +
    +		$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
    +		$ASCII_text.="|                                                           TOTALI | $FtotCALLS |\n";
    +		$ASCII_text.="+------------------------------------------------------------------+------------+\n";
    +		$CSV_text1.="\"\",\"\",\"TOTALI\",\"$FtotCALLS\"\n";
    +		#$MAIN.=$GRAPH;
    +
    +		}
    +
    +
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totCALLSmax=0;
    +	$totCALLSdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +		$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +		$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +		$qrtCALLS[$j]=0; $qrtCALLSmax[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
    +				{
    +				$totCALLS++;
    +				$qrtCALLS[$j]++;
    +				$dtt = $dt[$i];
    +				$totCALLSdate[$dtt]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +
    +
    +	###################################################
    +	### TOTALI DATE SUMMARY SECTION ###
    +	$ASCII_text.="\nDate Summary:\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="| SHIFT                                     |        |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | CALLS  |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +
    +	$CSV_text1.="\n\"Date Summary:\"\n";
    +	$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
    +
    +	$GRAPH_text.="
    \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + $GRAPH_text.="\n"; + + $d=0; + $max_calls=1; + $graph_stats=array(); + while ($d < $DURATIONday) + { + if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;} + + if ($totCALLSsecDATE[$d] > 0) + { + $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); + + $totTIME_M = ($totCALLSsecDATE[$d] / 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_MS = "$totTIME_M_int:$totTIME_S"; + $totTIME_MS = sprintf("%8s", $totTIME_MS); + } + else + { + $totCALLSavgDATE[$d] = 0; + $totTIME_MS=' '; + } + + if ($totCALLSdate[$d] < 1) + {$totCALLSdate[$d]='';} + $totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]); + + if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];} + $graph_stats[$d][0]=$totCALLSdate[$d]+0; + $graph_stats[$d][1]=substr($daySTART[$d],0,10); + + $ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n"; + $CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n"; + $d++; + } + + for ($d=0; $d".$graph_stats[$d][1]."\n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + } + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.=" \n"; + $GRAPH_text.="
    Date Summary:
    SHIFT DATE-TIME RANGECALLS
    \"\"".$graph_stats[$d][0]."
    TOTALE CHIAMATE:".trim($totCALLS)."
    \n";
    +
    +
    +	$FtotCALLS =	sprintf("%6s", $totCALLS);
    +
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$ASCII_text.="|                                    TOTALI | $FtotCALLS |\n";
    +	$ASCII_text.="+-------------------------------------------+--------+\n";
    +	$CSV_text1.="\"TOTALI\",\"$FtotCALLS\"\n";
    +	#$MAIN.=$GRAPH;
    +
    +	if ($report_display_type=="HTML")
    +		{
    +		$MAIN.=$GRAPH_text;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +
    +	## FORMAT OUTPUT ##
    +	$i=0;
    +	$hi_hour_count=0;
    +	$hi_hold_count=0;
    +
    +	while ($i < $TOTintervals)
    +		{
    +		if ($qrtCALLS[$i] > 0)
    +			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
    +
    +		if ($qrtCALLS[$i] > $hi_hour_count) 
    +			{$hi_hour_count = $qrtCALLS[$i];}
    +
    +		$i++;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (70 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (70 / $hi_hold_count);}
    +
    +
    +
    +
    +	###################################################################
    +	#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
    +
    +	$MAIN.="\n";
    +	$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
    +
    +	$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
    +
    +	$ASCII_text.="";
    +
    +	$ASCII_text.="";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
    +
    +	$k=1;
    +	$Mk=0;
    +	$call_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hour_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hour_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hour_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$call_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$call_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$call_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +	$k=1;
    +	$Mk=0;
    +	$hold_scale = '0';
    +	while ($k <= 72) 
    +		{
    +		if ( ($k < 1) or ($hold_multiplier <= 0) )
    +			{$scale_num = 70;}
    +		else
    +			{
    +			$TMPscale_num=(73 / $hold_multiplier);
    +			$TMPscale_num = round($TMPscale_num, 0);
    +			$scale_num=($k / $hold_multiplier);
    +			$scale_num = round($scale_num, 0);
    +			}
    +		$tmpscl = "$hold_scale$TMPscale_num";
    +
    +		if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
    +			{
    +			$Mk=0;
    +			$LENscale_num = (strlen($scale_num));
    +			$k = ($k + $LENscale_num);
    +			$hold_scale .= "$scale_num";
    +			}
    +		else
    +			{
    +			$hold_scale .= " ";
    +			$k++;   $Mk++;
    +			}
    +		}
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="|    TIME     |    CALLS HANDLED                                                        |       |\n";
    +	$ASCII_text.="| 15 MIN INT  |$call_scale| TOTAL |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +	$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
    +
    +
    +
    +	$max_calls=1;
    +	$graph_stats=array();
    +	$GRAPH_text="";
    +
    +
    +	$i=0;
    +	while ($i < $TOTintervals)
    +		{
    +		$char_counter=0;
    +		### BEGIN HOLD TIME TOTALI GRAPH ###
    +			$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count > 0) {$no_lines_yet=0;}
    +
    +		$Gavg_hold = $qrtQUEUEavg[$i];
    +		if ($Gavg_hold < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				$TOT_lines++;
    +				$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +				$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +				$ASCII_text.="|$HMdisplay[$i]|";
    +				$CSV_text1.="\"$HMdisplay[$i]\",";
    +			#	$k=0;   while ($k <= 22) {$ASCII_text.=" ";   $k++;}
    +			#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +				}
    +			}
    +		else
    +			{
    +			$TOT_lines++;
    +			$no_lines_yet=0;
    +			$Xavg_hold = ($Gavg_hold * $hold_multiplier);
    +			$Yavg_hold = (19 - $Xavg_hold);
    +
    +			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
    +			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
    +
    +		#	$ASCII_text.="|$HMdisplay[$i]|";
    +			$ASCII_text.="|$HMdisplay[$i]|";
    +			$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
    +		#	$k=0;   while ($k <= $Xavg_hold) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +		#	if ($char_counter >= 22) {$ASCII_text.="H";   $char_counter++;}
    +		#	else {$ASCII_text.="*H";   $char_counter++;   $char_counter++;}
    +		#	$k=0;   while ($k <= $Yavg_hold) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +		#		while ($char_counter <= 22) {$ASCII_text.=" ";   $char_counter++;}
    +		#	$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
    +			}
    +		### END HOLD TIME TOTALI GRAPH ###
    +
    +		$char_counter=0;
    +		### BEGIN CALLS TOTALI GRAPH ###
    +		$Ghour_count = $qrtCALLS[$i];
    +		if ($Ghour_count < 1) 
    +			{
    +			if ($i < 0)
    +				{
    +				$do_nothing=1;
    +				}
    +			else
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +			#	$ASCII_text.="  |";
    +				$k=0;   while ($k <= 72) {$ASCII_text.=" ";   $k++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"0\"\n";
    +				}
    +			}
    +		else
    +			{
    +			$no_lines_yet=0;
    +			$Xhour_count = ($Ghour_count * $hour_multiplier);
    +			$Yhour_count = (69 - $Xhour_count);
    +
    +			$Gdrop_count = $qrtDROPS[$i];
    +			if ($Gdrop_count < 1) 
    +				{
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				if ($char_counter > 71) {$ASCII_text.="C";   $char_counter++;}
    +				else {$ASCII_text.="*C";   $char_counter++;   $char_counter++;}
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +					while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			else
    +				{
    +				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
    +
    +			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
    +
    +				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
    +
    +				if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
    +				$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
    +				$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
    +
    +				$ASCII_text.="";
    +				$k=0;   while ($k <= $Xdrop_count) {$ASCII_text.=">";   $k++;   $char_counter++;}
    +				$ASCII_text.="D";   $char_counter++;
    +				$k=0;   while ($k <= $XXhour_count) {$ASCII_text.="*";   $k++;   $char_counter++;}
    +				$ASCII_text.="C";   $char_counter++;
    +				$k=0;   while ($k <= $Yhour_count) {$ASCII_text.=" ";   $k++;   $char_counter++;}
    +				while ($char_counter <= 72) {$ASCII_text.=" ";   $char_counter++;}
    +
    +				$ASCII_text.="| $qrtCALLS[$i] |\n";
    +				$CSV_text1.="\"$qrtCALLS[$i]\"\n";
    +				}
    +			}
    +		### END CALLS TOTALI GRAPH ###
    +		$graph_stats[$i][0]=$HMdisplay[$i];
    +		$graph_stats[$i][1]=trim($qrtCALLS[$i]);
    +		$graph_stats[$i][2]=trim($qrtDROPS[$i]);
    +		if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
    +		$i++;
    +		}
    +
    +
    +	if ($totQUEUEsec > 0)
    +		{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
    +	else
    +		{$totQUEUEavgRAW = 0;}
    +	$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
    +	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
    +	$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
    +	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
    +	$totDROPS =	sprintf("%5s", $totDROPS);
    +	$totCALLS =	sprintf("%5s", $totCALLS);
    +
    +
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +	$ASCII_text.="| TOTAL       |                                                                         | $totCALLS |\n";
    +	$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
    +
    +
    +	for ($d=0; $d\n";
    +	}
    +	$GRAPH_text.="
    HOLD TIME, CALL AND DROP STATS
    TIME 15-MIN INTDROPS / CALLS
    \n"; + if ($graph_stats[$d][1]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][1]."
    • "; + if ($graph_stats[$d][2]>0) { + $GRAPH_text.="
    • ".$graph_stats[$d][2]."
    • "; + } + $GRAPH_text.="
    \n"; + } else { + $GRAPH_text.="0"; + } + $GRAPH_text.="
    TOTALI:".trim($totCALLS)."
    "; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + + + $CSV_text1.="\"TOTAL\",\"$totCALLS\"\n"; + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIDstats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + + + echo $MAIN; + } + +?> + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRfilter.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRfilter.php index 62d2dc2e..499bc259 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRfilter.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRfilter.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 81030-0432 - First build # 90310-2054 - Admin header # 90508-0644 - Changed to PHP long tags +# 120113-2022 - Added new columns for sent to queue and agent # require("dbconnect.php"); @@ -17,14 +18,40 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_dateY"])) {$query_dateY=$_GET["query_dateY"];} + elseif (isset($_POST["query_dateY"])) {$query_dateY=$_POST["query_dateY"];} +if (isset($_GET["query_dateM"])) {$query_dateM=$_GET["query_dateM"];} + elseif (isset($_POST["query_dateM"])) {$query_dateM=$_POST["query_dateM"];} +if (isset($_GET["query_dateD"])) {$query_dateD=$_GET["query_dateD"];} + elseif (isset($_POST["query_dateD"])) {$query_dateD=$_POST["query_dateD"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_dateY"])) {$end_dateY=$_GET["end_dateY"];} + elseif (isset($_POST["end_dateY"])) {$end_dateY=$_POST["end_dateY"];} +if (isset($_GET["end_dateM"])) {$end_dateM=$_GET["end_dateM"];} + elseif (isset($_POST["end_dateM"])) {$end_dateM=$_POST["end_dateM"];} +if (isset($_GET["end_dateD"])) {$end_dateD=$_GET["end_dateD"];} + elseif (isset($_POST["end_dateD"])) {$end_dateD=$_POST["end_dateD"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} + +if ($hourly_breakdown) { + $date_int=3600; + $substr_place=13; + $checked="checked"; +} else { + $date_int=86400; + $substr_place=10; + $checked=""; +} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -33,7 +60,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$HTML_header.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $qm_conf_ct) @@ -46,14 +73,14 @@ while ($i < $qm_conf_ct) ########################################### $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$HTML_header.="|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -69,51 +96,76 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $i=0; -?> - - - +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +$HTML_header.="\n"; +$HTML_header.="VICIDIAL: VDL IVR Filter Stats\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; -\n"; -echo "VICIDIAL: VDL IVR Filter Stats\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "\n"; +$HTML_text.="
    \n"; -echo "\n"; -echo "Date:
    \n"; -echo "\n"; -echo " to \n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "           "; -echo "ADMIN | "; -echo "REPORT\n"; -echo "\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; +$HTML_text.="Date:
    \n"; +$HTML_text.="\n"; -echo "
    \n"; +$HTML_text.="\n"; -echo "   \n"; -echo "
    \n"; -echo "\n\n"; +$HTML_text.=" to \n"; -echo "
    \n\n";
    +$HTML_text.="\n";
    +
    +$HTML_text.="
    Break into hours\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           "; +$HTML_text.="ADMIN | "; +$HTML_text.="REPORT\n"; +$HTML_text.="\n"; + +$HTML_text.="
    \n"; + +$HTML_text.="   \n"; +$HTML_text.="
    \n"; +$HTML_text.="\n\n"; + +$HTML_text.="
    \n\n";
     
     $shift = 'ALL';
     
    @@ -141,109 +193,314 @@ $query_date_END = "$end_date $time_END";
     
     
     
    -echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
    +$HTML_text.="VDL: IVR Filter Stats:           $NOW_TIME   [DOWNLOAD]\n";
    +
    +$CSV_header="\"VDL: IVR Filter Stats:           $NOW_TIME\"\n";
    +
    +$start_date=mktime(substr($time_BEGIN,0,2), substr($time_BEGIN,3,2), substr($time_BEGIN,6,2), substr($query_date_BEGIN,5,2), substr($query_date_BEGIN,8,2), substr($query_date_BEGIN,0,4));
    +$end_date=mktime(substr($time_END,0,2), substr($time_END,3,2), substr($time_END,6,2), substr($query_date_END,5,2), substr($query_date_END,8,2), substr($query_date_END,0,4));
    +
    +$i=0;
    +while($start_date<$end_date) {
    +	$start_date_ary[$i]=date("Y-m-d H:i:s", $start_date);
    +	$end_date_ary[$i]=date("Y-m-d H:i:s", ($start_date+($date_int-1)) );
    +	for ($j=0; $j<16; $j++) {
    +		$count_ary[substr($start_date_ary[$i],0,$substr_place)][$j]=0;
    +	}
    +	
    +	$i++;
    +	$start_date+=$date_int;
    +}
    +
    +$total=0;
    +$Utotal=0;
    +$totalstq=0;
    +$Utotalstq=0;
    +$totalnocid=0;
    +$Utotalnocid=0;
    +$totaldnc=0;
    +$Utotaldnc=0;
    +$totalsale=0;
    +$Utotalsale=0;
    +$totalarch=0;
    +$Utotalarch=0;
    +$totaltiq=0;
    +$Utotaltiq=0;
    +$totalsta=0;
    +$Utotalsta=0;
    +
    +	$stmtA="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' group by stime";
    +	$rsltA=mysql_query($stmtA, $link);
    +	if ($DB) {$HTML_text.="$stmtA\n";}
    +	while ($rowA=mysql_fetch_row($rsltA)) {
    +		$count_ary[$rowA[2]][0]+=$rowA[0];
    +		$count_ary[$rowA[2]][1]+=$rowA[1];
    +		$count_ary[$rowA[2]][14]+=$rowA[0];
    +		$count_ary[$rowA[2]][15]+=$rowA[1];
    +		$total+=$rowA[0];
    +		$Utotal+=$rowA[1];
    +		$totalstq+=$rowA[0];
    +		$Utotalstq+=$rowA[1];
    +	}
    +
    +	$stmtB="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND' group by stime;";
    +	$rsltB=mysql_query($stmtB, $link);
    +	if ($DB) {$HTML_text.="$stmtB\n";}
    +	while ($rowB=mysql_fetch_row($rsltB)) {
    +		$count_ary[$rowB[2]][2]+=$rowB[0];
    +		$count_ary[$rowB[2]][3]+=$rowB[1];
    +		$total+=$rowB[0];
    +		$Utotal+=$rowB[1];
    +		$count_ary[$rowB[2]][14]+=$rowB[0];
    +		$count_ary[$rowB[2]][15]+=$rowB[1];
    +		$totalnocid+=$rowB[0];
    +		$Utotalnocid+=$rowB[1];
    +	}
    +
    +	$stmtC="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC' group by stime;";
    +	$rsltC=mysql_query($stmtC, $link);
    +	if ($DB) {$HTML_text.="$stmtC\n";}
    +	while ($rowC=mysql_fetch_row($rsltC)) {
    +		$count_ary[$rowC[2]][4]+=$rowC[0];
    +		$count_ary[$rowC[2]][5]+=$rowC[1];
    +		$total+=$rowC[0];
    +		$Utotal+=$rowC[1];
    +		$count_ary[$rowC[2]][14]+=$rowC[0];
    +		$count_ary[$rowC[2]][15]+=$rowC[1];
    +		$totaldnc+=$rowC[0];
    +		$Utotaldnc+=$rowC[1];
    +	}
    +
    +	$stmtD="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE' group by stime;";
    +	$rsltD=mysql_query($stmtD, $link);
    +	if ($DB) {$HTML_text.="$stmtD\n";}
    +	while ($rowD=mysql_fetch_row($rsltD)) {
    +		$count_ary[$rowD[2]][6]+=$rowD[0];
    +		$count_ary[$rowD[2]][7]+=$rowD[1];
    +		$total+=$rowD[0];
    +		$Utotal+=$rowD[1];
    +		$count_ary[$rowD[2]][14]+=$rowD[0];
    +		$count_ary[$rowD[2]][15]+=$rowD[1];
    +		$totalsale+=$rowD[0];
    +		$Utotalsale+=$rowD[1];
    +	}
    +
    +	$stmtE="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE' group by stime;";
    +	$rsltE=mysql_query($stmtE, $link);
    +	if ($DB) {$HTML_text.="$stmtE\n";}
    +	while ($rowE=mysql_fetch_row($rsltE)) {
    +		$count_ary[$rowE[2]][8]+=$rowE[0];
    +		$count_ary[$rowE[2]][9]+=$rowE[1];
    +		$total+=$rowE[0];
    +		$Utotal+=$rowE[1];
    +		$count_ary[$rowE[2]][14]+=$rowE[0];
    +		$count_ary[$rowE[2]][15]+=$rowE[1];
    +		$totalarch+=$rowE[0];
    +		$Utotalarch+=$rowE[1];
    +	}
    +
    +	$stmtF="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid group by stime;";
    +	$rsltF=mysql_query($stmtF, $link);
    +	if ($DB) {$HTML_text.="$stmtF\n";}
    +	while ($rowF=mysql_fetch_row($rsltF)) {
    +		$count_ary[$rowF[2]][10]+=$rowF[0];
    +		$count_ary[$rowF[2]][11]+=$rowF[1];
    +		$totaltiq+=$rowF[0];
    +		$Utotaltiq+=$rowF[1];
    +	}
    +
    +	$stmtG="select count(*),count(distinct caller_id), substr(start_time,1,$substr_place) as stime From vicidial_closer_log vc, live_inbound_log l where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN' and (vc.xfercallid is null or vc.xfercallid='0') and vc.uniqueid=l.uniqueid and vc.user!='VDCL' group by stime;";
    +	$rsltG=mysql_query($stmtG, $link);
    +	if ($DB) {$HTML_text.="$stmtG\n";}
    +	while ($rowG=mysql_fetch_row($rsltG)) {
    +		$count_ary[$rowG[2]][12]+=$rowG[0];
    +		$count_ary[$rowG[2]][13]+=$rowG[1];
    +		$totalsta+=$rowG[0];
    +		$Utotalsta+=$rowG[1];
    +	}
     
     
    -echo "\n";
    -echo "+----------------------+---------+---------+---------+\n";
    -echo "| CATEGORIA             | CALLS   | UNIQUE  |      %  |\n";
    -echo "+----------------------+---------+---------+---------+\n";
    +	$HTML_text.="\n";
    +	$HTML_text.="+------------------------------+-------------------------+-----------------------------------------------------+-------------------------+-------------------------+-------------------------+-------------------------+\n";
    +	$HTML_text.="|                              |          TOTALI         |              SENT TO QUEUE                          |   CALLERID NOT FOUND    |       PREVIOUS DNC      |       PREVIOUS SALE     |       ARCHIVE ONLY      |\n";
    +	$HTML_text.="|                              +--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	$HTML_text.="| HOURS                        | CALLS  | UNIQUE |     % | CALLS**              | UNIQUE**             |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % | CALLS  | UNIQUE |     % |\n";
    +	$HTML_text.="+------------------------------+--------+--------+-------+----------------------+----------------------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+--------+--------+-------+\n";
    +	
    +	$CSV_text.="\n";
    +	$CSV_text.="\"\",\"\",\"TOTALI\",\"\",\"\",\"SENT TO QUEUE\",\"\",\"\",\"CALLERID NOT FOUND\",\"\",\"\",\"PREVIOUS DNC\",\"\",\"\",\"PREVIOUS SALE\",\"\",\"\",\"ARCHIVE ONLY\",\n";
    +	$CSV_text.="\"HOURS\",\"CALLS\",\"UNIQUE\",\"%\",\"CALLS**\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\"CALLS*\",\"UNIQUE**\",\"%\",\n";
    +
    +	for($i=0; $i
    -
    -
    + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); - + // It will be called LIST_101_20090209-121212.txt + 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; + +# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +# fwrite($CSV_report, $CSV_header); +# fwrite($CSV_report, $CSV_lines); +# fwrite($CSV_report, $CSV_total); + +} +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php index 0a006041..85b14cb2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -16,6 +16,10 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis +# 110703-1850 - Added download option +# 111103-2315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -31,26 +35,38 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} -$report_name = 'Inbound IVR Report'; +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} $db_source = 'M'; +$JS_text=" - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "Date:
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; -echo "\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="Date:
    \n"; -echo "\n"; -echo "\n"; -echo ""; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    to
    "; +$MAIN.="
    to
    "; -?> - -\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date_D'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="\n"; -echo "   "; +$MAIN.="   "; -echo "
    \n"; -echo "Gruppi Inbound: \n"; -echo "\n"; -echo "\n"; + +if ($type == 'inbound') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "\n";} - else - {echo "\n";} - $o++; + $MAIN.="Gruppi Inbound: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="MODIFICA | "; + $MAIN.="REPORT | "; + $MAIN.="INFORME CLOSER \n"; + $MAIN.="\n"; + } +else + { + $MAIN.="Campagnas: \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="           "; + $MAIN.="DOWNLOAD | "; + $MAIN.="MODIFICA | "; + $MAIN.="REPORT | "; + $MAIN.="OUTBOUND REPORT \n"; + $MAIN.="\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "MODIFICA | "; -echo "REPORT | "; -echo "INFORME CLOSER \n"; -echo "\n"; -echo "
    \n"; +$MAIN.="
    \n"; -#echo "\n"; # $o=0; # while ($groups_to_print > $o) # { -# if ($groups[$o] == $group) {echo "\n";} -# else {echo "\n";} +# if ($groups[$o] == $group) {$MAIN.="\n";} +# else {$MAIN.="\n";} # $o++; # } -#echo "\n"; -echo "Shift: \n"; +#$MAIN.="\n"; +$MAIN.="Shift: \n"; -?> -\n"; - +$MAIN.="
    Visualizzare as:  "; +$MAIN.="\n
    "; +$MAIN.="    \n"; -   -
    \n"; +$MAIN.="\n\n"; -echo "
    \n"; -echo "\n\n"; - -echo "
    \n\n";
    +$MAIN.="
    \n\n";
     
     
     if ($groups_to_print < 1)
     	{
    -	echo "\n\n";
    -	echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
     	}
     
     else
     	{
    -	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    -	echo "                  $group_string\n";
    +	$MAIN.="IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
    +	$MAIN.="                  $group_string\n";
    +
    +	$CSV_text.="\"IVR Stats Report: $query_date_BEGIN to $query_date_END\",\"$NOW_TIME\"\n";
     
     	$TOTALcalls=0;
     	$NOCALLERIDcalls=0;
    @@ -383,9 +463,16 @@ else
     	$totFLOWtotal_time=0;
     
     	##### Grab all records for the IVR for the specified time period
    -	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +	if ($type == 'inbound')
    +		{
    +		$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
    +		}
    +	else
    +		{
    +		$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
    +		}
     	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    +	if ($DB) {$MAIN.="$stmt\n";}
     	$logs_to_print = mysql_num_rows($rslt);
     	$p=0;
     	while ($p < $logs_to_print)
    @@ -410,11 +497,11 @@ else
     	$r=-1;
     	while ($p < $logs_to_print)
     		{
    -		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
    +		if ($DB > 0) {$MAIN.="$p|$uniqueid[$p]|$comment_b[$p]";}
     		if ($last_uniqueid === "$uniqueid[$p]")
     			{
     			$unique_calls[$r] .= "----------$comment_b[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			$last_epoch[$r]=$epoch[$p];
     			}
     		else
    @@ -436,7 +523,7 @@ else
     			$unique_calls[$r] = $comment_b[$p];
     			$FLOWuniqueid[$r] = "$uniqueid[$p]";
     			$last_uniqueid = "$uniqueid[$p]";
    -			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
    +			if ($DB > 0) {$MAIN.="   $r|$unique_calls[$r]\n";}
     			}
     		$p++;
     		}
    @@ -453,7 +540,7 @@ else
     	$s=0;
     	while ($s <= $r)
     		{
    -		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
    +		if ($DB > 0) {$MAIN.="$s|$unique_calls[$s]\n";}
     		if ($last_Suniqueid === "$unique_calls[$s]")
     			{
     			$STunique_calls_count[$p]++;
    @@ -481,11 +568,15 @@ else
     		}
     
     	#### PRINT TOTALE CHIAMATE INTO THIS IVR
    -	echo "\n";
    -	echo "Calls taken into this IVR:   $TOTALcalls\n";
    -	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
    -	echo "Unique Callers:              $UNIQUEcallers\n";
    -	echo "\n";
    +	$MAIN.="\n";
    +	$MAIN.="Calls taken into this IVR:   $TOTALcalls\n";
    +	$MAIN.="Calls with no CallerID:      $NOCALLERIDcalls\n";
    +	$MAIN.="Unique Callers:              $UNIQUEcallers\n";
    +	$MAIN.="\n";
    +
    +	$CSV_text.="\"Calls taken into this IVR: $TOTALcalls\"\n";
    +	$CSV_text.="\"Calls with no CallerID: $NOCALLERIDcalls\"\n";
    +	$CSV_text.="\"Unique Callers: $UNIQUEcallers\"\n\n";
     
     	### sort call flows for counting
     	if ($p > 0)
    @@ -520,11 +611,32 @@ else
     	### put call flows and counts together for sorting again
     	$s=0;
     
    -	echo "+--------+--------+--------+--------+------+------+\n";
    -	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    -	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    -	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    -	echo "+--------+--------+--------+--------+------+------+------------\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
    +	$ASCII_text.="|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
    +	$ASCII_text.="| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
    +	$ASCII_text.="| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
    +	$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
    +
    +	######## GRAPHING #########
    +	$graph_stats=array();
    +	$max_ivr_calls=1;
    +	$max_queue_calls=1;
    +	$max_queue_drops=1;
    +	$max_queue_drops_percent=1;
    +	$max_ivr_avg=1;
    +	$max_total_avg=1;
    +	$GRAPH="";
    +	$GRAPH.="";
    +	$GRAPH.="
    IVR CALLSQUEUE CALLSQUEUE DROP CALLSQUEUE DROP PERCENTIVR AVG TIMETOTAL AVG TIME

     


    "; + $IVRCALLS_graph=""; + $QUEUECALLS_graph="
    IVR STATS
    IVR CALLSCALL PATH
    "; + $QUEUEDROPCALLS_graph="
    IVR STATS
    QUEUE CALLSCALL PATH
    "; + $QUEUEDROPPERCENT_graph="
    IVR STATS
    QUEUE DROP CALLSCALL PATH
    "; + $IVRAVGTIME_graph="
    IVR STATS
    QUEUE DROP PERCENTCALL PATH
    "; + $TOTALAVGTIME_graph="
    IVR STATS
    IVR AVG TIMECALL PATH
    "; + ########################### + + $CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n"; while ($s <= $p) { @@ -538,27 +650,40 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$ASCII_text.="$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); } + + if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];} + if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];} + if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];} + if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];} + $graph_stats[$s][1]=$FLOWsummary[0]; + $graph_stats[$s][2]=$FLOWtotal[$s]; + $graph_stats[$s][3]=$FLOWdrop[$s]; + $graph_stats[$s][4]=$FLOWdropPCT[$s]; + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); @@ -573,12 +698,20 @@ else $avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0); $avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]); + if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);} + if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);} + $graph_stats[$s][0]=$FLOWsummary[1]; + $graph_stats[$s][5]=trim($avgFLOWivr_time[$s]); + $graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]); + + $totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]); $totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]); $totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]); $totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]); - echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n"; + $CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n"; $s++; } @@ -602,18 +735,63 @@ else } $totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT); - echo "+--------+--------+--------+--------+------+------+------------\n"; - echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; - echo "+--------+--------+--------+--------+------+------+\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+------------\n"; + $ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n"; + $ASCII_text.="+--------+--------+--------+--------+------+------+\n"; + $CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n"; + for ($d=0; $d".$graph_stats[$d][1].""; + $QUEUECALLS_graph.=" "; + $QUEUEDROPCALLS_graph.=" "; + $QUEUEDROPPERCENT_graph.=" "; + $IVRAVGTIME_graph.=" "; + $TOTALAVGTIME_graph.=" "; + } + $IVRCALLS_graph.="
    IVR STATS
    TOTAL AVG TIMECALL PATH
    ".$graph_stats[$d][0]."
    ".$graph_stats[$d][2]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][3]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][4]."%".$graph_stats[$d][0]."
    ".$graph_stats[$d][5]."".$graph_stats[$d][0]."
    ".$graph_stats[$d][6]."".$graph_stats[$d][0]."
    ".trim($TOTALcalls)."TOTALE
    "; + $QUEUECALLS_graph.="
    ".trim($totFLOWtotal)."TOTALE
    "; + $QUEUEDROPCALLS_graph.="
    ".trim($totFLOWdrop)."TOTALE
    "; + $QUEUEDROPPERCENT_graph.="
    ".trim($totFLOWdropPCT)."%TOTALE
    "; + $IVRAVGTIME_graph.="
    ".trim($TavgFLOWivr_time)."TOTALE
    "; + $TOTALAVGTIME_graph.="
    ".trim($TavgFLOWtotal_time)."TOTALE
    "; + $JS_onload.="\tDrawGraph('IVRCALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n"; + $JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n"; + $JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n"; + $JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n"; + $JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"ivrgraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"ivrgraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; + + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + } + else + { + $MAIN.=$ASCII_text; + } + ############################## ######### TIME STATS - echo "\n"; - echo "---------- STATISTICHE TEMPO\n"; + $MAIN.="\n"; + $MAIN.="---------- STATISTICHE TEMPO\n"; - echo "\n"; + $MAIN.="\n"; $hi_hour_count=0; $last_full_record=0; @@ -621,9 +799,16 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -631,27 +816,48 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $hour_count[$i] = $row[0]; if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];} @@ -668,8 +874,9 @@ else #$hour_multiplier = round($hour_multiplier, 0); } - echo "\n"; - echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IVR\n"; + $MAIN.="\n"; + $MAIN.="GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IVR\n"; + $CSV_text.="\n\"GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IVR\"\n"; $k=1; $Mk=0; @@ -698,10 +905,11 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; - #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; - echo "| HOUR |$call_scale| TOTAL |\n"; - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + #$MAIN.="| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n"; + $MAIN.="| HOUR |$call_scale| TOTAL |\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n"; + $CSV_text.="\"HOUR\",\"TOTAL\"\n"; $ZZ = '00'; $i=0; @@ -733,9 +941,10 @@ else else { $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= 102) {echo " "; $k++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= 102) {$MAIN.=" "; $k++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"0\"\n"; } } else @@ -746,12 +955,14 @@ else $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); - echo "|$time|"; - $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} - echo "*X"; $char_counter++; - $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} - while ($char_counter <= 101) {echo " "; $char_counter++;} - echo "| $hour_count[$i] |\n"; + $MAIN.="|$time|"; + $k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;} + $MAIN.="*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;} + while ($char_counter <= 101) {$MAIN.=" "; $char_counter++;} + $MAIN.="| $hour_count[$i] |\n"; + $CSV_text.="\"\",\"$time\",\"$hour_count[$i]\"\n"; + } @@ -760,18 +971,48 @@ else } - echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; + $MAIN.="+------+-------------------------------------------------------------------------------------------------------+-------+\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); - echo "\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\nRun Time: $RUNtime seconds|$db_source\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + + $MAIN.="\n"; + } + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_IVRstats_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; } ?> - -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_LISTS_campaign_stats.php new file mode 100644 index 00000000..ae5a2356 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_LISTS_campaign_stats.php @@ -0,0 +1,966 @@ + LICENSE: AGPLv2 +# +# This is a list inventory report, not a calling report. This report will show +# statistics for all of the lists in the selected campaigns +# +# CHANGES +# 100916-0928 - First build +# 110703-1815 - Added download option +# 120224-0910 - Added HTML display option with bar graphs +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$report_name = 'Liste Esiti Campagna Report'; +$db_source = 'M'; +$JS_text="\n"; + + echo $HEADER; + echo $JS_text; + require("admin_header.php"); + echo $MAIN; + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_LIST_UPDATEstats.php new file mode 100644 index 00000000..b21d5527 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_LIST_UPDATEstats.php @@ -0,0 +1,242 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90627-2055 - First build +# 90907-0636 - Added list id to results +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'List Update Stats'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} + + +?> + + + + + +\n"; +echo "$report_name\n"; + + $short_header=1; + + require("admin_header.php"); + +if ($DB > 0) + { + echo "
    \n"; + echo "$query_date|$end_date\n"; + echo "
    \n"; + } + +echo "
    "; + +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    to
    \n"; +echo "
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           REPORT \n"; +echo "
    \n"; +echo "
    \n"; + +echo "
    ";
    +
    +
    +if (!$query_date)
    +{
    +echo "\n\n";
    +echo "PLEASE SELECT A DATE RANGE ABOVE AND CLICK INVIA\n";
    +}
    +
    +else
    +{
    +echo "List Update Process Report                      $NOW_TIME\n";
    +echo "\n";
    +echo "Time range $query_date to $end_date\n\n";
    +
    +
    +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +echo "List Update Summary:\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "| FILENAME                                           | RESULT     | RECORDS  | UPDATES  |\n";
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +
    +$stmt="SELECT count(*),filename,result,sum(result_rows) from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' group by filename,result order by filename,result;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$records_to_grab = mysql_num_rows($rslt);
    +$i=0;
    +while ($i < $records_to_grab)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$TOTcount = ($TOTcount + $row[0]);
    +	$TOTupdated = ($TOTupdated + $row[3]);
    +	$count =	sprintf("%-8s", $row[0]);
    +	$filename =	sprintf("%-50s", trim($row[1]));
    +	$result =	sprintf("%-10s", $row[2]);
    +	$updated =	sprintf("%-8s", $row[3]);
    +	echo "| $filename | $result | $count | $updated |\n";
    +
    +	$i++;
    +	}
    +$TOTcount =	sprintf("%-8s", $TOTcount);
    +$TOTupdated =	sprintf("%-8s", $TOTupdated);
    +
    +echo "+----------------------------------------------------+------------+----------+----------+\n";
    +echo "                                                                  | $TOTcount | $TOTupdated |\n";
    +echo "                                                                  +----------+----------+\n";
    +echo "\n
    \n"; + + + +### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ### +echo "List Update Dettagliata:
    \n"; +echo "\n"; +echo "\n"; +echo "\n"; + + +$stmt="SELECT event_date,lead_id,vendor_id,phone_number,status,old_status,filename,result,result_rows,list_id from vicidial_list_update_log where event_date >= '$query_date' and event_date <= '$end_date' order by event_date,filename;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$records_to_grab = mysql_num_rows($rslt); +$i=0; +while ($i < $records_to_grab) + { + $row=mysql_fetch_row($rslt); + $row[6] = trim($row[6]); + echo "\n"; + $i++; + } + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "
    DATE/TIMELEAD_IDVENDOR_IDPHONEESITOOLD_STATUSOLD_LISTFILENAMERESULTUPDATED_ROWS
    $row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[9]$row[6]$row[7]$row[8]

    \nRun Time: $RUNtime seconds|$db_source\n"; +} + + + +?> + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php index bfe26cb6..659a49d0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1825 - Added download option +# 111104-1205 - Added user_group and calltime restrictions +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -41,10 +44,14 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} 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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -55,12 +62,14 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';} $report_name = 'Outbound Summary Interval Report'; $db_source = 'M'; +$JS_text="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "\n"; - -echo "\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; if ($bareformat < 1) { $short_header=1; - require("admin_header.php"); - echo "
    "; + $MAIN.="
    "; if ($DB > 0) { - echo "
    \n"; - echo "$group_ct|$group_string|$group_SQL\n"; - echo "
    \n"; - echo "$shift|$query_date|$end_date\n"; - echo "
    \n"; + $MAIN.="
    \n"; + $MAIN.="$group_ct|$group_string|$group_SQL\n"; + $MAIN.="
    \n"; + $MAIN.="$shift|$query_date|$end_date\n"; + $MAIN.="
    \n"; } - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Date Range:
    \n"; - echo ""; - ?> - - \n"; + $MAIN.="\n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="Date:
    \n"; + $MAIN.=""; + $MAIN.=" \n"; + $MAIN.=" to "; + $MAIN.=" \n"; - echo " to "; - - ?> - -
    Campaigns:
    "; - echo "
    Campagnas:
    "; + $MAIN.="\n"; - echo "
    "; - echo "Include Drop  
    Rollover:
    "; - echo "
    \n"; - echo "Time Interval:
    "; - echo "\n"; + $MAIN.="
    "; + $MAIN.="Include Drop  
    Rollover:
    "; + $MAIN.="
    \n"; + $MAIN.="Time Interval:
    "; + $MAIN.="\n"; - echo "
    \n"; - echo "         "; - echo "MODIFY | "; - echo "REPORTS"; - echo "

    \n"; - echo "
            "; - echo "\n"; + {$MAIN.="\n";} - echo "
    \n"; - echo "Call Time:
    \n"; - echo "\n"; + $MAIN.="
    \n"; + $MAIN.="         "; + $MAIN.="DOWNLOAD | "; + $MAIN.="MODIFICA | "; + $MAIN.="REPORT"; + $MAIN.="

    \n"; + $MAIN.="Visualizzare as:
    "; + $MAIN.="\n
    "; + $MAIN.="
            "; + $MAIN.="\n"; + + $MAIN.="
    \n"; + + $MAIN.="Call Time:
    \n"; + $MAIN.="\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n\n"; + $MAIN.="\n"; + $MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n\n"; - echo "
    \n\n";
    +	$MAIN.="
    \n\n";
     	}
     
     if ($group_ct < 1)
     	{
    -	echo "\n\n";
    -	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
    +	$MAIN.="\n\n";
    +	$MAIN.="PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK INVIA\n";
     	}
     
     else
    @@ -509,7 +526,7 @@ else
     		{
     		$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='$shift';";
     		$rslt=mysql_query($stmt, $link);
    -		if ($DB) {echo "$stmt\n";}
    +		if ($DB) {$MAIN.="$stmt\n";}
     		$calltimes_to_print = mysql_num_rows($rslt);
     		if ($calltimes_to_print > 0)
     			{
    @@ -579,7 +596,7 @@ else
     			$Hcalltime_HHMM[$h] = "$H_test";
     			}
     		if ($DB)
    -			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
    +			{$MAIN.="( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
     		$h++;
     		}
     
    @@ -589,19 +606,49 @@ else
     
     	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
     
    -
    +	$CSV_main.="\"Outbound Summary Interval Report:\"\n\"$group_string\"\n\"$NOW_TIME\"\n\n";
     
     
     	##### Loop through each campaign and gether stats
     	if ($group_ct > 0)
     		{
    -		$MAIN .= "\n";
    -		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    -		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    -		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
    -		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    -		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "\n";
    +		$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +		$ASCII_text .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
    +		$ASCII_text .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | RISPOSTA | DROP   | LOGIN      | PAUSE      |\n";
    +		$ASCII_text .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
    +		$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
    +
    +		$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
    +		$CSV_main.="\"CAMPAIGN\",\"TOTALE CHIAMATE\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RISPOSTA PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME(H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n";
    +		$CSV_subreports="";
    +		
    +		######## GRAPHING #########
    +		$max_calls=1;
    +		$max_system_release=1;
    +		$max_agent_release=1;
    +		$max_sales=1;
    +		$max_dncs=1;
    +		$max_nas=1;
    +		$max_drops=1;
    +		$max_login_time=1;
    +		$max_pause_time=1;
    +
    +		$GRAPH="

    "; + $GRAPH.=""; + $GRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENT RELEASE CALLSSALE CALLSDNC CALLSNO RISPOSTA PERCENTDROP PERCENTAGENT LOGIN TIMEAGENT PAUSE TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $SYSTEMRELEASE_graph=$graph_header.""; + $AGENTRELEASE_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $DNCS_graph=$graph_header.""; + $NAS_graph=$graph_header.""; + $DROPS_graph=$graph_header.""; + $LOGINTIME_graph=$graph_header.""; + $PAUSETIME_graph=$graph_header.""; + ########################### $i=0; $TOTcalls_count=0; @@ -622,7 +669,7 @@ else ##### Gather Agent time records $stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $AGENTtime_to_print = mysql_num_rows($rslt); $s=0; while ($s < $AGENTtime_to_print) @@ -640,7 +687,7 @@ else ##### Gather outbound calls $stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $calls_to_parse = mysql_num_rows($rslt); $p=0; while ($p < $calls_to_parse) @@ -667,7 +714,7 @@ else ##### Gather inbound calls from drop inbound group if selected $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $in_groups_to_print = mysql_num_rows($rslt); if ($in_groups_to_print > 0) { @@ -681,7 +728,7 @@ else $agent_alert_delayZ=0; $stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $INallcalls_to_printZ = mysql_num_rows($rslt); $y=0; while ($y < $INallcalls_to_printZ) @@ -758,7 +805,7 @@ else $Hanswer_count=$MT; $Hmax_queue_seconds=$MT; $hTOTALcalls = 0; - $hANSWERcalls = 0; + $hRISPOSTAcalls = 0; $hSUMagent = 0; $hSUMpause = 0; $hSUMtalk = 0; @@ -841,7 +888,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -849,7 +896,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} + {$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";} $p++; } @@ -979,7 +1026,7 @@ else if ($print_calls > 0) { - echo "$row[5]\t$row[6]\t$TEMPtalk\n"; + $ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n"; $PCtemptalk = ($PCtemptalk + $TEMPtalk); } $q++; @@ -987,7 +1034,7 @@ else else {$out_of_call_time++;} if ($DB) - {echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} + {$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";} $p++; } @@ -1004,7 +1051,7 @@ else if ($print_calls > 0) { $PCtemptalkmin = ($PCtemptalk / 60); - echo "$q\t$PCtemptalk\t$PCtemptalkmin\n"; + $ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n"; } if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) ) @@ -1030,6 +1077,22 @@ else if ($max_queue_seconds[$i] > $TOTmax_queue_seconds) {$TOTmax_queue_seconds = $max_queue_seconds[$i];} + if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];} + if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];} + if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];} + if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];} + if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];} + if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];} + if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];} + $graph_stats[$i][0]="$group[$i] - $group_cname[$i]"; + $graph_stats[$i][1]=$calls_count[$i]; + $graph_stats[$i][2]=$system_count[$i]; + $graph_stats[$i][3]=$agent_count[$i]; + $graph_stats[$i][4]=$ptp_count[$i]; + $graph_stats[$i][5]=$rtp_count[$i]; + $graph_stats[$i][8]=$agent_sec[$i]; + $graph_stats[$i][9]=$pause_sec[$i]; + $agent_sec[$i] = sec_convert($agent_sec[$i],'H'); $pause_sec[$i] = sec_convert($pause_sec[$i],'H'); $talk_sec[$i] = sec_convert($talk_sec[$i],'H'); @@ -1051,7 +1114,7 @@ else {$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);} $gNApercent = sprintf("%6.2f",$gNApercent); $gNAcalls = sprintf("%6s", $na_count[$i]); - $gANSWERcalls = sprintf("%6s", $answer_count[$i]); + $gRISPOSTAcalls = sprintf("%6s", $answer_count[$i]); $gSUMagent = sprintf("%10s", $agent_sec[$i]); $gSUMpause = sprintf("%10s", $pause_sec[$i]); $gSUMtalk = sprintf("%9s", $talk_sec[$i]); @@ -1066,21 +1129,59 @@ else $gDROPpercent = sprintf("%6.2f",$gDROPpercent); $gDROPcalls = sprintf("%6s", $drop_count[$i]); + if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);} + if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);} + $graph_stats[$i][6]=trim($gNApercent); + $graph_stats[$i][7]=trim($gDROPpercent); + + while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);} - $MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; - if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} - $MAIN .= "\n"; + $ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |"; + $CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n"; + if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";} + $ASCII_text .= "\n"; ### hour by hour sumaries - $SUBoutput .= "\n---------- $group[$i] - $group_cname[$i] INTERVAL BREAKDOWN:\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; - $SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n"; - $SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n"; + $SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | RISPOSTA | DROP | LOGIN | PAUSE |\n"; + $SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $h=0; + $CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n"; + $CSV_subreports.="\"INTERVAL\",\"TOTALE CHIAMATE\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO RISPOSTA PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME (H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n"; + + ######## GRAPHING ######### + $SUBmax_calls=1; + $SUBmax_system_release=1; + $SUBmax_agent_release=1; + $SUBmax_sales=1; + $SUBmax_dncs=1; + $SUBmax_nas=1; + $SUBmax_drops=1; + $SUBmax_login_time=1; + $SUBmax_pause_time=1; + $SUBgraph_stats=""; + $SUBrpt_campaign=$group[$i]; + + $SUBGRAPH="

    MULTI-CAMPAIGN BREAKDOWN
    CAMPAIGNSTOTALE CHIAMATE
    SYSTEM RELEASE CALLS
    AGENT RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO RISPOSTA PERCENT
    DROP PERCENT
    AGENT LOGIN TIME (H:M:S)
    AGENT PAUSE TIME (H:M:S)
    "; + $SUBGRAPH.=""; + $SUBGRAPH.="
    CALLSSYSTEM RELEASE CALLSAGENT RELEASE CALLSSALE CALLSDNC CALLSNO RISPOSTA PERCENTDROP PERCENTAGENT LOGIN TIMEAGENT PAUSE TIME

     


    "; + $SUBgraph_header=""; + $SUBCALLS_graph=$SUBgraph_header.""; + $SUBSYSTEMRELEASE_graph=$SUBgraph_header.""; + $SUBAGENTRELEASE_graph=$SUBgraph_header.""; + $SUBSALES_graph=$SUBgraph_header.""; + $SUBDNCS_graph=$SUBgraph_header.""; + $SUBNAS_graph=$SUBgraph_header.""; + $SUBDROPS_graph=$SUBgraph_header.""; + $SUBLOGINTIME_graph=$SUBgraph_header.""; + $SUBPAUSETIME_graph=$SUBgraph_header.""; + ########################### + + $h=0; $z=0; while ($h < $interval_count) { if ($Hcalltime[$h] > 0) @@ -1131,6 +1232,24 @@ else else {$Hqueue_avg[$h] = 0;} + if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];} + if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];} + if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];} + if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];} + if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];} + if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);} + if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);} + if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];} + if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];} + $SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]"; + $SUBgraph_stats[$z][1]=$Hcalls_count[$h]; + $SUBgraph_stats[$z][2]=$Hsystem_count[$h]; + $SUBgraph_stats[$z][3]=$Hagent_count[$h]; + $SUBgraph_stats[$z][4]=$Hptp_count[$h]; + $SUBgraph_stats[$z][5]=$Hrtp_count[$h]; + $SUBgraph_stats[$z][8]=$Hagent_sec[$h]; + $SUBgraph_stats[$z][9]=$Hpause_sec[$h]; + $Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H'); $Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H'); $Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H'); @@ -1150,7 +1269,7 @@ else {$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);} $hNApercent = sprintf("%6.2f",$hNApercent); $hNAcalls = sprintf("%6s", $Hna_count[$h]); - $hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]); + $hRISPOSTAcalls = sprintf("%6s", $Hanswer_count[$h]); $hSUMagent = sprintf("%10s", $Hagent_sec[$h]); $hSUMpause = sprintf("%10s", $Hpause_sec[$h]); $hSUMtalk = sprintf("%9s", $Htalk_sec[$h]); @@ -1166,8 +1285,13 @@ else $hDROPcalls = sprintf("%6s", $Hdrop_count[$h]); $hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]); - $SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; - if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + $SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n"; + $CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n"; + if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";} + + $SUBgraph_stats[$z][6]=trim($hNApercent); + $SUBgraph_stats[$z][7]=trim($hDROPpercent); + $z++; } $h++; @@ -1216,11 +1340,55 @@ else $hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent); $hTOTdrop_count = sprintf("%6s", $hTOTdrop_count); - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; - $SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $SUB_ASCII_text .= "| TOTALI | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n"; + $SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_subreports.="\"TOTALI\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n"; $i++; + + for ($d=0; $d"; + $SUBSYSTEMRELEASE_graph.=" "; + $SUBAGENTRELEASE_graph.=" "; + $SUBSALES_graph.=" "; + $SUBDNCS_graph.=" "; + $SUBNAS_graph.=" "; + $SUBDROPS_graph.=" "; + $SUBLOGINTIME_graph.=" "; + $SUBPAUSETIME_graph.=" "; + } + $SUBCALLS_graph.="
    $SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:
    INTERVALTOTALE CHIAMATE
    SYSTEM RELEASE CALLS
    AGENT RELEASE CALLS
    SALE CALLS
    DNC CALLS
    NO RISPOSTA PERCENT
    DROP PERCENT
    AGENT LOGIN TIME (H:M:S)
    AGENT PAUSE TIME (H:M:S)
    ".$SUBgraph_stats[$d][1]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][2]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][3]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][4]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][5]."
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][6]."%
    ".$SUBgraph_stats[$d][0]."".$SUBgraph_stats[$d][7]."%
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][8], 'H')."
    ".$SUBgraph_stats[$d][0]."".sec_convert($SUBgraph_stats[$d][9], 'H')."
    TOTAL:".trim($hTOTcalls_count)."
    "; + $SUBSYSTEMRELEASE_graph.="
    TOTAL:".trim($hTOTsystem_count)."
    "; + $SUBAGENTRELEASE_graph.="
    TOTAL:".trim($hTOTagent_count)."
    "; + $SUBSALES_graph.="
    TOTAL:".trim($hTOTptp_count)."
    "; + $SUBDNCS_graph.="
    TOTAL:".trim($hTOTrtp_count)."
    "; + $SUBNAS_graph.="
    TOTAL:".trim($hTOTna_percent)."%
    "; + $SUBDROPS_graph.="
    TOTAL:".trim($hTOTdrop_percent)."%
    "; + $SUBLOGINTIME_graph.="
    TOTAL:".trim($hTOTagent_sec)."
    "; + $SUBPAUSETIME_graph.="
    TOTAL:".trim($hTOTpause_sec)."
    "; + $JS_onload.="\tDraw".$SUBrpt_campaign."CampagnaGraph('CALLS', '1');\n"; + $JS_text.="function Draw".$SUBrpt_campaign."CampagnaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $SUB_HTML_text.=$SUBGRAPH; } $rawTOTtalk_sec = $TOTtalk_sec; @@ -1270,38 +1438,123 @@ else $TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent); $TOTdrop_count = sprintf("%6s", $TOTdrop_count); - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; - $MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; - $MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $ASCII_text .= "| TOTALI Campagnas: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n"; + $ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n"; + $CSV_main.="\"TOTALI Campagnas: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n"; } if ($costformat > 0) { - echo "\n"; + $ASCII_text.="\n"; $inbound_cost = ($rawTOTtalk_min * $inbound_rate); $inbound_cost = sprintf("%8.2f", $inbound_cost); - echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + $ASCII_text.="INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; exit; } + for ($d=0; $d
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'H')."
    TOTAL:".trim($TOTcalls_count)."
    "; + $SYSTEMRELEASE_graph.="
    TOTAL:".trim($TOTsystem_count)."
    "; + $AGENTRELEASE_graph.="
    TOTAL:".trim($TOTagent_count)."
    "; + $SALES_graph.="
    TOTAL:".trim($TOTptp_count)."
    "; + $DNCS_graph.="
    TOTAL:".trim($TOTrtp_count)."
    "; + $NAS_graph.="
    TOTAL:".trim($TOTna_percent)."%
    "; + $DROPS_graph.="
    TOTAL:".trim($TOTdrop_percent)."%
    "; + $LOGINTIME_graph.="TOTAL:".trim($TOTagent_sec).""; + $PAUSETIME_graph.="TOTAL:".trim($TOTpause_sec).""; + $JS_onload.="\tDrawMultiCampagnaGraph('CALLS', '1');\n"; + $JS_text.="function DrawMultiCampagnaGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n"; + $JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n"; + $JS_text.=" var NAS_graph=\"$NAS_graph\";\n"; + $JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n"; + $JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n"; + $JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=9; i++) {\n"; + $JS_text.=" var cellID=\"campbreakdown\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"campbreakdown\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; - echo "$MAIN"; - echo "$SUBoutput"; + if ($file_download>0) { +# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); +# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); +# fwrite($CSV_report, $CSV_text); +# fclose($CSV_report); + $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; + $CSV_text=$CSV_main.$CSV_subreports; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + if ($report_display_type=="HTML") + { + $MAIN.=$GRAPH_text; + $SUBoutput.=$SUB_HTML_text; + } + else + { + $MAIN.=$ASCII_text; + $SUBoutput.=$SUB_ASCII_text; + } + + echo "$HEADER"; + echo $JS_text; + require("admin_header.php"); + echo "$MAIN"; + echo "$SUBoutput"; + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; + echo "
    "; + echo ""; + + echo ""; + } - - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $STARTtime); - echo "\n\nRun Time: $RUNtime seconds|$db_source\n"; } ?> -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php index 94a2ca9c..0d1836ce 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -30,6 +30,8 @@ # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100814-2307 - Added display of preset dials if presets are enabled in the campaign # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log +# 120224-0910 - Added HTML display option with bar graphs # header ("Content-type: text/html; charset=utf-8"); @@ -68,6 +70,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -79,6 +83,8 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';} $report_name = 'Outbound Calling Report'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; +echo "\n"; echo "\n"; echo "$report_name\n"; $short_header=1; +$draw_graph=1; require("admin_header.php"); @@ -392,6 +400,10 @@ if ($carrier_logging_active > 0) echo "\n"; echo "\n"; } +echo "

    Visualizzare as:
    "; +echo "\n
    "; echo "Shift:  
    "; echo "\n"; +$o=0; +while ($ingroups_to_print > $o) + { + if ($group_id[$o] == $group) + { + echo "\n"; + $selected_name=$group_name[$o]; + } + else + { + echo "\n"; + } + $o++; + } +echo "\n"; +echo "\n"; +echo "           MODIFICA \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A IN-GROUP ABOVE AND CLICK INVIA\n";
    +	}
    +
    +else
    +	{
    +	echo "Live Current Agenti logged in to take calls from $group - $selected_name         $NOW_TIME\n";
    +
    +	echo "\n";
    +
    +	$stmt="select count(*) from vicidial_live_agents where closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\";";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +
    +	$TOTALagents =	sprintf("%10s", $row[0]);
    +
    +	echo "Total agents:       $TOTALagents\n";
    +
    +
    +	##############################
    +	#########  LIVE AGENT STATS
    +	$user_list='|';
    +	echo "\n";
    +	echo "---------- LIVE AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +	echo "| #    | UTENTE                        | CAMPAIGN             | STATUS | LAST ACTIVITY       |\n";
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	$stmt="select vla.user,vu.full_name,vla.campaign_id,vla.status,vla.last_state_change from vicidial_live_agents vla,vicidial_users vu where vla.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" and vla.user=vu.user order by vla.user limit 1000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$users_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $users_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		$campaign_id =	sprintf("%-8s", $row[2]);
    +		$status =		sprintf("%-6s", $row[3]);
    +		$time =			sprintf("%-19s", $row[4]);
    +		$user_list .=	"$row[0]---$row[3]|";
    +
    +		echo "| $FMT_i | $user | $campaign_id   Real-Time | $status | $time |\n";
    +		}
    +
    +	echo "+------+--------------------------------+----------------------+--------+---------------------+\n";
    +
    +	
    +	if ($DB) {echo "\n$user_list\n";}
    +
    +	##############################
    +	#########  ALL AGENT STATS
    +
    +	echo "\n";
    +	echo "---------- DEFAULT AGENTS IN IN-GROUP\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +	echo "| #    | UTENTE                        | LOGGED IN |\n";
    +	echo "+------+--------------------------------+-----------+\n";
    +
    +	$stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$Xusers_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $Xusers_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		$i++;
    +
    +		$FMT_i =		sprintf("%-4s", $i);
    +		$user =			sprintf("%-30s", "$row[0] - $row[1]");
    +			while(strlen($user)>30) {$user = substr("$user", 0, -1);}
    +		if (preg_match("/\|$row[0]---/",$user_list))
    +			{
    +			$userstatusARY =	explode("|$row[0]---",$user_list);
    +			$userstatus =		explode('|',$userstatusARY[1]);
    +			$status_line =		sprintf("%-9s", $userstatus[0]);
    +
    +			if ($DB) {echo "\n$user_list     |$row[0]---     $userstatusARY[1]     $userstatus[0]\n";}
    +			}
    +		else
    +			{$status_line = '         ';}
    +
    +		echo "| $FMT_i | $user | $status_line |\n";
    +		}
    +
    +	echo "+------+--------------------------------+-----------+\n";
    +	
    +	}
    +
    +
    +?>
    +
    + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_log_display.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_log_display.php deleted file mode 100644 index 1bc446ca..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: AGPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} - elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "
    \n\n"; - -echo "
    \n\n";
    -
    -
    -echo "VICIDIAL ADMIN Change Log                             $NOW_TIME\n";
    -
    -#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
    -passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
    -
    -
    -?>
    -
    - - \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_template_maker.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_template_maker.php new file mode 100644 index 00000000..8495e53b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_admin_template_maker.php @@ -0,0 +1,447 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120402-2132 - First Build +# + +require("dbconnect.php"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_description"])) {$template_description=$_GET["template_description"];} + elseif (isset($_POST["template_description"])) {$template_description=$_POST["template_description"];} +if (isset($_GET["file_format"])) {$file_format=$_GET["file_format"];} + elseif (isset($_POST["file_format"])) {$file_format=$_POST["file_format"];} +if (isset($_GET["file_delimiter"])) {$file_delimiter=$_GET["file_delimiter"];} + elseif (isset($_POST["file_delimiter"])) {$file_delimiter=$_POST["file_delimiter"];} +if (isset($_GET["template_list_id"])) {$template_list_id=$_GET["template_list_id"];} + elseif (isset($_POST["template_list_id"])) {$template_list_id=$_POST["template_list_id"];} +if (isset($_GET["standard_fields_layout"])) {$standard_fields_layout=$_GET["standard_fields_layout"];} + elseif (isset($_POST["standard_fields_layout"])) {$standard_fields_layout=$_POST["standard_fields_layout"];} +if (isset($_GET["custom_fields_layout"])) {$custom_fields_layout=$_GET["custom_fields_layout"];} + elseif (isset($_POST["custom_fields_layout"])) {$custom_fields_layout=$_POST["custom_fields_layout"];} +if (isset($_GET["submit_template"])) {$submit_template=$_GET["submit_template"];} + elseif (isset($_POST["submit_template"])) {$submit_template=$_POST["submit_template"];} +if (isset($_GET["delete_template"])) {$delete_template=$_GET["delete_template"];} + elseif (isset($_POST["delete_template"])) {$delete_template=$_POST["delete_template"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +#$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +$vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +if ($submit_template=="Carica modello" && $template_id && $template_name && $template_list_id && $standard_fields_layout) { + $custom_table="custom_".$template_list_id; + $ins_stmt="insert into vicidial_custom_leadloader_templates(template_id, template_name, template_description, list_id, standard_variables, custom_table, custom_variables) values('$template_id', '$template_name', '$template_description', '$template_list_id', '$standard_fields_layout', '$custom_table', '$custom_fields_layout')"; + $ins_rslt=mysql_query($ins_stmt, $link); + if (mysql_affected_rows()>0) { + $success_msg="NEW TEMPLATE CREATED SUCCESSFULLY"; + if (!$custom_fields_layout) { + $success_msg.="
    **NO CUSTOM FIELDS ASSIGNED**"; + } + } else { + $error_msg="TEMPLATE CREATION FAILED"; + } +} else if ($delete_template=="Elimina modello" && $template_id) { + $delete_stmt="delete from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $delete_rslt=mysql_query($delete_stmt, $link); +} + +$US='_'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + # Header("HTTP/1.0 401 Unauthorized"); + # echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + echo "
    **$LOGallowed_campaigns**"; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + echo "
    ##$rawLOGallowed_campaignsSQL##"; + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   \"AIUTO\""; + +?> + + + + += 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; +?> + + + +
    + + +
    Listloader Maker modello personalizzato
    + +"; + echo ""; + echo ""; +} +if ($success_msg) { + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + +
    $error_msg
    $success_msg
    Creare un nuovo modelloEliminare un modello esistente
    +
    + Esempio di modello di file di montaggio:
    ()


    +
    +
    Selezionare il modello da eliminare:


    +
            TORNA AD AMMINISTRAZIONE         Go to Lead Loader    
    + +
    + + + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php index 4ca1776e..77e14f6d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1302 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -42,11 +44,15 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Single Agent Daily'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; echo "Single Agent Daily\n"; @@ -242,8 +273,9 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="
    \n";
    +	$GRAPH_text.="
    \n";
     	}
     
     if (strlen($group[0]) < 1)
    @@ -282,10 +314,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Giorni di stato Report: $user                     $NOW_TIME\n";
    -
    -		echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENT Dettagliatas -------------\n\n";
    +		$ASCII_text.="Agent Giorni di stato Report: $user                     $NOW_TIME\n";
    +		$ASCII_text.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    +		$ASCII_text.="---------- AGENT Dettagliatas -------------\n\n";
    +		$GRAPH_text.="Agent Giorni di stato Report: $user                     $NOW_TIME\n";
    +		$GRAPH_text.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    +		$GRAPH_text.="---------- AGENT Dettagliatas -------------\n";
     		}
     	else
     		{
    @@ -305,7 +339,7 @@ else
     	$date_namesARY[0]='';
     	$k=0;
     
    -	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
    +	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date,status order by date,status desc limit 500000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$rows_to_print = mysql_num_rows($rslt);
    @@ -341,10 +375,17 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "LEAD STATS BREAKDOWN:\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    -		echo "| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    -		echo "+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="LEAD STATS BREAKDOWN:\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		$ASCII_text.="| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
    +		$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
    +		for ($i=0; $i$SstatusTXT";
    +		}
    +
     		}
     	else
     		{
    @@ -355,6 +396,18 @@ else
     	$m=0;
     	$CIScountTOT=0;
     	$DNCcountTOT=0;
    +
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_cicalls=1;
    +	$max_dncci=1;
    +	$GRAPH="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Sdate=$datesARY[$m]; @@ -370,6 +423,10 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; + $graph_stats[$m][(4+$n)]=0; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -388,6 +445,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -427,9 +488,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Sdate"); } else { @@ -467,7 +536,7 @@ else if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) { if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} } @@ -496,7 +565,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -515,6 +584,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -530,12 +600,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -557,11 +629,71 @@ else if ($file_download < 1) { - echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALI | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALI | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n"; + + $ASCII_text.="\n\n"; + + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e"; + } + } + + $CALLS_graph.="
    LEAD STATS BREAKDOWN
    ESITOCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="
    TOTAL:".trim($CIScountTOT)."
    "; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + $GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3; - echo "\n\n
    "; } else { @@ -592,8 +724,19 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; - +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH_text; + } +else + { + echo $ASCII_text; + } echo "
    \n"; echo "
    Date:
    "; @@ -642,6 +785,11 @@ while ($campaigns_to_print > $o) $o++; } echo "\n"; +echo "
    "; +echo "Visualizzare as:   
    "; +echo "\n

    "; echo "
    Utente:
    "; echo "\n"; echo "
    Shift:
    "; @@ -669,35 +817,38 @@ echo "
    "; echo "
    \n\n
    $db_source"; echo "
    \n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if ($report_display_type=="TEXT" || !$report_display_type) 
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php
    index 167f67a9..81fe33a8 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     #
    @@ -26,6 +26,10 @@
     # 100712-1324 - Added system setting slave server option
     # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
     # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 110703-1739 - Added file download option
    +# 111007-0709 - Changed user and fullname to use non-truncated for output file
    +# 111104-1249 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -52,20 +56,24 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
     	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
     if (isset($_GET["INVIA"]))					{$INVIA=$_GET["INVIA"];}
     	elseif (isset($_POST["INVIA"]))		{$INVIA=$_POST["INVIA"];}
    +if (isset($_GET["file_download"]))				{$file_download=$_GET["file_download"];}
    +	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    -$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
    -
     $report_name = 'Agent Performance Dettagliata';
     $db_source = 'M';
    +$JS_text="\n";
    -echo "\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
     
    -echo "\n";
    -echo "$report_name\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +$HTML_head.="\n";
    +
    +$HTML_head.="\n";
    +$HTML_head.="$report_name\n";
     
     	$short_header=1;
     
    -	require("admin_header.php");
    +#	require("admin_header.php");
     
    -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo "
    Date:
    "; -echo "\n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.="
    Date:
    "; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$HTML_text.="\n"; -echo "
    to
    "; +$HTML_text.="
    to
    "; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'end_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$HTML_text.="\n"; -echo "
    Campagnas:
    "; -echo "
    Campagnas:
    "; +$HTML_text.="\n"; -echo "
    Gruppi Utenti:
    "; -echo "\n"; +$HTML_text.="
    Gruppi Utenti:
    "; +$HTML_text.="\n"; -echo "
    Shift:
    "; -echo "

    \n"; -echo "\n"; -echo "
            "; +$HTML_text.="\n"; +$HTML_text.="Shift:
    "; +$HTML_text.="

    \n"; +$HTML_text.="Visualizzare as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; -echo "          \n"; -echo " REPORT \n"; -echo "\n"; -echo "
    "; +$HTML_text.="          \n"; +$HTML_text.=" REPORT \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; -echo "
    \n\n"; +$HTML_text.="\n\n"; -echo "
    \n";
    +$HTML_text.="
    \n";
     
     
     if (!$group)
     {
    -echo "\n";
    -echo "PER FAVORE SELEZIONA UNA CAMPAGNA E UNA DATA E PREMI INVIA\n";
    -echo " NOTE: stats taken from shift specified\n";
    +$HTML_text.="\n";
    +$HTML_text.="PER FAVORE SELEZIONA UNA CAMPAGNA E UNA DATA E PREMI INVIA\n";
    +$HTML_text.=" NOTE: stats taken from shift specified\n";
     }
     
     else
    @@ -371,10 +403,10 @@ $query_date_END = "$end_date $time_END";
     if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
     else {$ugSQL='';}
     
    -echo "Agent Performance Dettagliata                        $NOW_TIME\n";
    +$HTML_text.="Agent Performance Dettagliata                        $NOW_TIME\n";
     
    -echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    -echo "---------- AGENTS Dettagliatas -------------\n\n";
    +$HTML_text.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    +$HTML_text.="---------- AGENTS Dettagliatas -------------\n\n";
     
     
     
    @@ -383,6 +415,12 @@ echo "---------- AGENTS Dettagliatas -------------\n\n";
     $statuses='-';
     $statusesTXT='';
     $statusesHEAD='';
    +
    +$CSV_header="\"Agent Performance Dettagliata                        $NOW_TIME\"\n";
    +$CSV_header.="\"Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\"\n\n";
    +$CSV_header.="\"---------- AGENTS Dettagliatas -------------\"\n";
    +$CSV_header.='"USER NAME","ID","CALLS","TIME","PAUSE","PAUSAVG","WAIT","WAITAVG","TALK","TALKAVG","DISPO","DISPAVG","DEAD","DEADAVG","CUSTOMER","CUSTAVG"';
    +
     $statusesHTML='';
     $statusesARY[0]='';
     $j=0;
    @@ -391,10 +429,44 @@ $usersARY[0]='';
     $user_namesARY[0]='';
     $k=0;
     
    -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
    +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $rows_to_print = mysql_num_rows($rslt);
    +
    +$graph_stats=array();
    +$max_calls=1;
    +$max_time=1;
    +$max_pause=1;
    +$max_pauseavg=1;
    +$max_wait=1;
    +$max_waitavg=1;
    +$max_talk=1;
    +$max_talkavg=1;
    +$max_dispo=1;
    +$max_dispoavg=1;
    +$max_dead=1;
    +$max_deadavg=1;
    +$max_customer=1;
    +$max_customeravg=1;
    +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    CALLSTIMEPAUSEPAUSE AVGWAITWAIT AVGTALKTALK AVGDISPODISPO AVGDEADDEAD AVGCUSTCUST AVG
    "; +$CALLS_graph=$graph_header.""; +$TIME_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; +$PAUSEAVG_graph=$graph_header.""; +$WAIT_graph=$graph_header.""; +$WAITAVG_graph=$graph_header.""; +$TALK_graph=$graph_header.""; +$TALKAVG_graph=$graph_header.""; +$DISPO_graph=$graph_header.""; +$DISPOAVG_graph=$graph_header.""; +$DEAD_graph=$graph_header.""; +$DEADAVG_graph=$graph_header.""; +$CUST_graph=$graph_header.""; +$CUSTAVG_graph=$graph_header.""; + $i=0; while ($i < $rows_to_print) { @@ -411,6 +483,10 @@ while ($i < $rows_to_print) $status[$i] = $row[7]; $dead_sec[$i] = $row[8]; $customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]); + + $max_varname="max_".$status[$i]; + $$max_varname=1; + if ($customer_sec[$i] < 1) {$customer_sec[$i]=0;} if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) @@ -418,6 +494,9 @@ while ($i < $rows_to_print) $statusesTXT = sprintf("%8s", $status[$i]); $statusesHEAD .= "----------+"; $statusesHTML .= " $statusesTXT |"; + + $CSV_header.=",\"$status[$i]\""; + $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; $j++; @@ -433,10 +512,13 @@ while ($i < $rows_to_print) $i++; } -echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$CSV_header.="\n"; +$CSV_lines=''; + +$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) [DOWNLOAD]\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; ### BEGIN loop through each user ### @@ -454,6 +536,7 @@ while ($m < $k) $Sdead_sec=0; $Scustomer_sec=0; $SstatusesHTML=''; + $CSVstatuses=''; ### BEGIN loop through each status ### $n=0; @@ -461,6 +544,10 @@ while ($m < $k) { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -476,6 +563,12 @@ while ($m < $k) $Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]); $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(15+$n)]=($calls[$i]+0); + + $CSVstatuses.=",\"$calls[$i]\""; + $status_found++; } $i++; @@ -483,6 +576,8 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSVstatuses.=",\"0\""; + $graph_stats[$m][(15+$n)]=0; } ### END loop through each stat line ### $n++; @@ -514,6 +609,8 @@ while ($m < $k) $RAWuser = $Suser; $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; if ($non_latin < 1) { @@ -530,6 +627,36 @@ while ($m < $k) while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($Stime)>$max_time) {$max_time=trim($Stime);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);} + if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);} + if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);} + if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);} + if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);} + if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);} + if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);} + if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);} + if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);} + if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);} + if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);} + $graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser); + $graph_stats[$m][1]=trim($Scalls); + $graph_stats[$m][2]=trim($Stime); + $graph_stats[$m][3]=trim($Spause_sec); + $graph_stats[$m][4]=trim($Spause_avg); + $graph_stats[$m][5]=trim($Swait_sec); + $graph_stats[$m][6]=trim($Swait_avg); + $graph_stats[$m][7]=trim($Stalk_sec); + $graph_stats[$m][8]=trim($Stalk_avg); + $graph_stats[$m][9]=trim($Sdispo_sec); + $graph_stats[$m][10]=trim($Sdispo_avg); + $graph_stats[$m][11]=trim($Sdead_sec); + $graph_stats[$m][12]=trim($Sdead_avg); + $graph_stats[$m][13]=trim($Scustomer_sec); + $graph_stats[$m][14]=trim($Scustomer_avg); + $pfUSERtime_MS = sec_convert($Stime,'H'); $pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H'); $pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M'); @@ -561,6 +688,10 @@ while ($m < $k) $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n"; + + $CSV_lines.="\"$Sfull_nameRAW\","; + $CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); + $TOPsorted_output[$m] = $Toutput; if ($stage == 'ID') @@ -570,7 +701,7 @@ while ($m < $k) if ($stage == 'TIME') {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} if (!ereg("ID|TIME|LEADS",$stage)) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} $m++; } @@ -592,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage)) $sort_split = explode("-----",$TOPsort[$m]); $i = $sort_split[1]; $sort_order[$m] = "$i"; - echo "$TOPsorted_output[$i]"; + $ASCII_text.="$TOPsorted_output[$i]"; $m++; } } @@ -603,12 +734,14 @@ if (ereg("ID|TIME|LEADS",$stage)) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $n=0; while ($n < $j) { $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -624,11 +757,14 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$Scalls\""; + $$total_var=$Scalls; } $n++; } @@ -693,17 +829,137 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1 while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);} -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; -echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; - -echo "\n\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +$ASCII_text.="| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n"; +$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; +for ($e=0; $e$SstatusTXT"; +} + +for ($d=0; $d"; + $TIME_graph.=" "; + $PAUSE_graph.=" "; + $PAUSEAVG_graph.=" "; + $WAIT_graph.=" "; + $WAITAVG_graph.=" "; + $TALK_graph.=" "; + $TALKAVG_graph.=" "; + $DISPO_graph.=" "; + $DISPOAVG_graph.=" "; + $DEAD_graph.=" "; + $DEADAVG_graph.=" "; + $CUST_graph.=" "; + $CUSTAVG_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } +} + +$CALLS_graph.="
    CALL STATS BREAKDOWN: (Statistics related to handling of calls only)
    UTENTECALLS
    TIME
    PAUSE
    PAUSE AVG
    WAIT
    WAIT AVG
    TALK
    TALK AVG
    DISPO
    DISPO AVG
    DEAD
    DEAD AVG
    CUST
    CUST AVG
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][10], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][11], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][12], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][13], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][14], 'HF')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+15)]."
    TOTAL:".trim($TOTcalls)."
    "; +$TIME_graph.="
    TOTAL:".trim($TOTtime_MS)."
    "; +$PAUSE_graph.="
    TOTAL:".trim($TOTtotPAUSE_MS)."
    "; +$PAUSEAVG_graph.="TOTAL:".trim($TOTavgPAUSE_MS).""; +$WAIT_graph.="TOTAL:".trim($TOTtotWAIT_MS).""; +$WAITAVG_graph.="TOTAL:".trim($TOTavgWAIT_MS).""; +$TALK_graph.="TOTAL:".trim($TOTtotTALK_MS).""; +$TALKAVG_graph.="TOTAL:".trim($TOTavgTALK_MS).""; +$DISPO_graph.="TOTAL:".trim($TOTtotDISPO_MS).""; +$DISPOAVG_graph.="TOTAL:".trim($TOTavgDISPO_MS).""; +$DEAD_graph.="TOTAL:".trim($TOTtotDEAD_MS).""; +$DEADAVG_graph.="TOTAL:".trim($TOTavgDEAD_MS).""; +$CUST_graph.="TOTAL:".trim($TOTtotCUSTOMER_MS).""; +$CUSTAVG_graph.="TOTAL:".trim($TOTavgCUSTOMER_MS).""; + +for ($e=0; $e"; +} + +$JS_onload.="\tDrawGraph('CALLS', '1');\n"; +$JS_text.="function DrawGraph(graph, th_id) {\n"; +$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; +$JS_text.=" var TIME_graph=\"$TIME_graph\";\n"; +$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; +$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n"; +$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; +$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n"; +$JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; +$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n"; +$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; +$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n"; +$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; +$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n"; +$JS_text.=" var CUST_graph=\"$CUST_graph\";\n"; +$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n"; + +for ($e=0; $e
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; +$CSV_total=eregi_replace(" ", "", "\"TOTALI\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); + +if ($file_download == 1) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } + +$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); +$ASCII_text.="\n\n"; @@ -717,15 +973,28 @@ $sub_statuses='-'; $sub_statusesTXT=''; $sub_statusesHEAD=''; $sub_statusesHTML=''; +$CSV_statuses=''; $sub_statusesARY=$MT; $j=0; $PCusers='-'; $PCusersARY=$MT; $PCuser_namesARY=$MT; $k=0; -$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; + +$graph_stats=array(); +$max_total=1; +$max_nonpause=1; +$max_pause=1; +$GRAPH="

    "; +$GRAPH2=""; +$graph_header="
    TOTALENONPAUSEPAUSE
    "; +$TOTAL_graph=$graph_header.""; +$NONPAUSE_graph=$graph_header.""; +$PAUSE_graph=$graph_header.""; + +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $subs_to_print = mysql_num_rows($rslt); $i=0; while ($i < $subs_to_print) @@ -736,8 +1005,10 @@ while ($i < $subs_to_print) $PCpause_sec[$i] = $row[2]; $sub_status[$i] = $row[3]; $PCnon_pause_sec[$i] = $row[4]; + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; -# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; + # echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) if (!eregi("-$sub_status[$i]-", $sub_statuses)) { @@ -746,6 +1017,7 @@ while ($i < $subs_to_print) $sub_statusesHTML .= " $sub_statusesTXT |"; $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$j] = $sub_status[$i]; + $CSV_statuses.=",\"$sub_status[$i]\""; $j++; } if (!eregi("-$PCuser[$i]-", $PCusers)) @@ -759,17 +1031,22 @@ while ($i < $subs_to_print) $i++; } -echo "PAUSE CODE BREAKDOWN:\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="PAUSE CODE BREAKDOWN: [DOWNLOAD]\n\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$CSV_header="\"Agent Performance Dettagliata $NOW_TIME\"\n"; +$CSV_header.="\"Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\"\n\n"; +$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n"; +$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n"; ### BEGIN loop through each user ### $m=0; $Suser_ct = count($usersARY); $TOTtotNONPAUSE = 0; $TOTtotTOTAL = 0; +$CSV_lines=""; while ($m < $k) { @@ -786,6 +1063,7 @@ while ($m < $k) $Snon_pause_sec=0; $Stotal_sec=0; $SstatusesHTML=''; + $CSV_statuses=""; ### BEGIN loop through each status ### $n=0; @@ -793,6 +1071,9 @@ while ($m < $k) { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -808,6 +1089,11 @@ while ($m < $k) $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats[$m][(4+$n)]=$PCpause_sec[$i]; + + $CSV_statuses.=",\"$USERcodePAUSE_MS\""; $status_found++; } $i++; @@ -815,12 +1101,17 @@ while ($m < $k) if ($status_found < 1) { $SstatusesHTML .= " 0 |"; + $CSV_statuses.=",\"0\""; + $graph_stats[$m][(4+$n)]=0; } ### END loop through each stat line ### $n++; } ### END loop through each status ### $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $Sfull_nameRAW = $Sfull_name; + $SuserRAW = $Suser; + $graph_stats[$m][0]="$Sfull_name - $SuserRAW"; if ($non_latin < 1) { @@ -840,6 +1131,13 @@ while ($m < $k) $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);} + if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);} + if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);} + $graph_stats[$m][1]="$Stotal_sec"; + $graph_stats[$m][2]="$Snon_pause_sec"; + $graph_stats[$m][3]="$Spause_sec"; + $USERtotPAUSE_MS = sec_convert($Spause_sec,'H'); $USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H'); $USERtotTOTAL_MS = sec_convert($Stotal_sec,'H'); @@ -852,8 +1150,8 @@ while ($m < $k) $BOTTOMsorted_output[$m] = $BOTTOMoutput; - echo "$BOTTOMoutput"; - + $ASCII_text.="$BOTTOMoutput"; + $CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $m++; } ### END loop through each user ### @@ -878,6 +1176,7 @@ while ($m < $k) ###### LAST LINE FORMATTING ########## ### BEGIN loop through each status ### $SUMstatusesHTML=''; +$CSVSUMstatuses=''; $TOTtotPAUSE=0; $n=0; while ($n < $j) @@ -885,6 +1184,7 @@ while ($n < $j) $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -900,16 +1200,19 @@ while ($n < $j) if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var=0; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + $$total_var=$Scalls; $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); $pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS); $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= " $SUMstatusTXT |"; + $CSVSUMstatuses.=",\"$USERsumstatPAUSE_MS\""; } $n++; } @@ -930,17 +1233,122 @@ while ($n < $j) while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} -echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "| TOTALI AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; -echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n"; +$ASCII_text.="| TOTALI AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n
    $db_source"; +for ($e=0; $e$SstatusTXT"; +} +for ($d=0; $d"; + $NONPAUSE_graph.=" "; + $PAUSE_graph.=" "; + + for ($e=0; $e"; + } +} + +$TOTAL_graph.="
    PAUSE CODE BREAKDOWN
    ESITOTOTALE
    NONPAUSE
    PAUSE
    $Sstatus
    ".sec_convert($graph_stats[$d][1], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'H')."
    ".sec_convert($graph_stats[$d][($e+4)], 'H')."
    TOTAL:".trim($TOTtotTOTAL_MS)."
    "; +$NONPAUSE_graph.="TOTAL:".trim($TOTtotNONPAUSE_MS).""; +$PAUSE_graph.="TOTAL:".trim($TOTtotPAUSE_MS)."%"; +for ($e=0; $e"; +} +$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n"; +$JS_text="\n"; +$GRAPH3="
     


    "; + +$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; + + + +$CSV_total=eregi_replace(" ", "", "\"TOTALI\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); + +if ($file_download == 2) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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_header$CSV_lines$CSV_total"; + + exit; + } +$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); +fwrite($CSV_report, $CSV_header); +fwrite($CSV_report, $CSV_lines); +fwrite($CSV_report, $CSV_total); + +if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +$HTML_text.="\n\n
    $db_source"; +$HTML_text.=""; + +$HTML_text.=""; + + +} +if ($file_download == 0 || !$file_download) { + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; } ?> - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php index 91730bf8..1d1bd0b6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1248 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -43,11 +45,15 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Agent Status Dettagliata'; $db_source = 'M'; +$JS_text="\n"; echo "\n"; + echo "\n"; echo "\n"; echo "$report_name\n"; @@ -290,13 +318,14 @@ if ($file_download < 1) require("admin_header.php"); echo "\n"; - echo "\n"; - echo "
    \n";
    +	$ASCII_text.="\n";
    +	$ASCII_text.="\n\n\n
    \n";
    +	$GRAPH.="
    \n";
     	}
     
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
    -	echo "\n";
    +	echo "
    \n\n\n";
     	echo "Seleziona una campagna o utente GRUPPO E DATA A TEMPO E CLICCA SOPRA INVIA\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
    @@ -330,10 +359,12 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Status Dettagliata Report                     $NOW_TIME\n";
    -
    -		echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
    -		echo "---------- AGENT Dettagliatas -------------\n\n";
    +		$ASCII_text.="

    Agent Status Dettagliata Report $NOW_TIME\n"; + $ASCII_text.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; + $ASCII_text.="---------- AGENT Dettagliatas -------------\n\n"; + $GRAPH.="

    Agent Status Dettagliata Report $NOW_TIME\n"; + $GRAPH.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; + $GRAPH.="---------- AGENT Dettagliatas -------------"; } else { @@ -357,7 +388,7 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; $sub_status_count=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); @@ -376,6 +407,12 @@ else $statusesFILE .= "$statusesTXT,"; $statuses .= "$status[$i]-"; $statusesARY[$j] = $status[$i]; + + $sub_statusesARY[$sub_status_count] = $status[$i]; + $sub_status_count++; + $max_varname="max_".$status[$i]; + $$max_varname=1; + $j++; } if (!eregi("-$user[$i]-", $users)) @@ -391,10 +428,18 @@ else if ($file_download < 1) { - echo "CALLS STATS BREAKDOWN:\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="CALLS STATS BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + + for ($i=0; $i$SstatusTXT"; + } + } else { @@ -406,6 +451,18 @@ else $m=0; $CIScountTOT=0; $DNCcountTOT=0; + + $graph_stats=array(); + $max_calls=1; + $max_cicalls=1; + $max_dncci=1; + $GRAPH.="

    "; + $GRAPH2=""; + $graph_header="
    CALLSCI/CALLSDNC/CI
    "; + $CALLS_graph=$graph_header.""; + $CICALLS_graph=$graph_header.""; + $DNCCI_graph=$graph_header.""; + while ($m < $k) { $Suser=$usersARY[$m]; @@ -422,6 +479,9 @@ else { $Sstatus=$statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -439,6 +499,10 @@ else $DNCcount = ($DNCcount + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]); } + + if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];} + $graph_stats[$m][(4+$n)]=$calls[$i]; + $SstatusTXT = sprintf("%8s", $calls[$i]); $SstatusesHTML .= " $SstatusTXT |"; $SstatusesFILE .= "$SstatusTXT,"; @@ -448,6 +512,7 @@ else } if ($status_found < 1) { + $graph_stats[$m][(4+$n)]=0; $SstatusesHTML .= " 0 |"; $SstatusesFILE .= "0,"; } @@ -492,9 +557,17 @@ else # $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs); $DNCcountPCTs = sprintf("%6s", $DNCcountPCTs); + if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);} + if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);} + if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);} + $graph_stats[$m][1]=trim("$Scalls"); + $graph_stats[$m][2]=trim("$CIScount"); + $graph_stats[$m][3]=trim("$DNCcountPCTs"); + if ($file_download < 1) { $Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]"); } else { @@ -531,7 +604,7 @@ else } if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -559,7 +632,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -578,6 +651,7 @@ else $Scalls=0; $Sstatus=$statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $rows_to_print) @@ -593,12 +667,14 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $SUMstatusTXT = sprintf("%8s", $Scalls); $SUMstatusesHTML .= " $SUMstatusTXT |"; $SUMstatusesFILE .= "$SUMstatusTXT,"; + $$total_var=$Scalls; } $n++; } @@ -622,11 +698,70 @@ else if ($file_download < 1) { - echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; - echo "+----------------------------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; + $ASCII_text.="| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n"; + $ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n"; - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $CICALLS_graph.=" "; + $DNCCI_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    CALL STATS BREAKDOWN
    ESITOCALLS
    CI CALLS
    DNC/CI%
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+4)]."
    TOTAL:".trim($TOTcalls)."
    "; + $CICALLS_graph.="TOTAL:".trim($CIScountTOT).""; + $DNCCI_graph.="TOTAL:".trim($DNCcountPCT)."%"; + for ($e=0; $e"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n"; + $JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { @@ -655,6 +790,20 @@ if ($file_download > 0) exit; } +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $GRAPH.$GRAPH2.$GRAPH3; + echo $JS_text; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; echo "
    Date:
    "; @@ -726,6 +875,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "

    \n"; +echo "Visualizzare as:
    "; +echo "\n

    "; echo "\n"; echo "
            "; @@ -738,35 +891,38 @@ echo "
    "; echo "
    \n\n
    $db_source"; echo "\n"; -echo "\n"; -echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -$m=0;
    -while ($m < $k)
    +if (!$report_display_type || $report_display_type=="TEXT")
     	{
    -	$sort_split = explode("-----",$TOPsort[$m]);
    -	$i = $sort_split[1];
    -	$sort_order[$m] = "$i";
    +	echo "\n";
    +	echo "
    \n\n\n\n\n\n\n\n\n\n";
     
    -	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    -		{echo "                              \n";}
    -	else
    +	$m=0;
    +	while ($m < $k)
     		{
    -		echo "                              ";
    -		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    -		$h=0;
    -		while ($h <= $TOPsortPLOT)
    +		$sort_split = explode("-----",$TOPsort[$m]);
    +		$i = $sort_split[1];
    +		$sort_order[$m] = "$i";
    +
    +		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
    +			{echo "                              \n";}
    +		else
     			{
    -			echo " ";
    -			$h++;
    +			echo "                              ";
    +			$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
    +			$h=0;
    +			while ($h <= $TOPsortPLOT)
    +				{
    +				echo " ";
    +				$h++;
    +				}
    +			echo "\n";
     			}
    -		echo "\n";
    +		$m++;
     		}
    -	$m++;
    +
    +	echo "\n";
     	}
    -
    -echo "\n";
    -
     ?>
     
     
    \ No newline at end of file
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php
    index 9bca0328..dcf06d04 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php
    @@ -4,7 +4,7 @@
     # Pulls time stats per agent selectable by campaign or user group
     # should be most accurate agent stats of all of the reports
     #
    -# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
    +# Copyright (C) 2012  Matt Florell     LICENSE: AGPLv2
     #
     # CHANGES
     # 90522-0723 - First build
    @@ -15,6 +15,14 @@
     # 100712-1324 - Added system setting slave server option
     # 100802-2347 - Added User Group Allowed Reports option validation
     # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
    +# 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log
    +# 101207-1719 - Fixed download file formatting bugs(issue 394)
    +# 101208-0320 - Fixed issue 404
    +# 110307-1057 - Added user_case setting in options.php
    +# 110623-0728 - Fixed user group selection bug
    +# 110708-1727 - Added options.php setting for time precision
    +# 111104-1248 - Added user_group restrictions for selecting in-groups
    +# 120224-0910 - Added HTML display option with bar graphs
     #
     
     require("dbconnect.php");
    @@ -41,14 +49,33 @@ if (isset($_GET["DB"]))						{$DB=$_GET["DB"];}
     	elseif (isset($_POST["DB"]))			{$DB=$_POST["DB"];}
     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["INVIA"]))					{$INVIA=$_GET["INVIA"];}
    +	elseif (isset($_POST["INVIA"]))		{$INVIA=$_POST["INVIA"];}
    +if (isset($_GET["report_display_type"]))				{$report_display_type=$_GET["report_display_type"];}
    +	elseif (isset($_POST["report_display_type"]))	{$report_display_type=$_POST["report_display_type"];}
     
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($stage)<2) {$stage='NAME';}
     
    -$report_name = 'Agent Time Detail';
    +$report_name = 'Agente Time Dettagliata';
     $db_source = 'M';
    +$JS_text="\n";
     	echo "\n";
    +	echo "\n";
     
     	echo "\n";
     	echo "$report_name\n";
    @@ -271,7 +321,7 @@ if ($file_download < 1)
     if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
     	{
     	echo "\n";
    -	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
    +	echo "Seleziona una campagna o utente GRUPPO E DATA A TEMPO E CLICCA SOPRA INVIA\n";
     	echo " NOTE: stats taken from shift specified\n";
     	}
     
    @@ -309,14 +359,14 @@ else
     
     	if ($file_download < 1)
     		{
    -		echo "Agent Time Detail                     $NOW_TIME\n";
    +		echo "Agente Time Dettagliata                     $NOW_TIME\n";
     
    -		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
     		}
     	else
     		{
    -		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
    -		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
    +		$file_output .= "Agente Time Dettagliata                     $NOW_TIME\n";
    +		$file_output .= "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
     		}
     
     
    @@ -326,11 +376,34 @@ else
     	############################################################################
     
     	### BEGIN gather user IDs and names for matching up later
    -	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
    +	$stmt="select full_name,$userSQL from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;";
     	$rslt=mysql_query($stmt, $link);
     	if ($DB) {echo "$stmt\n";}
     	$users_to_print = mysql_num_rows($rslt);
     	$i=0;
    +	$graph_stats=array();
    +	$max_calls=1;
    +	$max_timeclock=1;
    +	$max_agenttime=1;
    +	$max_wait=1;
    +	$max_talk=1;
    +	$max_dispo=1;
    +	$max_pause=1;
    +	$max_dead=1;
    +	$max_customer=1;
    +	$GRAPH="";
    +	$GRAPH2="";
    +	$graph_header="
    CALLSTIME CLOCKAGENT TIMEWAITTALKDISPOPAUSEDEADCUSTOMER
    "; + $CALLS_graph=$graph_header.""; + $TIMECLOCK_graph=$graph_header.""; + $AGENTTIME_graph=$graph_header.""; + $WAIT_graph=$graph_header.""; + $TALK_graph=$graph_header.""; + $DISPO_graph=$graph_header.""; + $PAUSE_graph=$graph_header.""; + $DEAD_graph=$graph_header.""; + $CUSTOMER_graph=$graph_header.""; + while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); @@ -342,7 +415,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -369,11 +442,11 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); - $i=0; + $i=0; while ($i < $subs_to_print) { $row=mysql_fetch_row($rslt); @@ -390,6 +463,9 @@ else $sub_statuses .= "$sub_status[$i]-"; $sub_statusesARY[$sub_status_count] = $sub_status[$i]; $sub_status_count++; + + $max_varname="max_".$sub_status[$i]; + $$max_varname=1; } if (!eregi("-$PCuser[$i]-", $PCusers)) { @@ -404,7 +480,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -423,11 +499,11 @@ else $lead = $row[5]; $status = $row[6]; $dead = $row[7]; - if ($wait > 30000) {$wait=0;} - if ($talk > 30000) {$talk=0;} - if ($dispo > 30000) {$dispo=0;} - if ($pause > 30000) {$pause=0;} - if ($dead > 30000) {$dead=0;} + if ($wait > 65000) {$wait=0;} + if ($talk > 65000) {$talk=0;} + if ($dispo > 65000) {$dispo=0;} + if ($pause > 65000) {$pause=0;} + if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); if ($customer < 1) {$customer=0;} @@ -492,10 +568,12 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME BREAKDOWN:\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="AGENT TIME BREAKDOWN:\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + + } else { @@ -523,13 +601,30 @@ else $RAWcalls = $Scalls[$m]; $RAWtimeSEC = $Stime[$m]; - $Swait[$m]= sec_convert($Swait[$m],'H'); - $Stalk[$m]= sec_convert($Stalk[$m],'H'); - $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); - $Spause[$m]= sec_convert($Spause[$m],'H'); - $Sdead[$m]= sec_convert($Sdead[$m],'H'); - $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); - $Stime[$m]= sec_convert($Stime[$m],'H'); + if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);} + if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);} + if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);} + if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);} + if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);} + if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} + if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} + if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + $graph_stats[$m][1]=trim($Scalls[$m]); + $graph_stats[$m][3]=trim($Stime[$m]); + $graph_stats[$m][4]=trim($Swait[$m]); + $graph_stats[$m][5]=trim($Stalk[$m]); + $graph_stats[$m][6]=trim($Sdispo[$m]); + $graph_stats[$m][7]=trim($Spause[$m]); + $graph_stats[$m][8]=trim($Sdead[$m]); + $graph_stats[$m][9]=trim($Scustomer[$m]); + + $Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail); + $Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail); + $Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail); + $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); + $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); + $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; $RAWwait = $Swait[$m]; @@ -566,7 +661,11 @@ else $punches_found++; $RAWtimeTCsec = $TCtime[$n]; $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); - $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + + if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);} + $graph_stats[$m][2]=trim($RAWtimeTCsec); + + $StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail); $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -575,7 +674,12 @@ else if ($punches_found < 1) { $RAWtimeTCsec = "0"; - $StimeTC[$m]= "0:00"; + + $graph_stats[$m][2]=0; + + $StimeTC[$m] = "0:00"; + if ($TIME_agenttimedetail == 'HF') + {$StimeTC[$m] = "0:00:00";} $RAWtimeTC = $StimeTC[$m]; $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } @@ -602,25 +706,41 @@ else { $Sstatus=$sub_statusesARY[$n]; $SstatusTXT=''; + $varname=$Sstatus."_graph"; + $$varname=$graph_header.""; + $max_varname="max_".$Sstatus; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ( ($i < $subs_to_print) and ($status_found < 1) ) { if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) { - $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail); + if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';} $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];} + $graph_stats_sub[$m][$n]=$PCpause_sec[$i]; $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); $SstatusesHTML .= " $SstatusTXT |"; - $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $SstatusesFILE .= ",$USERcodePAUSE_MS"; $status_found++; } $i++; } if ($status_found < 1) { - $SstatusesHTML .= " 0:00 |"; + if ($TIME_agenttimedetail == 'HF') + { + $SstatusesHTML .= " 0:00:00 |"; + $SstatusesFILE .= ",0:00:00"; + } + else + { + $SstatusesHTML .= " 0:00 |"; + $SstatusesFILE .= ",0:00"; + } } ### END loop through each stat line ### $n++; @@ -655,9 +775,18 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); +#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED } else { + if (strlen($RAWtime)<1) {$RAWtime='0';} + if (strlen($RAWwait)<1) {$RAWwait='0';} + if (strlen($RAWtalk)<1) {$RAWtalk='0';} + if (strlen($RAWdispo)<1) {$RAWdispo='0';} + if (strlen($RAWpause)<1) {$RAWpause='0';} + if (strlen($RAWdead)<1) {$RAWdead='0';} + if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; } @@ -691,7 +820,7 @@ else } if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if ($file_download < 1) - {echo "$Toutput";} + {$ASCII_text.="$Toutput";} else {$file_output .= "$fileToutput";} @@ -703,14 +832,15 @@ else ##### END loop through each user formatting data for output - $TOT_AGENTS = sprintf("%4s", $m); + $TOT_AGENTS = $m; + $hTOT_AGENTS = sprintf("%4s", $TOT_AGENTS); $k=$m; if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
    \n";} ### BEGIN sort through output to display properly ### - if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) { if (ereg("ID",$stage)) {sort($TOPsort, SORT_NUMERIC);} @@ -726,7 +856,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -753,6 +883,7 @@ else $Scalls=0; $Sstatus=$sub_statusesARY[$n]; $SUMstatusTXT=''; + $total_var=$Sstatus."_total"; ### BEGIN loop through each stat line ### $i=0; $status_found=0; while ($i < $subs_to_print) @@ -768,57 +899,136 @@ else if ($status_found < 1) { $SUMstatusesHTML .= " 0 |"; + $$total_var="0"; } else { $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); - $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail); $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + $$total_var="$pfUSERsumstatPAUSE_MS"; $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); $SUMstatusesHTML .= "$SUMstatusTXT |"; - $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + $SUMstatusesFILE .= ",$USERsumstatPAUSE_MS"; } $n++; } ### END loop through each status ### ### call function to calculate and print dialable leads - $TOTwait = sec_convert($TOTwait,'H'); - $TOTtalk = sec_convert($TOTtalk,'H'); - $TOTdispo = sec_convert($TOTdispo,'H'); - $TOTpause = sec_convert($TOTpause,'H'); - $TOTdead = sec_convert($TOTdead,'H'); - $TOTcustomer = sec_convert($TOTcustomer,'H'); - $TOTALtime = sec_convert($TOTALtime,'H'); - $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + $TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail); + $TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail); + $TOTdispo = sec_convert($TOTdispo,$TIME_agenttimedetail); + $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); + $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); + $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); + $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); - $TOTcalls = sprintf("%8s", $TOTcalls); - $TOTwait = sprintf("%11s", $TOTwait); - $TOTtalk = sprintf("%11s", $TOTtalk); - $TOTdispo = sprintf("%11s", $TOTdispo); - $TOTpause = sprintf("%11s", $TOTpause); - $TOTdead = sprintf("%11s", $TOTdead); - $TOTcustomer = sprintf("%11s", $TOTcustomer); - $TOTALtime = sprintf("%11s", $TOTALtime); - $TOTtimeTC = sprintf("%11s", $TOTtimeTC); - ###### END LAST LINE TOTALS FORMATTING ########## + $hTOTcalls = sprintf("%8s", $TOTcalls); + $hTOTwait = sprintf("%11s", $TOTwait); + $hTOTtalk = sprintf("%11s", $TOTtalk); + $hTOTdispo = sprintf("%11s", $TOTdispo); + $hTOTpause = sprintf("%11s", $TOTpause); + $hTOTdead = sprintf("%11s", $TOTdead); + $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTALtime = sprintf("%11s", $TOTALtime); + $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); + ###### END LAST LINE TOTALI FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; - echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| TOTALI AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n"; + $ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n"; + $ASCII_text.="\n\n"; + + for ($e=0; $e$SstatusTXT"; + } + + for ($d=0; $d"; + $TIMECLOCK_graph.=" "; + $AGENTTIME_graph.=" "; + $WAIT_graph.=" "; + $TALK_graph.=" "; + $DISPO_graph.=" "; + $PAUSE_graph.=" "; + $DEAD_graph.=" "; + $CUSTOMER_graph.=" "; + + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + $CALLS_graph.="
    AGENT TIME BREAKDOWN
    ESITOCALLS
    TIME CLOCK
    AGENT TIME
    WAIT
    TALK
    DISPO
    PAUSE
    DEAD
    CUSTOMER
    $Sstatus
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][2], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][3], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][4], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][7], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][8], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][9], 'HF')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats_sub[$d][$e], 'HF')."
    TOTAL:".trim($hTOTcalls)."
    "; + $TIMECLOCK_graph.="TOTAL:".trim($hTOTtimeTC).""; + $AGENTTIME_graph.="TOTAL:".trim($hTOTALtime).""; + $WAIT_graph.="TOTAL:".trim($hTOTwait).""; + $TALK_graph.="TOTAL:".trim($hTOTtalk).""; + $DISPO_graph.="TOTAL:".trim($hTOTdispo).""; + $PAUSE_graph.="TOTAL:".trim($hTOTpause).""; + $DEAD_graph.="TOTAL:".trim($hTOTdead).""; + $CUSTOMER_graph.="TOTAL:".trim($hTOTcustomer).""; + for ($e=0; $e"; +# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n"; + } + $JS_onload.="\tDrawGraph('CALLS', '1');\n"; + $JS_text.="function DrawGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n"; + $JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n"; + $JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n"; + $JS_text.=" var TALK_graph=\"$TALK_graph\";\n"; + $JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n"; + $JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n"; + $JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n"; + $JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n"; + + for ($e=0; $e
     


    "; + + # echo $GRAPH.$GRAPH2.$GRAPH3.$max; } else { - $file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead,$TOTcustomer$SUMstatusesFILE\n"; + $file_output .= "TOTALI,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead,$TOTcustomer$SUMstatusesFILE\n"; } } @@ -855,8 +1065,22 @@ if ($file_download > 0) ############################################################################ ##### BEGIN HTML form section ############################################################################ +$JS_onload.="}\n"; +$JS_text.=$JS_onload; +$JS_text.="\n"; + +if ($report_display_type=="HTML") + { + echo $JS_text; + echo $GRAPH.$GRAPH2.$GRAPH3.$max; + } +else + { + echo $ASCII_text; + } + echo "
    \n"; -echo "
    Dates:
    "; +echo "
    Date:
    "; echo "\n"; echo ""; @@ -869,7 +1093,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunedi week start
    Campaigns:
    "; +echo "
    Campagnas:
    "; echo "\n"; -echo "
    User Groups:
    "; +echo "
    Gruppi Utenti:
    "; echo "

    \n"; -echo "\n"; +echo "Visualizzare as:
    "; +echo "\n

    "; +echo "\n"; echo "
            "; echo "          \n"; echo " DOWNLOAD | \n"; -echo " REPORTS \n"; +echo " REPORT \n"; echo "\n"; echo "
    "; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php index 6c7d3984..112f0aea 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,8 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1848 - Added download option +# 111104-1308 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -26,7 +28,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -46,7 +48,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -62,6 +64,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $user=$agent; @@ -69,14 +73,14 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -90,47 +94,69 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -?> - - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -\n"; -echo "$report_name"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -151,26 +177,26 @@ $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; +$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n"; -echo "AgentTime Sheetfor: $user\n"; -echo "<BR>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; -echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; -echo "Utente ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; -echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; -echo "</FORM>\n\n"; +$MAIN.="AgentTime Sheetfor: $user\n"; +$MAIN.="<BR>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n"; +$MAIN.="Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n"; +$MAIN.="Utente ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n"; +$MAIN.="<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; +$MAIN.="</FORM>\n\n"; -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="<PRE><FONT SIZE=3>\n"; if (!$agent) { -echo "\n"; -echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK INVIA\n"; -echo " NOTE: stats taken from available agent log data\n"; +$MAIN.="\n"; +$MAIN.="PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK INVIA\n"; +$MAIN.=" NOTE: stats taken from available agent log data\n"; } else @@ -180,22 +206,27 @@ $query_date_END = "$query_date 23:59:59"; $time_BEGIN = "00:00:00"; $time_END = "23:59:59"; -$stmt="select full_name from vicidial_users where user='$agent';"; +$stmt="select full_name from vicidial_users where user='$agent' $vuLOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $full_name = $row[0]; -echo "AgentTime Sheet $NOW_TIME\n"; +$MAIN.="AgentTime Sheet $NOW_TIME\n"; + +$MAIN.="Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; +$MAIN.="---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n"; + +$CSV_text_header.="\"AgentTime Sheet- $NOW_TIME\"\n"; +$CSV_text_header.="\"Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\"\n"; +$CSV_text_header.="\"AGENT TIME SHEET: $agent - $full_name\"\n\n"; -echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; -echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n"; if ($calls_summary) { $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); $TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]); @@ -220,45 +251,56 @@ if ($calls_summary) $pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS); $pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS); - echo "TOTALE CHIAMATE TAKEN: $row[0]\n"; - echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; - echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; - echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; - echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; - echo "----------------------------------------------------------------\n"; - echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n"; - - echo "\n"; + $MAIN.="TOTALE CHIAMATE TAKEN: $row[0] <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=1'>[DOWNLOAD]</a>\n"; + $MAIN.="TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n"; + $MAIN.="PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n"; + $MAIN.="WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n"; + $MAIN.="WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n"; + $MAIN.="----------------------------------------------------------------\n"; + $MAIN.="TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n\n"; + $CSV_text1.=$CSV_text_header; + $CSV_text1.="\"\",\"TOTALE CHIAMATE TAKEN: $row[0]\"\n"; + $CSV_text1.="\"\",\"TALK TIME:\",\"$pfTALK_TIME_HMS\",\"AVERAGE:\",\"$pfTALK_AVG_MS\"\n"; + $CSV_text1.="\"\",\"PAUSE TIME:\",\"$pfPAUSE_TIME_HMS\",\"AVERAGE:\",\"$pfPAUSE_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WAIT TIME:\",\"$pfWAIT_TIME_HMS\",\"AVERAGE:\",\"$pfWAIT_AVG_MS\"\n"; + $CSV_text1.="\"\",\"WRAPUP TIME:\",\"$pfWRAPUP_TIME_HMS\",\"AVERAGE:\",\"$pfWRAPUP_AVG_MS\"\n"; + $CSV_text1.="\"\",\"TOTAL ACTIVE AGENT TIME:\",\"$pfTOTAL_TIME_HMS\"\n\n"; } else { - echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; + $MAIN.="<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n"; } $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "FIRST LOGIN: $row[0]\n"; +$MAIN.="FIRST LOGIN: $row[0]\n"; $start = $row[1]; +$CSV_login.="\"\",\"FIRST LOGIN:\",\"$row[0]\"\n"; + $stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $row=mysql_fetch_row($rslt); -echo "LAST LOG ACTIVITY: $row[0]\n"; +$MAIN.="LAST LOG ACTIVITY: $row[0]\n"; $end = $row[1]; +$CSV_login.="\"\",\"LAST LOG ACTIVITY:\",\"$row[0]\"\n"; + $login_time = ($end - $start); $LOGIN_TIME_HMS = sec_convert($login_time,'H'); $pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS); -echo "-----------------------------------------\n"; -echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$MAIN.="-----------------------------------------\n"; +$MAIN.="TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n"; +$CSV_login.="\"\",\"TOTAL LOGGED-IN TIME:\",\"$pfLOGIN_TIME_HMS\"\n\n"; +$CSV_text1.=$CSV_login; ### timeclock records @@ -271,14 +313,19 @@ $EQday_ARY = explode('-',$query_date_END); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "\n"; +$MAIN.="\n"; -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n"; +$MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT: <a href='$PHP_SELF?calls_summary=$calls_summary&agent=$agent&query_date=$query_date&file_download=2'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n"; + +$CSV_text2.=$CSV_text_header; +$CSV_text2.=$CSV_login; +$CSV_text2.="\"TIMECLOCK TIEMPO LOGIN/LOGOUT:\"\n"; +$CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"ORE:MINUTI\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -299,13 +346,14 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -313,15 +361,16 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -329,27 +378,55 @@ if (strlen($login_sec)<1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right colspan=2><font size=2><font size=2>TOTALE </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE><BR>$db_source\n"; - + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right colspan=2><font size=2><font size=2>TOTALE </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; +$CSV_text2.="\"\",\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; +$MAIN.="</TABLE><BR>$db_source\n"; +$MAIN.="</BODY></HTML>\n"; } + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_agent_time_sheet_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^ +/', '', $$CSV_var); + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } + ?> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php index 6b03fb37..5e8a99f5 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php @@ -3,7 +3,7 @@ # # Pulls all timeclock records for an agent # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 90602-2244 - First build @@ -11,6 +11,8 @@ # 100712-1324 - Added system setting slave server option and added user stats link dates # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 111104-1315 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # @@ -38,13 +40,14 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} -$report_name = 'User Timeclock Detail Report'; +$report_name = 'UtenteOrologio Dettagliata Report'; $db_source = 'M'; ############################################# @@ -70,7 +73,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; +# echo "<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -93,7 +96,7 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -103,21 +106,54 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -135,7 +171,7 @@ $end_dateARRAY = explode(" ",$end_date); $end_date_D = $end_dateARRAY[0]; $end_date_T = $end_dateARRAY[1]; -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -146,7 +182,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -231,6 +267,7 @@ if ($file_download < 1) <script language="JavaScript" src="calendar_db.js"></script> <link rel="stylesheet" href="calendar.css"> + <link rel="stylesheet" href="horizontalbargraph.css"> <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; @@ -249,7 +286,7 @@ if ($file_download < 1) if (strlen($user_group[0]) < 1) { echo "\n"; - echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n"; + echo "Seleziona una campagna o utente GRUPPO E DATA A TEMPO E CLICCA SOPRA INVIA\n"; echo " NOTE: stats taken from shift specified\n"; } @@ -287,14 +324,14 @@ else if ($file_download < 1) { - echo "User Time-Clock Detail $NOW_TIME\n"; + echo "Utente Time-Clock Dettagliata $NOW_TIME\n"; - echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; + echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; } else { - $file_output .= "User Time-Clock Detail $NOW_TIME\n"; - $file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n"; + $file_output .= "Utente Time-Clock Dettagliata $NOW_TIME\n"; + $file_output .= "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n"; } @@ -304,7 +341,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;"; + $stmt="select full_name,user,user_group from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -346,10 +383,19 @@ else ##### BEGIN print the output to screen or put into file output variable if ($file_download < 1) { - echo "AGENT TIME-CLOCK DETAIL:\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">USER GROUP</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n"; - echo "+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="AGENT TIME-CLOCK DETAIL:\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">Utente Group</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + + $GRAPH.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"AGENT TIME-CLOCK DETAIL\" class=\"horizontalgraph\">\n"; + $GRAPH.=" <caption align=\"top\">AGENT TIME-CLOCK DETAIL</caption>\n"; + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">USER/Utente Group</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\" nowrap>TIME CLOCK </th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">TIME CLOCK PUNCHES</th>\n"; + $GRAPH.=" </tr>\n"; + } else { @@ -368,6 +414,9 @@ else ##### BEGIN loop through each user formatting data for output $AUTOLOGOUTflag=0; $m=0; + $max_time=1; + $graph_stats=array(); + $q=0; while ( ($m < $uc) and ($m < 50000) ) { $TCdetail=''; @@ -405,6 +454,7 @@ else $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); $StimeTC[$m]= sec_convert($TCtime[$n],'H'); $RAWtimeTC = $StimeTC[$m]; + if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;} $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); } $n++; @@ -421,7 +471,7 @@ else $TCuserAUTOLOGOUT = ' '; $stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;"; $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $TC_results = mysql_num_rows($rslt); $k=0; while ($TC_results > $k) @@ -475,6 +525,11 @@ else if ($file_download < 1) { $Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser&begin_date=$query_date_D&end_date=$end_date_D\">$Suser[$m]</a> | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]"; + $graph_stats[$q][1]="$RAWtimeTCsec"; + $graph_stats[$q][2]="$TCuserAUTOLOGOUT"; + $graph_stats[$q][3]="$TCdetail"; + $q++; } else { @@ -506,7 +561,9 @@ else } if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if ($file_download < 1) - {echo "$Toutput";} + { + $ASCII_text.="$Toutput"; + } else {$file_output .= "$fileToutput";} @@ -516,12 +573,19 @@ else $m++; } ##### END loop through each user formatting data for output - + for ($i=0; $i<count($graph_stats); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($graph_stats)) {$class=" last";} else {$class="";} + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][0]."</th>\n"; + $GRAPH.=" <th class=\"thgraph value$class\" scope=\"col\" nowrap><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(200*$graph_stats[$i][1]/$max_time)."\" height=\"16\" />".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."</th>\n"; + $GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][3]."</th>\n"; + $GRAPH.=" </tr>\n"; + } $TOT_AGENTS = sprintf("%4s", $m); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";} + if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";} ### BEGIN sort through output to display properly ### @@ -543,7 +607,7 @@ else $i = $sort_split[1]; $sort_order[$m] = "$i"; if ($file_download < 1) - {echo "$TOPsorted_output[$i]";} + {$ASCII_text.="$TOPsorted_output[$i]";} else {$file_output .= "$TOPsorted_outputFILE[$i]";} $m++; @@ -566,22 +630,32 @@ else $TOTtimeTC = sec_convert($TOTtimeTC,'H'); $TOTtimeTC = sprintf("%11s", $TOTtimeTC); - ###### END LAST LINE TOTALS FORMATTING ########## + ###### END LAST LINE TOTALI FORMATTING ########## if ($file_download < 1) { - echo "+-----------------+----------+----------------------+------------+--------------------\n"; - echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; - echo "+----------------------------+ +------------+\n"; + $ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n"; + $ASCII_text.="| TOTALI AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + $ASCII_text.="+----------------------------+ +------------+\n"; + $GRAPH.=" <tr>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTALI</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">AGENTS: $TOT_AGENTS</th>\n"; + $GRAPH.=" <th class=\"thgraph\" scope=\"col\">$TOTtimeTC</th>\n"; + $GRAPH.=" </tr>\n"; + $GRAPH.=" </table>\n"; if ($AUTOLOGOUTflag > 0) - {echo " * denotes AUTOLOGOUT from timeclock\n";} - echo "\n\n</PRE>"; + { + $ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n"; + $GRAPH.=" * denotes AUTOLOGOUT from timeclock\n"; + } + $ASCII_text.="</PRE>"; + $GRAPH.="</PRE>"; } else { - $file_output .= "TOTALS,$TOT_AGENTS,,$TOTtimeTC\n"; + $file_output .= "TOTALI,$TOT_AGENTS,,$TOTtimeTC\n"; } } @@ -614,12 +688,20 @@ if ($file_download > 0) exit; } +if ($report_display_type=="HTML") + { + echo $GRAPH; + } +else + { + echo $ASCII_text; + } ############################################################################ ##### BEGIN HTML form section ############################################################################ echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>"; +echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Date:<BR>"; echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n"; echo "<INPUT TYPE=hidden NAME=query_date ID=query_date VALUE=\"$query_date\">\n"; echo "<INPUT TYPE=hidden NAME=end_date ID=end_date VALUE=\"$end_date\">\n"; @@ -634,7 +716,7 @@ var o_cal = new tcal ({ 'controlname': 'query_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunedi week start </script> <?php @@ -651,7 +733,7 @@ var o_cal = new tcal ({ 'controlname': 'end_date_D' }); o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Monday week start +// o_cal.a_tpl.weekstart = 1; // Lunedi week start </script> <?php @@ -672,13 +754,13 @@ echo "   <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$end_d # } # echo "</SELECT>\n"; -echo "</TD><TD VALIGN=TOP>User Groups:<BR>"; +echo "</TD><TD VALIGN=TOP>Gruppi Utenti:<BR>"; echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; if (eregi("--ALL--",$user_group_string)) - {echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} + {echo "<option value=\"--ALL--\" selected>-- ALL GRUPPI UTENTI --</option>\n";} else - {echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} + {echo "<option value=\"--ALL--\">-- ALL GRUPPI UTENTI --</option>\n";} $o=0; while ($user_groups_to_print > $o) { @@ -687,6 +769,11 @@ while ($user_groups_to_print > $o) $o++; } echo "</SELECT>\n"; +echo "</TD><TD VALIGN=TOP>"; +echo "Visualizzare as:   <BR>"; +echo "<select name='report_display_type'>"; +if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";} +echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>"; echo "</TD><TD VALIGN=TOP>Shift:<BR>"; echo "<SELECT SIZE=1 NAME=shift>\n"; echo "<option selected value=\"$shift\">$shift</option>\n"; @@ -710,7 +797,7 @@ function submit_form() </SCRIPT> -<input type=button value="SUBMIT" name=smt id=smt onClick="submit_form()"> +<input type=button value="INVIA" name=smt id=smt onClick="submit_form()"> <?php @@ -718,7 +805,7 @@ echo "</TD><TD VALIGN=TOP>         "; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>          \n"; echo " <a href=\"$LINKbase&stage=$stage&file_download=1\">DOWNLOAD</a> | \n"; -echo " <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n"; +echo " <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n"; echo "</FONT>\n"; echo "</TD></TR></TABLE>"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_campaign_status_list_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_campaign_status_list_report.php new file mode 100644 index 00000000..9ac4f201 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_campaign_status_list_report.php @@ -0,0 +1,471 @@ +<?php +# AST_campaign_status_list_report.php +# +# This report is designed to show the breakdown by list_id of the calls and +# their statuses for all lists within a campaign for a set time period +# +# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 110815-2138 - First build +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$report_name="Campagna Status List Report"; +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;} +if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;} +if (!isset($query_date_T)) {$query_date_T="00:00:00";} +if (!isset($end_date_T)) {$end_date_T="23:59:59";} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n"; + } + +$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER); +$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_text.="$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (preg_match("/-ALL/",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = preg_replace("/,\$/",'',$group_SQL); + $group_SQL_str=$group_SQL; + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$query_date="$query_date_D $query_date_T"; +$end_date="$end_date_D $end_date_T"; + +$HTML_head.="<HTML>\n"; +$HTML_head.="<HEAD>\n"; +$HTML_head.="<STYLE type=\"text/css\">\n"; +$HTML_head.="<!--\n"; +$HTML_head.=" .green {color: white; background-color: green}\n"; +$HTML_head.=" .red {color: white; background-color: red}\n"; +$HTML_head.=" .blue {color: white; background-color: blue}\n"; +$HTML_head.=" .purple {color: white; background-color: purple}\n"; +$HTML_head.="-->\n"; +$HTML_head.=" </STYLE>\n"; + +$HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n"; + +$HTML_head.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HTML_head.="<TITLE>$report_name$group_S\n"; +$short_header=1; + +# require("admin_header.php"); + +$HTML_text.="
    "; + +$HTML_text.="\n"; +$HTML_text.="
    Date:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campagnas:
    "; +$HTML_text.="\n"; + +$HTML_text.="
     \n"; +$HTML_text.="\n"; +$HTML_text.="Visualizzare as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" REPORT \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="\n\n"; + +$HTML_text.="
    ";
    +$i=0;
    +$group_string='|';
    +$group_ct = count($group);
    +$JS_text.="\n";
    +
    +if ($report_display_type=="HTML")
    +	{
    +	$HTML_text.=$JS_text.$GRAPH;
    +	}
    +else
    +	{
    +	$HTML_text.=$ASCII_text;
    +	}
    +
    +$HTML_text.="
    "; + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_campaign_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + + echo $HTML_head; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_carrier_log_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_carrier_log_report.php new file mode 100644 index 00000000..dc539f44 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_carrier_log_report.php @@ -0,0 +1,325 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120210-2202 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="
    \n"; +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Server:
    \n"; +$MAIN.="
    \n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($INVIA && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVER IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RISPOSTAED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RISPOSTAED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="
    \n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_dialer_inventory_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_dialer_inventory_report.php new file mode 100644 index 00000000..eb1f28b0 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_dialer_inventory_report.php @@ -0,0 +1,899 @@ + LICENSE: AGPLv2 +# Matt Florell +# +# NOTES: +# - For snapshots, the AST_dialer_inventory_snapshot.pl script should be put in +# the crontab and run on a nightly basis after-hours +# +# +# CHANGES +# 111013-0054 - First build +# 111106-1327 - Reformatting, other minor changes +# 111230-1145 - Debugging additions and more minor changes +# 120221-2237 - Added totals, list options, other small changes +# + +error_reporting(0); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["report_type"])) {$report_type=$_GET["report_type"];} + elseif (isset($_POST["report_type"])) {$report_type=$_POST["report_type"];} +if (isset($_GET["selected_list"])) {$selected_list=$_GET["selected_list"];} + elseif (isset($_POST["selected_list"])) {$selected_list=$_POST["selected_list"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["time_setting"])) {$time_setting=$_GET["time_setting"];} + elseif (isset($_POST["time_setting"])) {$time_setting=$_POST["time_setting"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_source"])) {$report_source=$_GET["report_source"];} + elseif (isset($_POST["report_source"])) {$report_source=$_POST["report_source"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["DBX"])) {$DBX=$_GET["DBX"];} + elseif (isset($_POST["DBX"])) {$DBX=$_POST["DBX"];} +if (isset($_GET["snapshot_time"])) {$snapshot_time=$_GET["snapshot_time"];} + elseif (isset($_POST["snapshot_time"])) {$snapshot_time=$_POST["snapshot_time"];} +if (isset($_GET["override_24hours"])) {$override_24hours=$_GET["override_24hours"];} + elseif (isset($_POST["override_24hours"])) {$override_24hours=$_POST["override_24hours"];} + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$time_start = microtime(true); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + + +$report_name = 'Dialer Inventory report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + #$HTML_header.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_header.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$inventory_allow_realtime = 0; +if (file_exists('options.php')) + { + require('options.php'); + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) { echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$HTML_header.="$stmt\n";} +$lists_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $lists[$i] = $row[0]; + $list_names[$i] = $row[1]; + $i++; + } + +$campaign_span_txt="Campagnas:
    "; +$campaign_span_txt.=""; + +$list_span_txt="Liste:
    "; +$list_span_txt.=""; + +$snapshot_span_txt="Snapshot time:
    "; +$snapshot_stmt="SELECT distinct snapshot_time from dialable_inventory_snapshots order by snapshot_time desc limit 100;"; +if ($DBX > 0) {$HTML_header.= "|$snapshot_stmt|\n";} +$snapshot_rslt=mysql_query($snapshot_stmt, $link); +$snapshot_span_txt.="\n"; + + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; + +if ($report_type=='LIST') {$onload="onload=\"ToggleSpan('list_span', 'campaign_span')\"";} + +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="\n"; +$HTML_header.="$report_name\n"; +$HTML_header.="
    \n";
    +
    +$rpt_header="";
    +####### STAT GENERATION #######
    +require("count_functions.inc");
    +function GetListCount($list_id, $inventory_ptnstr) 
    +	{
    +	global $list_start_inv;
    +	global $new_count;
    +	global $link;
    +	global $total_calls;
    +	$ct_stmt="SELECT status, called_count, count(*) From vicidial_list where list_id='$list_id' group by status, called_count order by status, called_count;";
    +	if ($DBX > 0) {$HTML_header.= "|$ct_stmt|\n";}
    +	$ct_rslt=mysql_query($ct_stmt, $link);
    +	$new_count=0; $total_calls=0;
    +	while ($ct_row=mysql_fetch_row($ct_rslt)) 
    +		{
    +		$list_start_inv+=$ct_row[2];
    +		$total_calls+=($ct_row[1]*$ct_row[2]);
    +		if (preg_match('/|$ct_row[0]|/', $inventory_ptnstr) && $ct_row[1]=="0") {$new_count+=$ct_row[2];} 
    +		}
    +	}
    +
    +if ($INVIA) 
    +	{
    +
    +	$total_list_start_inv=0;
    +	$total_dialable_count=0;
    +	$total_dialable_count_nofilter=0;
    +	$total_dialable_count_oneoff=0;
    +	$total_dialable_count_inactive=0;
    +	$total_total_calls=0;
    +	$total_average_call_count=0;
    +	$total_penetration=0;
    +
    +	if ($snapshot_time && $report_source=="SNAPSHOT") 
    +		{
    +		$rpt_header="SNAPSHOT from $snapshot_time\n";
    +		$stmt="SELECT distinct shift_data from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
    +		if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
    +		$rslt=mysql_query($stmt, $link);
    +		$shift_SQL_str="";
    +		while ($shift_row=mysql_fetch_array($rslt)) 
    +			{
    +			$shift_data1=explode("|", $shift_row["shift_data"]);
    +			for ($i=0; $i 0) {$HTML_header.= "|$shift_stmt|\n";}
    +		$shift_rslt=mysql_query($shift_stmt, $link);
    +		$c=0;
    +		while($shift_row=mysql_fetch_array($shift_rslt)) 
    +			{
    +			$rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |";
    +			$CSV_header_SHIFTS.="\"$shift_row[shift_id]\",";
    +			$rpt_header_SHIFTS_lower.="          |";
    +			$rpt_header_Border.="----------+";
    +			$shift_ary[$c]=$shift_row["shift_id"];
    +			$total_varname="total_".$shift_row["shift_id"];
    +			$$total_varname=0;
    +			if ($DB > 0) {echo "
    -$c-$shift_ary[$c]-$shift_row[shift_id]-\n";} + $c++; + } + + if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;} + if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";} + $stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;"; + if ($DBX > 0) {$HTML_header.= "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $row["list_description"]=substr($row["list_description"], 0, 30); + if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];} + $rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |"; + $CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\""; + + $total_list_start_inv+=$row["list_start_inv"]; + $total_dialable_count+=$row["dialable_count"]; + $total_dialable_count_nofilter+=$row["dialable_count_nofilter"]; + $total_dialable_count_oneoff+=$row["dialable_count_oneoff"]; + $total_dialable_count_inactive+=$row["dialable_count_inactive"]; + $total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]); + + $shift_data_a=explode("|", $row["shift_data"]); + $b=0; + while ($b < count($shift_ary)) + { + $a=0; + while ($a < count($shift_data_a)) + { + $shift_data_b=explode(",", $shift_data_a[$a]); + $line_match=0; + if ($shift_ary[$b] == "$shift_data_b[0]") + { + $rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |"; + $CSV_body.=",\"$shift_data_b[1]\""; + $total_varname="total_".$shift_data_b[0]; + $$total_varname+=$shift_data_b[1]; + $line_match++; + } + if ($DB > 0) {echo "
    -$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";} + $a++; + } + $b++; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + } + } + else + { + $single_status=1; + + ## If time setting is set to 'Local', compile a list of time zone offsets and make an array of those offsets with the amount of time that needs to be added or subtracted + if ($time_setting=="LOCAL") + { + $gmt_stmt="SELECT default_local_gmt from system_settings;"; + $gmt_rslt=mysql_query($gmt_stmt, $link); + $gmt_row=mysql_fetch_row($gmt_rslt); + $local_offset=$gmt_row[0]; + + if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";} + if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";} + $gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;"; + if ($DB) {$HTML_header.=$gmt_stmt."
    \n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + $gmt_row[1]=preg_replace('/25$/', '15', $gmt_row[1]); + $gmt_row[1]=preg_replace('/75$/', '45', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\.5$/', '.30', $gmt_row[1]); + $gmt_row[1]=preg_replace('/\./', ':', $gmt_row[1]); + $gri = $gmt_row[0]; + $gmt_array[$gri]=$gmt_row[1]; + } + } + + # Get shift information + $shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;"; + if ($DB) {$HTML_header.="$shift_stmt;\n";} + $shift_rslt=mysql_query($shift_stmt, $link); + while($shift_row=mysql_fetch_array($shift_rslt)) + { + $rpt_header_SHIFTS.=" ".sprintf("%8s", substr($shift_row["shift_id"],0,8))." |"; + $rpt_header_SHIFTS_lower.=" |"; + $CSV_header_SHIFTS.="\"$shift_row[shift_id]\","; + $rpt_header_Border.="----------+"; + $shift_ary[$shift_row["shift_id"]][0]=$shift_row["shift_name"]; + $shift_ary[$shift_row["shift_id"]][1]=$shift_row["shift_start_time"]; + $shift_ary[$shift_row["shift_id"]][2]=$shift_row["shift_end_time"]; + $shift_ary[$shift_row["shift_id"]][3]=$shift_row["day_offset"]; + $shift_ary[$shift_row["shift_id"]][4]=$shift_row["shift_weekdays"]; + } + + $rpt_body=""; + if ($group_ct>0 && $report_type=="CAMPAIGNS") + { + for ($i=0; $i<$group_ct; $i++) + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id='$group[$i]' $LOGallowed_campaignsSQL"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $dial_statuses=" "; + $inventory_statuses=" "; + $inventory_ptnstr="|"; + $inactive_dial_statuses=" "; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL esito: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$group[$i]' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + + $list_start_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + $total_total_calls+=$total_calls; + + # $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL"; + # SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($j=0; $j=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + } + else if ($selected_list && $report_type=="LIST") + { + $campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;"; + if ($DB) {$HTML_header.="$campaign_stmt;\n";} + $campaign_rslt=mysql_query($campaign_stmt, $link); + $campaign_row=mysql_fetch_row($campaign_rslt); + $call_count_limit=$campaign_row[0]; + $call_count_target=$campaign_row[1]; + $active_dial_statuses=$campaign_row[2]; + $local_call_time=$campaign_row[3]; if ($override_24hours) {$local_call_time="24hours";} + $drop_lockout_time=$campaign_row[4]; + $campaign_id=$campaign_row[5]; + + $stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);"; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $inactive_dial_statuses=" "; + $dial_statuses=" "; + $inventory_statuses=""; + $inventory_ptnstr="|"; + while ($row=mysql_fetch_row($rslt)) + { + $dial_statuses.="$row[0] "; + $inventory_statuses.="'$row[0]',"; + $inventory_ptnstr.="$row[0]|"; + if (!preg_match("/ $row[0] /", "$active_dial_statuses")) {$inactive_dial_statuses.="$row[0] ";} + } + $inventory_statuses=substr($inventory_statuses, 0, -1); + if ($DB) {$HTML_header.= " CAMPAIGN DIAL esito: |$active_dial_statuses|\n";} + if ($DB) {$HTML_header.= " DIAL esito: |$dial_statuses|\n";} + if ($DB) {$HTML_header.= " INVENTORY STATUSES RESULTS: |$inventory_statuses|\n";} + if ($DB) {$HTML_header.= " INACTIVE STATUSES RESULTS: |$inactive_dial_statuses|\n";} + + if ($DB) {$HTML_header.="$campaign_stmt; - $dial_statuses\n";} + + $filter_stmt="SELECT lead_filter_sql from vicidial_campaigns v, vicidial_lead_filters vlf where v.campaign_id='$campaign_id' and v.lead_filter_id=vlf.lead_filter_id limit 1;"; + if ($DB) {$HTML_header.="$filter_stmt;\n";} + $filter_rslt=mysql_query($filter_stmt, $link); + $filter_row=mysql_fetch_row($filter_rslt); + if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";} + $filter_SQL = preg_replace("/\\\/",'',$filter_SQL); + + $lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;"; + if ($DB) {$HTML_header.="$lists_stmt;\n";} + $lists_rslt=mysql_query($lists_stmt, $link); + while ($lists_row=mysql_fetch_array($lists_rslt)) + { + $list_id=$lists_row["list_id"]; + $list_name=$lists_row["list_name"]; + $lists_row["list_description"]=substr($lists_row["list_description"], 0, 30); + $list_description=$lists_row["list_description"]; + $last_calldate=$lists_row["list_lastcalldate"]; + $campaign_id=$lists_row["campaign_id"]; + if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;} + $list_call_inv=0; + GetListCount($list_id, $inventory_ptnstr); + if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";} + + ### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report + $total_total_calls+=$total_calls; + + $Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,""); + if (strlen($inactive_dial_statuses)>1) + { + $Xdialable_inactive_count = dialable_leads($DB,$link,$local_call_time,"$inactive_dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + } + else + { + $Xdialable_inactive_count = 0; + } + + $oneoff_SQL=$filter_SQL." and (called_count < $call_count_limit-1) "; + $oneoff_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$oneoff_SQL"); + + $full_dialable_SQL=""; + $Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL"); + if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";} + } + + if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";} + + $rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |"; + $CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\""; + + $total_list_start_inv+=$list_start_inv; + $total_dialable_count+=$Xdialable_count; + $total_dialable_count_nofilter+=$Xdialable_count_nofilter; + $total_dialable_count_oneoff+=$oneoff_count; + $total_dialable_count_inactive+=$Xdialable_inactive_count; + + $shift_ary2=$shift_ary; + while (list($key, $val)=each($shift_ary2)) + { + $total_shift_count=0; + $total_nofilter_shift_count=0; + $total_oneoff_shift_count=0; + $total_undialable_shift_count=0; + $total_nofilter_undialable_shift_count=0; + $gmt_stmt="SELECT distinct gmt_offset_now from vicidial_list where list_id='$list_id';"; + if ($DB) {$HTML_header.="$gmt_stmt\n";} + $gmt_rslt=mysql_query($gmt_stmt, $link); + while ($gmt_row=mysql_fetch_row($gmt_rslt)) + { + if ($time_setting=="LOCAL") + { + $gri = $gmt_row[0]; + $offset_hours=$gmt_array[$gri]; + } + else + { + $offset_hours=0; + } + + if (strlen($val[4])>0) + { + if ($val[3]==0) + { + $shift_days_SQL=" and time(addtime(call_date, '$offset_hours'))>='$val[1]' and time(addtime(call_date, '$offset_hours'))<='$val[2]' "; + $day_str=""; + for ($i=0; $i=addtime('09:00', '00:04:00') + } + $shift_days_SQL=substr($shift_days_SQL, 0, -3).")"; + } + } + else + { + $shift_days_SQL=""; + } + +# $dialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $dialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $undialable_nofilter_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]') $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target'"; +# $oneoff_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='($call_count_target-1)'"; + $shift_stmt="SELECT count(*) from (SELECT lead_id, count(*) as count from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where $full_dialable_SQL and gmt_offset_now='$gmt_row[0]' $filter_SQL) $shift_days_SQL group by lead_id) as count_table where count_table.count>='$call_count_target';"; + + $shift_rslt=mysql_query($shift_stmt, $link); + $shift_row=mysql_fetch_row($shift_rslt); + if ($DB) {$HTML_header.="$shift_stmt;
    $shift_row[0]
    \n";} + $total_shift_count+=$shift_row[0]; + } + $shift_count=$Xdialable_count-$total_shift_count; + $rpt_body.=" ".sprintf("%8s", $shift_count)." |"; + $total_varname="total_".$key; + $$total_varname+=$shift_count; + $CSV_body.=",\"$shift_count\""; + } + $rpt_body.="\n"; + $CSV_body.="\n"; + if (!$file_download) {echo $HTML_header; $HTML_header=""; flush();} + } + } + + $rpt_header.="Date: ".date("m/d/Y")." -- Time: ".date("H:i a")."\n\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + $rpt_header.="| Call list | List description | Campagna | Last call date | Start Inv | Call Inv | Call Inv | Call Inv | Call Inv | Dial Avg | Pen. % |$rpt_header_SHIFTS\n"; + $rpt_header.="| | | | | | Total | No filtr | One-off | Inactive | | |$rpt_header_SHIFTS_lower\n"; + $rpt_header.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + $CSV_header="\"$report_name\"\n"; + $CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n"; + $CSV_header.="\"Call list\",\"List description\",\"Campagna\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n"; + + $rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + + #### PRINT TOTALI #### + if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";} + if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";} + $rpt_footer.="|".sprintf("%76s", "TOTALI")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |"; + $CSV_body.="\"\",\"\",\"\",\"TOTALI\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\""; + $b=0; + while ($b < count($shift_ary)) + { + $total_varname="total_".$shift_ary[$b]; + $rpt_footer.=" ".sprintf("%8s", $$total_varname)." |"; + $CSV_body.=",\"".$$total_varname."\""; + $b++; + } + $CSV_body.="\n"; + $rpt_footer.="\n"; + ###################### + + $rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_Border\n"; + } +$HTML_header.="
    \n"; +############################### + +$HTML_text="
    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_type=='LIST') {$cmp_checked=""; $list_checked="checked";} else {$cmp_checked="checked"; $list_checked="";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Report type:
    Campagnas
    List
    \n"; +$HTML_text.="
     \n"; +$HTML_text.="$campaign_span_txt\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($time_setting=='LOCAL') {$svr_checked=""; $local_checked="checked";} else {$svr_checked="checked"; $local_checked="";} +if ($override_24hours) {$override_checked="checked";} +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +$HTML_text.="
    Time setting:
    Server
    Local
    Ignore local campaign call time
    (default to 24 hours)
    \n"; +$HTML_text.="
    \n"; +$HTML_text.=" \n"; +$HTML_text.=" \n"; +if ($report_source=='REALTIME') {$ss_checked=""; $rt_checked="checked";} else {$ss_checked="checked"; $rt_checked="";} +$HTML_text.=" \n"; + +if ($inventory_allow_realtime > 0) + { + $HTML_text.=" \n"; + } +else + { + $HTML_text.=" \n"; + } + +$HTML_text.="
    Report source:
    Snapshot
    Real-time
     
    $snapshot_span_txt\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n"; +$HTML_text.="           DOWNLOAD | REPORT

    \n"; +$HTML_text.="\n"; +$HTML_text.="
    \n"; +$HTML_text.="
    \n\n";
    +
    +$HTML_text.="$rpt_header";
    +$HTML_text.="$rpt_body";
    +$HTML_text.="$rpt_footer";
    +
    +$time_end = microtime(true);
    +$ENDtime = date("U");
    +$time = $ENDtime - $STARTtime;
    +
    +$HTML_text.="Executed in $time seconds\n";
    +$HTML_text.="
    \n"; +$HTML_text.="\n"; +$HTML_text.="\n"; + + +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_DIALERinventory_$US$FILE_TIME.csv"; + $CSV_text=$CSV_header.$CSV_body; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/,\s+/', ',', $CSV_text); + // We'll be outputting a TXT file + 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; + } +else + { + $short_header=1; + + echo $HTML_header; + require("admin_header.php"); + echo $HTML_text; + } + +?> + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_hangup_cause_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_hangup_cause_report.php new file mode 100644 index 00000000..bfae6665 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_hangup_cause_report.php @@ -0,0 +1,413 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 120331-2301 - First build +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} + elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc"; +$server_rslt=mysql_query($server_stmt, $link); +$servers_to_print=mysql_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (ereg("-ALL",$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### HANGUP CAUSES +$hangup_cause_string='|'; +$dialstatus_string='|'; +$hangup_and_dialstatus_string='|'; +$hangup_cause_ct = count($hangup_cause); + +$i=0; +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + $hangup_and_dialstatus_string .= "$hangup_cause[$i]|"; + $hangup_cause_string .= "$hangup_array[0]|"; + $dialstatus_string .= "$hangup_array[1]|"; + $i++; + } + +$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc"; +$hangupcause_rslt=mysql_query($hangupcause_stmt, $link); +$causes_to_print=mysql_num_rows($hangupcause_rslt); +$i=0; +while ($i < $causes_to_print) + { + $row=mysql_fetch_row($hangupcause_rslt); + $LISThangup_causes[$i] = $row[0]; + $LISTdialstatuses[$i] = $row[1]; + if (ereg("-ALL",$hangup_cause_string) ) + { + $hangup_cause[$i] = $LISThangup_causes[$i]; + $dialstatus[$i] = $LISTdialstatuses[$i]; + } + $i++; + } +$i=0; +$hangup_causes_string='|'; +$hangup_cause_ct = count($hangup_cause); +while($i < $hangup_cause_ct) + { + $hangup_array=explode("!", $hangup_cause[$i]); + if ( (strlen($hangup_array[0]) > 0) and (preg_match("/\|$hangup_array[0]\|/",$hangup_cause_string)) and (strlen($hangup_array[1]) > 0) and (preg_match("/\|$hangup_array[1]\|/",$dialstatus_string)) ) + { + $hangup_causes_string .= "$hangup_array[0]|"; + $hangup_cause_SQL .= "(hangup_cause='$hangup_array[0]' and dialstatus='$hangup_array[1]') OR"; + $hangup_causeQS .= "&hangup_cause[]=$hangup_cause[$i]"; + } + $i++; + } + +if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) + { + $hangup_cause_SQL = ""; + $HC_rpt_string="- ALL hangup causes "; + if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} + } +else + { + $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); + $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); + $hangup_cause_SQL = "and ($hangup_cause_SQL)"; + $hangup_and_dialstatus_string=preg_replace('/\!/', "-", $hangup_and_dialstatus_string); + $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_and_dialstatus_string, 1, -1)); + } +if (strlen($hangup_cause_SQL)<3) {$hangup_cause_SQL="";} +######################## +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +$MAIN.="
    "; +$MAIN.="\n"; +$MAIN.=""; + +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.="
    \n"; +$MAIN.="\n"; +$MAIN.="Date:\n"; +$MAIN.=""; +$MAIN.="\n"; + +$MAIN.="

    "; + +$MAIN.="
    to
    "; + +$MAIN.="
    IP Server:
    \n"; +$MAIN.="
    Hangup Cause/Dial Status:
    "; +$MAIN.="
    "; + +$MAIN.="\n"; +$MAIN.="

    \n"; +$MAIN.="
    \n"; +if ($INVIA && $server_ip_ct>0) { + $stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus"; + $rslt=mysql_query($stmt, $link); + $MAIN.="
    \n";
    +	if ($DB) {$MAIN.=$stmt."\n";}
    +	if (mysql_num_rows($rslt)>0) {
    +		$MAIN.="--- DIAL STATUS BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="| HANGUP CAUSE | DIAL STATUS |  COUNT  |\n";
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$total_count=0;
    +		while ($row=mysql_fetch_array($rslt)) {
    +			$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
    +			$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
    +			$MAIN.="| ".sprintf("%-8s", $row["ct"]);
    +			$MAIN.="|\n";
    +			$total_count+=$row["ct"];
    +		}
    +		$MAIN.="+--------------+-------------+---------+\n";
    +		$MAIN.="|                      TOTAL | ".sprintf("%-8s", $total_count)."|\n";
    +		$MAIN.="+--------------+-------------+---------+\n\n\n";
    +
    +		$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
    +		$rpt_rslt=mysql_query($rpt_stmt, $link);
    +		if ($DB) {$MAIN.=$rpt_stmt."\n";}
    +
    +		if (!$lower_limit) {$lower_limit=1;}
    +		if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
    +		
    +		$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string\n --- RECORDS #$lower_limit-$upper_limit               [DOWNLOAD]\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$carrier_rpt.="| UNIQUE ID            | CALL DATE           | SERVER IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | RISPOSTAED TIME | PHONE NUMBER |\n";
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +		$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"RISPOSTAED TIME\",\"PHONE NUMBER\"\n";
    +
    +		for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
    +			$row=mysql_fetch_array($rpt_rslt);
    +			$phone_number=""; $phone_note="";
    +
    +			if (strlen($row["phone_number"])==0) {
    +				$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
    +				$rslt2=mysql_query($stmt2, $link);
    +				$channel=$row["channel"];
    +				while ($row2=mysql_fetch_array($rslt2)) {
    +					if (strlen($row2["alt_phone"])>=7 && preg_match("/$row2[alt_phone]/", $channel)) {$phone_number=$row2["alt_phone"]; $phone_note="ALT";}
    +					else if (strlen($row2["address3"])>=7 && preg_match("/$row2[address3]/", $channel)) {$phone_number=$row2["address3"]; $phone_note="ADDR3";}
    +					else if (strlen($row2["phone_number"])>=7 && preg_match("/$row2[phone_number]/", $channel)) {$phone_number=$row2["phone_number"]; $phone_note="*";}
    +				}
    +			} else {
    +				$phone_number=$row["phone_number"];
    +			}
    +
    +			$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
    +			if ($i>=$lower_limit && $i<=$upper_limit) {
    +				if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
    +				$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); 
    +				$carrier_rpt.="| ".sprintf("%-20s", $row["call_date"]); 
    +				$carrier_rpt.="| ".sprintf("%-16s", $row["server_ip"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["lead_id"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $row["hangup_cause"]); 
    +				$carrier_rpt.="| ".sprintf("%-12s", $row["dialstatus"]); 
    +				$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); 
    +				$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); 
    +				$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; 
    +			}
    +		}
    +		$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
    +
    +		$carrier_rpt_hf="";
    +		$ll=$lower_limit-1000;
    +		if ($ll>=1) {
    +			$carrier_rpt_hf.="[<<< PREV 1000 records]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%-23s", " ");
    +		}
    +		$carrier_rpt_hf.=sprintf("%-145s", " ");
    +		if (($lower_limit+1000)=mysql_num_rows($rpt_rslt)) {$max_limit=mysql_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
    +			$carrier_rpt_hf.="[NEXT $max_limit records >>>]";
    +		} else {
    +			$carrier_rpt_hf.=sprintf("%23s", " ");
    +		}
    +		$carrier_rpt_hf.="\n";
    +		$MAIN.=$carrier_rpt_hf.$carrier_rpt.$carrier_rpt_hf;
    +	} else {
    +		$MAIN.="*** NO RECORDS FOUND ***\n";
    +	}
    +	$MAIN.="
    \n"; + + $MAIN.="\n"; + + +} + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_carrier_log_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_inbound_daily_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_inbound_daily_report.php new file mode 100644 index 00000000..6a43bb27 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_inbound_daily_report.php @@ -0,0 +1,1794 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 111119-1234 - First build +# 120118-2116 - Changed headers on CSV download +# 120224-0910 - Added HTML display option with bar graphs +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdown"];} + elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Inbound Daily Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + $MAIN.="\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$groups_string='|'; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $groups_string .= "$groups[$i]|"; + $i++; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +if (!preg_match("/\|$group\|/i",$groups_string)) + { + $HEADER.="\n"; + $group=''; + } + +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; + +$HEADER.="\n"; +$HEADER.="$report_name\n"; + +$short_header=1; + +# require("admin_header.php"); + +$MAIN.="
    "; + +$MAIN.="
    \n"; +$MAIN.=""; + +$MAIN.="\n"; + +$MAIN.=" to "; + +$MAIN.="\n"; + +$MAIN.="\n"; +$MAIN.="  "; +$MAIN.="  "; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="           DOWNLOAD | MODIFICA | REPORT
    Show hourly results
    \n"; +$MAIN.="
    \n\n"; + +$MAIN.="
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	$MAIN.="\n\n";
    +	$MAIN.="SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
    +	echo "$HEADER";
    +	require("admin_header.php");
    +	echo "$MAIN";
    +	}
    +
    +else
    +	{
    +	### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
    +
    +	if ($shift == 'AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
    +		if (strlen($time_END) < 6) {$time_END = "11:59:59";}
    +		}
    +	if ($shift == 'PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'ALL') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
    +		}
    +	if ($shift == 'DAYTIME') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '10AM-6PM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:59:59";}
    +		}
    +	if ($shift == '9AM-1AM') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +	if ($shift == '845-1745') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "17:44:59";}
    +		}
    +	if ($shift == '1745-100') 
    +		{
    +		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
    +		if (strlen($time_END) < 6) {$time_END = "00:59:59";}
    +		}
    +
    +	$time1 = strtotime($time_BEGIN);
    +	$time2 = strtotime($time_END)+1;
    +
    +	$hpd = ceil(($time2 - $time1) / 3600);
    +	if ($hpd<0) {$hpd+=24;}
    +
    +
    +	$query_date_BEGIN = "$query_date $time_BEGIN";   
    +	$query_date_END = "$end_date $time_END";
    +
    +	$SQdate_ARY =	explode(' ',$query_date_BEGIN);
    +	$SQday_ARY =	explode('-',$SQdate_ARY[0]);
    +	$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
    +	$EQdate_ARY =	explode(' ',$query_date_END);
    +	$EQday_ARY =	explode('-',$EQdate_ARY[0]);
    +	$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
    +
    +	$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
    +	$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
    +
    +	$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
    +	$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
    +
    +	$DURATIONsec = ($EQepoch - $SQepoch);
    +	$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
    +
    +	if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
    +		{
    +		$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
    +		$query_date_END = date("Y-m-d H:i:s", $EQepoch);
    +		$DURATIONday++;
    +		}
    +
    +	$MAIN.="Inbound Daily Report                      $NOW_TIME\n";
    +	$MAIN.="Selected in-gruppo: $group\n";
    +	$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
    +	#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
    +	$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
    +	$CSV_text.="Selected in-gruppo: $group\n";
    +	$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
    +
    +	$d=0; $q=0; $hr=0;
    +	while ($d < $DURATIONday)
    +		{
    +		$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
    +
    +		if ($hourly_breakdown) 
    +			{
    +			$dEQepoch = $dSQepoch+3599;
    +			}
    +			else
    +			{
    +			$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
    +			if ($EQsec < $SQsec)
    +				{
    +				$dEQepoch = ($dEQepoch + 86400);
    +				}
    +			}
    +
    +		$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
    +		$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
    +
    +	#  || $time_END<=date("H:i:s", $dEQepoch)
    +		if ($hr>=($hpd-1) || !$hourly_breakdown) 
    +			{
    +			$d++;
    +			$hr=0;
    +			if (date("H:i:s", $dEQepoch)>$time_END) 
    +				{
    +				$dayEND[$q] = date("Y-m-d ", $dEQepoch).$time_END;
    +				}
    +			}
    +			else
    +			{
    +			$hr++;
    +			}
    +		#$MAIN.="$daySTART[$q] - $dayEND[$q] | $SQepochDAY,".date("Y-m-d H:i:s",$SQepochDAY)."\n";
    +		$q++;
    +
    +		}
    +	$prev_week=$daySTART[0];
    +	$prev_month=$daySTART[0];
    +	$prev_qtr=$daySTART[0];
    +	##########################################################################
    +	#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
    +
    +	### BUILD HOUR:MIN DISPLAY ARRAY ###
    +	$i=0;
    +	$h=4;
    +	$j=0;
    +	$Zhour=1;
    +	$active_time=0;
    +	$hour =		($SQtime_ARY[0] - 1);
    +	$startSEC = ($SQsec - 900);
    +	$endSEC =	($SQsec - 1);
    +	if ($SQtime_ARY[1] > 14) 
    +		{
    +		$h=1;
    +		$hour++;
    +		if ($hour < 10) {$hour = "0$hour";}
    +		}
    +	if ($SQtime_ARY[1] > 29) {$h=2;}
    +	if ($SQtime_ARY[1] > 44) {$h=3;}
    +	while ($i < 96)
    +		{
    +		$startSEC = ($startSEC + 900);
    +		$endSEC = ($endSEC + 900);
    +		$time = '      ';
    +		if ($h >= 4)
    +			{
    +			$hour++;
    +			if ($Zhour == '00') 
    +				{
    +				$startSEC=0;
    +				$endSEC=899;
    +				}
    +			$h=0;
    +			if ($hour < 10) {$hour = "0$hour";}
    +			$Stime="$hour:00";
    +			$Etime="$hour:15";
    +			$time = "+$Stime-$Etime+";
    +			}
    +		if ($h == 1)
    +			{
    +			$Stime="$hour:15";
    +			$Etime="$hour:30";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 2)
    +			{
    +			$Stime="$hour:30";
    +			$Etime="$hour:45";
    +			$time = " $Stime-$Etime ";
    +			}
    +		if ($h == 3)
    +			{
    +			$Zhour=$hour;
    +			$Zhour++;
    +			if ($Zhour < 10) {$Zhour = "0$Zhour";}
    +			if ($Zhour == 24) {$Zhour = "00";}
    +			$Stime="$hour:45";
    +			$Etime="$Zhour:00";
    +			$time = " $Stime-$Etime ";
    +			if ($Zhour == '00') 
    +				{$hour = ($Zhour - 1);}
    +			}
    +
    +		if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
    +			( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
    +			( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
    +			{
    +			$HMdisplay[$j] =	$time;
    +			$HMstart[$j] =		$Stime;
    +			$HMend[$j] =		$Etime;
    +			$HMSepoch[$j] =		$startSEC;
    +			$HMEepoch[$j] =		$endSEC;
    +
    +			$j++;
    +			}
    +
    +		$h++;
    +		$i++;
    +		}
    +
    +	$TOTintervals = $q;
    +
    +
    +	### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
    +	$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$ASCII_text.="$stmt\n";}
    +	$records_to_grab = mysql_num_rows($rslt);
    +	$i=0;
    +	if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
    +	while ($i < $records_to_grab)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$qs[$i] = $row[0];
    +		$dt[$i] = 0;
    +		$ut[$i] = ($row[1] - $SQepochDAY);
    +		while($ut[$i] >= $epoch_interval) 
    +			{
    +			$ut[$i] = ($ut[$i] - $epoch_interval);
    +			$dt[$i]++;
    +			}
    +		if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
    +			{
    +			$dt[$i] = ($dt[$i] - 1);
    +			}
    +		$ls[$i] = $row[2];
    +		$st[$i] = $row[3];
    +		$tr[$i] = $row[4];
    +		$at[$i] = $row[5]; # Actual time
    +
    +		# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
    +
    +		$i++;
    +		}
    +
    +	### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
    +	$MT[0]='0';
    +	$totCALLS=0;
    +	$totDROPS=0;
    +	$totQUEUE=0;
    +	$totCALLSsec=0;
    +	$totDROPSsec=0;
    +	$totQUEUEsec=0;
    +	$totCALLSmax=0;
    +	$totDROPSmax=0;
    +	$totQUEUEmax=0;
    +	$totCALLSdate=$MT;
    +	$totDROPSdate=$MT;
    +	$totQUEUEdate=$MT;
    +	$qrtCALLS=$MT;
    +	$qrtDROPS=$MT;
    +	$qrtQUEUE=$MT;
    +	$qrtCALLSsec=$MT;
    +	$qrtDROPSsec=$MT;
    +	$qrtQUEUEsec=$MT;
    +	$qrtCALLSavg=$MT;
    +	$qrtDROPSavg=$MT;
    +	$qrtQUEUEavg=$MT;
    +	$qrtCALLSmax=$MT;
    +	$qrtDROPSmax=$MT;
    +	$qrtQUEUEmax=$MT;
    +
    +	$totABANDONSdate=$MT;
    +	$totRISPOSTASdate=$MT;
    +
    +	$totRISPOSTAS=0;
    +	$totABANDONS=0;
    +	$totRISPOSTASsec=0;
    +	$totABANDONSsec=0;
    +	$totRISPOSTASspeed=0;
    +
    +	$FtotRISPOSTAS=0;
    +	$FtotABANDONS=0;
    +	$FtotRISPOSTASsec=0;
    +	$FtotABANDONSsec=0;
    +	$FtotRISPOSTASspeed=0;
    +
    +	$j=0;
    +	while ($j < $TOTintervals)
    +		{
    +	#	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
    +	#	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
    +	#	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
    +	#	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
    +	#	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
    +		$totABANDONSdate[$j]=0;
    +		$totABANDONSsecdate[$j]=0;
    +		$totRISPOSTASdate[$j]=0;
    +		$totRISPOSTASsecdate[$j]=0;
    +		$totRISPOSTASspeeddate[$j]=0;
    +		$i=0;
    +		while ($i < $records_to_grab)
    +			{
    +			if ( ($at[$i] >= $daySTART[$j]) and ($at[$i] <= $dayEND[$j]) )
    +				{
    +				$totCALLS++;
    +				$totCALLSsec = ($totCALLSsec + $ls[$i]);
    +				$totCALLSsecDATE[$j] = ($totCALLSsecDATE[$j] + $ls[$i]);
    +	#			$qrtCALLS[$j]++;
    +	#			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
    +	#			$dtt = $dt[$i];
    +				$totCALLSdate[$j]++;
    +				if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
    +				if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
    +				if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) 
    +					{
    +					$totABANDONSdate[$j]++;
    +					$totABANDONSsecdate[$j]+=$ls[$i];
    +					$FtotABANDONS++;
    +					$FtotABANDONSsec+=$ls[$i];
    +					}
    +					else 
    +					{
    +					$totRISPOSTASdate[$j]++;
    +					$totRISPOSTASsecdate[$j]+=($ls[$i]-$qs[$i]-15);
    +					$totRISPOSTASspeeddate[$j]+=$qs[$i];
    +					$FtotRISPOSTAS++;
    +					$FtotRISPOSTASsec+=($ls[$i]-$qs[$i]-15);
    +					$FtotRISPOSTASspeeddate+=$qs[$i];
    +					}
    +				if (ereg('DROP',$st[$i])) 
    +					{
    +					$totDROPS++;
    +					$totDROPSsec = ($totDROPSsec + $ls[$i]);
    +					$totDROPSsecDATE[$j] = ($totDROPSsecDATE[$j] + $ls[$i]);
    +	#				$qrtDROPS[$j]++;
    +	#				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
    +					$totDROPSdate[$j]++;
    +	#				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
    +	#				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
    +					}
    +				if ($qs[$i] > 0) 
    +					{
    +					$totQUEUE++;
    +					$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
    +					$totQUEUEsecDATE[$j] = ($totQUEUEsecDATE[$j] + $qs[$i]);
    +	#				$qrtQUEUE[$j]++;
    +	#				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
    +					$totQUEUEdate[$j]++;
    +	#				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
    +	#				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
    +					}
    +	/*
    +				if ($qs[$i] == 0) {$hd__0[$j]++;}
    +				if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
    +				if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
    +				if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
    +				if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
    +				if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
    +				if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
    +				if ($qs[$i] > 120) {$hd121[$j]++;}
    +	*/
    +				}
    +			
    +			$i++;
    +			}
    +
    +		$j++;
    +		}
    +
    +
    +	###################################################
    +	### TOTALI SUMMARY SECTION ###
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$ASCII_text.="|                                           | TOTAL   | TOTAL    | TOTAL     | TOTAL   | AVG     | AVG    | AVG    | TOTAL      | TOTAL      | TOTAL      |\n";
    +	$ASCII_text.="| SHIFT                                     | CALLS   | CALLS    | CALLS     | ABANDON | ABANDON | RISPOSTA | TALK   | TALK       | WRAP       | CALL       |\n";
    +	$ASCII_text.="| DATE-TIME RANGE                           | OFFERED | RISPOSTAED | ABANDONED | PERCENT | TIME    | SPEED  | TIME   | TIME       | TIME       | TIME       |\n";
    +	$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
    +	$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
    +	$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"RISPOSTA\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
    +	$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"RISPOSTAED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
    +
    +	##########################
    +	$JS_text="\n";
    +
    +	if ($report_display_type=="HTML") 
    +		{
    +		$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
    +		}
    +	else
    +		{
    +		$MAIN.=$ASCII_text;
    +		}
    +
    +	if ($hi_hour_count < 1)
    +		{$hour_multiplier = 0;}
    +	else
    +		{$hour_multiplier = (20 / $hi_hour_count);}
    +	if ($hi_hold_count < 1)
    +		{$hold_multiplier = 0;}
    +	else
    +		{$hold_multiplier = (20 / $hi_hold_count);}
    +
    +
    +	$ENDtime = date("U");
    +	$RUNtime = ($ENDtime - $STARTtime);
    +	$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
    +	$MAIN.="
    \n"; + $MAIN.="
    \n"; + $MAIN.="\n"; + + if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "Inbound_Daily_Report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } + } + + + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php index 9ba4e4ef..25ddf027 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php @@ -105,7 +105,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_team_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_team_performance_detail.php new file mode 100644 index 00000000..2d2d3acf --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_team_performance_detail.php @@ -0,0 +1,1330 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110802-2041 - First build +# 110804-0049 - Added First Call Resolution +# 111104-1259 - Added user_group restrictions for selecting in-groups +# 120224-1424 - Added new colums and PRECAL to System Time +# 120307-1926 - Added additional statuses option and HTML display option +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];} + elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];} + elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["call_status"])) {$call_status=$_GET["call_status"];} + elseif (isset($_POST["call_status"])) {$call_status=$_POST["call_status"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + + +$report_name = 'Team Performance Dettagliata'; +$db_source = 'M'; +$JS_text.="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; + +$HTML_head.="\n"; +$HTML_head.="$report_name$group_S\n"; + +$HTML_text.="
    "; + +$HTML_text.="
    \n"; +$HTML_text.="\n"; + +$HTML_text.="\n"; + + +$HTML_text.="
    Date:
    "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="Date:
    \n"; + +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.=""; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    to
    "; + +$HTML_text.="\n"; + +$HTML_text.="   "; + +$HTML_text.="
    Campagnas:
    "; +$HTML_text.="\n"; + +$HTML_text.="
    Teams/Gruppi Utenti:
    "; +$HTML_text.="\n"; +$HTML_text.="
    Show additional statuses:
    "; +$HTML_text.="
    \n"; +$HTML_text.="Visualizzare as:
    "; +$HTML_text.="\n

    "; +$HTML_text.="\n"; +$HTML_text.="
            "; + +$HTML_text.="          \n"; +$HTML_text.="DOWNLOAD |"; +$HTML_text.=" REPORT \n"; +$HTML_text.="\n"; +$HTML_text.="
    "; +$HTML_text.="
    \n\n"; + +if ($INVIA=="INVIA") + { + # Sale counts per rep + $stmt="select max(event_time), vicidial_agent_log.user, vicidial_agent_log.lead_id, vicidial_list.status as current_status from vicidial_agent_log, vicidial_list where event_time>='$query_date' and event_time<='$end_date' $group_SQL and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' $group_SQL UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id group by vicidial_agent_log.user, vicidial_agent_log.lead_id"; + if ($DB) {$ASCII_text.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + while ($row=mysql_fetch_array($rslt)) + { + $lead_id=$row["lead_id"]; + $user=$row["user"]; + $current_status=$row["current_status"]; + if (eregi("QCCANC", $current_status)) + { + $cancel_array[$row["user"]]++; + } + else if (eregi("QCFAIL", $current_status)) + { + $incomplete_array[$row["user"]]++; + } + else + { + $sale_array[$row["user"]]++; + + # Get actual talk time for all calls made by the user for this particular lead. If cancelled and incomplete sales are to have their times + # counted towards sales talk time, move the below lines OUTSIDE the curly bracket below, so the query runs regardless of what "type" of + # sale it is. + $sale_time_stmt="select sum(talk_sec)-sum(dead_sec) from vicidial_agent_log where user='$user' and lead_id='$lead_id' $group_SQL"; + if ($DB) {$ASCII_text.="$sale_time_stmt\n";} + $sale_time_rslt=mysql_query($sale_time_stmt, $link); + $sale_time_row=mysql_fetch_row($sale_time_rslt); + $sales_talk_time_array[$row["user"]]+=$sale_time_row[0]; + } + } + + $HTML_text.="
    ";
    +	$total_average_sale_time=0;
    +	$total_average_contact_time=0;
    +	$total_talk_time=0; 
    +	$total_system_time=0; 
    +	$total_calls=0;	
    +	$total_leads=0;
    +	$total_contacts=0;
    +	$total_sales=0;
    +	$total_inc_sales=0;
    +	$total_cnc_sales=0;
    +	$total_callbacks=0;
    +	$total_stcall=0;
    +	for ($q=0; $q".$call_status[$q]."";
    +	}
    +	$total_graph_stats[]="";
    +	$max_totalcalls=1;
    +	$max_totalleads=1;
    +	$max_totalcontacts=1;
    +	$max_totalcontactratio=1;
    +	$max_totalsystemtime=1;
    +	$max_totaltalktime=1;
    +	$max_totalsales=1;
    +	$max_totalsalesleadsratio=1;
    +	$max_totalsalescontactsratio=1;
    +	$max_totalsalesperhour=1;
    +	$max_totalincsales=1;
    +	$max_totalcancelledsales=1;
    +	$max_totalcallbacks=1;
    +	$max_totalfirstcall=1;
    +	$max_totalavgsaletime=1;
    +	$max_totalavgcontacttime=1;
    +	$TOTALGRAPH="

    "; + $TOTALGRAPH2="".$GRAPH2.""; + $TOTALGRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $TOTALGRAPH_header=""; + $TOTALCALLS_graph=$TOTALGRAPH_header.""; + $TOTALLEADS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTS_graph=$TOTALGRAPH_header.""; + $TOTALCONTACTRATIO_graph=$TOTALGRAPH_header.""; + $TOTALIYSTEMTIME_graph=$TOTALGRAPH_header.""; + $TOTALTALKTIME_graph=$TOTALGRAPH_header.""; + $TOTALIALES_graph=$TOTALGRAPH_header.""; + $TOTALIALESLEADSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALIALESCONTACTSRATIO_graph=$TOTALGRAPH_header.""; + $TOTALIALESPERHOUR_graph=$TOTALGRAPH_header.""; + $TOTALINCSALES_graph=$TOTALGRAPH_header.""; + $TOTALCANCELLEDSALES_graph=$TOTALGRAPH_header.""; + $TOTALCALLBACKS_graph=$TOTALGRAPH_header.""; + $TOTALFIRSTCALLS_graph=$TOTALGRAPH_header.""; + $TOTALAVGSALETIME_graph=$TOTALGRAPH_header.""; + $TOTALAVGCONTACTTIME_graph=$TOTALGRAPH_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + for($i=0; $i<$user_group_ct; $i++) + { + $group_average_sale_time=0; + $group_average_contact_time=0; + $group_talk_time=0; + $group_system_time=0; + $group_nonpause_time=0; + $group_calls=0; + $group_leads=0; + $group_contacts=0; + $group_sales=0; + $group_inc_sales=0; + $group_cnc_sales=0; + $group_callbacks=0; + $group_stcall=0; + $name_stmt="select group_name from vicidial_user_groups where user_group='$user_group[$i]'"; + $name_rslt=mysql_query($name_stmt, $link); + $name_row=mysql_fetch_row($name_rslt); + $group_name=$name_row[0]; + for ($q=0; $q0) + { + $graph_stats=array(); + $max_calls=1; + $max_leads=1; + $max_contacts=1; + $max_contactratio=1; + $max_systemtime=1; + $max_talktime=1; + $max_sales=1; + $max_salesleadsratio=1; + $max_salescontactsratio=1; + $max_salesperhour=1; + $max_incsales=1; + $max_cancelledsales=1; + $max_callbacks=1; + $max_firstcall=1; + $max_avgsaletime=1; + $max_avgcontacttime=1; + $GRAPH="

    CALL CENTER TOTAL
    UTENTECALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    "; + $STATGRAPH=""; + for ($q=0; $q".$call_status[$q].""; + $max_varname="max_".$call_status[$q]; + $$max_varname=1; + } + + $GRAPH2="".$STATGRAPH.""; + $GRAPH3="
    CALLSLEADSCONTACTSCONTACT RATIOSYSTEM TIMETALK TIMESALESSALES TO LEADS RATIOSALES TO CONTACTS RATIOSALES PER HOURINCOMPLETE SALESCANCELLED SALESCALLBACKSFIRST CALLSAVG SALE TIMEAVG CONTACT TIME

     


    "; + $graph_header=""; + $CALLS_graph=$graph_header.""; + $LEADS_graph=$graph_header.""; + $CONTACTS_graph=$graph_header.""; + $CONTACTRATIO_graph=$graph_header.""; + $SYSTEMTIME_graph=$graph_header.""; + $TALKTIME_graph=$graph_header.""; + $SALES_graph=$graph_header.""; + $SALESLEADSRATIO_graph=$graph_header.""; + $SALESCONTACTSRATIO_graph=$graph_header.""; + $SALESPERHOUR_graph=$graph_header.""; + $INCSALES_graph=$graph_header.""; + $CANCELLEDSALES_graph=$graph_header.""; + $CALLBACKS_graph=$graph_header.""; + $FIRSTCALLS_graph=$graph_header.""; + $AVGSALETIME_graph=$graph_header.""; + $AVGCONTACTTIME_graph=$graph_header.""; + for ($q=0; $q".$call_status[$q].""; + } + + $j=0; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |$HTMLstatusheader\n"; + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"$CSVstatusheader\n"; + while ($user_row=mysql_fetch_array($user_rslt)) + { + $j++; + $contacts=0; + $callbacks=0; + $stcall=0; + $calls=0; + $leads=0; + $system_time=0; + $talk_time=0; + $nonpause_time=0; + # For each user + $user=$user_row["user"]; + $sale_array[$user]+=0; # For agents with no sales logged + $incomplete_array[$user]+=0; # For agents with no QCFAIL logged + $cancel_array[$user]+=0; # For agents with no QCCANC logged + + # Leads + $lead_stmt="select count(distinct lead_id) from vicidial_agent_log where lead_id is not null and event_time>='$query_date' and event_time<='$end_date' $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$lead_stmt\n";} + $lead_rslt=mysql_query($lead_stmt, $link); + $lead_row=mysql_fetch_row($lead_rslt); + $leads=$lead_row[0]; + + # Callbacks + $callback_stmt="select count(*) from vicidial_callbacks where status in ('ACTIVE', 'LIVE') $group_SQL and user='$user' and user_group='$user_group[$i]'"; + if ($DB) {$ASCII_text.="$callback_stmt\n";} + $callback_rslt=mysql_query($callback_stmt, $link); + $callback_row=mysql_fetch_row($callback_rslt); + $callbacks=$callback_row[0]; + + $stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact"; + if ($DB) {$ASCII_text.="$stat_stmt\n";} + $stat_rslt=mysql_query($stat_stmt, $link); + while ($stat_row=mysql_fetch_row($stat_rslt)) + { + if ($stat_row[2]=="Y") + { + $contacts+=$stat_row[8]; + $contact_talk_time+=($stat_row[3]-$stat_row[7]); + + $group_contact_talk_time+=($stat_row[3]-$stat_row[7]); + } + # if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];} + $calls+=$stat_row[8]; + $talk_time+=($stat_row[3]-$stat_row[7]); + $system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + $nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]); + if ($stat_row[1]=="PRECAL") + { + $nonpause_time+=$stat_row[4]; + } + } + $user_talk_time = sec_convert($talk_time,'H'); + $group_talk_time+=$talk_time; + $user_system_time = sec_convert($system_time,'H'); + $talk_hours=$talk_time/3600; + $group_system_time+=$system_time; + $user_nonpause_time = sec_convert($nonpause_time,'H'); + $group_nonpause_time+=$nonpause_time; + + if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";} + $group_sales_talk_time+=$sales_talk_time_array[$user]; + if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";} + + $ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]); + $ASCII_text.=" | ".sprintf("%10s", "$user").""; + $ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls; + $ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads; + $ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts; + if ($leads>0) + { + $contact_ratio=sprintf("%.2f", (100*$contacts/$leads)); + } + else + { + $contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time); + $ASCII_text.=" | ".sprintf("%11s", $user_system_time); + $ASCII_text.=" | ".sprintf("%9s", $user_talk_time); + $ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user]; + if ($nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($leads>0) + { + $sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads)); + } + else + { + $sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%"; + if ($contacts>0) + { + $sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts)); + } + else + { + $sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%"; + if ($talk_hours>0) + { + $sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours)); + } + else + { + $sales_per_hour="0.00"; + } + if ( ($calls>0) and ($leads>0) ) + { + $stcall=sprintf("%.2f", ($calls/$leads)); + } + else + { + $stcall="0.00"; + } + + if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;} + if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;} + $graph_stats[$j][0]=$user_row["full_name"]." - $user"; + $graph_stats[$j][1]=trim($calls); + $graph_stats[$j][2]=trim($leads); + $graph_stats[$j][3]=trim($contacts); + $graph_stats[$j][4]=trim($contact_ratio); + $graph_stats[$j][5]=trim($system_time); + $graph_stats[$j][6]=trim($talk_time); + $graph_stats[$j][7]=trim($sale_array[$user]); + $graph_stats[$j][8]=trim($sales_ratio); + $graph_stats[$j][9]=trim($sale_contact_ratio); + $graph_stats[$j][10]=trim($sales_per_hour); + $graph_stats[$j][11]=trim($incomplete_array[$user]); + $graph_stats[$j][12]=trim($cancel_array[$user]); + $graph_stats[$j][13]=trim($callbacks); + $graph_stats[$j][14]=trim($stcall); + $graph_stats[$j][15]=trim($avg_sale_time); + $graph_stats[$j][16]=trim($avg_contact_time); + + if (trim($calls)>$max_calls) {$max_calls=trim($calls);} + if (trim($leads)>$max_leads) {$max_leads=trim($leads);} + if (trim($contacts)>$max_contacts) {$max_contacts=trim($contacts);} + if (trim($contact_ratio)>$max_contactratio) {$max_contactratio=trim($contact_ratio);} + if (trim($system_time)>$max_systemtime) {$max_systemtime=trim($system_time);} + if (trim($talk_time)>$max_talktime) {$max_talktime=trim($talk_time);} + if (trim($sale_array[$user])>$max_sales) {$max_sales=trim($sale_array[$user]);} + if (trim($sales_ratio)>$max_salesleadsratio) {$max_salesleadsratio=trim($sales_ratio);} + if (trim($sale_contact_ratio)>$max_salescontactsratio) {$max_salescontactsratio=trim($sale_contact_ratio);} + if (trim($sales_per_hour)>$max_salesperhour) {$max_salesperhour=trim($sales_per_hour);} + if (trim($incomplete_array[$user])>$max_incsales) {$max_incsales=trim($incomplete_array[$user]);} + if (trim($cancel_array[$user])>$max_cancelledsales) {$max_cancelledsales=trim($cancel_array[$user]);} + if (trim($callbacks)>$max_callbacks) {$max_callbacks=trim($callbacks);} + if (trim($stcall)>$max_firstcall) {$max_firstcall=trim($stcall);} + if (trim($avg_sale_time)>$max_avgsaletime) {$max_avgsaletime=trim($avg_sale_time);} + if (trim($avg_contact_time)>$max_avgcontacttime) {$max_avgcontacttime=trim($avg_contact_time);} + + $ASCII_text.=" | ".sprintf("%14s", $sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $incomplete_array[$user]); $group_inc_sales+=$incomplete_array[$user]; + $ASCII_text.=" | ".sprintf("%15s", $cancel_array[$user]); $group_cnc_sales+=$cancel_array[$user]; + $ASCII_text.=" | ".sprintf("%9s", $callbacks); $group_callbacks+=$callbacks; + $ASCII_text.=" | ".sprintf("%21s", $stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$Sstatus"; + + $max_varname="max_".$call_status[$q]; + if ($stat_row[0]>$$max_varname) {$$max_varname=$stat_row[0];} + } + $ASCII_text.="\n"; + + $CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"$CSV_status_text\n"; + } + + ##### GROUP TOTALI ############# + if ($group_sales>0) + { + $group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H'); + } + else + { + $group_average_sale_time="00:00:00"; + } + if ($group_contacts>0) + { + $group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H'); + } + else + { + $group_average_contact_time="00:00:00"; + } + $group_talk_hours=$group_talk_time/3600; + + $GROUP_text.="| ".sprintf("%40s", "$group_name"); + $GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]"); + $total_graph_stats[$i][0]="$user_group[$i] - $group_name"; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALI:"); + + $TOTAL_text=" | ".sprintf("%5s", $group_calls); + $TOTAL_text.=" | ".sprintf("%5s", $group_leads); + $TOTAL_text.=" | ".sprintf("%8s", $group_contacts); + if ($group_leads>0) + { + $group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads)); + } + else + { + $group_contact_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%"; + $TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H')); + $TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H')); + $TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H')); + $TOTAL_text.=" | ".sprintf("%5s", $group_sales); + if ($group_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($group_leads>0) + { + $group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads)); + } + else + { + $group_sales_ratio="0.00"; + } + $TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%"; + if ($group_contacts>0) + { + $group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts)); + } + else + { + $group_sale_contact_ratio=0; + } + $TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%"; + if ($group_talk_hours>0) + { + $group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours)); + } + else + { + $group_sales_per_hour="0.00"; + } + if ( ($group_calls>0) and ($group_leads>0) ) + { + $group_stcall=sprintf("%.2f", ($group_calls/$group_leads)); + } + else + { + $group_stcall="0.00"; + } + $TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour); + $TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales); + $TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales); + $TOTAL_text.=" | ".sprintf("%9s", $group_callbacks); + $TOTAL_text.=" | ".sprintf("%21s", $group_stcall); # first call resolution + $TOTAL_text.=" | ".sprintf("%17s", $group_average_sale_time); + $TOTAL_text.=" | ".sprintf("%20s", $group_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q$$max_varname) {$$max_varname=$call_status_group_totals[$q];} + } + $TOTAL_text.="\n"; + + if (trim($group_calls)>$max_totalcalls) {$max_totalcalls=trim($group_calls);} + if (trim($group_leads)>$max_totalleads) {$max_totalleads=trim($group_leads);} + if (trim($group_contacts)>$max_totalcontacts) {$max_totalcontacts=trim($group_contacts);} + if (trim($group_contact_ratio)>$max_totalcontactratio) {$max_totalcontactratio=trim($group_contact_ratio);} + if (trim($group_system_time)>$max_totalsystemtime) {$max_totalsystemtime=trim($group_system_time);} + if (trim($group_talk_time)>$max_totaltalktime) {$max_totaltalktime=trim($group_talk_time);} + if (trim($group_sales)>$max_totalsales) {$max_totalsales=trim($group_sales);} + if (trim($group_sales_ratio)>$max_totalsalesleadsratio) {$max_totalsalesleadsratio=trim($group_sales_ratio);} + if (trim($group_sale_contact_ratio)>$max_totalsalescontactsratio) {$max_totalsalescontactsratio=trim($group_sale_contact_ratio);} + if (trim($group_sales_per_hour)>$max_totalsalesperhour) {$max_totalsalesperhour=trim($group_sales_per_hour);} + if (trim($group_inc_sales)>$max_totalincsales) {$max_totalincsales=trim($group_inc_sales);} + if (trim($group_cnc_sales)>$max_totalcancelledsales) {$max_totalcancelledsales=trim($group_cnc_sales);} + if (trim($group_callbacks)>$max_totalcallbacks) {$max_totalcallbacks=trim($group_callbacks);} + if (trim($group_stcall)>$max_totalfirstcall) {$max_totalfirstcall=trim($group_stcall);} + if (trim($group_avg_sale_time)>$max_totalavgsaletime) {$max_totalavgsaletime=trim($group_avg_sale_time);} + if (trim($group_avg_contact_time)>$max_totalavgcontacttime) {$max_totalavgcontacttime=trim($group_avg_contact_time);} + $total_graph_stats[$i][1]=$group_calls; + $total_graph_stats[$i][2]=$group_leads; + $total_graph_stats[$i][3]=$group_contacts; + $total_graph_stats[$i][4]=$group_contact_ratio; + $total_graph_stats[$i][5]=$group_system_time; + $total_graph_stats[$i][6]=$group_talk_time; + $total_graph_stats[$i][7]=$group_sales; + $total_graph_stats[$i][8]=$group_sales_ratio; + $total_graph_stats[$i][9]=$group_sale_contact_ratio; + $total_graph_stats[$i][10]=$group_sales_per_hour; + $total_graph_stats[$i][11]=$group_inc_sales; + $total_graph_stats[$i][12]=$group_cnc_sales; + $total_graph_stats[$i][13]=$group_callbacks; + $total_graph_stats[$i][14]=$group_stcall; + $total_graph_stats[$i][15]=$group_avg_sale_time; + $total_graph_stats[$i][16]=$group_avg_contact_time; + + $ASCII_text.=$TOTAL_text; + $GROUP_text.=$TOTAL_text; + + $ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n"; + $ASCII_text.="\n\n"; + + $CSV_text.="\"\",\"\",\"TOTALI:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"$CSV_status_text\n"; + $CSV_text.="\n\n"; + + $total_calls+=$group_calls; + $total_leads+=$group_leads; + $total_contacts+=$group_contacts; + $total_system_time+=$group_system_time; + $total_nonpause_time+=$group_nonpause_time; + $total_talk_time+=$group_talk_time; + $total_sales+=$group_sales; + $total_inc_sales+=$group_inc_sales; + $total_cnc_sales+=$group_cnc_sales; + $total_callbacks+=$group_callbacks; + $total_stcall+=$group_stcall; # first call resolution + $total_sales_talk_time+=$group_sales_talk_time; + $total_contact_talk_time+=$group_contact_talk_time; + + for ($d=1; $d<=count($graph_stats); $d++) { + if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";} + $CALLS_graph.=" "; + $LEADS_graph.=" "; + $CONTACTS_graph.=" "; + $CONTACTRATIO_graph.=" "; + $SYSTEMTIME_graph.=" "; + $TALKTIME_graph.=" "; + $SALES_graph.=" "; + $SALESLEADSRATIO_graph.=" "; + $SALESCONTACTSRATIO_graph.=" "; + $SALESPERHOUR_graph.=" "; + $INCSALES_graph.=" "; + $CANCELLEDSALES_graph.=" "; + $CALLBACKS_graph.=" "; + $FIRSTCALLS_graph.=" "; + $AVGSALETIME_graph.=" "; + $AVGCONTACTTIME_graph.=" "; + for ($e=0; $e\n"; + + $$varname.=" "; + } + } + + $CALLS_graph.="
    TEAM: $user_group[$i] - $group_name
    UTENTECALLS
    LEADS
    CONTACTS
    CONTACT RATIO
    SYSTEM TIME
    TALK TIME
    SALES
    SALES TO LEADS RATIO
    SALES TO CONTACTS RATIO
    SALES PER HOUR
    INCOMPLETE SALES
    CANCELLED SALES
    CALLBACKS
    FIRST CALLS
    AVG SALE TIME
    AVG CONTACT TIME
    ".$graph_stats[$d][0]."".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."%
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][5], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][6], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][7]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][8]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][9]."%
    ".$graph_stats[$d][0]."".$graph_stats[$d][10]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][11]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][12]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][13]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][14]."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][15], 'H')."
    ".$graph_stats[$d][0]."".sec_convert($graph_stats[$d][16], 'H')."
    ".$graph_stats[$d][0]."".$graph_stats[$d][($e+17)]."
    TOTAL:".trim($group_calls)."
    "; + $LEADS_graph.="
    TOTAL:".trim($group_leads)."
    "; + $CONTACTS_graph.="
    TOTAL:".trim($group_contacts)."
    "; + $CONTACTRATIO_graph.="
    TOTAL:".trim($group_contact_ratio)."%
    "; + $SYSTEMTIME_graph.="
    TOTAL:".sec_convert($group_system_time,'H')."
    "; + $TALKTIME_graph.="
    TOTAL:".sec_convert($group_talk_time,'H')."
    "; + $SALES_graph.="
    TOTAL:".trim($group_sales)."
    "; + $SALESLEADSRATIO_graph.="TOTAL:".trim($group_sales_ratio)."%"; + $SALESCONTACTSRATIO_graph.="TOTAL:".trim($group_sale_contact_ratio)."%"; + $SALESPERHOUR_graph.="TOTAL:".trim($group_sales_per_hour).""; + $INCSALES_graph.="TOTAL:".trim($group_inc_sales).""; + $CANCELLEDSALES_graph.="TOTAL:".trim($group_cnc_sales).""; + $CALLBACKS_graph.="TOTAL:".trim($group_callbacks).""; + $FIRSTCALLS_graph.="TOTAL:".trim($group_stcall).""; + $AVGSALETIME_graph.="TOTAL:".trim($group_average_sale_time).""; + $AVGCONTACTTIME_graph.="TOTAL:".trim($group_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDraw".$user_group[$i]."Graph('CALLS', '1');\n"; + $JS_text.="function Draw".$user_group[$i]."Graph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$LEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$CONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$CONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$SYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$SALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$SALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$SALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$INCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$CANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$CALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$FIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$AVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$AVGCONTACTTIME_graph\";\n"; + $JS_text.="\n"; + for ($e=0; $e0) + { + $total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H'); + } + else + { + $total_average_sale_time="00:00:00"; + } + if ($total_contacts>0) + { + $total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H'); + } + else + { + $total_average_contact_time="00:00:00"; + } + $total_talk_hours=$total_talk_time/3600; + + $ASCII_text.="| ".sprintf("%40s", ""); + $ASCII_text.=" | ".sprintf("%10s", "TOTALI:"); + $ASCII_text.=" | ".sprintf("%5s", $total_calls); + $ASCII_text.=" | ".sprintf("%5s", $total_leads); + $ASCII_text.=" | ".sprintf("%8s", $total_contacts); + if ($total_leads>0) + { + $total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads)); + } + else + { + $total_contact_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%"; + $ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H')); + $ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H')); + $ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H')); + $ASCII_text.=" | ".sprintf("%5s", $total_sales); + if ($total_nonpause_time>0) + { + $sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600))); + } + else + { + $sales_per_working_hours="0.00"; + } + $ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours); + if ($total_leads>0) + { + $total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads)); + } + else + { + $total_sales_ratio="0.00"; + } + $ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%"; + if ($total_contacts>0) + { + $total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts)); + } + else + { + $total_sale_contact_ratio=0; + } + $ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%"; + if ($total_talk_hours>0) + { + $total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours)); + } + else + { + $total_sales_per_hour="0.00"; + } + if ( ($total_calls>0) and ($total_leads>0) ) + { + $total_stcall=sprintf("%.2f", ($total_calls/$total_leads)); + } + else + { + $total_stcall="0.00"; + } + $ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour); + $ASCII_text.=" | ".sprintf("%16s", $total_inc_sales); + $ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales); + $ASCII_text.=" | ".sprintf("%9s", $total_callbacks); + $ASCII_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution + $ASCII_text.=" | ".sprintf("%17s", $total_average_sale_time); + $ASCII_text.=" | ".sprintf("%20s", $total_average_contact_time)." |"; + + $CSV_status_text=""; + for ($q=0; $q".$total_graph_stats[$d][1].""; + $TOTALLEADS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][2].""; + $TOTALCONTACTS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][3].""; + $TOTALCONTACTRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][4]."%"; + $TOTALIYSTEMTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][5], 'H').""; + $TOTALTALKTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][6], 'H').""; + $TOTALIALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][7].""; + $TOTALIALESLEADSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][8]."%"; + $TOTALIALESCONTACTSRATIO_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][9]."%"; + $TOTALIALESPERHOUR_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][10].""; + $TOTALINCSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][11].""; + $TOTALCANCELLEDSALES_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][12].""; + $TOTALCALLBACKS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][13].""; + $TOTALFIRSTCALLS_graph.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][14].""; + $TOTALAVGSALETIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][15], 'H').""; + $TOTALAVGCONTACTTIME_graph.=" ".$total_graph_stats[$d][0]."".sec_convert($total_graph_stats[$d][16], 'H').""; + + for ($e=0; $e\n"; + + $$varname.=" ".$total_graph_stats[$d][0]."".$total_graph_stats[$d][($e+17)].""; + } + + } + + $TOTALCALLS_graph.="TOTAL:".trim($total_calls).""; + $TOTALLEADS_graph.="TOTAL:".trim($total_leads).""; + $TOTALCONTACTS_graph.="TOTAL:".trim($total_contacts).""; + $TOTALCONTACTRATIO_graph.="TOTAL:".trim($total_contact_ratio)."%"; + $TOTALIYSTEMTIME_graph.="TOTAL:".sec_convert($total_system_time,'H').""; + $TOTALTALKTIME_graph.="TOTAL:".sec_convert($total_talk_time,'H').""; + $TOTALIALES_graph.="TOTAL:".trim($total_sales).""; + $TOTALIALESLEADSRATIO_graph.="TOTAL:".trim($total_sales_ratio)."%"; + $TOTALIALESCONTACTSRATIO_graph.="TOTAL:".trim($total_sale_contact_ratio)."%"; + $TOTALIALESPERHOUR_graph.="TOTAL:".trim($total_sales_per_hour).""; + $TOTALINCSALES_graph.="TOTAL:".trim($total_inc_sales).""; + $TOTALCANCELLEDSALES_graph.="TOTAL:".trim($total_cnc_sales).""; + $TOTALCALLBACKS_graph.="TOTAL:".trim($total_callbacks).""; + $TOTALFIRSTCALLS_graph.="TOTAL:".trim($total_stcall).""; + $TOTALAVGSALETIME_graph.="TOTAL:".trim($total_average_sale_time).""; + $TOTALAVGCONTACTTIME_graph.="TOTAL:".trim($total_average_contact_time).""; + for ($e=0; $e"; + } + $JS_onload.="\tDrawTotalGraph('CALLS', '1');\n"; + $JS_text.="function DrawTotalGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$TOTALCALLS_graph\";\n"; + $JS_text.=" var LEADS_graph=\"$TOTALLEADS_graph\";\n"; + $JS_text.=" var CONTACTS_graph=\"$TOTALCONTACTS_graph\";\n"; + $JS_text.=" var CONTACTRATIO_graph=\"$TOTALCONTACTRATIO_graph\";\n"; + $JS_text.=" var SYSTEMTIME_graph=\"$TOTALIYSTEMTIME_graph\";\n"; + $JS_text.=" var TALKTIME_graph=\"$TOTALTALKTIME_graph\";\n"; + $JS_text.=" var SALES_graph=\"$TOTALIALES_graph\";\n"; + $JS_text.=" var SALESLEADSRATIO_graph=\"$TOTALIALESLEADSRATIO_graph\";\n"; + $JS_text.=" var SALESCONTACTSRATIO_graph=\"$TOTALIALESCONTACTSRATIO_graph\";\n"; + $JS_text.=" var SALESPERHOUR_graph=\"$TOTALIALESPERHOUR_graph\";\n"; + $JS_text.=" var INCSALES_graph=\"$TOTALINCSALES_graph\";\n"; + $JS_text.=" var CANCELLEDSALES_graph=\"$TOTALCANCELLEDSALES_graph\";\n"; + $JS_text.=" var CALLBACKS_graph=\"$TOTALCALLBACKS_graph\";\n"; + $JS_text.=" var FIRSTCALLS_graph=\"$TOTALFIRSTCALLS_graph\";\n"; + $JS_text.=" var AVGSALETIME_graph=\"$TOTALAVGSALETIME_graph\";\n"; + $JS_text.=" var AVGCONTACTTIME_graph=\"$TOTALAVGCONTACTTIME_graph\";\n"; + for ($e=0; $e0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_team_performance_detail_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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; + } +else + { + header("Content-type: text/html; charset=utf-8"); + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + if ($report_display_type=="HTML") + { + $HTML_text.=$GRAPH_text; + } + else + { + $HTML_text.=$ASCII_text; + } + + echo $HTML_head; + echo $JS_text; + $short_header=1; + require("admin_header.php"); + echo $HTML_text; + flush(); + } +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php index f06ce1c4..658fc2a9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -69,10 +69,17 @@ # 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # 101024-0832 - Added Agent time stats option and agents-in-dispo counter +# 101109-1448 - Added Auto Hopper Level display (MikeC) +# 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries +# 110303-2125 - Added agent on-hook phone indication and RING status and color +# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries +# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-1934 - Added user group options # -$version = '2.4-60'; -$build = '101024-0832'; +$version = '2.4-67'; +$build = '120223-1934'; header ("Content-type: text/html; charset=utf-8"); @@ -138,6 +145,15 @@ if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];} + elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];} +if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];} + elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];} +if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];} + elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];} +if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} + elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} + $report_name = 'Real-Time Main Report'; $db_source = 'M'; @@ -171,6 +187,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} if (!isset($group)) {$group='ALL-ACTIVE';} +if (!isset($user_group_filter)) {$user_group_filter='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -257,7 +274,6 @@ $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); $epochTWENTYFOURhoursAGO = ($STARTtime - 86400); $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); - $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -281,6 +297,86 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +if ($auth) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,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' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; + + $LOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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;} + + } + # and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) { @@ -291,12 +387,14 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="SELECT realtime_block_user_info,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +$stmt="SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $realtime_block_user_info = $row[0]; $LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} @@ -309,7 +407,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -359,6 +457,22 @@ while($i < $group_ct) } $group_SQL = eregi_replace(",$",'',$group_SQL); +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group_filter); +while($i < $user_group_ct) + { +# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) +# { + $user_group_string .= "$user_group_filter[$i]|"; + $user_group_SQL .= "'$user_group_filter[$i]',"; + $usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]"; +# } + + $i++; + } +$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + ### if no campaigns selected, display all if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { @@ -367,6 +481,13 @@ if ( ($group_ct < 1) or (strlen($group_string) < 2) ) $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } +### if no user groups selected, display all +if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) + { + $user_group_filter[0] = 'ALL-GROUPS'; + $user_group_string = '|ALL-GROUPS|'; + $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -388,14 +509,40 @@ else $group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)"; } +### USER GROUP STUFF +if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $all_active_groups = 0; + $user_group_SQL = "''"; +# $user_group_SQLand = "and FALSE"; +# $user_group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-GROUPS',$user_group_string) ) + { + $all_active_groups = 1; +# $user_group_SQL = ''; + $user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; +# $group_SQLand = "and campaign_id IN($allactivecampaigns)"; +# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; + } +else + { + $all_active_groups = 0; +# $user_group_SQLand = "and user_group IN($user_group_SQL)"; +# $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; + } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} if ($DB) {echo "$stmt\n";} $usergroups_to_print = mysql_num_rows($rslt); $i=0; +$usergroups[$i]='ALL-GROUPS'; +$usergroupnames[$i] = 'All user groups'; +$i++; +$usergroups_to_print++; while ($i < $usergroups_to_print) { $row=mysql_fetch_row($rslt); @@ -422,6 +569,20 @@ while ($groups_to_print > $o) } $select_list .= ""; $select_list .= "
    (Per selezionare più di campagna 1, tenere premuto il tasto Ctrl e fare clic su)"; + +$select_list .= "

    Select Gruppi Utenti:
    "; +$select_list .= ""; + $select_list .= ""; $select_list .= "Chiudi pannello

    "; $select_list .= ""; @@ -521,7 +682,7 @@ if ($presets_enabled_count > 0) if ($presets_enabled > 0) { $select_list .= "
    "; - $select_list .= "Show Presets Stats:
    "; - -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Real-Time Report                                                                               \n"; -echo "\n"; -echo "
    \n"; -echo "Scegli Opzioni di visualizzazione Relazione"; -echo "
    \n"; -echo "
    \n"; -echo "\n"; -echo "   "; -echo "\n"; -echo "STOP | "; -echo "PIU LENTO | "; -echo "INIZIA"; -if (eregi('ALL-ACTIVE',$group_string)) +if ($RTajax < 1) { - echo "       MODIFICA | \n"; - } -else - { - echo "       MODIFICA | \n"; - } -echo "RIEPILOGO \n"; -echo "\n\n"; + echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1593,7 +1774,7 @@ else echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1680,63 +1861,67 @@ echo ""; echo ""; 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Real-Time Report                                                                               \n"; + echo "\n"; + echo "
    \n"; + echo "Scegli Opzioni di visualizzazione Relazione"; + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "   "; + echo "\n"; + echo "STOP | "; + echo "PIU LENTO | "; + echo "INIZIA"; + if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       MODIFICA | \n"; + } + else + { + echo "       MODIFICA | \n"; + } + echo "RIEPILOGO \n"; + echo "\n\n"; + } if (!$group) {echo "

    per favore seleziona una campagna dal menu qui in alto\n"; exit;} @@ -1435,7 +1611,7 @@ else else {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y' $group_SQLand;"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } @@ -1448,13 +1624,13 @@ else $multi_drop++; if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { - $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; + $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } @@ -1484,6 +1660,7 @@ else $DIALstatuses = $row[18]; $agent_pause_codes_active = $row[19]; $DIALmix = $row[20]; + $AHOPlev = $row[21]; $stmt="select count(*) from vicidial_hopper $group_SQLwhere;"; @@ -1570,8 +1747,12 @@ else if ($adastats>1) { + $min_link='- min '; + if ($RTajax > 0) + {$min_link='';} + echo "
    - min   LIVELLO MAX:  $maxDIALlev   $min_link  LIVELLO MAX:  $maxDIALlev   ABBATTIMENTO MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    LIVELLO CODA CHIAMATE:  $HOPlev     HOPPER ( min/auto ):  $HOPlev / $AHOPlev     ABBATTUTE / RISPOSTE:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     ESITI:  $DIALstatuses     "; echo "$ingroup_detail"; -if ($adastats<2) +if ($RTajax < 1) { - echo "+ VIEW MORE"; - } -else - { - echo "+ VIEW LESS"; - } -if ($UGdisplay>0) - { - echo "       NASCONDI GRUPPI UTENTI"; - } -else - { - echo "       MOSTRA GRUPPI UTENTI"; - } -if ($SERVdisplay>0) - { - echo "       NASCONDI INFO SERVER"; - } -else - { - echo "       MOSTRA INFO SERVER"; - } -if ($CALLSdisplay>0) - { - echo "       NASCONDI WAITING CALLS"; - } -else - { - echo "       MOSTRA WAITING CALLS"; + if ($adastats<2) + { + echo "+ VIEW MORE"; + } + else + { + echo "+ VIEW LESS"; + } + if ($UGdisplay>0) + { + echo "       NASCONDI GRUPPI UTENTI"; + } + else + { + echo "       MOSTRA GRUPPI UTENTI"; + } + if ($SERVdisplay>0) + { + echo "       NASCONDI INFO SERVER"; + } + else + { + echo "       MOSTRA INFO SERVER"; + } + if ($CALLSdisplay>0) + { + echo "       NASCONDI WAITING CALLS"; + } + else + { + echo "       MOSTRA WAITING CALLS"; + } + + if ($ALLINGROUPstats>0) + { + echo "       NASCONDI IN-GROUP STATS"; + } + else + { + echo "       MOSTRA IN-GROUP STATS"; + } + if ($PHONEdisplay>0) + { + echo "       NASCONDI PHONES"; + } + else + { + echo "       MOSTRA PHONES"; + } + if ($CUSTPHONEdisplay>0) + { + echo "       NASCONDI CUSTPHONES"; + } + else + { + echo "       MOSTRA CUSTPHONES"; + } } -if ($ALLINGROUPstats>0) - { - echo "       NASCONDI IN-GROUP STATS"; - } -else - { - echo "       MOSTRA IN-GROUP STATS"; - } -if ($PHONEdisplay>0) - { - echo "       NASCONDI PHONES"; - } -else - { - echo "       MOSTRA PHONES"; - } -if ($CUSTPHONEdisplay>0) - { - echo "       NASCONDI CUSTPHONES"; - } -else - { - echo "       MOSTRA CUSTPHONES"; - } echo "
    "; @@ -1826,6 +2011,22 @@ $parked_to_print = mysql_num_rows($rslt); while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + $phone_temp = $row[2]; + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } if (eregi("LIVE",$row[0])) { @@ -1994,25 +2195,41 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; +if ($RTajax > 0) + {$HTphone = " PHONE |";} $HDuser = "------------------------+"; -$HTuser = " UTENTE "; +$HTuser = " UTENTE "; +if ($RTajax > 0) + {$HTuser = " UTENTE ";} if ($UidORname>0) { - $HTuser .= "MOSTRA ID "; + if ($RTajax > 0) + {$HTuser .= "MOSTRA ID ";} + else + { + $HTuser .= "MOSTRA ID "; + } } else { - $HTuser .= "MOSTRA NAME"; + if ($RTajax > 0) + {$HTuser .= "MOSTRA NAME";} + else + { + $HTuser .= "MOSTRA NAME"; + } } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " Utente Group |"; +$HTusergroup = " Utente Group |"; +if ($RTajax > 0) + {$HTusergroup = " Utente Group |";} $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -2026,9 +2243,13 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; +if ($RTajax > 0) + {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; -$HTcampaign = " CAMPAGNA |"; +$HTcampaign = " CAMPAGNA |"; +if ($RTajax > 0) + {$HTcampaign = " CAMPAGNA |";} $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -2115,7 +2336,11 @@ else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} -$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} +else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} + +$ring_agents=0; +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $talking_to_print = mysql_num_rows($rslt); @@ -2142,6 +2367,19 @@ $talking_to_print = mysql_num_rows($rslt); $Acallerid[$i] = $row[13]; $Alead_id[$i] = $row[14]; $Astate_change[$i] = $row[15]; + $Aon_hook_agent[$i] = $row[16]; + $Aring_callerid[$i] = $row[17]; + $Aagent_log_id[$i] = $row[18]; + $Aring_note[$i] = ' '; + + if ($Aon_hook_agent[$i] == 'Y') + { + $Aring_note[$i] = '*'; + $ring_agents++; + if (strlen($Aring_callerid[$i]) > 18) + {$Astatus[$i]="RING";} + } + ### 3-WAY Check ### if ($Alead_id[$i]!=0) @@ -2160,26 +2398,42 @@ $talking_to_print = mysql_num_rows($rslt); $i++; } -$callerids=''; -$pausecode=''; -$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$calls_to_list = mysql_num_rows($rslt); + $callerids=''; + $pausecode=''; + $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $calls_to_list = mysql_num_rows($rslt); if ($calls_to_list > 0) - { - $i=0; - while ($i < $calls_to_list) { - $row=mysql_fetch_row($rslt); - $callerids .= "$row[0]|"; - $VAClead_ids[$i] = $row[1]; - $VACphones[$i] = $row[2]; - $i++; + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[2]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[2]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[2] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[2] = preg_replace("/./",'X',$phone_temp);} + } + } + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } } - } -### Lookup phone logins + ### Lookup phone logins $i=0; while ($i < $talking_to_print) { @@ -2383,6 +2637,7 @@ $calls_to_list = mysql_num_rows($rslt); $call_time_MS = sec_convert($call_time_S,'M'); $call_time_MS = sprintf("%7s", $call_time_MS); + $call_time_MS = " $call_time_MS"; $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { @@ -2423,7 +2678,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); @@ -2455,6 +2711,13 @@ $calls_to_list = mysql_num_rows($rslt); if ($call_time_S >= 300) {$G=''; $EG='';} } + if ($Astatus[$i] == 'RING') + { + $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 0) {$G=''; $EG='';} + } + $L=''; $R=''; if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} @@ -2472,7 +2735,7 @@ $calls_to_list = mysql_num_rows($rslt); if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";} else {$SVD = "";} if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} @@ -2502,11 +2765,11 @@ $calls_to_list = mysql_num_rows($rslt); if ($realtime_block_user_info > 0) { - $Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } if ($realtime_block_user_info < 1) { - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } $j++; } @@ -2528,6 +2791,12 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; $Aecho .= " - Agent on a dead call\n"; + if ($ring_agents > 0) + { + $Aecho .= " - Agent phone ringing\n"; + $Aecho .= " * Denotes on-hook agent\n"; + } + if ($agent_ready > 0) {$B=''; $BG='';} if ($agent_ready > 4) {$B=''; $BG='';} if ($agent_ready > 9) {$B=''; $BG='';} @@ -2554,8 +2823,12 @@ $calls_to_list = mysql_num_rows($rslt); echo "
    $Cecho";
     	}
     
    +echo "
    "; + +if ($RTajax < 1) + { + echo "
    "; + } ?> - -
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php index 2fd9eb2c..6ae9b271 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -19,10 +19,12 @@ # 100709-1806 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101214-1142 - Added Agent time stats +# 110110-1327 - Changed campaign real-time link to the new realtime_report.php +# 110517-0059 - Added campaign type display option +# 110703-1854 - Added doanload option # -header ("Content-type: text/html; charset=utf-8"); - require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -34,12 +36,17 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["types"])) {$types=$_GET["types"];} + elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (!isset($RR)) {$gRRroup=4;} +if (!isset($types)) {$types='MOSTRA ALL CAMPAGNE';} $report_name = 'Real-Time Campagna Summary'; $db_source = 'M'; @@ -48,7 +55,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -67,7 +74,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } @@ -75,13 +82,13 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -95,13 +102,13 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; @@ -111,7 +118,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -128,10 +135,15 @@ if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; } -$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; +$campaign_typeSQL=''; +if ($types == 'AUTO-DIAL ONLY') {$campaign_typeSQL="and dial_method IN('RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE')";} +if ($types == 'MANUAL ONLY') {$campaign_typeSQL="and dial_method IN('MANUAL','INBOUND_MAN')";} +if ($types == 'INBOUND ONLY') {$campaign_typeSQL="and campaign_allow_inbound='Y'";} + +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL $campaign_typeSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; while ($i < $groups_to_print) @@ -143,62 +155,78 @@ while ($i < $groups_to_print) if (!isset($RR)) {$RR=4;} -?> +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; - .r1 {color: black; background-color: #FFCCCC} - .r2 {color: black; background-color: #FF9999} - .r3 {color: black; background-color: #FF6666} - .r4 {color: white; background-color: #FF0000} - .b1 {color: black; background-color: #CCCCFF} - .b2 {color: black; background-color: #9999FF} - .b3 {color: black; background-color: #6666FF} - .b4 {color: white; background-color: #0000FF} ---> - -\n"; -echo "$report_name\n"; +$HEADER.="\n"; +$HEADER.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$MAIN.="
    "; +$MAIN.=""; +$MAIN.="
    "; -echo "Real-Time All Campagne Summary           \n"; -echo "STOP | "; -echo "PIU LENTO | "; -echo "INIZIA "; -echo "       \n"; +$MAIN.="Real-Time All Campagne Summary       \n"; +$MAIN.="STOP | "; +$MAIN.="PIU LENTO | "; +$MAIN.="INIZIA "; +$MAIN.="     \n"; if ($adastats<2) { - echo "+ VISUALIZZA PIU DATI"; + $MAIN.="+ VISUALIZZA PIU DATI"; } else { - echo "- VISUALIZZA MENO DATI"; + $MAIN.="- VISUALIZZA MENO DATI"; } -echo "       REPORT"; -echo "

    \n\n"; +$MAIN.="      DOWNLOAD | REPORT"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.="\n"; +$MAIN.=""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.="
    LIVELLO CHIAMATE:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTRO:  $DIALfilter   DATA:   $NOW_TIME
    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; + +$CSV_text.="\"LIVELLO CHIAMATE:\",\"$DIALlev\",\"TRUNK SHORT/FILL:\",\"$balanceSHORT / $balanceFILL\",\"FILTRO:\",\"$DIALfilter\",\"TIME:\",\"$NOW_TIME\"\n"; if ($adastats>1) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"MAX LIVELLO:\",\"$maxDIALlev\",\"ABBATTIMENTO MAX:\",\"$DROPmax\",\"TARGET DIFF:\",\"$targetDIFF\",\"INTENSITY:\",\"$ADAintense\"\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"TIMEOUT CHIAMATA:\",\"$DIALtimeout\",\"TAPER TIME:\",\"$TAPERtime\",\"LOCAL TIME:\",\"$CALLtime\",\"AVAIL ONLY:\",\"$ADAavailonly\"\n"; } -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"CONTATTI CHIAMABILI:\",\"$DAleads\",\"CALLS TODAY:\",\"$callsTODAY\",\"MEDIA OPERATORI:\",\"$agentsONEMIN\",\"METODO CHIAMATA:\",\"$DIALmethod\"\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"LIVELLO CODA CHIAMATE:\",\"$HOPlev\",\"DROPPED / RISPOSTAED:\",\"$dropsTODAY / $answersTODAY\",\"DL DIFF:\",\"$diffONEMIN\",\"ESITI:\",\"$DIALstatuses\"\n"; -echo ""; -echo ""; -echo ""; +$MAIN.=""; +$MAIN.=""; -echo ""; -echo ""; -echo ""; + {$MAIN.="$drpctTODAY%";} +$MAIN.="    "; +$MAIN.=""; +$MAIN.=""; +$MAIN.=""; +$CSV_text.="\"CONTATTI IN CODA:\",\"$VDhop\",\"PERCENT ABBATTIMENTO:\",\"$drpctTODAY%\",\"DIFF:\",\"$diffpctONEMIN%\",\"ORDINE:\",\"$DIALorder\"\n"; -echo ""; -echo ""; +$MAIN.=""; -echo ""; -echo ""; +$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; + +if ($VSCagentcalls > 0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $CSV_text.="\"AGENT AVG WAIT:\",\"$avgwaitTODAY\",\"AVG CUSTTIME:\",\"$avgcustTODAY\",\"AVG ACW:\",\"$avgacwTODAY\",\"AVG PAUSE:\",\"$avgpauseTODAY\"\n"; + } + +$MAIN.=""; +$MAIN.=""; -echo ""; -echo "
    LIVELLO CHIAMATE:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTRO:  $DIALfilter   DATA:   $NOW_TIME
      LIVELLO MAX:  $maxDIALlev   ABBATTIMENTO MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
      LIVELLO MAX:  $maxDIALlev   ABBATTIMENTO MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
    TIMEOUT CHIAMATA:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    TIMEOUT CHIAMATA:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
    CONTATTI CHIAMABILI:  $DAleads     CHIAMATE OGGI:  $callsTODAY     MEDIA OPERATORI:  $agentsONEMIN     METODO CHIAMATA:  $DIALmethod    
    CONTATTI CHIAMABILI:  $DAleads     CHIAMATE OGGI:  $callsTODAY     MEDIA OPERATORI:  $agentsONEMIN     METODO CHIAMATA:  $DIALmethod    
    LIVELLO CODA CHIAMATE:  $HOPlev     ABBATTUTE / RISPOSTE:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     ESITI:  $DIALstatuses    
    LIVELLO CODA CHIAMATE:  $HOPlev     ABBATTUTE / RISPOSTE:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     ESITI:  $DIALstatuses    
    CONTATTI IN CODA:  $VDhop     PERCENT ABBATTIMENTO:  "; +$MAIN.="
    CONTATTI IN CODA:  $VDhop     PERCENT ABBATTIMENTO:  "; if ($drpctTODAY >= $DROPmax) - {echo "$drpctTODAY%";} + {$MAIN.="$drpctTODAY%";} else - {echo "$drpctTODAY%";} -echo "    DIFF:  $diffpctONEMIN%     ORDINE:  $DIALorder    
    DIFF:  $diffpctONEMIN%     ORDINE:  $DIALorder    
    "; +$MAIN.="
    "; if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) - {echo "$VSCcat1:   $VSCcat1tally       \n";} + {$MAIN.="$VSCcat1:   $VSCcat1tally       \n";} if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) - {echo "$VSCcat2:   $VSCcat2tally       \n";} + {$MAIN.="$VSCcat2:   $VSCcat2tally       \n";} if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) - {echo "$VSCcat3:   $VSCcat3tally       \n";} + {$MAIN.="$VSCcat3:   $VSCcat3tally       \n";} if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) - {echo "$VSCcat4:   $VSCcat4tally       \n";} -echo "
    "; + {$MAIN.="$VSCcat4:   $VSCcat4tally       \n";} +$MAIN.="
    AGENT AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; ### Header finish @@ -376,7 +465,7 @@ else $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysql_num_rows($rslt); if ($parked_to_print > 0) { @@ -410,17 +499,25 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 14) {$F=''; $FG='';} if ($campaign_allow_inbound > 0) - {echo "$NFB$out_total$NFE current active calls      \n";} + { + $MAIN.="$NFB$out_total$NFE current active calls      \n"; + $CSV_text.="\"$out_total current active calls\",\"\"\n"; + } else - {echo "$NFB$out_total$NFE calls being placed       \n";} + { + $MAIN.="$NFB$out_total$NFE calls being placed       \n"; + $CSV_text.="\"$NFB$out_total$NFE calls being placed\",\"\"\n"; + } - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + $MAIN.="$NFB$out_ring$NFE calls ringing         \n"; + $MAIN.="$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + $MAIN.="$NFB  $in_ivr$NFE calls in IVR       \n"; + $CSV_text.="\"$out_ring calls ringing\",\"$out_live calls waiting for agents\",\"$in_ivr calls in IVR\"\n"; } else { - echo " NESSUNA CHIAMATA IN ATTESA\n"; + $MAIN.=" NESSUNA CHIAMATA IN ATTESA\n"; + $CSV_text.="\"NO LIVE CALLS WAITING\"\n"; } @@ -435,7 +532,7 @@ $agent_total=0; $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 where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysql_num_rows($rslt); if ($talking_to_print > 0) { @@ -488,19 +585,21 @@ $talking_to_print = mysql_num_rows($rslt); if ($agent_ready > 9) {$B=''; $BG='';} if ($agent_ready > 14) {$B=''; $BG='';} - echo "\n
    \n"; + $MAIN.="\n
    \n"; - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
    ";
    -		echo "";
    +		$MAIN.="$NFB$agent_total$NFE agents logged in         \n";
    +		$MAIN.="$NFB$agent_incall$NFE agents in calls       \n";
    +		$MAIN.="$NFB$B  $agent_ready $BG$NFE agents waiting       \n";
    +		$MAIN.="$NFB$agent_paused$NFE paused agents       \n";
    +		$CSV_text.="\"$agent_total agents logged in\",\"$agent_incall agents in calls\",\"$agent_ready agents waiting\",\"$agent_paused paused agents\"\n\n";
    +				
    +		$MAIN.="
    ";
    +		$MAIN.="";
     	}
     	else
     	{
    -	echo " NESSUN OPERATORE AL TELEFONO
    \n"; + $MAIN.=" NESSUN OPERATORE AL TELEFONO
    \n"; + $CSV_text.="\"NO AGENTS ON CALLS\"\n\n"; } ################################################################################ @@ -511,18 +610,47 @@ $talking_to_print = mysql_num_rows($rslt); -echo "
    "; +$MAIN.="
    \n\n
    "; -echo "
    \n\n
    "; $k++; } +$MAIN.="\n\n
    "; +$MAIN.="\n"; +$MAIN.="
    \n"; +$MAIN.="\n"; + +$MAIN.="$db_source\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + header ("Content-type: text/html; charset=utf-8"); + + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + } -echo "$db_source\n"; ?> -
    - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonpark.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonpark.php index 817ffd23..3d8083e1 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonpark.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonpark.php @@ -155,7 +155,7 @@ $parked_to_print = mysql_num_rows($rslt); echo "\n\n"; echo "----------------------------------------------------------------------------------------"; echo "\n\n"; -echo "VICIDIAL: Agenti Time On Inbound Calls $NOW_TIME\n\n"; +echo "VICIDIAL: Agenti Time On Inbound Calls $NOW_TIME\n\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n"; echo "+------------|--------+------------+-----------------+---------------------+---------+\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin.php index 71cb561c..4d0d8c8b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -37,10 +38,13 @@ $reports_color = '#99FF33'; $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'; @@ -57,10 +61,13 @@ $reports_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'; ### comment this section out for colorful section headings @@ -82,10 +89,13 @@ $reports_color = '#E6E6E6'; $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'; ### @@ -93,10 +103,13 @@ $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 Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Liste Esiti Campagna Report, Esporta invita Relazione , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List'; +$Vreports = 'NONE, Real-Time Main Report, Real-Time Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Liste Esiti Campagna Report, Campagna Status List Report, Esporta invita Relazione, Export Leads Rapporto , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Team Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List, Dialer Inventory report, Maximum System Stats, Maximum Stats Dettagliata, Search Leads Logs'; -$UGreports = 'ALL REPORT, NONE, Real-Time Main Report, Real-Time Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Liste Esiti Campagna Report, Esporta invita Relazione , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List, Custom Report Links, CallCard Search'; +$UGreports = 'ALL REPORT, NONE, Real-Time Main Report, Real-Time Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Liste Esiti Campagna Report, Campagna Status List Report, Esporta invita Relazione , Export Leads Rapporto , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Team Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List, Dialer Inventory report, Custom Report Links, CallCard Search, Maximum System Stats, Maximum Stats Dettagliata, Search Leads Logs'; + +$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### @@ -325,16 +338,16 @@ 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_fast_rinfrescare"])) {$enable_fast_rinfrescare=$_GET["enable_fast_rinfrescare"];} + elseif (isset($_POST["enable_fast_rinfrescare"])) {$enable_fast_rinfrescare=$_POST["enable_fast_rinfrescare"];} 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["fast_rinfrescare_rate"])) {$fast_rinfrescare_rate=$_GET["fast_rinfrescare_rate"];} + elseif (isset($_POST["fast_rinfrescare_rate"])) {$fast_rinfrescare_rate=$_POST["fast_rinfrescare_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"];} @@ -599,8 +612,8 @@ 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["campaign_stats_rinfrescare"])) {$campaign_stats_rinfrescare=$_GET["campaign_stats_rinfrescare"];} + elseif (isset($_POST["campaign_stats_rinfrescare"])){$campaign_stats_rinfrescare=$_POST["campaign_stats_rinfrescare"];} 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"];} @@ -691,6 +704,8 @@ 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"];} @@ -1475,6 +1490,245 @@ if (isset($_GET["eht_minimum_prompt_seconds"])) {$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_rinfrescare"])) {$admin_modify_rinfrescare=$_GET["admin_modify_rinfrescare"];} + elseif (isset($_POST["admin_modify_rinfrescare"])) {$admin_modify_rinfrescare=$_POST["admin_modify_rinfrescare"];} +if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];} + elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];} +if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];} + elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];} +if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];} + elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];} +if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];} + elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];} +if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];} + elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];} +if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];} + elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];} +if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];} + elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];} +if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];} + elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];} +if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];} + elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];} +if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} + elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} +if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];} + elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];} +if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} + elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} +if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} + elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} +if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];} + elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} +if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} + elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} +if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];} + elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];} +if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];} + elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];} +if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];} + elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];} +if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];} + elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];} +if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];} + elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];} +if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];} + elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];} +if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];} + elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];} +if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];} + elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];} +if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];} + elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];} +if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];} + elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];} +if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];} + elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];} +if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];} + elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];} +if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];} + elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];} +if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];} + elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];} +if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];} + elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} +if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} + elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} +if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];} + elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];} +if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];} + elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];} +if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];} + elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];} +if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];} + elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];} +if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];} + elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];} +if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];} + elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];} +if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];} + elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];} +if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];} + elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];} +if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];} + elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];} +if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];} + elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];} +if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];} + elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];} +if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];} + elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];} +if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];} + elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];} +if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];} + elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];} +if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];} + elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];} +if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];} + elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];} +if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];} + elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];} +if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];} + elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];} +if (isset($_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["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($script_id)) {$script_id= strtoupper($script_id);} @@ -1488,7 +1742,7 @@ if (strlen($dial_status) > 0) ############################################# ##### 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 FROM system_settings;"; +$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 FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -1511,6 +1765,21 @@ if ($qm_conf_ct > 0) $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]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -1583,9 +1852,9 @@ if ($non_latin < 1) $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); - $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_fast_rinfrescare = ereg_replace("[^0-9]","",$enable_fast_rinfrescare); $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); - $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $fast_rinfrescare_rate = ereg_replace("[^0-9]","",$fast_rinfrescare_rate); $hopper_level = ereg_replace("[^0-9]","",$hopper_level); $hotkey = ereg_replace("[^0-9]","",$hotkey); $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); @@ -1617,7 +1886,6 @@ if ($non_latin < 1) $telnet_port = ereg_replace("[^0-9]","",$telnet_port); $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); $user_level = ereg_replace("[^0-9]","",$user_level); - $user_start = ereg_replace("[^0-9]","",$user_start); $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); @@ -1705,6 +1973,48 @@ if ($non_latin < 1) $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); + $admin_modify_rinfrescare = ereg_replace("[^0-9]","",$admin_modify_rinfrescare); + $nocache_admin = ereg_replace("[^0-9]","",$nocache_admin); + $generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten); + $queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled); + $modify_page = ereg_replace("[^0-9]","",$modify_page); + $on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time); + $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); + $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); + $callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit); + $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); + $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); + $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); + $pllb_grouping_limit = ereg_replace("[^0-9]","",$pllb_grouping_limit); + $did_ra_extensions_enabled = ereg_replace("[^0-9]","",$did_ra_extensions_enabled); + $modify_shifts = ereg_replace("[^0-9]","",$modify_shifts); + $modify_phones = ereg_replace("[^0-9]","",$modify_phones); + $modify_carriers = ereg_replace("[^0-9]","",$modify_carriers); + $modify_labels = ereg_replace("[^0-9]","",$modify_labels); + $modify_statuses = ereg_replace("[^0-9]","",$modify_statuses); + $modify_voicemail = ereg_replace("[^0-9]","",$modify_voicemail); + $modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore); + $modify_moh = ereg_replace("[^0-9]","",$modify_moh); + $modify_tts = ereg_replace("[^0-9]","",$modify_tts); + $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit); + $call_count_target = ereg_replace("[^0-9]","",$call_count_target); + $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats); + $contacts_enabled = ereg_replace("[^0-9]","",$contacts_enabled); + $contact_id = ereg_replace("[^0-9]","",$contact_id); + $office_num = ereg_replace("[^0-9]","",$office_num); + $cell_num = ereg_replace("[^0-9]","",$cell_num); + $other_num1 = ereg_replace("[^0-9]","",$other_num1); + $other_num2 = ereg_replace("[^0-9]","",$other_num2); + $modify_contacts = ereg_replace("[^0-9]","",$modify_contacts); + $callback_hours_block = ereg_replace("[^0-9]","",$callback_hours_block); + $modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level); + $admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data); + $max_calls_count = ereg_replace("[^0-9]","",$max_calls_count); + $report_rank = ereg_replace("[^0-9]","",$report_rank); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1736,12 +2046,13 @@ if ($non_latin < 1) $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); - $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $campaign_stats_rinfrescare = ereg_replace("[^NY]","",$campaign_stats_rinfrescare); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); $human_answered = ereg_replace("[^NY]","",$human_answered); $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound); $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); @@ -1775,7 +2086,6 @@ if ($non_latin < 1) $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); $is_webphone = ereg_replace("[^NY]","",$is_webphone); $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); - $use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid); $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); @@ -1788,9 +2098,22 @@ if ($non_latin < 1) $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper); + $auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper); $force_change_password = ereg_replace("[^NY]","",$force_change_password); $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); + $lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize); + $on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent); + $auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall); + $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); + $completed = ereg_replace("[^NY]","",$completed); + $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); + $inventory_report = ereg_replace("[^NY]","",$inventory_report); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1848,6 +2171,14 @@ if ($non_latin < 1) $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); + $queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause); + $per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes); + $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); + $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); + $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); + $action_xfer_cid = ereg_replace("[^0-9a-zA-Z]","",$action_xfer_cid); + $callback_list_calltime = ereg_replace("[^0-9a-zA-Z]","",$callback_list_calltime); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1863,6 +2194,7 @@ if ($non_latin < 1) $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); + $auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1953,9 +2285,6 @@ if ($non_latin < 1) $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); - $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); - $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); - $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); @@ -1985,8 +2314,6 @@ if ($non_latin < 1) $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); - $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); - $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); @@ -2044,6 +2371,38 @@ if ($non_latin < 1) $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); + $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); + $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); + $manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid); + $post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert); + $custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer); + $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); + $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); + $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); + $survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id); + $dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method); + $disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen); + $screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels); + $label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs); + $label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id); + $status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields); + $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone); + $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone); + $on_hook_cid = ereg_replace("[^-_0-9a-zA-Z]","",$on_hook_cid); + $pllb_grouping = ereg_replace("[^-_0-9a-zA-Z]","",$pllb_grouping); + $user_start = ereg_replace("[^-_0-9a-zA-Z]","",$user_start); + $drop_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$drop_callmenu); + $after_hours_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_callmenu); + $survey_recording = ereg_replace("[^-_0-9a-zA-Z]","",$survey_recording); + $dtmf_field = ereg_replace("[^-_0-9a-zA-Z]","",$dtmf_field); + $preset_contact_search = ereg_replace("[^-_0-9a-zA-Z]","",$preset_contact_search); + $admin_hide_phone_data = ereg_replace("[^-_0-9a-zA-Z]","",$admin_hide_phone_data); + $max_calls_method = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_method); + $max_calls_action = ereg_replace("[^-_0-9a-zA-Z]","",$max_calls_action); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -2073,6 +2432,18 @@ if ($non_latin < 1) $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); + $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); + $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); + $alt_log_server_ip = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_server_ip); + $alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname); + $alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login); + $alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass); + $survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -2080,11 +2451,11 @@ if ($non_latin < 1) $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots - $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + $sounds_web_server = ereg_replace("[^-\:\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); ### ALPHA-NUMERIC and spaces and dashes and underscores - $preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name); + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); @@ -2102,77 +2473,88 @@ if ($non_latin < 1) ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); - $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); - $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); - $external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip); - $default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs); - $codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list); - $label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title); - $label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name); - $label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial); - $label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name); - $label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1); - $label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2); - $label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3); - $label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city); - $label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state); - $label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province); - $label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code); - $label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code); - $label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender); - $label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number); - $label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code); - $label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone); - $label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase); - $label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email); - $label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments); - $slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server); - $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name); - $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description); - $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -2202,10 +2584,13 @@ if ($non_latin < 1) $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma - $ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); ### NUMERIC and comma and pipe - $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); ### value cleaning $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); @@ -2246,7 +2631,10 @@ if ($non_latin < 1) $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); - + $modify_url = ereg_replace("\\\\","",$modify_url); + $modify_url = ereg_replace(";","",$modify_url); + $modify_url = ereg_replace("\r","",$modify_url); + $modify_url = ereg_replace("\"","",$modify_url); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url @@ -2261,7 +2649,7 @@ if ($non_latin < 1) # $webphone_url # $webphone_url_override # $filter_url - + # $na_call_url ### VARIABLES not filtered at all ### # $script_text @@ -2577,44 +2965,135 @@ else # 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 # + # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-285'; -$build = '101022-1427'; +$admin_version = '2.4-364a'; +$build = '120409-1136'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); +$CIDdate = date("mdHis"); +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} + $MT[0]=''; $US='_'; $active_lists=0; $inactive_lists=0; +$modify_rinfrescare_set=0; +$modify_footer_rinfrescare=0; +$check_time = ($STARTtime - 86400); +$SSanswer_transfer_agent = '8368'; $month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $past_week_date = date("Y-m-d H:i:s",$week_old); -$dtmf[0]='0'; $dtmf_key[0]='0'; -$dtmf[1]='1'; $dtmf_key[1]='1'; -$dtmf[2]='2'; $dtmf_key[2]='2'; -$dtmf[3]='3'; $dtmf_key[3]='3'; -$dtmf[4]='4'; $dtmf_key[4]='4'; -$dtmf[5]='5'; $dtmf_key[5]='5'; -$dtmf[6]='6'; $dtmf_key[6]='6'; -$dtmf[7]='7'; $dtmf_key[7]='7'; -$dtmf[8]='8'; $dtmf_key[8]='8'; -$dtmf[9]='9'; $dtmf_key[9]='9'; -$dtmf[10]='HASH'; $dtmf_key[10]='#'; -$dtmf[11]='STAR'; $dtmf_key[11]='*'; -$dtmf[12]='A'; $dtmf_key[12]='A'; -$dtmf[13]='B'; $dtmf_key[13]='B'; -$dtmf[14]='C'; $dtmf_key[14]='C'; -$dtmf[15]='D'; $dtmf_key[15]='D'; -$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; -$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; -$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; +$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) { @@ -2629,7 +3108,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_rinfrescare,nocache_admin,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2641,6 +3120,9 @@ if ($qm_conf_ct > 0) $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; $SScallcard_enabled = $row[4]; + $SSadmin_modify_rinfrescare = $row[5]; + $SSnocache_admin = $row[6]; + $SSwebroot_writable = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2665,7 +3147,7 @@ if ( ($reports_auth > 0) and ($auth < 1) ) $reports_only_user=1; } -if ($WeBRooTWritablE > 0) +if ($SSwebroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -2684,7 +3166,7 @@ if ( ($auth > 0) or ($reports_auth > 0) ) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; + $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' and pass='$PHP_AUTH_PW';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGfull_name =$row[3]; @@ -2722,12 +3204,25 @@ if ( ($auth > 0) or ($reports_auth > 0) ) $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 from vicidial_user_groups where user_group='$LOGuser_group';"; + $stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - $LOGallowed_reports = $row[1]; + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + $LOGadmin_viewable_groups = $row[2]; + $LOGadmin_viewable_call_times = $row[3]; $LOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL=''; @@ -2740,7 +3235,50 @@ if ( ($auth > 0) or ($reports_auth > 0) ) } $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; - if ($WeBRooTWritablE > 0) + $admin_viewable_groupsALL=0; + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + $valLOGadmin_viewable_groupsSQL=''; + $vmLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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 ( (!eregi("--ALL--",$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_query($stmt, $link); + $UUgroups_to_print = mysql_num_rows($rslt); + $o=0; + while ($UUgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $UUgroups_list .= "\n"; + $o++; + } + + if ($SSwebroot_writable > 0) { fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); @@ -2771,9 +3309,9 @@ if ( ($auth > 0) or ($reports_auth > 0) ) } else { - if ($WeBRooTWritablE > 0) + if ($SSwebroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -2787,9 +3325,29 @@ else 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"; +if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } +if ( ($SSadmin_modify_rinfrescare > 1) and (preg_match("/^3/",$ADD)) ) + { + $modify_rinfrescare_set=1; + if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";} + echo "\n"; + } echo "ADMINISTRATION: "; if (!isset($ADD)) {$ADD=0;} @@ -2800,16 +3358,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Aggiungi Nuova Campagna";} if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copia Campagna";} if ($ADD==111) {$hh='lists'; echo "Aggiungi Nuova Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} -if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";} +if ($ADD==171) {$hh='ingroups'; echo "Numeri di telefono del Gruppo filtro";} if ($ADD==1111) {$hh='ingroups'; echo "Aggiungi Nuovo Gruppo Inbound";} if ($ADD==1211) {$hh='ingroups'; echo "Copia Gruppo Inbound";} if ($ADD==1311) {$hh='ingroups'; echo "Aggiungi nuovoDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopiaDID";} if ($ADD==1511) {$hh='ingroups'; echo "Aggiungi Call Menu";} if ($ADD==1611) {$hh='ingroups'; echo "Copia Call Menu";} -if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";} +if ($ADD==1711) {$hh='ingroups'; echo "Aggiungi gruppo Filter Phone";} if ($ADD==11111) {$hh='remoteagent'; echo "Aggiungi Nuovo Operatore Remoto";} -if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";} +if ($ADD==12111) {$hh='remoteagent'; echo "Aggiungi gruppo Extension";} if ($ADD==111111) {$hh='usergroups'; echo "Aggiungi Nuovo Gruppo Utente";} if ($ADD==1111111) {$hh='scripts'; echo "Aggiungi Nuovo Script";} if ($ADD==11111111) {$hh='filters'; echo "Agiungi Nuovo Filtro";} @@ -2822,10 +3380,12 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI NUOVO GRUPPO A if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "AGGIUNGI SERVER";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "ADD NEW CONF TEMPLATE";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "AGGIUNGI NUOVO VETTORE";} -if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "AGGIUNGI CARRIER COPIATO";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW ENTRY TTS";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC IN ATTESA INGRESSO";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW VOICEMAIL BOX";} +if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "Aggiungere la nuova etichetta SCREEN";} +if ($ADD==191111111111) {$hh='admin'; $sh='cts'; echo "Aggiungi nuovo contatto";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NUEVA CONFERENCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Creazione Nuovo Utente";} @@ -2839,7 +3399,8 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nuevo Estado Del Dial Del if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nuevo Co`digo De la Pausa Del Agente";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Esito Campagna Aggiunto";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la Campaña Agregada";} -if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campagna Preset Added";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Preset Campagna Aggiunto";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Campagna Modifica Prefisso CID";} if ($ADD==211) {$hh='lists'; echo "Creazione Nuova Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Creazione Nuovo Gruppo Inbound";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} @@ -2847,9 +3408,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Nuova aggiunta DID";} if ($ADD==2411) {$hh='ingroups'; echo "Nuova aggiunta Copiato DID";} if ($ADD==2511) {$hh='ingroups'; echo "Nuova chiamata Menu";} if ($ADD==2611) {$hh='ingroups'; echo "Nuova chiamata Menu";} -if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";} +if ($ADD==2711) {$hh='ingroups'; echo "Nuovo gruppo Phone Filter";} if ($ADD==21111) {$hh='remoteagent'; echo "Creazuibe Nuovi Operatori Remoti";} -if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";} +if ($ADD==22111) {$hh='remoteagent'; echo "Nuovo gruppo aggiunta Extension";} if ($ADD==211111) {$hh='usergroups'; echo "Creazione Nuovo Gruppo Utenti";} if ($ADD==2111111) {$hh='scripts'; echo "Creazione Nuovo Script";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adicio`n Del Filtro";} @@ -2863,10 +3424,12 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIo`N DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Aggiunta di nuovi CONF TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Aggiunta di nuovi VETTORE";} -if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "AGGIUNTA CARRIER COPIATO";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "Aggiunta di nuovi TTS ENTRY";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "AGGIUNTA NUOVA MUSICA IN ATTESA INGRESSO";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "Aggiunta di nuovi VOICEMAIL BOX";} +if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "AGGIUNTA DI ETICHETTA NEW SCREEN";} +if ($ADD==291111111111) {$hh='admin'; $sh='cts'; echo "AGGIUNTA DI NUOVO CONTATTO";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "CREANDO CONFERENCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "AGGIUNGI ESITI DI DEFAULT VICIDIAL";} @@ -2886,6 +3449,7 @@ if ($ADD==31) if ($SUB==29) {echo " - Elenco Mixes";} if ($SUB=='20A') {echo " - Indagine";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -2899,6 +3463,7 @@ if ($ADD==34) if ($SUB==29) {echo " - Elenco Mixes";} if ($SUB=='20A') {echo " - Indagine";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Esiti Campagna";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Hot-Key Campagna";} @@ -2908,13 +3473,15 @@ if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Codici Pausa Operatore per if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la Campaña";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campagna Presets";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Campagna Prefisso CID";} if ($ADD==311) {$hh='lists'; echo "Modifica Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} if ($ADD==3311) {$hh='ingroups'; echo "ModificareDID";} +if ($ADD==3321) {$hh='ingroups'; echo "Modificare DID RA Extension Overrides";} if ($ADD==3511) {$hh='ingroups'; echo "Modifica Call Menu";} -if ($ADD==3711) {$hh='ingroups'; echo "Modifica Filtro Phone Group";} +if ($ADD==3711) {$hh='ingroups'; echo "Modifica gruppo Filter Phone";} if ($ADD==31111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} -if ($ADD==32111) {$hh='remoteagent'; echo "ModificareExtension Group";} +if ($ADD==32111) {$hh='remoteagent'; echo "Modifica gruppo Extension";} if ($ADD==311111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==3111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==31111111) {$hh='filters'; echo "Modifica Filtro";} @@ -2931,6 +3498,8 @@ if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICA DEL VETTORE if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFICA TTS ENTRY";} if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFICA Music On Hold ENTRATA";} if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFICA VOICEMAIL BOX";} +if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "Modificare l'etichetta SCREEN";} +if ($ADD==391111111111) {$hh='admin'; $sh='cts'; echo "Modifica contatto";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFICA IMPOSTAZIONI DI SISTEMA";} @@ -2948,15 +3517,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Co`digo De la Pausa Del Agente";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modifica impostazioni campagna, QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} -if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifica Campagna Preset";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifica Preset Campagna";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificare la campagna Sondaggio";} if ($ADD==411) {$hh='lists'; echo "Modifica Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} if ($ADD==4311) {$hh='ingroups'; echo "ModificareDID";} if ($ADD==4511) {$hh='ingroups'; echo "Modifica Call Menu";} -if ($ADD==4711) {$hh='ingroups'; echo "Modifica Filtro Phone Group";} +if ($ADD==4711) {$hh='ingroups'; echo "Modifica gruppo Filter Phone";} if ($ADD==41111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} -if ($ADD==42111) {$hh='remoteagent'; echo "ModificareExtension Group";} +if ($ADD==42111) {$hh='remoteagent'; echo "Modifica gruppo Extension";} if ($ADD==411111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==4111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==41111111) {$hh='filters'; echo "Modifica Filtro";} @@ -2973,6 +3542,8 @@ if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICA DEL VETTORE if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFICA TTS ENTRY";} if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFICA Music On Hold ENTRATA";} if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFICA VOICEMAIL BOX";} +if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "Modificare l'etichetta SCREEN";} +if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo "Modifica contatto";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFICA IMPOSTAZIONI DI SISTEMA";} @@ -2987,9 +3558,9 @@ if ($ADD==511) {$hh='lists'; echo "EliminareList";} if ($ADD==5111) {$hh='ingroups'; echo "EliminareIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==5511) {$hh='ingroups'; echo "Elimina Call Menu";} -if ($ADD==5711) {$hh='ingroups'; echo "EliminarePhone Filter Group";} +if ($ADD==5711) {$hh='ingroups'; echo "Elimina Phone filtro gruppo";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==52111) {$hh='remoteagent'; echo "EliminareExtension Group";} +if ($ADD==52111) {$hh='remoteagent'; echo "Elimina gruppo Extension";} if ($ADD==511111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==5111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==51111111) {$hh='filters'; echo "Cancella Filtro";} @@ -3005,6 +3576,8 @@ if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "CANC VETTORE";} if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRY";} if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE Music On Hold ENTRATA";} if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE VOICEMAIL BOX";} +if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "DELETE LABEL SCREEN";} +if ($ADD==591111111111) {$hh='admin'; $sh='cts'; echo "Elimina contatto";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "EliminareUtente";} @@ -3016,14 +3589,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Co`digo De la Pausa Del Agente De la Cancelacio`n";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Esito Campagna Rimosso";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quito`";} -if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Campagna Preset Removed";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Preset Campagna Rimosso";} if ($ADD==611) {$hh='lists'; echo "EliminareList";} if ($ADD==6111) {$hh='ingroups'; echo "EliminareIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==6511) {$hh='ingroups'; echo "Elimina Call Menu";} -if ($ADD==6711) {$hh='ingroups'; echo "EliminarePhone Filter Group";} +if ($ADD==6711) {$hh='ingroups'; echo "Elimina Phone filtro gruppo";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==62111) {$hh='remoteagent'; echo "EliminareExtension Group";} +if ($ADD==62111) {$hh='remoteagent'; echo "Elimina gruppo Extension";} if ($ADD==611111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==6111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==61111111) {$hh='filters'; echo "Cancella Filtro";} @@ -3040,6 +3613,8 @@ if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "CANC VETTORE";} if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRY";} if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE Music On Hold ENTRATA";} if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE VOICEMAIL BOX";} +if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "DELETE LABEL SCREEN";} +if ($ADD==691111111111) {$hh='admin'; $sh='cts'; echo "Elimina contatto";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Cuenta Del Plomo De Dialable";} @@ -3057,10 +3632,11 @@ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campagnas";} if ($ADD==100) {$hh='lists'; echo "Liste";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1320) {$hh='ingroups'; echo "Modificare DID RA Extension Overrides";} if ($ADD==1500) {$hh='ingroups'; echo "Call Menu";} -if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";} +if ($ADD==1700) {$hh='ingroups'; echo "Gruppi di Telefono filtro";} if ($ADD==10000) {$hh='remoteagent'; echo "Operatori Remoti";} -if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";} +if ($ADD==12000) {$hh='remoteagent'; echo "Gruppi di estensione";} if ($ADD==100000) {$hh='usergroups'; echo "Gruppi Utenti";} if ($ADD==1000000) {$hh='scripts'; echo "Script";} if ($ADD==10000000) {$hh='filters'; echo "Filtri";} @@ -3076,6 +3652,8 @@ if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "ELENCO CARRIER";} 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 caselle di riepilogo";} +if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "SCREEN ETICHETTE LIST";} +if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "CONTATTI LISTA";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERENCIAS";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERENCIAS";} if ($ADD==550) {$hh='users'; echo "Form di Ricerca";} @@ -3085,15 +3663,18 @@ if ($ADD==661) {$hh='users'; echo "RESULTADO DE LA BÚSQUEDA DE telefonOS";} if ($ADD==99999) {$hh='users'; echo "AIUTO";} if ($ADD==999999) {$hh='reports'; echo "REPORT";} 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==999997) {$hh='reports'; echo "CAMBIO PASSWORD";} +if ($ADD==999996) {$hh='reports'; echo "L'installazione iniziale BENVENUTI";} +if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT MARCHIO DI LICENZA";} +if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "SINTESI STATS";} +if ($ADD==999992) {$hh='reports'; echo "SYSTEM SINTESI STATS";} -if ( ($ADD>9) && ($ADD < 99998) ) +if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $scripts_list="<option value=\"\">NESSUNO</option>\n"; @@ -3108,7 +3689,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $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_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); $filters_list="<option value=\"\">NESSUNO</option>\n"; @@ -3124,7 +3705,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_query($stmt, $link); $times_to_print = mysql_num_rows($rslt); @@ -3138,7 +3719,7 @@ if ( ($ADD>9) && ($ADD < 99998) ) } } -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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 ##### @@ -3148,7 +3729,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAGNA</td><td>     CLASSIFICA</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $RANKcampaigns_list="<tr><td>CAMPAGNA</td><td>     CLASSIFICA</td><td>     GRADE</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) @@ -3165,18 +3746,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $campaign_web=''; - $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysql_fetch_row($rslt); - $SELECT_campaign_rank = $row[0]; - $calls_today = $row[1]; - $group_web_vars = $row[2]; + $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; $group_web_vars='';} + {$calls_today=0; $SELECT_campaign_rank=0; $SELECT_campaign_grade=1; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { $stmt_grp_values=''; @@ -3184,30 +3766,37 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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 = ereg_replace("[^-\_0-9]","",$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + $campaign_grade = ereg_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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$campaign_rank = $SELECT_campaign_rank;} + else + { + $campaign_rank = $SELECT_campaign_rank; + $campaign_grade = $SELECT_campaign_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -3215,28 +3804,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$bgcolor='bgcolor="#9BB9FB"';} # disable non user-group allowable campaign ranks - $stmt="SELECT user_group from vicidial_users where user='$user';"; + $stmt="SELECT user_group from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Ruser_group = $row[0]; - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); - $p=0; $RANK_camp_active=0; $CR_disabled = ''; + $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) - {$RANK_camp_active++;} + {$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++;} + {$RANK_camp_active++; $GRADE_camp_active++;} $p++; } } @@ -3245,7 +3834,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKcampaigns_list .= "<td>   <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; $h="9"; while ($h>=-9) { @@ -3258,6 +3847,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -3269,7 +3871,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { - $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -3308,7 +3910,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD if ($ADD==3) { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $stmt="SELECT closer_campaigns from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; @@ -3316,14 +3918,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; - $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     CLASSIFICA</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     CLASSIFICA</td><td>     GRADE</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($groups_to_print > $o) @@ -3339,7 +3941,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $group_web_vars=''; $group_web=''; - $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $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_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); if ($ranks_to_print > 0) @@ -3348,40 +3950,48 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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;} + {$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 = ereg_replace("[^-\_0-9]","",$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); + $group_grade = ereg_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' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { - $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $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_query($stmt, $link); $stmt_grp_values .= "$stmt|"; } - else {$group_rank = $SELECT_group_rank;} + else + { + $group_rank = $SELECT_group_rank; + $group_grade = $SELECT_group_grade; + } if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -3414,7 +4024,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VIG_priority = $row[0]; @@ -3422,7 +4032,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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"; + $RANKgroups_list .= "<td>   <select size=1 name=RANK_$group_id_values[$o]>\n"; $h="9"; while ($h>=-9) { @@ -3435,6 +4045,19 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD 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++; @@ -3450,7 +4073,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { 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';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $allowed_campaigns = $row[0]; @@ -3465,7 +4088,8 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; + if ( (eregi("-ALL",$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=''; @@ -3475,8 +4099,11 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A { if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS-"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPAIGNS-"; + } } if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) { @@ -3490,11 +4117,12 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A } $p++; } - $campaigns_list.="> ALL-CAMPAIGNS - GLI UTENTI POSSONO VISUALIZZARE QUALSIASI CAMPAGNA</B><BR>\n"; + if ( (eregi("-ALL",$LOGallowed_campaigns)) ) + {$campaigns_list.="> ALL-CAMPAIGNS - GLI UTENTI POSSONO VISUALIZZARE QUALSIASI CAMPAGNA</B><BR>\n";} $qc_campaigns_list.="> ALL-CAMPAIGNS - Gli utenti possono, QC OGNI CAMPAGNA</B><BR>\n"; $qc_groups_list.="> ALL-GROUPS - Gli utenti possono QC INBOUND OGNI GRUPPO</B><BR>\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -3528,7 +4156,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $o++; } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); @@ -3560,7 +4188,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### 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) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) +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"; @@ -3611,12 +4239,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-pass"> <BR> - <B>Contraseña -</B> este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Contraseña -</B> este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. La password utente forte deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero. <BR> <A NAME="vicidial_users-force_change_password"> <BR> - <B>Force Change Password -</B> If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N. + <B>Forza Cambia password -</B> Se questa opzione è impostata su Y, allora l'utente verrà richiesto di cambiare la propria password la prossima volta che accedi alla pagina web di amministrazione. Il valore predefinito è N. <BR> <A NAME="vicidial_users-full_name"> @@ -3651,7 +4279,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-voicemail_id"> <BR> - <B>Casella Vocale ID -</B> This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Casella Vocale field set to AGENTVMAIL. + <B>Casella Vocale ID -</B> Questa è la casella vocale che le chiamate verranno indirizzati a in un AGENTDIRECT in gruppo al momento se la caduta in gruppo ha impostato il metodo della goccia alla casella vocale e il campo di Casella Vocale impostata AGENTVMAIL. <BR> <A NAME="vicidial_users-optional"> @@ -3671,7 +4299,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_choose_blended"> <BR> - <B>Agent Choose Blended -</B> This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled. + <B>Agente Scegli Blended -</B> Questa opzione se impostato a 1 consente all'utente di scegliere se l'agente ha il proprio set campagna per miscelati o meno, e se poi non l'impostazione predefinita mescolato verrà utilizzato. Il valore predefinito è 1 per abilitato. <BR> <A NAME="vicidial_users-agent_choose_territories"> @@ -3728,7 +4356,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-agent_call_log_view_override"> <BR> - <B>Agent Call Log View Override -</B> This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED. + <B>Call Agent View Log Override -</B> Questa impostazione avrà la precedenza su ciò che l'utente gli utenti gruppo ha fissato per View Call Log Agent. DISABLED utilizza l'impostazione gruppo di utenti. N non permetterà che mostra la chiamata degli utenti log. Y permetterà mostrando il registro delle chiamate dell'utente. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_users-agent_lead_search_override"> + <BR> + <B>Agente di piombo Override Search -</B> Questa impostazione avrà la precedenza su ciò che la campagna ha fissato per la Ricerca Agente di piombo. NOT_ACTIVE utilizza l'impostazione della campagna. ENABLED permette la ricerca di piombo ei disabili non permette la ricerca di piombo. Il valore predefinito è NOT_ACTIVE. <BR> <A NAME="vicidial_users-alert_enabled"> @@ -3741,9 +4374,14 @@ if ($ADD==99999) <B>Consentire Alerts -</B> Questo campo ti dà la possibilità di consentire browser agente di avvisi per essere abilitato l-agente per le chiamate quando entrano in loro sessione vicidial.php. Di default è 0 per il NO. <BR> - <A NAME="vicidial_users-vicidial_users-campaign_ranks"> + <A NAME="vicidial_users-preset_contact_search"> <BR> - <B>La campaña alinea -</B> en esta seccio`n usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. Anche in questa sezione sono WEB VAR per ciascuna campagna. Questi permettono di ogni agente di avere una diversa variabile stringa che può essere aggiunto al Web Form o SCRIPT scheda URL semplicemente messa - A - web_vars - B - come si farebbe con qualsiasi altro posto campo. + <B>Ricerca Contatto Preset -</B> Se l'utente è connesso in una campagna che ha Presets di trasferimento impostate CONTATTI, questa impostazione è possibile disattivare la ricerca di contatto solo per questo utente. Il valore predefinito è NOT_ACTIVE che userà qualunque sia l'impostazione della campagna è. + + <BR> + <A NAME="vicidial_users-campaign_ranks"> + <BR> + <B>La campaña alinea -</B> en esta seccio`n usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. Anche in questa sezione sono WEB VAR per ciascuna campagna. Questi permettono di ogni agente di avere una diversa variabile stringa che può essere aggiunto al Web Form o SCRIPT scheda URL semplicemente messa - A - web_vars - B - come si farebbe con qualsiasi altro posto campo. Un altro campo in questa sezione è GRADE, che consente la campaign_grade_random agente successiva chiamata l'impostazione da utilizzare. Questa impostazione grado aumenta o diminuisce la probabilità che l'agente riceve la chiamata. <BR> <A NAME="vicidial_users-closer_campaigns"> @@ -3763,7 +4401,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_one"> <BR> - <B>Utente campi personalizzati -</B> Questi cinque campi possono essere utilizzati per vari scopi, e possono essere organizzati in forma gli indirizzi web e script come user_custom_one e così via. + <B>Utente campi personalizzati -</B> Questi cinque campi possono essere utilizzati per vari scopi, e possono essere organizzati in forma gli indirizzi web e script come user_custom_one e così via. La personalizzato 5 campo può essere utilizzato come campo per definire un numero dialplan di inviare una chiamata a da un AGENTDIRECT in gruppo se l'utente non è disponibile, basta mettere AGENTEXT nel campo del messaggio o gli ampliamenti di AGENTDIRECT l'in-group e il sistema cercherà il costume cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -3816,7 +4454,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-custom_fields_modify"> <BR> - <B>Custom Fields Modificare-</B> This option if set to 1 allows the user to modify custom list fields. + <B>Modifica campi personalizzati -</B> Questa opzione, se impostato su 1 consente all'utente di modificare i campi elenco personalizzati. <?php } ?> @@ -3955,7 +4593,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-export_reports"> <BR> - <B>Rapporti Export -</B> Questa impostazione, se impostato su 1 consente di accedere a un manager di esportazione chiamata relazioni sulle relazioni schermo. Il valore di default è 0. Per la relazione chiede di esportazione, per il seguente campo è utilizzato per le esportazioni: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + <B>Rapporti Export -</B> Questa impostazione, se impostato a 1 consentirà un manager di accedere alla chiamata di esportazione e le relazioni di piombo sullo schermo Report. Di default è 0. Per l'esportazione chiamate e conduce Rapporti, l'ordine seguente campo viene utilizzato per le esportazioni: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner <BR> <A NAME="vicidial_users-delete_from_dnc"> @@ -3965,7 +4603,23 @@ if ($ADD==99999) <BR> <A NAME="vicidial_users-realtime_block_user_info"> <BR> - <B>Realtime Block Utente Info -</B> This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled. + <B>Realtime Block Info Utente -</B> Questa impostazione, se impostato su 1 si bloccherà le informazioni utente e la stazione venga visualizzato in tempo reale report. Il default è 0 per disabili. + + <BR> + <A NAME="vicidial_users-modify_same_user_level"> + <BR> + <B>Modificare stesso livello utente -</B> Questa impostazione si applica solo al livello 9 utenti. Se abilitato permette al livello 9 all'utente di modificare le proprie impostazioni così come altri a livello di 9 utenti. Il valore predefinito è 1 per abilitato. + + <BR> + <A NAME="vicidial_users-admin_hide_lead_data"> + <BR> + <B>Admin nascondere i dati di piombo -</B> Questa impostazione si applica solo a livello 7, 8 e 9 utenti. Se abilitato sostituisce i dati del cliente di piombo nei molti rapporti e le schermate del sistema con Xs. Il default è 0 per disabili. + + <BR> + <A NAME="vicidial_users-admin_hide_phone_data"> + <BR> + <B>Admin nascondere i dati del telefono -</B> Questa impostazione si applica solo a livello 7, 8 e 9 utenti. Se abilitato sostituisce i numeri telefonici dei clienti in numerosi rapporti e le schermate del sistema con Xs. Le impostazioni CIFRE mostra solo le ultime X cifre del numero di telefono. Il default è 0 per disabili. + @@ -3988,6 +4642,11 @@ if ($ADD==99999) <BR> <B>Descripcio`n de la campaña -</B> esto es un campo de la nota para lacampaña, es opcional y puede ser un máximo de 255 caracteres enlongitud. + <BR> + <A NAME="vicidial_campaigns-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questa campagna, questo permette la visualizzazione amministratore di questa campagna così come le liste assegnati a questa campagna per essere limitato dal gruppo di utenti. Il default è - ALL - che consente a qualsiasi utente amministratore con le autorizzazioni di gruppi di utenti delle campagne per visualizzare questa campagna. + <BR> <A NAME="vicidial_campaigns-campaign_changedate"> <BR> @@ -4004,14 +4663,19 @@ if ($ADD==99999) <B>Last Campagna Call Data -</B> Questa è l-ultima volta che una chiamata è stata gestita da un agente registrato in questa campagna. <BR> - <A NAME="vicidial_campaigns-campaign_stats_refresh"> + <A NAME="vicidial_campaigns-max_stats"> + <BR> + <B>Massimo giornaliero Stats -</B> Sono dati che vengono generati dal sistema ogni giorno per tutta la giornata fino allaOrologio fine della giornata in quanto si trova in Impostazioni di sistema. Questi numeri sono generati dai registri all'interno del sistema per consentire visualizzazione molto più veloce. Le statistiche sono inclusi sono: - Chiamate totali, Agenti Massimo, Massimo chiamate in entrata, Massimo chiamate outbound. + + <BR> + <A NAME="vicidial_campaigns-campaign_stats_rinfrescare"> <BR> <B>Los Stats de la campaña restauran -</B> este checkbox permitirá queusted fuerce un stats vicidial restaura, incluso si la campaña no esactiva. <BR> <A NAME="vicidial_campaigns-realtime_agent_time_stats"> <BR> - <B>Real-Time Agent Time Stats -</B> Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED. + <B>Real-Time Agente Statistiche temporali -</B> L'impostazione di questo a nulla, ma DISABLED consentirà la raccolta di statistiche temporali agente per oggi per questa campagna, che sono visualizzabili attraverso il rapporto in tempo reale. Le chiamate sono in media le chiamate gestite per agente, WAIT è il tempo medio di attesa agente, CUST è il tempo medio di conversazione del cliente, ACW è la media Dopo il tempo di lavoro a chiamata, PAUSE è il tempo di pausa media. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-active"> @@ -4021,7 +4685,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-park_ext"> <BR> - <B>Park Music-on-Hold -</B> This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default. + <B>Parco della Musica-on-Hold -</B> Qui è dove è possibile definire on-hold contesto musicale per questa campagna. Assicurarsi di selezionare una musica valida sul contesto attesa dalla lista di selezione e che il contesto che hai selezionato ha file validi in esso. Il valore predefinito è di default. <BR> <A NAME="vicidial_campaigns-park_file_name"> @@ -4031,7 +4695,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> - <B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el boton de la FORMA del WEB. Per personalizzare la stringa di ricerca dopo il modulo web, è sufficiente avviare il modulo web con VAR e quindi lURL che si desidera utilizzare, che sostituisce le variabili con i nomi di variabile che si desidera utilizzare - A - phone_number - B -- proprio come nella sezione SCRIPT scheda. + <B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el boton de la FORMA del WEB. Per personalizzare la stringa di ricerca dopo il modulo web, è sufficiente avviare il modulo web con VAR e quindi lURL che si desidera utilizzare, che sostituisce le variabili con i nomi di variabile che si desidera utilizzare - A - phone_number - B -- proprio come nella sezione SCRIPT scheda. Se si desidera utilizzare i campi personalizzati in un indirizzo web form, è necessario aggiungere &CF_uses_custom_fields=Y come parte del tuo URL. <BR> <A NAME="vicidial_campaigns-web_form_target"> @@ -4092,16 +4756,56 @@ if ($ADD==99999) <BR>   - UP TIMEZONE: Inizia con fuso orario orientale e opere West <BR>   - DOWN TIMEZONE: Inizia con fuso orario occidentale e orientale opere + <BR> + <A NAME="vicidial_campaigns-lead_order_randomize"> + <BR> + <B>Order List Randomize -</B> Questa opzione consente di casuale l'ordine dei cavi nella tramoggia di carico all'interno dei risultati definiti dai criteri di cui sopra. Per esempio, l'ordine di graduatoria saranno conservati, ma i risultati saranno randomizzati all'interno di tale ordinamento. Impostando questa opzione su Y abilitare questa funzione. Il default è n per disabili. NOTE, se si dispone di un gran numero di porta questa opzione può rallentare la velocità dello script tramoggia di carico. + + <BR> + <A NAME="vicidial_campaigns-lead_order_secondary"> + <BR> + <B>Elenco Ordine Secondario -</B> Questa opzione consente di selezionare secondo ordine smistamento dei cavi in ​​carico tramoggia dopo l'ordine di graduatoria e nei risultati definiti dai criteri di cui sopra. Ad esempio, l'Ordine elenco verrà utilizzato per il primo tipo dei fili conduttori, ma i risultati saranno ordinati una seconda volta all'interno di tale ordinamento attraverso lo stesso insieme dell'Ordine primo elenco. Ad esempio, se avete Order List impostato conto alla rovescia e si dispone solo di cavi che sono state tentate 1 e 2 volte, quindi se avete il set dell'Ordine secondaria List per LEAD_ASCEND tutti i 1 conduce tentativo verranno ordinati dai più antichi conduttori prima e sarà messa nella tramoggia in quel modo. Predefinito è LEAD_ASCEND. NOTE, se si dispone di un gran numero di cavi utilizzando una delle opzioni CALLTIME può rallentare la velocità dello script tramoggia di carico. Se Order List Randomize è attivata, questa opzione verrà ignorata. + <BR> <A NAME="vicidial_campaigns-hopper_level"> <BR> - <B>Tolva llana -</B> este es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a trave`s en un minuto. + <B>Hopper Livello Minimo -</B> Questo è il numero minimo di guida dello script VDhopper cerca di mantenere nella tabella vicidial_hopper per questa campagna. Se si esegue lo script VDhopper ogni minuto, fanno di questo un po 'maggiore del numero di porta si attraversa in un minuto. + + <BR> + <A NAME="vicidial_campaigns-use_auto_hopper"> + <BR> + <B>Hopper Automatic Level -</B> Impostare questo a Y permetterà Vicidial per regolare automaticamente la tramoggia in base al largo le impostazioni che hai nella tua campagna. La formula si usa per fare questo è:<BR>Number of Attivo Agenti * Livello Auto Dial * ( 60 seconds / Timeout Chiamata ) * Auto Hopper Multiplier<BR>Default is Y. + + <BR> + <A NAME="vicidial_campaigns-auto_hopper_multi"> + <BR> + <B>Hopper Moltiplicatore automatico -</B> Questo è il moltiplicatore per Hopper Auto. L'impostazione di questo a meno di 1 farà sì che l'algoritmo di Hopper Auto per caricare meno contatti rispetto al normale. L'impostazione di questa maggiore di 1 farà sì che l'algoritmo di Hopper Auto per caricare più contatti di quanto non farebbe normalmente. Default è 1. + + <BR> + <A NAME="vicidial_campaigns-auto_trim_hopper"> + <BR> + <B>Auto Trim Hopper -</B> Impostare questo a Y permetterà Vicidial per rimuovere automaticamente cavi in ​​eccesso dalla tramoggia. Il valore predefinito è Y. + + <BR> + <A NAME="vicidial_campaigns-hopper_vlc_dup_check"> + <BR> + <B>Hopper VLC Dup Verifica -</B> Impostare questo a Y si tradurrà in ogni lead essere inserito nella tramoggia di essere controllato da vendor_lead_code per assicurarsi che non ci sono duplicati conduttori inseriti con la vendor_lead_code stessa. Questo è molto utile quando Auto-Alt-Dialing con MULTI_LEAD. Il valore predefinito è N. <BR> <A NAME="vicidial_campaigns-lead_filter_id"> <BR> <B>Filtro del plomo -</B> este es un me`todo de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaucio`n, e`l es fácil de parar el marcar accidentalmente con la alteracio`n más leve a la declaracio`n del SQL. El defecto no es NINGUNO. + <BR> + <A NAME="vicidial_campaigns-call_count_limit"> + <BR> + <B>Conteggio chiamate Limit -</B> Questo impone un limite al numero di tentativi di chiamata per i cavi selezionati in questa campagna. Un cavo può andare oltre questo limite un po 'Se il riciclaggio di piombo o Auto-Alt-Dialing è abilitata. Di default è 0 per nessun limite. + + <BR> + <A NAME="vicidial_campaigns-call_count_target"> + <BR> + <B>Conteggio chiamate di destinazione -</B> Questa opzione viene utilizzata solo per fini di comunicazione e non ha alcun effetto sulla porta composti. Di default è 3. + <BR> <A NAME="vicidial_campaigns-drop_lockout_time"> <BR> @@ -4122,11 +4826,21 @@ if ($ADD==99999) <BR> <B>Nivel auto del dial -</B> aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automo`vil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIo`N del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el me`todo del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. + <BR> + <A NAME="vicidial_campaigns-dial_level_threshold"> + <BR> + <B>Auto Dial Threshold Level -</B> Questa impostazione funziona solo con una ADAPT o RATIO Metodo di selezione, e deve essere impostato a qualcosa di diverso da Disabilitato e il numero di agenti impostazione deve essere superiore a 0. Questa funzione consente di impostare un numero minimo di agenti che l'algoritmo predittivo lavorare. Se il numero di agenti scende al di sotto del numero che avete impostato, allora il livello dial andrà a 1.0 fino a più agenti il ​​login o andare nello stato selezionato. LOGGED di IN_AGENTS conterà tutti gli agenti registrati nella campagna, NON PAUSED_AGENTS conterà solo gli agenti che sono in attesa o di parlare, e WAITING_AGENTS conterà solo agenti che sono in attesa di una chiamata. Predefinito è DISABLED. + <BR> <A NAME="vicidial_campaigns-available_only_ratio_tally"> <BR> <B>Solamente cuenta disponible -</B> este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. + <BR> + <A NAME="vicidial_campaigns-available_only_tally_threshold"> + <BR> + <B>Disponibile Soglia Tally Solo -</B> Questa impostazione funziona solo con una ADAPT o RATIO Metodo di selezione, disponibile solo Tally deve essere impostato su N, questa impostazione deve essere impostato a qualcosa di diverso da Disabilitato e il numero di agenti impostazione deve essere superiore a 0. Questa funzione consente di impostare il numero di agenti di sotto del quale Tally Disponibile solo verrà attivato. Se il numero di agenti scende al di sotto del numero che avete impostato, l'impostazione Disponibile solo con Tally andare a Y temporaneamente fino a quando altri agenti il ​​login o andare nello stato selezionato. LOGGED di IN_AGENTS conterà tutti gli agenti registrati nella campagna, NON PAUSED_AGENTS conterà solo gli agenti che sono in attesa o di parlare, e WAITING_AGENTS conterà solo agenti che sono in attesa di una chiamata. Predefinito è DISABLED. + <BR> <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> <BR> @@ -4150,7 +4864,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> <BR> - <B>Blanco llana de la diferencia del dial -</B> este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los me`todos del dial del MANUAL o del COCIENTE. + <B>Blanco Llana De la Diferencia Del Dial -</B> Questo campo è utilizzato per definire se si vuole indirizzare avere un determinato numero di agenti di attesa per le chiamate o le chiamate in attesa per gli agenti. Ad esempio se si vorrebbe sempre avere in media un agente libero di prendere immediatamente le chiamate è necessario impostare questo a -1, se si desidera avere sempre di mira una chiamata in attesa in attesa di un agente è necessario impostare questo valore a 1. Di default è 0. Questo campo non viene utilizzato dal manuale o metodi di selezione INBOUND_MAN. + + <BR> + <A NAME="vicidial_campaigns-dl_diff_target_method"> + <BR> + <B>Comporre Differenza Metodo Target Level -</B> Questa opzione consente di definire se il livello di rotella di regolazione differenza di destinazione viene applicato solo al calcolo del livello di quadrante o anche per la composizione reale su ogni server di composizione. Se si esegue una piccola campagna con agenti collegati in su molti server si potrebbe desiderare di utilizzare l'opzione ADAPT_CALC_ONLY, perché l'opzione CALLS_PLACED può comportare un minor numero di chiamate di essere immessi che deisred. Questa opzione è attiva solo se il livello Dial Difference è impostato su qualcosa di diverso da 0. Il valore predefinito è ADAPT_CALC_ONLY. <BR> <A NAME="vicidial_campaigns-concurrent_transfers"> @@ -4160,7 +4879,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queue_priority"> <BR> - <B>Coda di priorità - </B> Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone. + <B>Coda di priorità - </B> Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended. Si consiglia di non impostare le chiamate in entrata a una priorità maggiore rispetto alle campagne outbound chiamate perché le persone si aspettano di chiamata in attesa e le persone si aspettano di essere chiamati per qualcuno di essere lì al telefono. <BR> <A NAME="vicidial_campaigns-drop_rate_group"> @@ -4170,12 +4889,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-inbound_queue_no_dial"> <BR> - <B>Inbound Queue No Dial -</B> This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED. + <B>Coda in ingresso No Dial -</B> Questa funzione, se impostata su ENABLED permette di evitare che in uscita auto-selezione di questa campagna se ci sono chiamate in entrata in attesa in coda che fanno parte dei gruppi ammessi in entrata di cui in questa campagna. Impostare questo a ALL_SERVERS cambierà l'algoritmo per calcolare tutte le chiamate in entrata, come le chiamate attive su questo server, anche se sono su un altro server che si riducono le possibilità di porre inutili chiamate in uscita se si dispone di chiamate in arrivo su un altro server. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-auto_alt_dial"> <BR> - <B>Alt-Nu`mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA me`todos del dial cuando no hay contacto en elnúmero de telefono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el me`todoMANUAL del dial. PROROGATO alternano i numeri sono numeri caricato nel sistema al di fuori della norma portare informazioni schermo. Uso PROROGATO si possono avere centinaia di numeri di telefono per un singolo cliente record. + <B>Alt-Nu`mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA me`todos del dial cuando no hay contacto en elnúmero de telefono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el me`todoMANUAL del dial. PROROGATO alternano i numeri sono numeri caricato nel sistema al di fuori della norma portare informazioni schermo. Uso PROROGATO si possono avere centinaia di numeri di telefono per un singolo cliente record. Utilizzando MULTI_LEAD consente di utilizzare un cavo separato per ogni numero su un conto cliente che tutti condividono un vendor_lead_code comune, e il tipo di numero di telefono per ciascuno è definito con una etichetta nel campo Proprietario. Questa opzione consente di disattivare alcune opzioni sulla schermata Campagna Modifica e mostrare un link al Multi-Alt pagina Impostazioni che permette di impostare quali tipi numero di telefono, definiti dalla etichetta di ogni cavo, viene selezionato e in quale ordine. Questo creerà un filtro speciale di piombo e alterare il campo Rango di tutti i cavi all'interno degli elenchi di cui a questa campagna per chiamare nell'ordine specificato. <BR> <A NAME="vicidial_campaigns-dial_timeout"> @@ -4185,14 +4904,16 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_vdad_exten"> <BR> - <B>Campagna VDAD estensione -</B> Questo campo consente un trasferimento personalizzato VDAD estensione. Questo vi permette di utilizzare diversi metodi di gestione delle chiamate a seconda della tua campagna. - - 8364 - 8368 stessa - - 8365 - Will inviare la chiamata ad un solo agente sullo stesso server come la chiamata è in - - 8366 - Usato-1 per la stampa e campagne di indagine - - 8367 - Il primo a provare a inviare la chiamata a un agente sul server locale, poi si guarda su altri server - - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on - - 8369 - Utilizzato per Segreteria di rilevamento, dopo che, lo stesso comportamento come 8368 - - 8373 - Utilizzato per Segreteria di rilevamento dopo lo stesso comportamento come 8366 + <B>Routing Extension -</B> Questo campo permette di un'estensione personalizzata di routing in uscita. Questo consente di utilizzare diversi metodi di gestione delle chiamate a seconda di come si desidera instradare le chiamate in uscita attraverso la vostra campagna. Precedentemente chiamato Campagna estensione VDAD. + <BR>- 8364 - stesso 8368 + <BR>- 8365 - Invierà la chiamata solo per un agente sullo stesso server come la chiamata viene messa in + <BR>- 8366 - Utilizzato per la stampa-1, radiofonici e televisivi e campagne di indagine + <BR>- 8367 - Will tenta di inviare prima la chiamata a un agente sul server locale, quindi cercherà su altri server + <BR>- 8368 - DEFAULT - Può inviare la chiamata al prossimo agente disponibile non importa a quale server sono in + <BR>- 8369 - Utilizzati esclusivamente per rispondere Detection macchina dopo che, lo stesso comportamento 8368 + <BR>- 8373 - Utilizzati esclusivamente per rispondere Detection macchina dopo che il comportamento stesso 8366 + <BR>- 8374 - Utilizzato per la stampa-1, trasmissione e campagne di indagine con Cepstral Text-to-speech + <BR>- 8375 - Utilizzati esclusivamente per rispondere Detection macchina, quindi premere-1, trasmissione e con campagne di indagine Cepstral Text-to-speech <BR> <A NAME="vicidial_campaigns-am_message_exten"> @@ -4234,6 +4955,16 @@ if ($ADD==99999) <BR> <B>seguro puerto Exten -</B> este ser dial plan extension que desear seguropuerto audio archivo ser localizar en en su servidor. + <BR> + <A NAME="vicidial_campaigns-safe_harbor_audio"> + <BR> + <B>Safe Harbor Audio -</B> Questo è il prompt dei file audio che viene riprodotto se l'azione è impostata su Goccia AUDIO. Il valore predefinito è Buzz. + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_menu_id"> + <BR> + <B>Safe Harbor Menu chiamata -</B> Questo è il menu chiamata che una chiamata viene inviato se l'azione è impostata su Goccia CALLMENU. + <BR> <A NAME="vicidial_campaigns-voicemail_ext"> <BR> @@ -4324,7 +5055,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_opt_in_audio_file"> <BR> - <B>Indagine Opt-in Audio File - </B> Questo è il nome del file audio che viene riprodotto quando il cliente ha optato-in per lindagine, non hanno scelto lopt-out non ha risposto o se la non-azione-reazione è impostato su OptOut. Dopo questo file audio viene riprodotto, il metodo di indagine di azione. + <B>Indagine Opt-in file Audio - </B> Questo è il nome del file audio che viene riprodotto quando il cliente ha optato-in per lindagine, non hanno scelto lopt-out non ha risposto o se la non-azione-reazione è impostato su OptOut. Dopo questo file audio viene riprodotto, il metodo di indagine di azione. <BR> <A NAME="vicidial_campaigns-survey_ni_audio_file"> @@ -4334,7 +5065,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-survey_method"> <BR> - <B>Indagine Metodo - </B> Questa opzione definisce che cosa succede a una chiamata dopo che il cliente ha scelto lopt-in. AGENT_XFER invierà linvito al prossimo disponibili agente. Segreteria invierà la chiamata alla casella vocale che è specificato nel campo Casella Vocale. ESTENSIONE invierà al cliente di definire lestensione della Indagine Xfer Estensione campo. Hangup si bloccherà il cliente. CAMPREC_60_WAV invierà al cliente di avere una registrazione fatta con la loro risposta, questa registrazione sarà collocato in una cartella denominata come la campagna allinterno della campagna di registrazione Indagine Directory. + <B>Indagine Metodo - </B> Questa opzione definisce che cosa succede a una chiamata dopo che il cliente ha scelto lopt-in. AGENT_XFER invierà linvito al prossimo disponibili agente. Segreteria invierà la chiamata alla casella vocale che è specificato nel campo Casella Vocale. ESTENSIONE invierà al cliente di definire lestensione della Indagine Xfer Estensione campo. Hangup si bloccherà il cliente. CAMPREC_60_WAV invierà al cliente di avere una registrazione fatta con la loro risposta, questa registrazione sarà collocato in una cartella denominata come la campagna allinterno della campagna di registrazione Indagine Directory. CALLMENU invierà al cliente al menu chiamate definito nell'elenco di selezione di seguito. <BR> <A NAME="vicidial_campaigns-survey_no_response_action"> @@ -4386,6 +5117,16 @@ if ($ADD==99999) <BR> <B>Agent Visualizzare Dialable Leads -</B> Questa opzione, se attivata mostrerà il numero di porta dialable disponibili nella campagna nella schermata agente. Questo numero è aggiornato nel sistema di una volta al minuto e sarà aggiornata sullo schermo agente ogni pochi secondi. + <BR> + <A NAME="vicidial_campaigns-survey_menu_id"> + <BR> + <B>Indagine chiamate Menu -</B> Se il metodo è impostato CALLMENU, questo è il Menu di chiamata che il cliente viene inviato a se opt-in. + + <BR> + <A NAME="vicidial_campaigns-survey_recording"> + <BR> + <B>Indagine di registrazione -</B> Se attivata, questa inizierà la registrazione quando si risponde alla chiamata. Consigliato solo se il metodo non è impostato per trasferire ad un agente. Il default è n per disabili. Se è impostato su Y_WITH_AMD anche segreteria telefonica le chiamate dei messaggi rilevati saranno registrati. + <?php } ?> @@ -4399,6 +5140,7 @@ if ($ADD==99999) <BR>   - oldest_call_finish: las o`rdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. <BR>   - overall_user_level: las o`rdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. <BR>   - campaign_rank: o`rdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - campaign_grade_random: fornisce una maggiore probabilità di ottenere una chiamata agli agenti superiori graduate. <BR>   - fewest_calls: o`rdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - longest_wait_time: ordini per la quantità di tempo agente è stato attivamente in attesa di una chiamata. @@ -4415,7 +5157,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_prefix"> <BR> - <B>Manual Prefisso Chiamata -</B> This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Prefisso Chiamata defined in the field above. This option does not interfere with the 3way Prefisso Chiamata option. + <B>Selezione prefisso manuale -</B> Questo campo opzionale consente di impostare il prefisso di selezione da utilizzare solo quando effettuano le chiamate dial manuali dall'interfaccia agente, come ad esempio utilizzando la funzione MANUAL DIAL, o Dial Number successiva quando il metodo di selezione MANUAL, o la composizione manuale alt numero, oppure programmato dall'utente solo richiamate. Il valore predefinito è vuoto per disabili, che utilizzano il prefisso di selezione definita nel campo precedente. Questa opzione non interferisce con l'opzione Prefisso Chiamata 3way. <BR> <A NAME="vicidial_campaigns-omit_phone_code"> @@ -4430,7 +5172,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-use_custom_cid"> <BR> - <B>Custom CallerID -</B> When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the CallerID della Campagna defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. + <B>Personalizzato CallerID -</B> Quando è impostato su Y, questa opzione consente di utilizzare il campo security_phrase nella tabella vicidial_list come CallerID di inviare quando si posiziona per ogni lead specifico. Se questo campo non ha CID in esso allora la campagna CallerID sopra definito verrà utilizzato. Questa opzione consente di disattivare il CallerID override lista se è presente un CID nel campo security_phrase. Il valore predefinito è N. Quando è impostato su IndicativoLocalità si avrà la possibilità di entrare nel sottomenu AC-CID e definire callerids più da utilizzare per prefisso locale. <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> @@ -4445,13 +5187,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-campaign_rec_filename"> <BR> - <B>Nome Registrazioni Per Questa Campagna -</B> This field allows you to customize the name of the recording when Campagna recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. + <B>Nome Registrazioni Per Questa Campagna -</B> Questo campo vi permette di personalizzare il nome della registrazione quando la campagna è OnDemand o ALLCALLS. Le variabili sono consentiti CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che sarebbe simile a questa TESTCAMP_51020103108_3125551212. 50 char max. <BR> <A NAME="vicidial_campaigns-allcalls_delay"> <BR> <B>La registracion retrasa -</B> para la grabacion de ALLCALLS y deALLFORCE solamente. Esta voluntad del ajuste retrasa comenzar de lagrabacion en todas las llamadas para el número de los segundosespecificados en este campo. El defecto es 0. + <BR> + <A NAME="vicidial_campaigns-per_call_notes"> + <BR> + <B>Chiama Note per chiamata -</B> Impostando questa opzione a ENABLED consentirà agli agenti di entrare in note per ogni chiamata che gestiscono l'interfaccia agente. La voce le note campo verrà visualizzato sotto il campo Commenti nell'interfaccia dell'agente. Inoltre, se il gruppo Utente Agent è autorizzato a visualizzare dei registri delle chiamate quindi l'agente sarà in grado di visualizzare le note di chiamata passate per un lead in qualsiasi momento. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search"> + <BR> + <B>Agente di piombo Search -</B> Impostando questa opzione su ENABLED consentirà agli agenti di cercare contatti e visualizzare le informazioni di piombo durante la pausa nell'interfaccia dell'agente. Inoltre, se il gruppo Utente Agent è autorizzato a visualizzare dei registri delle chiamate quindi l'agente sarà in grado di visualizzare le note di chiamata per ogni ultimi piombo che si sta visualizzando informazioni su. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_campaigns-agent_lead_search_method"> + <BR> + <B>Agente di piombo Metodo di ricerca -</B> Se il piombo Agente di ricerca è attivata, questa impostazione definisce dove l'agente sarà consentito per la ricerca di conduttori. Sistema cercherà l'intero sistema, CAMPAIGNLISTS cercherà all'interno di tutte le liste attive all'interno della campagna, CAMPLISTS_ALL cercherà all'interno di tutte le liste attivi e inattivi all'interno della campagna, LIST cercherà solo all'interno della ID Manuale delle liste Dial come definito nella campagna . Il valore predefinito è CAMPLISTS_ALL. Una di queste opzioni con Utente_ di fronte solo cercare all'interno di cavi che hanno il campo corrispondente al proprietario ID utente dell'agente, le opzioni con GROUP_ di fronte solo cercare all'interno di cavi che hanno il campo proprietario che corrisponde al gruppo di utenti che l'utente è un membro, le opzioni con TERRITORY_ di fronte solo cercare all'interno di cavi che hanno il campo proprietario corrispondenti ai territori che l'agente ha selezionato. + <BR> <A NAME="vicidial_campaigns-campaign_script"> <BR> @@ -4460,7 +5217,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-get_call_launch"> <BR> - <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent. + <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. Se i campi elenco personalizzati sono attivati ​​sul vostro sistema, FORM si aprirà la scheda FORM al momento della connessione di una chiamata a un agente. <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> @@ -4470,7 +5227,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-quick_transfer_button"> <BR> - <B>Trasferimento rapido Button -</B> Questa opzione aggiunge un pulsante di trasferimento rapido alla schermata agente sotto il pulsante Transfer-Conf che permetterà un clic cieco trasferimento di chiamate al selezionato In-gruppo o numero. IN_GROUP invierà le chiamate al Default Xfer gruppo per questa campagna, o In-gruppo se ci fosse una chiamata in entrata. Le opzioni preimpostate invierà le chiamate al preset selezionato. Di default è N per disabili. The LOCKED options are used to lock the value to the Trasferimento rapido Button even if the agent uses the transfer conference features during a cacll before using the Trasferimento rapido Button. + <B>Trasferimento rapido Button -</B> Questa opzione aggiunge un pulsante di trasferimento rapido alla schermata agente sotto il pulsante Transfer-Conf che permetterà un clic cieco trasferimento di chiamate al selezionato In-gruppo o numero. IN_GROUP invierà le chiamate al Default Xfer gruppo per questa campagna, o In-gruppo se ci fosse una chiamata in entrata. Le opzioni preimpostate invierà le chiamate al preset selezionato. Di default è N per disabili. Le opzioni BLOCCATE vengono utilizzate per bloccare il valore per il pulsante di trasferimento rapido anche se l'agente utilizza le funzionalità di trasferimento conferenza durante una chiamata prima di utilizzare il pulsante Quick Transfer. + + <BR> + <A NAME="vicidial_campaigns-custom_3way_button_transfer"> + <BR> + <B>Custom 3-Way Button Transfer -</B> Questa opzione aggiungere un pulsante personalizzato Transfer alla schermata agente sotto il Transfer-Conf pulsante che permette uno scatto a tre vie chiamate utilizzando il preset selezionato o sul campo. Le opzioni saranno PRESET_ effettuare chiamate utilizzando il valore predefinito definito. Le opzioni saranno FIELD_ effettuare chiamate utilizzando il numero nel campo selezionato dal piombo. DISABILI non verrà visualizzato il pulsante sullo schermo dell'agente. Le opzioni saranno PARK_ parcheggiare al cliente prima della composizione. Predefinito è DISABLED. L'opzione sarà VIEW_PRESET aprire semplicemente la cornice di trasferimento e il telaio preset. L'opzione VIEW_CONTACTS aprirà una finestra di ricerca di contatti, questo funziona solo se Presets Enable è impostato su CONTATTI. <BR> <A NAME="vicidial_campaigns-prepopulate_transfer_preset"> @@ -4480,27 +5242,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-enable_xfer_presets"> <BR> - <B>Enable Transfer Presets -</B> This option will enable the Presets sub menu to appear at the top of the Campagna Modification page, and also you will have the ability to specify Preset dialing numbers for Agenti to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. + <B>Abilita Presets di trasferimento -</B> Questa opzione permetterà ai Presets menu secondario ad apparire nella parte superiore della pagina Modifica campagna, e inoltre si avrà la possibilità di specificare i numeri preimpostati di composizione per agenti da utilizzare nel Transfer-Conference struttura dell'interfaccia dell'agente. Predefinito è DISABLED. CONTATTI è un'opzione solo se contact_information è abilitata sul sistema, che è una funzione personalizzata. + + <BR> + <A NAME="vicidial_campaigns-enable_xfer_presets"> + <BR> + <B>Abilita Presets di trasferimento -</B> Questa opzione permetterà ai Presets menu secondario ad apparire nella parte superiore della pagina Modifica campagna, e inoltre si avrà la possibilità di specificare i numeri preimpostati di composizione per agenti da utilizzare nel Transfer-Conference struttura dell'interfaccia dell'agente. Predefinito è DISABLED. CONTATTI è un'opzione solo se contact_information è abilitata sul sistema, che è una funzione personalizzata. <BR> <A NAME="vicidial_campaigns-hide_xfer_number_to_dial"> <BR> - <B>Hide Transfer Number to Dial -</B> This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED. + <B>Nascondi numero di trasferimento da chiamare -</B> Questa opzione consente di nascondere il numero da comporre campo nella Transfer-Conference struttura dell'interfaccia dell'agente. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-ivr_park_call"> <BR> - <B>Park Call IVR -</B> This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED. + <B>Parcheggia chiamata IVR -</B> Questa opzione permetterà un agente di parcheggiare una chiamata con un apposito tasto CALL IVR PARK sulla loro interfaccia agente se questo è abilitato o ENABLED_PARK_ONLY. L'opzione ENABLED_PARK_ONLY permetterà all'agente di inviare la chiamata a parco, ma non fare clic per recuperare la chiamata come l'opzione abilitata. L'opzione ENABLED_BUTTON_HIDDEN consente alla funzione tramite l'API solo. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-ivr_park_call_agi"> <BR> - <B>Park Call IVR AGI -</B> If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible. + <B>Parcheggia chiamata IVR AGI -</B> Se il campo Chiamata Parco IVR non è disattivato, allora questo campo viene utilizzato come stringa di applicazione AGI che il cliente viene inviato. Si tratta di una impostazione che deve essere impostata dall'amministratore, se possibile,. <BR> <A NAME="vicidial_campaigns-timer_action"> <BR> - <B>Timer azione -</B> Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer azione Destination field, EXTENSION will send the call to the Extension that is specified in the Timer azione Destination field, IN_GROUP will send the call to the In-Group specified in the Timer azione Destination field. + <B>Timer azione -</B> Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. CHIUDI si bloccherà la chiamata quando il timer è attivato, CALLMENU invierà la chiamata al Menu chiamata specificato nel campo Destinazione Timer azione, ESTENSIONE invierà la chiamata per l'estensione che è specificato nel campo Destinazione Timer azione, IN_GROUP invierà la chiamata alla In-gruppo specificato nel campo Destinazione Timer azione. <BR> <A NAME="vicidial_campaigns-timer_action_message"> @@ -4515,7 +5282,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-timer_action_destination"> <BR> - <B>Timer azione Destination -</B> This field is where you specify the Call Menu, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. + <B>Timer Azione Destination -</B> Questo campo è dove si specifica il Menu di chiamata, l'estensione o In-gruppo che si desidera la chiamata inviata se l'azione ora è impostato su CALLMENU, l'estensione o IN_GROUP. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> @@ -4525,12 +5292,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-scheduled_callbacks_alert"> <BR> - <B>Scheduled Callbacks Alert -</B> This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line. + <B>Richiamate pianificate Alert -</B> Questa opzione consente la riga di stato callback nell'interfaccia agente essere rosso, lampeggia o lampeggiare in rosso quando ci sono in programma AGENTONLY callback che hanno colpito il loro tempo e la data di attivazione. Il valore predefinito è NONE per la linea di stato standard. Le opzioni rinviano smette di lampeggiare e-o la visualizzazione in rosso quando si controlla i callback, finché il numero di callback modifiche. <BR> <A NAME="vicidial_campaigns-scheduled_callbacks_count"> <BR> - <B>Scheduled Callbacks Count -</B> This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE. + <B>Richiamate pianificate Conte -</B> Questa opzione permette di impostare solo se richiamate VIVI, dall'utente solo richiamate pianificate che hanno colpito la data e l'ora di attivazione, o callback ALL_ACTIVE, user-only callback che sono attivi nel sistema così come callback viviamo, deve BE3 ha contato int agente di avviso sezione richiamata sullo schermo dell'agente. Il valore predefinito è ALL_ACTIVE. + + <BR> + <A NAME="vicidial_campaigns-callback_days_limit"> + <BR> + <B>Programmato richiamate Giorni Limit -</B> Questa opzione consente di ridurre l'agente richiamate in programma calendario per un numero selezionabile di giorni da oggi, 12 l'intero mese di calendario verrà comunque visualizzato, ma solo il numero di giorni sarà selezionabile. Il default è 0 per un numero illimitato. + + <BR> + <A NAME="vicidial_campaigns-callback_hours_block"> + <BR> + <B>Programmato richiamate Ore Block -</B> Questa opzione consente di limitare un callback USERONLY prevista la visualizzazione della lista agente di callback fino a X ore dopo che è stato impostato. Il valore predefinito è 0 per nessun blocco. + + <BR> + <A NAME="vicidial_campaigns-callback_list_calltime"> + <BR> + <B>Richiamate pianificate blocco Calltime -</B> Questa opzione, se abilitata impedirà la richiamata classificata nella lista callback agente di essere composto se è al di fuori del calltime previsto per la campagna. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_campaigns-my_callback_option"> + <BR> + <B>Il mio richiamate Casella di default -</B> Questa opzione consente di pre-impostare la mia casella di controllo richiamata sullo schermo agente pianificato callback. CHECKED controllerà la casella di controllo automaticamente per ogni chiamata. Il valore predefinito è UNCHECKED. <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> @@ -4542,6 +5329,26 @@ if ($ADD==99999) <BR> <B>Mensaje de Wrap up -</B> esto es un mensaje campaña-especi`fico que seexhibirá en la pantalla del wrapup si se fijan los segundos delwrapup. + <BR> + <A NAME="vicidial_campaigns-disable_dispo_screen"> + <BR> + <B>Disable Screen Dispo -</B> Questa opzione consente di disattivare lo schermo disposizione nell'interfaccia dell'agente. Il campo Stato Disattiva Dispo di seguito devono essere compilati per far funzionare questa opzione. Il valore predefinito è DISPO_ENABLED. L'opzione DISPO_SELECT_DISABLED non disattivare la schermata dispo completamente, ma viene visualizzata la schermata dispo senza disposizioni, questa opzione deve essere utilizzata solo se si desidera forzare i vostri agenti di utilizzare il software CRM, che invierà lo stato del sistema tramite l'API. + + <BR> + <A NAME="vicidial_campaigns-disable_dispo_status"> + <BR> + <B>Disabilita Stato Dispo -</B> Se l'opzione Dispo schermo è impostata su Disabilita DISPO_DISABLED, allora questo campo deve essere compilati Puoi usare qualsiasi disposizione che si desidera per il campo finché è di 1 a 6 caratteri di lunghezza, con solo lettere e numeri. + + <BR> + <A NAME="vicidial_campaigns-screen_labels"> + <BR> + <B>Agente schermo etichette -</B> È possibile selezionare un set di etichette schermo agenti da utilizzare con questa opzione. Il valore predefinito è - System-Settings - per le etichette predefinite. + + <BR> + <A NAME="vicidial_campaigns-status_display_fields"> + <BR> + <B>Visualizzazione dello stato Fields -</B> È possibile selezionare quali variabili per le chiamate verrà visualizzato nella riga di stato della schermata agente. CallID visualizzerà il 20 ID chiamata il suo carattere unico, LEADID visualizzerà l'ID di piombo del sistema, LISTID visualizzerà la lista di ID. Il valore predefinito è CallID. + <BR> <A NAME="vicidial_campaigns-use_internal_dnc"> <BR> @@ -4562,6 +5369,21 @@ if ($ADD==99999) <BR> <B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun co`digo de la pausa cuando chascan encendido el boton de PAUSA envicidial.php. Los co`digos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinio`n de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. VIGORE costringerà gli agenti di scegliere un codice PAUSE se fai clic sul pulsante PAUSE. + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall"> + <BR> + <B>Auto Pause Pre-Call Work -</B> In auto-selettore di modalità, questa impostazione se abilitata imposterà l'agente automaticamente messa in pausa quando si fa clic su qualsiasi agente delle seguenti funzioni che richiede loro di essere in pausa-Manual Dial, chiamata rapida, Ricerca Piombo, Call View Log, richiamate Check, Inserisci il codice Pausa. Il default è n per inattivo. + + <BR> + <A NAME="vicidial_campaigns-auto_resume_precall"> + <BR> + <B>Auto Resume Pre-Call Work -</B> In auto-selettore di modalità, questa impostazione se abilitata imposterà l'agente attiva automaticamente quando l'agente fa clic fuori, o annulla, su qualsiasi delle seguenti funzioni che richiede loro di essere in pausa Dial-Manual, chiamata rapida, Ricerca Piombo, Call Log View, richiamate di controllo, immettere codice di pausa. Il default è n per inattivo. + + <BR> + <A NAME="vicidial_campaigns-auto_pause_precall_code"> + <BR> + <B>Auto Pause Pre-Call Codice -</B> Se l'Auto Pause Pre-Call funzione di lavoro di cui sopra è attiva e codici Pause agente è attivo, questa impostazione sarà il codice pausa che viene utilizzato quando l'agente è in pausa per queste attività. Il valore predefinito è PRECAL. + <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> <BR> @@ -4580,7 +5402,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_override"> <BR> - <B>Manual Dial Override -</B> The setting can override the Utenti setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Utenti setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE. + <B>Selezione manuale Override -</B> L'impostazione può ignorare le possibilità di impostazione per utenti dial manuale per gli agenti quando sono connessi in questa campagna. NONE seguirà l'impostazione di utenti, ALLOW_ALL permetterà a qualsiasi agente collegato in questa campagna di effettuare chiamate di selezione manuale, DISABLE_ALL non permetteremo a nessuno l'accesso a questa campagna per effettuare chiamate di selezione manuale. Il valore predefinito è NONE. <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> @@ -4590,12 +5412,32 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> - <B>Manuale Dial Filtro - </B> Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTE - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi. CAMPLISTE_ALL - will include lista inattive in the search for the number. + <B>Manuale Dial Filtro - </B> Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTS - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi. CAMPLISTS_ALL - si includono gli elenchi inattivi nella ricerca per il numero. <BR> <A NAME="vicidial_campaigns-manual_preview_dial"> <BR> - <B>Manual Preview Dial -</B> This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP. + <B>Anteprima composizione manuale -</B> In questo modo l'agente in modalità di selezione manuale per visualizzare le informazioni di piombo quando si fa clic su Componi Numero successiva prima che attivamente comporre la telefonata. C'è un collegamento opzionale per SALTA il cavo e passare a quella successiva se selezionata. Il valore predefinito è PREVIEW_AND_SKIP. + + <BR> + <A NAME="vicidial_campaigns-api_manual_dial"> + <BR> + <B>Selezione manuale API -</B> Questa opzione consente di impostare l'API agente per fare uno dei due chiamate contemporaneamente, STANDARD, o la capacità di mettere in coda le chiamate di selezione manuale e li hanno comporre automaticamente una volta che l'agente va in pausa o è disponibile a prendere il loro chiamata successiva con il opzione per disattivare la composizione automatica di queste chiamate, una coda o QUEUE_AND_AUTOCALL che è lo stesso di coda, ma senza l'opzione per disattivare la composizione automatica di queste chiamate. Se un agente ha più di una chiamata in coda per loro vedranno il conteggio di quante chiamate dial manuali sono in coda proprio sotto il pulsante Pausa, o Dial Number pulsante Avanti. Suggeriamo che se coda viene utilizzato di inviare azioni API usando l'anteprima = YES opzione in modo non si è più volte chiamata chiamate per l'agente senza preavviso. Inoltre, se usate QUEUE e pesantemente utilizzando le chiamate con linea manuali in un metodo non composizione manuale, si consiglia l'impostazione della pausa agente dopo ogni opzione Call to Y. Il valore predefinito è STANDARD. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_call_time_check"> + <BR> + <B>Tempo di chiamata Controllo manuale -</B> Se questa opzione è attivata, controlla tutte le chiamate di selezione manuale per assicurarsi che essi si trovano le impostazioni dell'ora delle chiamate previste per la campagna. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_campaigns-manual_dial_cid"> + <BR> + <B>Selezione manuale CID -</B> Questo definisce se un agente di effettuare le chiamate di selezione manuale avrà le impostazioni della campagna identificativi dei chiamanti utilizzati, o dei loro agenti impostazioni del telefono utilizzato identificativi dei chiamanti. Il valore predefinito è CAMPAGNA. Se l'opzione Custom campagna Usa CID è abilitata o la campagna elenco CID impostazione Override viene utilizzato, questa impostazione verrà ignorata. + + <BR> + <A NAME="vicidial_campaigns-post_phone_time_diff_alert"> + <BR> + <B>Phone messaggio Ora Alert Difference -</B> Questo manuale-dial-unica caratteristica, se attivata, verrà visualizzato un avviso se il fuso orario per il codice postale di piombo, o il codice postale, è diverso dal fuso orario del prefisso del numero di telefono per il piombo. L'opzione OUTSIDE_CALLTIME_ONLY mostrerà solo l'avviso se i due fusi orari sono diversi e uno dei fusi orari è al di fuori del tempo di chiamata selezionata per la campagna. OUTSIDE_CALLTIME_PHONE solo controllare il fuso orario del numero di telefono del piombo e avvisa se è al di fuori del tempo di chiamata locale. OUTSIDE_CALLTIME_POSTAL solo controllare il fuso orario del codice postale del piombo e avvisa se è al di fuori del tempo di chiamata locale. OUTSIDE_CALLTIME_BOTH controllerà il codice postale e numero di telefono per essere dentro il tempo di chiamata locale, anche se sono nello stesso fuso orario. Questi avvisi mostrerà le informazioni nel registro delle chiamate, elenco callback informazioni, risultati di ricerca di informazioni, quando un cavo viene composto e quando è previsto un cavo. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> @@ -4605,7 +5447,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> - <B>3-Way chiamate in uscita CallerID - </B> Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in. AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte. CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead. + <B>3-Way chiamate in uscita CallerID - </B> Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in. AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte. CUSTOM_CID utilizzerà il CID personalizzato che è definita nel campo della tabella security_phrase vicidial_list per il cavo. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> @@ -4615,17 +5457,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_logging"> <BR> - <B>Customer 3-Way Hangup Logging -</B> If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED. + <B>Clienti 3-Way Hangup Logging -</B> Se questa opzione è abilitata, la user_call_log registrerà quando un cliente fino hangup se riagganciare nel corso di un 3-way chiamata. Inoltre, questo può consentire al Cliente 3-way azione hangup se è defineed seguito. Predefinito è ABILITATO. <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_seconds"> <BR> - <B>Customer 3-Way Hangup Seconds -</B> If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds. + <B>Cliente 3-Way Hangup Secondi -</B> Se il Cliente 3-way la registrazione è attivata, questa opzione consente di definire il numero di secondi dopo l'hangup cliente viene rilevato prima che sia effettivamente registrato e opzionale cliente 3-way hangup azione viene eseguita. Il valore predefinito è 5 secondi. <BR> <A NAME="vicidial_campaigns-customer_3way_hangup_action"> <BR> - <B>Customer 3-Way Hangup Action -</B> If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE. + <B>Clienti 3-Way Hangup Action -</B> Se il Cliente 3-way la registrazione è attivata, questa opzione permette di avere lo schermo automaticamente agente di riagganciare la chiamata e passare alla schermata DISPO se questa opzione è impostata su DISPO. Il valore predefinito è NONE. <?php if ($SSqc_features_active > 0) @@ -4702,12 +5544,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-queuemetrics_callstatus"> <BR> - <B>QM CallStatus Override -</B> If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the Impostazioni di Sistema setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting. + <B>QM CallStatus Override -</B> Se l'integrazione QueueMetrics è abilitato nelle impostazioni di sistema questa impostazione consentono prevalente delle impostazioni di sistema di impostazione per CallStatus voci queue_log. Predefinito è DISABLED che utilizzerà l'impostazione del sistema. + + <BR> + <A NAME="vicidial_campaigns-queuemetrics_phone_environment"> + <BR> + <B>QM Phone Ambiente -</B> Se l'integrazione QueueMetrics è abilitato nelle impostazioni di sistema questa impostazione consente l'inserimento di questo valore dei dati nel campo data4 del queue_log per le registrazioni delle attività dell'agente. Il valore predefinito è vuota per disabili. <BR> <A NAME="vicidial_campaigns-extension_appended_cidname"> <BR> - <B>Extension Append CID -</B> If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + <B>Extension Aggiunge CID -</B> Se attivata, le chiamate effettuate da questa campagna avrà uno spazio e l'estensione telefono dell'agente aggiunto alla fine del nome CallerID per la chiamata prima che venga inviato all'agente. Il default è n per disabili. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping"> + <BR> + <B>PLLB Raggruppamento -</B> Accedi Phone Raggruppamento Load Balancing, consentito solo se ci sono server multipli e alias agente del telefono sono presenti sul sistema. Se è impostato su ONE_SERVER_ONLY che costringerà tutti gli agenti di questa campagna per accedere allo stesso server. Se è impostato su CASCATA si raggruppare i registrato nel agenti sullo stesso server fino al numero Raggruppamento PLLB Limite di agenti sono raggiunti, allora l'agente prossimo per accedere al server successivo con il minor numero di agenti. Se impostato su Disabilitato il comportamento standard Phone alias di ciascun agente trovare il server con il minor numero di agenti non-remoti collegati in esso sarà utilizzato. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_campaigns-pllb_grouping_limit"> + <BR> + <B>PLLB Raggruppamento Limit -</B> Telefono Accedi Load Balancing Limit Raggruppamento. Se Raggruppamento PLLB è impostato su CASCATA questa impostazione determinerà il numero di agenti accettabile in ogni server per questa campagna. Il valore predefinito è 50. <BR> <A NAME="vicidial_campaigns-crm_popup_login"> @@ -4729,6 +5586,11 @@ if ($ADD==99999) <BR> <B>Dispo Call URL -</B> Questo web indirizzo URL non è visto che l-agente, ma è chiamato ogni volta che una chiamata è dispositioned da un agente, se viene popolato. Utilizza le stesse variabili, come i campi del modulo web e script. dispo e talk_time sono le variabili che si possono utilizzare per recuperare l-agente definito disposizione per la chiamata e il tempo effettivo di conversazione in secondi della telefonata. Questo URL non può essere un percorso relativo. Predefinita è vuota. + <BR> + <A NAME="vicidial_campaigns-na_call_url"> + <BR> + <B>Nessun agente URL chiamata -</B> Questo indirizzo URL web non si vede l'agente, ma se è popolato è chiamato ogni volta che viene appeso a una chiamata che non è gestito da un agente verso l'alto o trasferiti. Utilizza le stesse variabili i campi del modulo web e script. dispo può essere utilizzato per recuperare il sistema definito disposizione per la chiamata. Questo URL non può essere un percorso relativo. Il valore predefinito è vuoto. + <BR> <A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> @@ -4767,17 +5629,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_campaigns-blind_monitor_warning"> <BR> - <B>Blind Monitor Warning -</B> This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED. + <B>Monitor Warning cieca -</B> Questa opzione, se attivata farà l'agente di sapere in vari modi opzionali se vengono cieco controllati da qualcuno. DISABILI significa che questa funzione non è attiva, ALERT solo un avviso pop-up sullo schermo agente, AVVISO pubblicherà una nota che rimane sullo schermo agente finché theya re monitorato, AUDIO giocherà il nome del file definito di seguito quando un agente sta cominciando a essere monitorati e le altre opzioni sono combibnations delle suddette opzioni. Predefinito è DISABLED. <BR> <A NAME="vicidial_campaigns-blind_monitor_message"> <BR> - <B>Blind Monitor Notice -</B> This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is -Someone is blind monitoring your session-. + <B>Cieco Monitor Notice -</B> Questo è il messaggio che verrà visualizzato sullo schermo l'agente mentre vengono monitorati se l'opzione AVVISO è selezionata. Il valore predefinito è -Someone is blind monitoring your session-. <BR> <A NAME="vicidial_campaigns-blind_monitor_filename"> <BR> - <B>Blind Monitor Filename -</B> This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty. + <B>Cieco Monitor Filename -</B> Questo è il file audio che verrà riprodotto nella sessione agenti all'inizio del monitoraggio che qualcuno li accecano. Questo messaggio sarà giocato per tutta la sessione anche se il cliente è presente. Il valore predefinito è vuoto. @@ -4785,7 +5647,7 @@ if ($ADD==99999) <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_LISTE TABELLA</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_LISTS TABELLA</FONT></B><BR><BR> <A NAME="vicidial_lists-list_id"> <BR> <B>Identificacio`n de la lista -</B> Úste es el nombre nume`rico de la lista, e`l no es editable despue`s de la sumisio`n inicial, debe contener solamente números y debe estar entre 2 y 8 caracteres en longitud. Must be a number greater than 100. @@ -4847,13 +5709,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_lists-drop_inbound_group_override"> <BR> - <B>Drop Inbound Group Override -</B> Se questo campo è impostato, in questo gruppo verranno utilizzati per le chiamate in uscita all-interno di questa lista che scendono da campagna in uscita, invece di cadere in gruppo insieme nella schermata di dettaglio della campagna. Di default non è impostato. + <B>Drop Inbound Group Override -</B> Se questo campo è impostato, in questo gruppo verranno utilizzati per le chiamate in uscita all-interno di questa lista che scendono da campagna in uscita, invece di cadere in gruppo insieme nella schermata di dettaglio della campagna. Di default non è impostato. + + <BR> + <A NAME="vicidial_lists-web_form_address"> + <BR> + <B>Override Web Form - </ B> Questo è l'indirizzo personalizzato che cliccando sul pulsante WEB FORM in VICIDIAL vi porterà per le chiamate che arrivano su questo elenco. Se si desidera utilizzare i campi personalizzati in un indirizzo web form, è necessario aggiungere &CF_uses_custom_fields=Y come parte del tuo URL. <BR> <A NAME="vicidial_lists-xferconf_a_dtmf"> <BR> <B>XFER-Conf Numero Override -</B> Questi cinque campi consentono di ignorare le impostazioni predefinite Conferenza di trasferimento del numero, quando la guida è da questo elenco. Predefinita è vuota. + <BR> + <A NAME="vicidial_lists-inventory_report"> + <BR> + <B>Inventory report -</B> Se nel verbale di inventario è abilitata sul sistema, questa opzione di verificare se questo elenco è incluso nella relazione oppure no. Il valore predefinito è Y per yes. + + <BR> + <A NAME="vicidial_lists-time_zone_setting"> + <BR> + <B>Impostazione del fuso orario -</B> Questa opzione consente di impostare il metodo di mantenere l'attuale ricerca fuso orario per i cavi all'interno di questa lista. Questo processo viene fatto solo di notte quindi tutte le modifiche apportate non saranno immediati. COUNTRY_AND_AREA_CODE è l'impostazione predefinita, e utilizzerà il prefisso del paese e il prefisso interurbano del numero di telefono per determinare il fuso orario del piombo. Postal_Code utilizzerà il codice postale se disponibile, per determinare il fuso orario del piombo. NANPA_PREFIX funziona solo negli Stati Uniti e utilizzerà il prefisso e il prefisso del numero di telefono per determinare il fuso orario del piombo, ma questo non è abilitato di default nel sistema, in modo da assicurarsi di disporre dei dati prefisso NANPA caricati su il sistema prima di selezionare questa opzione. OWNER_TIME_ZONE_CODE utilizzerà lo standard abbraviation fuso orario caricato nel campo proprietario del piombo per determinare il fuso orario, negli esempi USA sono AST, EST, CST, MST, PST, AKST, HST. Questa funzione deve essere abilitata dall'amministratore di sistema potrà entrare in vigore. + <BR> <A NAME="vicidial_list-dnc"> @@ -4884,10 +5761,20 @@ if ($ADD==99999) <BR> <B>Activo -</B> esto se determina si este grupo demuestra para arriba en la caja de la seleccio`n cuando un agente de VICIDIAL entra. + <BR> + <A NAME="vicidial_inbound_groups-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo gruppo in entrata, questo permette la visualizzazione di questa amministrazione in-gruppo limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo gruppo. + + <BR> + <A NAME="vicidial_inbound_groups-group_calldate"> + <BR> + <B>In-Group Calldate -</B> Questa è l'ultima data e l'ora che una chiamata è stata rivolta a questo gruppo in entrata. + <BR> <A NAME="vicidial_inbound_groups-web_form_address"> <BR> - <B>Forma del Web -</B> esta es la Direccion de encargo que el chascar en el boton de la FORMA del WEB en VICIDIAL le llevará para las llamadas que vienen adentro en este grupo. + <B>Forma del Web -</B> esta es la Direccion de encargo que el chascar en el boton de la FORMA del WEB en VICIDIAL le llevará para las llamadas que vienen adentro en este grupo. Se si desidera utilizzare i campi personalizzati in un indirizzo web form, è necessario aggiungere &CF_uses_custom_fields=Y come parte del tuo URL. <BR> <A NAME="vicidial_inbound_groups-next_agent_call"> @@ -4896,14 +5783,30 @@ if ($ADD==99999) <BR>   - random: o`rdenes por el valor al azar de la actualizacio`n en la tabla de los vicidial_live_agents <BR>   - oldest_call_start: las o`rdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. <BR>   - oldest_call_finish: las o`rdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. + <BR>   - oldest_inbound_call_start: ordini per l'ultima volta che un agente è stato inviato una chiamata in ingresso. Risultati in agenti che ricevono lo stesso numero complessivo di chiamate. + <BR>   - oldest_inbound_call_finish: ordini per l'ultima volta che un agente finito una chiamata in ingresso. Agente AKA attesa più lunga riceve per la prima chiamata. <BR>   - overall_user_level: las o`rdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. <BR>   - inbound_group_rank: o`rdenes de la fila dada al agente para el grupode entrada específico. Lo más arriba posible a lo más bajo posible. - <BR>   - fewest_calls: o`rdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - campaign_rank: o`rdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - ingroup_grade_random: dà una probabilità maggiore di ottenere una chiamata agli agenti più alti graduati di in-group. + <BR>   - campaign_grade_random: dà una probabilità maggiore di ottenere una chiamata agli agenti più alti graduati per campagna. + <BR>   - fewest_calls: o`rdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR>   - longest_wait_time: ordini per la quantità di tempo agente è stato attivamente in attesa di una chiamata. + <BR>   - ring_all: rings all available agents until one picks up the phone. + <BR> NOTE: Per ring_all, gli agenti che utilizzano i telefoni che hanno su Enabled Hook agente avranno il loro anello di telefoni e il primo a rispondere riceverà la chiamata e le informazioni sullo schermo dell'agente. Dal momento che ring_all ignora i tempi di attesa agente e ranking e chiamerà tutti gli agenti che è disponibile per la coda, si consiglia di non utilizzare questo metodo per le code di grandi dimensioni. Quando si utilizza ring_all, gli agenti registrati con i telefoni che hanno l'Agente On Hook disabili dovranno utilizzare le chiamate nel pannello Coda e cliccare sul link CALL PRESA a prendere le chiamate in coda. La quantità di tempo gli agenti del telefono squillerà per ring_all è impostato su On-Hook impostazione squilli o il tempo più breve anello dei telefoni che saranno chiamati. Si consiglia di non utilizzare ring_all su code ad alto volume di chiamata, o le code con molti agenti. Il metodo ring_all è destinato ad essere utilizzato con solo pochi agenti e il volume chiamata basso in gruppi. <BR> + <BR> + <A NAME="vicidial_inbound_groups-on_hook_ring_time"> + <BR> + <B>On-Hook squilli -</B> Questa opzione viene utilizzata solo per gli agenti che vengono registrati con i telefoni che hanno l'agente-on-hook funzione attivata. Questo è il numero di secondi che ogni tentativo di chiamata all'agente suonerà per fino a quando il sistema attende un secondo e iniziano a suonare i telefoni degli agenti disponibili di nuovo. Questo campo può essere ignorato se i telefoni degli agenti sono impostate per un tempo di anello inferiore che può essere necessario per evitare che le chiamate vengano inviate uno segreteria telefoni. Il valore predefinito è 15. + + <BR> + <A NAME="vicidial_inbound_groups-on_hook_cid"> + <BR> + <B>On-Hook CID -</B> Questa opzione viene utilizzata solo per gli agenti che vengono registrati con i telefoni che hanno l'agente-on-hook funzione attivata. Questo è l'ID chiamante che apparirà sui loro telefoni agenti quando le chiamate vengono chiamata. GENERIC è un generico RINGAGENT00000000001 tipo di notifica. Ingroup mostrerà solo l'in-group la chiamata proviene. CUSTOMER_PHONE mostrerà solo il numero telefonico del cliente. CUSTOMER_PHONE_RINGAGENT mostrerà RINGAGENT_3125551212 con il RINGAGENT come parte del CID con il numero di telefono del cliente. CUSTOMER_PHONE_INGROUP mostrerà i primi 10 caratteri del gruppo in-seguito dal numero di telefono del cliente. Default is GENERIC. + <BR> <A NAME="vicidial_inbound_groups-queue_priority"> <BR> @@ -4921,12 +5824,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ignore_list_script_override"> <BR> - <B>Ignore List Script Override-</B> This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any ID Lista script settings. Default is N. + <B>Ignora Script Override List-</B> Questa opzione consente di ignorare l'ID elenco delle opzioni Script Override per le chiamate che entrano in questo In-Group. Impostare questo a Y ignorerà le impostazioni di script ID List. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_groups-get_call_launch"> <BR> - <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent. + <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. Se i campi elenco personalizzati sono attivati ​​sul vostro sistema, FORM si aprirà la scheda FORM al momento della connessione di una chiamata a un agente. <BR> <A NAME="vicidial_inbound_groups-xferconf_a_dtmf"> @@ -4936,7 +5839,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action"> <BR> - <B>Timer azione -</B> Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. Questa impostazione sovrascrive le impostazioni della campagna. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer azione Destination field, EXTENSION will send the call to the Extension that is specified in the Timer azione Destination field, IN_GROUP will send the call to the In-Group specified in the Timer azione Destination field. + <B>Timer azione -</B> Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. Questa impostazione sovrascrive le impostazioni della campagna. CHIUDI si bloccherà la chiamata quando il timer è attivato, CALLMENU invierà la chiamata al Menu chiamata specificato nel campo Destinazione Timer azione, ESTENSIONE invierà la chiamata per l'estensione che è specificato nel campo Destinazione Timer azione, IN_GROUP invierà la chiamata alla In-gruppo specificato nel campo Destinazione Timer azione. <BR> <A NAME="vicidial_inbound_groups-timer_action_message"> @@ -4951,7 +5854,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-timer_action_destination"> <BR> - <B>Timer azione Destination -</B> This field is where you specify the Call Menu, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. + <B>Timer Azione Destination -</B> Questo campo è dove si specifica il Menu di chiamata, l'estensione o In-gruppo che si desidera la chiamata inviata se l'azione ora è impostato su CALLMENU, l'estensione o IN_GROUP. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> @@ -4966,18 +5869,28 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> - <B>Gota Extensions - </B> In caso di caduta di azione è fissato al messaggio, questa è la linea che il piano di estensione invito sarà inviato a se raggiunge Call Drop Secondi. + <B>Gota Extensions - </B> In caso di caduta di azione è fissato al messaggio, questa è la linea che il piano di estensione invito sarà inviato a se raggiunge Call Drop Secondi. Per AGENTDIRECT in gruppi, se l'utente non è disponibile, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> <BR> - <B>Casella Vocale -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + <B>Casella Vocale -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare. <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> <B>Trasferimento Drop Group - </B> In caso di caduta di azione è fissato a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si raggiunge il Call Drop Secondi. + <BR> + <A NAME="vicidial_inbound_groups-drop_callmenu"> + <BR> + <B>Menu a discesa chiamata -</B> Se l'azione è impostata su Goccia CALLMENU, la chiamata verrà inviato a questo menu chiamata, se arriva secondi di chiamata Goccia. + + <BR> + <A NAME="vicidial_inbound_groups-action_xfer_cid"> + <BR> + <B>Azione Transfer CID -</B> Usato per Drop, Dopo mezzanotte e No-agent-no-coda azioni. Questo è il numero ID del chiamante che la chiamata utilizza prima del loro trasferimento alle estensioni, messaggi, casella vocale o menu di chiamata. È possibile utilizzare CLIENTE in questo campo per utilizzare il numero telefonico del cliente, o campagna per utilizzare il primo numero del chiamante consentito campagna id. Il valore predefinito è CLIENTE. + <BR> <A NAME="vicidial_inbound_groups-call_time_id"> <BR> @@ -4996,22 +5909,27 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-after_hours_exten"> <BR> - <B>Despue`s de la extension de las horas -</B> la extension dialplan paraenviar la llamada si la accio`n se fija a la Extension. El defecto es8300. + <B>Despue`s de la extension de las horas -</B> la extension dialplan paraenviar la llamada si la accio`n se fija a la Extension. El defecto es8300. Per AGENTDIRECT in gruppi, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_inbound_groups-after_hours_voicemail"> <BR> - <B>Despue`s de las horas Casella Vocale -</B> la caja del voicemail para enviar lallamada si la accio`n se fija a VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + <B>Despue`s de las horas Casella Vocale -</B> la caja del voicemail para enviar lallamada si la accio`n se fija a VOICEMAIL. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare. <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> <B>After Hours Trasferimento Group - </B> Se After Hours azione è destinata a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si entra nel gruppo in al di fuori del regime di chiamata tempo definito per il gruppo in. + <BR> + <A NAME="vicidial_inbound_groups-after_hours_callmenu"> + <BR> + <B>After Hours chiamate Menu -</B> Se After Hours azione è impostata su CALLMENU, la chiamata verrà inviata a questo Menu chiamata se si entra in gruppo al di fuori del regime di tempo definito per la chiamata in gruppo. + <BR> <A NAME="vicidial_inbound_groups-no_agent_no_queue"> <BR> - <B>N. agenti n. Queueing -</B> Se questo campo è impostato su Y o NO_PAUSED allora non le chiamate saranno messi in coda per questo gruppo se non ci sono agenti di login e le chiamate andrà l-agente No No Action coda. L-opzione NO_PAUSED non anche inviare i chiamanti in coda se non ci sono solo agenti in pausa in gruppo. Di default è N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + <B>N. agenti n. Queueing -</B> Se questo campo è impostato su Y o NO_PAUSED allora non le chiamate saranno messi in coda per questo gruppo se non ci sono agenti di login e le chiamate andrà l-agente No No Action coda. L-opzione NO_PAUSED non anche inviare i chiamanti in coda se non ci sono solo agenti in pausa in gruppo. Di default è N. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare. Si può anche mettere AGENTEXT in questo campo se è impostato per estensione e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_inbound_groups-no_agent_action"> @@ -5023,6 +5941,21 @@ if ($ADD==99999) <BR> <B>Nessun agente n. coda azione Value -</B> Questo è il valore per l-azione di cui sopra. Predefinito è nbdy-avail-to-take-call|vm-goodbye. + <BR> + <A NAME="vicidial_inbound_groups-max_calls_method"> + <BR> + <B>Max Chiama il metodo -</B> Questa opzione può consentire la massima funzionalità concorrente chiede che tale in-gruppo. Se impostato a TOTAL, quindi il numero totale di chiamate gestite dagli agenti e in coda in questo gruppo non potrà superare il Conte Max chiama il numero di linee come di seguito definiti. Se impostato su IN_QUEUE, quindi se il numero di chiamate in coda in attesa per gli agenti non potranno superare il Conte Max chiamate non importa quante chiamate sono con gli agenti per questo in-gruppo. Predefinito è DISABLED. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_count"> + <BR> + <B>Chiamate Conte Max -</B> Questa opzione deve essere superiore a 0 se si desidera utilizzare la funzione di chiamate Max metodo. Il default è 0. + + <BR> + <A NAME="vicidial_inbound_groups-max_calls_action"> + <BR> + <B>Max chiamate Azione -</B> Questa è l'azione da intraprendere se il Max Chiama il metodo è abilitata e il numero di chiamate superiore a quello che si trova al di sopra del Conte Max Chiamate impostazione. Le chiamate oltre tale importo verrà inviato sia l'azione DROP, l'azione AFTERHOURS o l'azione NO_AGENT_NO_QUEUE e verrà registrato come uno status MAXCAL con una ragione hangup MaxCalls. Il valore predefinito è NO_AGENT_NO_QUEUE. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> @@ -5051,12 +5984,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-onhold_prompt_no_block"> <BR> - <B>On Hold Prompt No Block -</B> Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>In attesa Prompt No Block -</B> Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in attesa in cui la richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre l'On Hold messaggio Nome Prompt sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_groups-onhold_prompt_seconds"> <BR> - <B>On Hold Prompt Seconds -</B> This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10. + <B>In attesa Secondi Prompt -</B> Questo campo deve essere impostato il numero di secondi che l'On Hold Filename Prompt gioca. Il valore predefinito è 10. <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> @@ -5071,107 +6004,107 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds"> <BR> - <B>Calculate Estimated Hold Seconds -</B> This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0. + <B>Calcolare Secondi Attesa stimato -</B> Definisce il numero di secondi nella coda, che il cliente dovrà attendere prima il tempo di attesa stimato sarà calcolato ed eventualmente riprodotti. Minima è di 3 secondi, anche se impostato inferiore a 3. Il default è 0. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename"> <BR> - <B>Estimated Hold Time Minimum Filename -</B> If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive. + <B>Tenere minimo stimato Filename Tempo -</B> Se il tempo di attesa stimato è attivo e si calcola sia pari o inferiore al minimo di 15 secondi, allora questo file sarà tempestivamente svolto invece l'annuncio di default. Il valore predefinito è vuoto per inattiva. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block"> <BR> - <B>Estimated Hold Time Minimum Prompt No Block -</B> If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N. + <B>Tempo di attesa stimato minimo Prompt No Block -</B> Se il tempo di attesa stimato è attiva e la stima del tempo minimo di attesa campo Nome del file è al di sopra compilata, quindi questa opzione per consentire le chiamate in fila dietro a una chiamata in cui la richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio . Mentre la richiesta sta giocando a un cliente che non possono essere inviati ad un agente. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds"> <BR> - <B>Estimated Hold Time Minimum Prompt Seconds -</B> This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10. + <B>Tempo di attesa stimato secondi minimo Prompt -</B> Questo campo deve essere impostato il numero di secondi che il tempo stimato di attesa minima richiesta Nome gioca. Il valore predefinito è 10. <BR> <A NAME="vicidial_inbound_groups-wait_time_option"> <BR> - <B>Wait Time Opzione -</B> This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line. + <B>Attendere Opzione Tempo -</B> Ciò consente di offrire ai clienti opzioni per lasciare la coda se il loro tempo di attesa è finita la quantità di secondi specificato qui di seguito. Il valore predefinito è NONE. Se una delle opzioni PRESS_ è selezionata, si svolgerà il Filename Press definito di seguito e dare al cliente la possibilità di premere 1 sul telefono a lasciare la coda ed eseguire l'opzione selezionata. L'opzione PRESS_STAY invierà al cliente alla coda senza perdere il loro posto in linea. <BR> <A NAME="vicidial_inbound_groups-wait_time_second_option"> <BR> - <B>Wait Time Second Opzione -</B> Same as the first Wait Time Opzione field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Opzione is selected then this option will not be offered. + <B>Attendere Opzione Second Time -</B> Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo controllerà per il cliente premendo il tasto 2. Il valore predefinito è NONE. Se nessun tempo di attesa prima opzione è selezionata questa opzione non sarà disponibile. <BR> <A NAME="vicidial_inbound_groups-wait_time_third_option"> <BR> - <B>Wait Time Third Opzione -</B> Same as the first Wait Time Opzione field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Opzione is selected then this option will not be offered. + <B>Attendere Opzione terza volta -</B> Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo controllerà per il cliente preme il tasto 3. Il valore predefinito è NONE. Se non seconda opzione tempo di attesa è selezionata questa opzione non sarà disponibile. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_seconds"> <BR> - <B>Wait Time Opzione Seconds -</B> If Wait Time Opzione is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds. + <B>Attendere seconds Tempo -</B> Se il tempo di attesa opzione è impostata a nulla, ma NONE, questo è il numero di secondi che il cliente ha atteso in coda che attiveranno le opzioni di tempo di attesa. Il valore predefinito è 120 secondi. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_exten"> <BR> - <B>Wait Time Opzione Extension -</B> If Wait Time Opzione is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. + <B>Attendere Opzione proroga -</B> Se il tempo di attesa opzione è impostato PRESS_EXTEN, questa è l'estensione dialplan che la chiamata sarà inviata se il cliente preme il tasto opzione presentati con l'opzione. Per AGENTDIRECT in gruppi, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callmenu"> <BR> - <B>Wait Time Opzione Callmenu -</B> If Wait Time Opzione is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option. + <B>Attendere Opzione Callmenu Tempo -</B> Se il tempo di attesa opzione è impostata su PRESS_CALLMENU, questo è il Menu di chiamata che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_voicemail"> <BR> - <B>Wait Time Opzione Casella Vocale -</B> If Wait Time Opzione is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + <B>Attendere Opzione Casella Vocale Tempo -</B> Se il tempo di attesa opzione è impostata su PRESS_VMAIL, questa è la casella vocale che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_xfer_group"> <BR> - <B>Wait Time Opzione Transfer In-Group -</B> If Wait Time Opzione is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option. + <B>Attendere Opzione Transfer Time In-Group -</B> Se il tempo di attesa opzione è impostata su PRESS_INGROUP, questo è il gruppo in entrata che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_press_filename"> <BR> - <B>Wait Time Opzione Press Filename -</B> If Wait Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Opzione Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Opziones, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back. + <B>Attendere opzione filename Tempo Press -</B> Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto se il tempo di attesa dei clienti supera i Secondi opzione di Wait dare al cliente la possibilità di premere 1, 2 o 3 sul loro telefono cellulare per l'esecuzione i selezionati tempo di attesa premere Opzioni. E 'molto importante includere le opzioni nel file audio per tutte le opzioni selezionate tempo di attesa, e che la lunghezza del file audio in secondi è propriamente definito nel campo Nome file Seconds sotto o ci saranno problemi. L'impostazione predefinita è di-essere-chiamato-back. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_no_block"> <BR> - <B>Wait Time Opzione Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Wait Time Opzione Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Opzione Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>Attendere Opzione Press Tempo No Block -</B> Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in cui il tempo di attesa Opzione Press Nome richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre il tempo di attesa Opzione messaggio Press Filename sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds"> <BR> - <B>Wait Time Opzione Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Wait Time Opzione Press Filename plays for. Default is 10. + <B>Attendere opzione di secondi Nome del file Stampa -</B> Questo campo deve essere impostato il numero di secondi che il tempo di attesa Nome Opzione Press gioca. Il valore predefinito è 10. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callback_filename"> <BR> - <B>Wait Time Opzione After Press Filename -</B> If Wait Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3. + <B>Attendere opzione Time After Nome Press -</B> Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto dopo che il cliente ha premuto 1, 2 o 3. <BR> <A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id"> <BR> - <B>Wait Time Opzione Callback ID Lista -</B> If Wait Time Opzione is set to PRESS_CID_CALLBACK, this is the ID Lista the call is added to as a new lead if the customer presses the option key when presented with the option. + <B>Attendere Opzione Tempo ID Callback List -</B> Se il tempo di attesa opzione è impostata su PRESS_CID_CALLBACK, questo è l'ID List la chiamata viene aggiunto come un nuovo capo se il cliente preme il tasto Opzione quando presentati con l'opzione. <BR> <A NAME="vicidial_inbound_groups-wait_hold_option_priority"> <BR> - <B>Wait Hold Opzione Priority -</B> If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Opzione is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only. + <B>Attendere Tenere Priority Opzione -</B> Se entrambe le opzioni Stima tempo di mantenimento e attendere opzioni di tempo sono attive, questa impostazione definisce se uno, l'altra o entrambe queste funzioni sono attive. Ad esempio, se il tempo di attesa stimato opzione è impostata su 360, l'opzione di tempo di attesa è impostato a 120 e il cliente è in attesa di 120 secondi e ci sono ancora 400 secondi il tempo di attesa stimato, allora sono entrambe attive nello stesso momento e questa impostazione verrà controllato per vedere quali opzioni verranno offerti. Il valore predefinito è aspettare solo. <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> - <B>Estimated Tenere Opzione Tempo - </B> Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. + <B>Estimated Tenere Opzione Tempo - </B> Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO. Se una delle opzioni PRESS_ è selezionata, si svolgerà il Filename Press definito di seguito e dare al cliente la possibilità di premere 1 sul telefono a lasciare la coda ed eseguire l'opzione selezionata. <BR> <A NAME="vicidial_inbound_groups-hold_time_second_option"> <BR> - <B>Hold Time Second Opzione -</B> Same as the first Hold Time Opzione field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Opzione is selected then this option will not be offered. + <B>Tenere Opzione Second Time -</B> Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo si verifica per il cliente premendo il tasto 2. Il valore predefinito è NONE. Se non prima opzione Hold Time è selezionata questa opzione non sarà disponibile. <BR> <A NAME="vicidial_inbound_groups-hold_time_third_option"> <BR> - <B>Hold Time Third Opzione -</B> Same as the first Hold Time Opzione field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Opzione is selected then this option will not be offered. + <B>Tenere Opzione terza volta -</B> Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo si verifica per il cliente preme il tasto 3. Il valore predefinito è NONE. Se non seconda opzione Hold Time è selezionata questa opzione non sarà disponibile. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> @@ -5181,22 +6114,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-hold_time_option_minimum"> <BR> - <B>Hold Time Opzione Minimum -</B> If Hold Time Opzione enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Opzione Seconds value. Default is 0 seconds. + <B>Tenere Opzione Tempo minimo -</B> Se il tempo di attesa opzione abilitata, questo è il numero minimo di secondi la chiamata deve essere in attesa prima di essere presentato con l'opzione tempo di attesa. L'opzione tempo di attesa sarà immediatamente presentata in questo momento se il tempo di attesa stimato è superiore al Hold Time Value Opzione secondi. Il valore predefinito è 0 secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> - <B>Tenere Opzione Tempo Estensione - </B> Se lopzione Hold Time è impostato per estensione, questo è il dialplan proroga che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. + <B>Tenere Opzione Tempo Estensione - </B> Se lopzione Hold Time è impostato per estensione, questo è il dialplan proroga che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. Per AGENTDIRECT in gruppi, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callmenu"> <BR> - <B>Hold Time Opzione Callmenu -</B> If Hold Time Opzione is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Opzione Seconds. + <B>Tenere Opzione Callmenu Tempo -</B> Se il tempo di attesa opzione è impostata su CALL_MENU, questo è il Menu di chiamata che la chiamata verrà inviato se il tempo di attesa stimato supera i Attesa seconds Tempo. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> - <B>Tenere Tempo Opzione Segreteria - </B> Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + <B>Tenere Tempo Opzione Segreteria - </B> Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> @@ -5206,22 +6139,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-hold_time_option_press_filename"> <BR> - <B>Hold Time Opzione Press Filename -</B> If Hold Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Opzione Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Opzione. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back. + <B>Tenere opzione filename Tempo Press -</B> Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto se il tempo di attesa stimato supera i Attesa seconds tempo per dare al cliente la possibilità di premere 1 sul loro telefono cellulare per eseguire il tempo selezionato attesa Premere Opzione. E 'molto importante che questo file audio è di 10 secondi o meno o ci saranno problemi. L'impostazione predefinita è di-essere-chiamato-back. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_no_block"> <BR> - <B>Hold Time Opzione Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Hold Time Opzione Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Opzione Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + <B>Tenere Opzione Press Tempo No Block -</B> Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in cui l'attesa opzione di stampa Nome richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre il tempo di attesa Opzione messaggio Press Filename sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds"> <BR> - <B>Hold Time Opzione Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Hold Time Opzione Press Filename plays for. Default is 10. + <B>Tenere opzione di secondi Nome del file Stampa -</B> Questo campo deve essere impostato il numero di secondi che il tempo di attesa Nome Opzione Press gioca. Il valore predefinito è 10. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> - <B>Hold Time Opzione After Press Filename -</B> If Hold Time Opzione is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list. + <B>Tenere Opzione Time After Nome Press -</B> Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_ o CALLERID_CALLBACK, questo è il prompt nome del file che viene riprodotto dopo che il cliente ha premuto 1 o la chiamata è stato aggiunto alla lista callback. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> @@ -5251,7 +6184,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> - <B>In-Group Recording Filename -</B> This field will override the Registrazioni Per Questa Campagna Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. + <B>In-Group Recording Filename -</B> This field will override the Registrazioni Per Questa Campagna Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che sarebbe simile a questa TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. <?php if ($SSqc_features_active > 0) @@ -5323,7 +6256,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-add_lead_url"> <BR> - <B>Add Lead URL -</B> This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + <B>Aggiungi URL piombo -</B> Questo indirizzo URL web non si vede l'agente, ma è chiamato ogni volta che viene aggiunto un vantaggio al sistema attraverso il processo di entrata. Predefinita è vuota. Si deve iniziare con questo URL VAR, se si desidera utilizzare le variabili, e naturalmente - A - e - B - attorno al variabile effettiva nell'URL in cui si desidera utilizzarlo. Ecco l'elenco delle variabili che sono disponibili per questa funzione. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid + + <BR> + <A NAME="vicidial_inbound_groups-na_call_url"> + <BR> + <B>Nessun agente URL chiamata -</B> Questo indirizzo URL web non si vede l'agente, ma se è popolato è chiamato ogni volta che viene appeso a una chiamata che non è gestito da un agente verso l'alto o trasferiti. Utilizza le stesse variabili i campi del modulo web e script. dispo può essere utilizzato per recuperare il sistema definito disposizione per la chiamata. Questo URL non può essere un percorso relativo. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_inbound_groups-default_group_alias"> @@ -5333,17 +6271,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_groups-extension_appended_cidname"> <BR> - <B>Extension Append CID -</B> If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + <B>Extension Aggiunge CID -</B> Se attivata, le chiamate in arrivo da questo gruppo avrà uno spazio e l'estensione telefono dell'agente aggiunto alla fine del nome CallerID per la chiamata prima che venga inviato all'agente. Il default è n per disabili. <BR> <A NAME="vicidial_inbound_groups-uniqueid_status_display"> <BR> - <B>Uniqueid Status Visualizzare -</B> If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent. + <B>Visualizzare di stato UniqueID -</B> Se abilitato, quando un agente riceve una chiamata tramite questo gruppo vedranno il UniqueID della chiamata aggiunto alla riga di stato nella loro interfaccia agente. L'opzione sarà PREFIX aggiungere il prefisso definito colpo all'inizio della UniqueID sul display. Predefinito è DISABLED. Se ci fosse già un ID univoco definito su una chiamata di entrare in questo gruppo, allora il UniqueID originale sarà visualizzata. Se l'opzione PRESERVE viene utilizzato e la chiamata viene inviato ad un secondo agente, e la UniqueID prefisso visualizzato al primo agente verrà visualizzato anche al secondo agente. <BR> <A NAME="vicidial_inbound_groups-uniqueid_status_prefix"> <BR> - <B>Uniqueid Status Prefix -</B> If PREFIX option is selected above then this is the value of that prefix. Default is empty. + <B>Stato Prefisso UniqueID -</B> Se l'opzione è selezionata PREFISSO sopra allora questo è il valore di quel prefisso. Il valore predefinito è vuoto. @@ -5366,6 +6304,11 @@ if ($ADD==99999) <BR> <B>HA attiva - </B> Questo è il campo in cui si è impostato il DID ingresso attivo o meno. Il valore di default è Y. + <BR> + <A NAME="vicidial_inbound_dids-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo si, questo permette la visualizzazione di questa amministrazione ha limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore, per visualizzare questo ha fatto. + <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> @@ -5374,7 +6317,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-record_call"> <BR> - <B>Record Call -</B> This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N. + <B>Record di chiamata -</B> Questa opzione permette di impostare le chiamate che viene in questo DID da registrare. Y registrerà l'intera chiamata, Y_QUEUESTOP registrerà la chiamata fino a quando la chiamata è hungup o entra in un gruppo di in-coda, N non registrare la chiamata. Il valore predefinito è N. <BR> <A NAME="vicidial_inbound_dids-extension"> @@ -5429,7 +6372,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> - <B>In-Group Call Handle Method -</B> Se IN_GROUP è selezionato come il percorso fatto, allora questa è la gestione delle chiamate metodo utilizzato per queste chiamate. CID aggiungerà un nuovo record di piombo, con tutte le chiamate utilizzando il CallerID come il numero di telefono, CIDLOOKUP cercherà di ricerca il numero di telefono dal CallerID in tutto il sistema, CIDLOOKUPRL cercherà di ricerca il numero di telefono dal CallerID in una sola lista specificata , CIDLOOKUPRC cercherà di ricerca il numero di telefono dal CallerID in tutte le liste che appartengono alla campagna di cui, più vicino è specificato per VICIDIAL Closer chiamate, ANI aggiungerà un nuovo record di piombo, con tutte le chiamate utilizzando il ANI, come il numero di telefono, ANILOOKUP cercherà di ricerca il numero di telefono dal ANI in tutto il sistema, ANILOOKUPRL cercherà di ricerca il numero di telefono dal ANI in una sola lista specificata, XDIGITID chiederà il chiamante per un codice X cifra prima della chiamata verrà messa in la coda, VIDPROMPT chiederà il chiamante per il loro numero ID e creerà un nuovo record di piombo con il CallerID come il numero di telefono e l-ID come il Vendor ID, VIDPROMPTLOOKUP tenterà di ricerca l-ID di tutto il sistema, VIDPROMPTLOOKUPRL tenterà di ricerca del fornitore ID dal ID in una sola lista specificata, VIDPROMPTLOOKUPRC tenterà di ricerca da parte del venditore ID l-ID in tutte le liste che appartengono alla campagna specificato. Di default è CID. + <B>In-Group Call Maniglia Metodo -</B> Se IN_GROUP è selezionato come il percorso fatto, allora questa è la gestione delle chiamate metodo utilizzato per queste chiamate. CID aggiungerà un nuovo record di piombo, con tutte le chiamate utilizzando il CallerID come il numero di telefono, CIDLOOKUP cercherà di ricerca il numero di telefono dal CallerID in tutto il sistema, CIDLOOKUPRL cercherà di ricerca il numero di telefono dal CallerID in una sola lista specificata , CIDLOOKUPRC cercherà di ricerca il numero di telefono dal CallerID in tutte le liste che appartengono alla campagna di cui, più vicino è specificato per VICIDIAL Closer chiamate, ANI aggiungerà un nuovo record di piombo, con tutte le chiamate utilizzando il ANI, come il numero di telefono, ANILOOKUP cercherà di ricerca il numero di telefono dal ANI in tutto il sistema, ANILOOKUPRL cercherà di ricerca il numero di telefono dal ANI in una sola lista specificata, XDIGITID chiederà il chiamante per un codice X cifra prima della chiamata verrà messa in la coda, VIDPROMPT chiederà il chiamante per il loro numero ID e creerà un nuovo record di piombo con il CallerID come il numero di telefono e l-ID come il Vendor ID, VIDPROMPTLOOKUP tenterà di ricerca l-ID di tutto il sistema, VIDPROMPTLOOKUPRL tenterà di ricerca del fornitore ID dal ID in una sola lista specificata, VIDPROMPTLOOKUPRC tenterà di ricerca da parte del venditore ID l-ID in tutte le liste che appartengono alla campagna specificato. Di default è CID. Se un metodo CIDLOOKUP viene utilizzato con ALT, cercherà il campo alt_phone per il numero di telefono se non vengono trovate corrispondenze per il numero di telefono principale. Se un metodo viene utilizzato con CIDLOOKUP ADDR3, cercherà il campo Indirizzo3 per il numero di telefono se non vengono trovate corrispondenze per il numero di telefono principale e facoltativamente il campo alt_phone. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> @@ -5454,28 +6397,40 @@ if ($ADD==99999) <BR> <A NAME="vicidial_inbound_dids-filter_clean_cid_number"> <BR> - <B>Clean CID Number -</B> This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L. + <B>Pulire Numero CID -</B> Questo campo consente di specificare un numero di cifre per limitare il numero ID del chiamante in ingresso al ponendo R davanti al numero di cifre, ad esempio per limitare verso destra di 10 cifre è necessario immettere in R10. È inoltre possibile utilizzare questa funzione per rimuovere solo una cifra iniziale oi numeri ponendo L di fronte alle cifre specifiche che si desidera rimuovere, ad esempio per rimuovere un 1 come prima cifra è necessario immettere in L1. Il valore predefinito è vuoto. Se più di una regola viene specificato assicurarsi di separarle con uno spazio e la R verrà eseguito prima della L. <BR> <A NAME="vicidial_inbound_dids-filter_inbound_number"> <BR> - <B>Filter Inbound Number -</B> This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back. + <B>Filter Number Inbound -</B> Questa opzione, se attivata permette di filtrare le chiamate che entrano in questo DID e inviarli ad una azione alternativa se corrispondono a un numero di telefono che è nel gruppo telefonico filtro o una risposta URL se si è configurato uno. Predefinito è DISABLED. GRUPPO cercherà in un gruppo di Phone Filter. URL invierà un URL e corrisponde se un 1 viene inviato. <BR> <A NAME="vicidial_inbound_dids-filter_phone_group_id"> <BR> - <B>Filter Phone ID Gruppo -</B> If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call. + <B>Filter Phone ID Group -</B> Se il campo Filter Number ingresso è impostato su GROUP allora questo è l'ID del gruppo Phone Filter che avrà i suoi numeri di ricerca per trovare una corrispondenza per il numero del chiamante ID della chiamata in entrata. <BR> <A NAME="vicidial_inbound_dids-filter_url"> <BR> - <B>Filter URL -</B> If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on. + <B>URL Filter -</B> Se il campo Filter Number ingresso è impostato su URL, allora questo è l'indirizzo web di un script che cercherà un sistema remoto e restituire un 1 per un incontro e uno 0 per nessuna partita. Solo due variabili sono disponibili l'indirizzo se si utilizza il prefisso VAR come con indirizzi webform nelle campagne, - A - phone_number - B - e - A - did_pattern - B - può essere utilizzato nella URL per indicare l'ID chiamante del chiamante e il DID che il cliente chiamato in su. <BR> <A NAME="vicidial_inbound_dids-filter_action"> <BR> - <B>Filter Action -</B> If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing. + <B>Action Filter -</B> Se il filtro numero in ingresso viene attivato e viene rilevata una corrispondenza, allora questo è l'azione che deve essere presa. Questo è lo stesso del percorso che si seleziona per un fatto, e le seguenti impostazioni funzionano proprio come fanno di uno standard di routing. + <BR> + <A NAME="vicidial_inbound_dids-custom_one"> + <BR> + <B>I campi personalizzati DID - </ B> Questi cinque campi possono essere utilizzati per vari scopi, per lo più relative alla programmazione personalizzata e relazioni. + + + + + <BR> + <A NAME="vicidial_did_ra_extensions"> + <BR> + <B>DID distanza sostituisce interno di un agente -</B><BR>Questa sezione permette di abilitare DID di avere sostituzioni di estensione per agente remoto le chiamate instradate attraverso in-gruppi. The Start utente deve essere un valido Remote Start Utente Agent o se si desidera l'estensione Override voce a lavorare per tutte le chiamate è possibile utilizzare --- Tutte --- nel campo Inizio Utente. Se ci sono più voci per la stessa DID utente e Start, quindi le voci attive saranno utilizzati in un metodo round robin. @@ -5485,7 +6440,7 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_CALL MENU TABELLA</FONT></B><BR><BR> <A NAME="vicidial_call_menu-menu_id"> <BR> - <B>Menu ID -</B> Questo è l-ID di questo passo del menù chiamata. Questo mostrerà anche come il contesto che viene utilizzata nel dialplan per il presente invito menu. Here is a list of reserved phrases that cannot be used as menu IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. + <B>Menu ID -</B> Questo è l-ID di questo passo del menù chiamata. Questo mostrerà anche come il contesto che viene utilizzata nel dialplan per il presente invito menu. Ecco un elenco di frasi riservate che non possono essere utilizzati come menù ID: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor. <BR> <A NAME="vicidial_call_menu-menu_name"> @@ -5497,6 +6452,11 @@ if ($ADD==99999) <BR> <B>Menu Prompt -</B> Questo campo contiene il nome del file del prompt audio da riprodurre all-inizio di questo menu. È possibile immettere propmts più in questo campo e gli altri settori prompt separandole con un carattere pipe. + <BR> + <A NAME="vicidial_call_menu-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_call_menu-menu_timeout"> <BR> @@ -5537,10 +6497,20 @@ if ($ADD==99999) <BR> <B>Gruppo di monitoraggio -</B> Questo è l-ID che è possibile utilizzare per monitorare le chiamate a questo menu di chiamata se si guarda alla relazione IVR. L-elenco comprende CALLMENU come predefinito così come tutte le In-Groups. + <BR> + <A NAME="vicidial_call_menu-dtmf_log"> + <BR> + <B>Log pressione di un tasto -</B> Questa opzione, se attivata registrerà la stampa DTMF da parte del chiamante in questo menu Chiama. Il default è 0 per disabili. + + <BR> + <A NAME="vicidial_call_menu-dtmf_field"> + <BR> + <B>Log campo -</B> Se il tasto opzione Log Press è attivata, questa impostazione opzionale può permettere la risposta anche essere memorizzati in questo campo elenco. vendor_lead_code, source_id, phone_code, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, alt_phone, email, security_phrase, comments, rank, owner, status, user. Il valore predefinito è NONE per disabili. + <BR> <A NAME="vicidial_call_menu-option_value"> <BR> - <B>Value Opzione -</B> Questo campo è dove si definisce l-opzione di menu, le scelte possibili sono: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Il TIMECHECK speciale opzione può essere utilizzata solo se si dispone di menu Check Time abilitato e c-è un tempo chiamata definito per il Menu. Per eliminare un opzione, è sufficiente impostare il percorso per rimuovere e l-opzione verranno eliminati quando si fa clic sul pulsante INVIA. + <B>Value Opzione -</B> Questo campo è dove si definisce l-opzione di menu, le scelte possibili sono: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. Il TIMECHECK speciale opzione può essere utilizzata solo se si dispone di menu Check Time abilitato e c-è un tempo chiamata definito per il Menu. Per eliminare un opzione, è sufficiente impostare il percorso per rimuovere e l-opzione verranno eliminati quando si fa clic sul pulsante INVIA. TIMEOUT vi permetterà di impostare cosa succede alla chiamata quando si verifica un timeout senza alcun input dal chiamante. INVALID vi permetterà di impostare ciò che accade quando il chiamante entra un'opzione non valida. INVALID_2ND e 3 può essere attivo solo se INVALID non viene utilizzato, si attenderà fino all'entrata seconda o terza non valida da parte del chiamante prima di eseguire l'opzione. <BR> <A NAME="vicidial_call_menu-option_description"> @@ -5565,12 +6535,12 @@ if ($ADD==99999) <BR> <A NAME="vicidial_call_menu-ingroup_settings"> <BR> - <B>Call Menu In-Group Settings -</B> If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled, <a href="#vicidial_inbound_dids-call_handle_method">Click here to see a list of the available handle methods</a>. Search Method defines how the queue will find the next agent, recommend leave this on LB. ID Lista is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. ID Campagna is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID. + <B>Chiama Menu In-Impostazioni del gruppo -</B> Se il percorso è impostato su ingroup poi ci sono molte opzioni che si possono impostare per definire la modalità di chiamata viene inviato nella coda. In-Group è il gruppo in entrata a cui si desidera la chiamata per andare a. Metodo Handle è il modo in cui si desidera che la chiamata a essere gestito, <a href="#vicidial_inbound_dids-call_handle_method">Clicca qui per vedere un elenco dei metodi di maniglie disponibili</a>. Metodo di ricerca definisce come la coda si trova l'agente successivo, consigliamo lasciarlo su LB. ID List è l'elenco che il piombo viene inserito nel nuovo, anche se il metodo non è un metodo di ricerca e il piombo non viene trovato. ID campagna è la campagna per la ricerca attraverso liste se uno dei metodi RC viene utilizzato. Codice Phone è la voce del campo phone_code per il piombo che viene inserito con. VID Inserisci Nome viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato a chiedere al cliente di inserire il proprio ID. VID Nome Numero ID viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato dopo che il cliente entra nel loro ID, qualcosa di simile che hai inserito. Nome del file VID Conferma viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato a confermare il loro ID, qualcosa di simile PRESS 1 per confermare e 2 per rientrare. Cifre VID viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, se è impostato su un numero è il numero di cifre che devono essere inseriti dal Cliente quando richiesto per il loro ID, se impostato a vuoto o poi la X cliente dovrà premere sterlina o hash per terminare il loro ingresso del loro ID. <BR> <A NAME="vicidial_call_menu-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> Questo campo consente di inserire in ogni dialplan elementi che si desidera per il menu di chiamata. + <B>Personalizzato Entry Dialplan -</B> Questo campo consente di inserire in ogni dialplan elementi che si desidera per il menu di chiamata. @@ -5581,17 +6551,22 @@ if ($ADD==99999) <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_id"> <BR> - <B>Filter Phone ID Gruppo -</B> This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore. + <B>Filter Phone ID Group -</B> Questo è l'ID del gruppo Phone Filter, che è il contenitore per un gruppo di numeri di telefono che si può avere automaticamente cercato attraverso quando arriva una chiamata in un file. DID e inviare a un percorso alternativo se esiste una corrispondenza Il campo deve essere tra i 2 ei 20 caratteri e non hanno punteggiatura ad eccezione di sottolineatura. <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_name"> <BR> - <B>Filter Phone Nome Gruppo -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + <B>Filter Nome Telefono Group -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + + <BR> + <A NAME="vicidial_filter_phone_groups-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. <BR> <A NAME="vicidial_filter_phone_groups-filter_phone_group_description"> <BR> - <B>Filter Phone Group Description -</B> This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field. + <B>Filter Phone Descrizione Gruppo -</B> Questa è la descrizione del gruppo Phone Filter, è puramente notazione e non è un campo obbligatorio. @@ -5621,7 +6596,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_remote_agents-extension_group"> <BR> - <B>Extension Group -</B> If set to something other than NONE or empty this will override the Numero Di Interno Remoto field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated. + <B>Extension Group -</B> Se è impostato su qualcosa di diverso da NONE o vuoto questo ridefinire il campo esterno Estensione e utilizzare le voci di estensione del Gruppo che hanno lo stesso ID del gruppo estensione. Il valore predefinito è NONE per disattivato. <BR> <A NAME="vicidial_remote_agents-status"> @@ -5633,6 +6608,16 @@ if ($ADD==99999) <BR> <B>Campaña -</B> aquí es donde usted selecciona la campaña que estos agentes alejados serán registrados en. Necesidades de entrada de utilizar la campaña MÁS CERCANA y de seleccionar las campañas de entrada debajo de e`sa que usted desea recibir llamadas de. + <BR> + <A NAME="vicidial_remote_agents-on_hook_agent"> + <BR> + <B>On-Hook agente -</B> Questa opzione viene utilizzata solo per le chiamate in entrata che vanno a questo agente remoto. Questa funzione consente di chiamare l'agente remoto e non inviare al cliente all'agente remoto fino a quando la linea viene risposto. Il default è n per disabili. + + <BR> + <A NAME="vicidial_remote_agents-on_hook_ring_time"> + <BR> + <B>On-Hook squilli -</B> Questa opzione viene utilizzata solo quando l'On-Hook campo agente sopra è impostato a Y e quindi solo per le chiamate in entrata che arrivano a questo agente remoto. Questo è il numero di secondi che ogni tentativo di chiamata squillerà per cercare di ottenere una risposta. Si consiglia di impostare questo a pochi secondi in meno di quanto necessario per una chiamata da inviare alla segreteria telefonica. Il valore predefinito è 15. + <BR> <A NAME="vicidial_remote_agents-closer_campaigns"> <BR> @@ -5644,27 +6629,27 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABELLA</FONT></B><BR><BR> <A NAME="vicidial_extension_groups-extension_group_id"> <BR> - <B>Extension Group -</B> This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers. + <B>Extension Group -</B> Questo campo obbligatorio è dove inserire l'ID gruppo che si desidera questa estensione da mettere in. Non ci sono spazi o caratteri speciali ad eccezione di sottolineatura lettere e numeri. <BR> <A NAME="vicidial_extension_groups-extension"> <BR> - <B>Extension -</B> This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry. + <B>Extension -</B> Questo campo è richiesto in cui si inserisce l'estensione dialplan che si desidera che l'agente remoto le chiamate da inviare per questa voce gruppo di interni. <BR> <A NAME="vicidial_extension_groups-rank"> <BR> - <B>Rank -</B> This field allows you to rank the extension group entries that share the same extension group. Default is 0. + <B>Rank -</B> Questo campo consente di classificare le voci di estensione dei gruppi che condividono lo stesso gruppo estensione. Il default è 0. <BR> <A NAME="vicidial_extension_groups-campaign_groups"> <BR> - <B>Campagnas Groups -</B> In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string. + <B>Campagne Gruppi -</B> In questo campo si può mettere un elenco di ID o ID campagna e di gruppo in ingresso che si desidera limitare l'uso del gruppo per estensione. Elenco devono essere separati da tubi ed un condotto all'inizio e alla fine della stringa. <BR><BR><BR><BR> - <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTE</FONT></B><BR><BR> + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR> <A NAME="vicidial_campaign_lists"> <BR> <B>Las listas dentro de esta campaña se enumeran aquí, si son activas son denotadas por la Y o N y usted pueden ir a la pantalla de la lista chascando en la identificacio`n de la lista en la primera columna.</B> @@ -5734,7 +6719,18 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR> <A NAME="vicidial_xfer_presets"> <BR> - <B>If the Campagna setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent.</B> + <B>Se l'impostazione della campagna per i preset è impostato su ENABLED allora avete la possibilità di definire Transfer-conferenza preset che saranno disponibili per l'agente permettendo loro di 3-way chiamare questi preset o trasferire chiamate cieche a questi numeri preimpostati. Questi preset hanno anche un opzione per nascondere il numero associato ad ogni preset dall'agente.</B> + + + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CAMPAIGN CID PrefissoS</FONT></B><BR><BR> + <A NAME="vicidial_campaign_cid_areacodes"> + <BR> + <B>Se l'impostazione di sistema per IndicativoLocalità CID è attivata e l'impostazione della campagna per l'uso personalizzato CallerID è impostato su IndicativoLocalità allora avete la possibilità di definire CID prefisso locale che verranno utilizzati quando si chiama in uscita per cavi in ​​questa campagna specifica. È possibile aggiungere callerIDs multipli per ogni prefisso locale e si può attivare e disattivare ogni loro in tempo reale. Se più di un callerID è attiva per un prefisso locale specifica allora il sistema userà il CallerID che è stato utilizzato il minor numero di volte oggi. Se non callerIDs sono attivi per il prefisso locale poi il CallerID campagna o di un elenco di override CallerID verrà utilizzato.</B> @@ -5775,7 +6771,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_status_viewable_groups"> <BR> - <B>Stato agente Viewable Gruppi -</B> Questa è una lista selezionabile di gruppi di utenti e funzioni di utente a cui i membri di questo gruppo utente può visualizzare lo stato delle chiamate, nonché il trasferimento verso l-interno dello schermo agente. The All-GRUPPI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente del sistema. LA CAMPAGNA AGENTI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente nella campagna che si è registrato in. The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently. + <B>Stato agente Viewable Gruppi -</B> Questa è una lista selezionabile di gruppi di utenti e funzioni di utente a cui i membri di questo gruppo utente può visualizzare lo stato delle chiamate, nonché il trasferimento verso l-interno dello schermo agente. The All-GRUPPI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente del sistema. LA CAMPAGNA AGENTI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente nella campagna che si è registrato in. Il non-logged-IN-AGENTI opzione consente a tutti gli utenti del sistema da visualizzare, anche se non sono registrati curently. <BR> <A NAME="vicidial_user_groups-agent_status_view_time"> @@ -5785,22 +6781,33 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-agent_call_log_view"> <BR> - <B>Agent Call Log View -</B> This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled. + <B>Call Agent View Log -</B> Questa opzione stabilisce se l'agente sarà in grado di vedere il loro registro delle chiamate per le chiamate gestite attraverso lo schermo agente ViciDial. Il default è n per nulla o disabili. <BR> <A NAME="vicidial_user_groups-agent_xfer_options"> <BR> - <B>Agent Transfer Opziones -</B> These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled. + <B>Agente di trasferimento Opzioni -</B> Queste opzioni consentono la disattivazione di pulsanti specifici nella sezione di trasferimento Conferenza dell'interfaccia dell'agente. Il valore predefinito è Y per sì o abilitati. <BR> <A NAME="vicidial_user_groups-agent_fullscreen"> <BR> - <B>Agent Fullscreen -</B> This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agenti View, Calls in Queue View or Calls in Session view. Default is N for no or disabled. + <B>Agente Fullscreen -</B> Questa opzione se impostato a Y impostare l'altezza e la larghezza dello schermo dell'agente ViciDial alle dimensioni della finestra del browser web, senza alcuna indennità per la visualizzazione di agenti, chiamate in coda o Vista chiede in vista della sessione. Il default è n per nulla o disabili. <BR> <A NAME="vicidial_user_groups-allowed_reports"> <BR> - <B>Allowed Report -</B> If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports. + <B>Rapporti ammessi -</B> Se un utente in questo gruppo è impostata su livello di utente 7 o superiore, questa funzione può essere utilizzata per limitare i rapporti che gli utenti possono visualizzare. Il valore predefinito è ALL. Se si desidera selezionare più di una relazione, quindi premere il tasto Ctrl della tastiera mentre si selezionano i rapporti. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_groups"> + <BR> + <B>Gruppi di utenti ammessi -</B> Questa è una lista selezionabile di gruppi di utenti a cui i membri di questo gruppo di utenti può visualizzare ed eventualmente modificare. Gruppi di utenti possibile limitare l'accesso a quasi tutti gli aspetti del sistema, da DID in entrata ai telefoni a caselle vocali. The - ALL - opzione consente agli utenti in questo gruppo da vedere e accedere a qualsiasi record sul sistema se i loro permessi dell'utente lo consentono. + + <BR> + <A NAME="vicidial_user_groups-admin_viewable_call_times"> + <BR> + <B>Tempi di chiamata ammessi -</B> Questa è una lista selezionabile di durata delle chiamate a cui i membri di questo gruppo utente può utilizzare nelle campagne, nei gruppi e menu di chiamata. The - ALL - opzione consente agli utenti di questo gruppo di utilizzare tutti i tempi delle chiamate al sistema. + <?php if (strlen($SSwebphone_url) > 5) @@ -5809,17 +6816,17 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-webphone_url_override"> <BR> - <B>Webphone URL Override -</B> This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty. + <B>URL Override webphone -</B> Questa impostazione consente di impostare un URL alternativo webphone solo per i membri di un gruppo di utenti. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_user_groups-webphone_systemkey_override"> <BR> - <B>Webphone System Key Override -</B> This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty. + <B>Webphone Key System Override -</B> Questa impostazione consente di impostare un supplente Key System webphone solo per i membri di un gruppo di utenti. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_user_groups-webphone_dialpad_override"> <BR> - <B>Webphone Dialpad Override -</B> This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link. + <B>Webphone Dialpad Override -</B> Questa impostazione consente di attivare o disattivare la tastiera sul webphone solo per i membri di un gruppo di utenti. Predefinito è DISABLED. TOGGLE permetterà all'utente di visualizzare e nascondere la tastiera cliccando su un link. TOGGLE_OFF per impostazione predefinita per non mostrare la tastiera il primo carico, ma permette all'utente di visualizzare la tastiera facendo clic sul link tastiera. <?php } @@ -5835,7 +6842,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> <BR> - <B>QC ammessi Inbound Gruppi - </B> Si tratta di un elenco di ingresso selezionabile gruppi che membri di questo gruppo di utenti sarà in grado di QC. TUTTI I GRUPPI opzione consente agli utenti di questo gruppo di utenti di qualsiasi entrata CQ gruppo sul sistema. + <B>QC ammessi Inbound Gruppi - </B> Si tratta di un elenco di ingresso selezionabile gruppi che membri di questo gruppo di utenti sarà in grado di QC. TUTTI I GRUPPI opzione consente agli utenti di questo gruppo di utenti di qualsiasi entrata CQ gruppo sul sistema. <?php } ?> @@ -5858,14 +6865,21 @@ if ($ADD==99999) <A NAME="vicidial_scripts-script_comments"> <B>Comentarios de la escritura -</B> este es tal como donde usted puede poner los comentarios para una escritura de Vicidial - cambiantes para liberar mejora de sept. el 23 -. caracteres del máximo 255, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_scripts-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_scripts-script_text"> - <B>Testo Script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + <B>Testo Script -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> + <BR> + È inoltre possibile utilizzare uno IGNORENOSCROLL variabile speciale per forzare le barre di scorrimento nella scheda script anche se si utilizza un iframe all'interno di esso. <BR> <A NAME="vicidial_scripts-active"> @@ -5895,6 +6909,11 @@ if ($ADD==99999) <A NAME="vicidial_lead_filters-lead_filter_comments"> <B>El filtro comenta -</B> aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_lead_filters-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_lead_filters-lead_filter_sql"> <B>Filtro SQL -</B> Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. @@ -5920,9 +6939,14 @@ if ($ADD==99999) <A NAME="vicidial_call_times-call_time_comments"> <B>El tiempo de la llamada comenta -</B> aquí es donde usted puede poner loscomentarios para una definicio`n del tiempo de la llamada de Vicidialtal como -10am hasta los 4pm con restricciones adicionales del estadode la llamada -. los caracteres del máximo 255. + <BR> + <A NAME="vicidial_call_times-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_call_times-ct_default_start"> - <B>Tiempos del comienzo y de parada del defecto -</B> este es el tiempo dedefecto paran que el llamar será permitido que sea comenzado o dentrode esta definicio`n del tiempo de la llamada si la hora de salida dela di`a-de-$$$-SEMANA no se define. 0 es medianoche. Evitar el llamarfijo` totalmente este campo a 2400 y fijo` el tiempo de parada deldefecto a 2400. Permitir el llamar 24 horas al día fijo` la hora desalida a 0 y el tiempo de parada a 2400. + <B>Tiempos del comienzo y de parada del defecto -</B> este es el tiempo dedefecto paran que el llamar será permitido que sea comenzado o dentrode esta definicio`n del tiempo de la llamada si la hora de salida dela di`a-de-$$$-SEMANA no se define. 0 es medianoche. Evitar el llamarfijo` totalmente este campo a 2400 y fijo` el tiempo de parada deldefecto a 2400. Permitir el llamar 24 horas al día fijo` la hora desalida a 0 y el tiempo de parada a 2400. Per solo in ingresso, è possibile anche impostare la durata delle chiamate di arresto superiore a 2400 se si desidera che la durata delle chiamate di andare oltre la mezzanotte. Quindi, se volete che il vostro tempo di chiamata per eseguire dalle 6 del mattino fino alle 2 del mattino del giorno successivo, si metterebbe 0600 come l'ora di inizio e 2600 come il tempo di arresto. <BR> <A NAME="vicidial_call_times-ct_sunday_start"> @@ -5930,7 +6954,7 @@ if ($ADD==99999) <BR> <A NAME="vicidial_call_times-default_afterhours_filename_override"> - <B>After Hours Filename Override -</B> These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty. + <B>Dopo Nome file Override Hours -</B> Questi campi consentono di ignorare il messaggio After Hours per i gruppi in arrivo se è impostato a qualcosa. Il valore predefinito è vuoto. <BR> <A NAME="vicidial_call_times-ct_state_call_times"> @@ -5954,6 +6978,11 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_name"> <B>Nome Shift - </B> Questo è un nome più descrittivo della Maiuscole Definizione. Questa è una breve sintesi della Maiuscole definizione. max 50 caratteri, minimo di 2 caratteri. + <BR> + <A NAME="vicidial_shifts-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_shifts-shift_start_time"> <B>Start Time Shift - </B> Questo è il tempo che la campagna ha inizio turno. Deve essere solo numeri, 9:30 AM sarebbe 5:00 PM 0930 e 1700 sarebbe. @@ -5966,13 +6995,20 @@ if ($ADD==99999) <A NAME="vicidial_shifts-shift_weekdays"> <B>Maiusc Weekdays - </B> In questa sezione si deve scegliere il giorno della settimana che questo spostamento è attivo. + <BR> + <A NAME="vicidial_shifts-report_option"> + <B>Segnala Opzione -</B> Questa opzione consente questo cambiamento specifico di presentarsi nei rapporti selezionati che supportano questa opzione. + + <BR> + <A NAME="vicidial_shifts-report_rank"> + <B>Segnala Rango -</B> Questa opzione consente di classificare cambiamenti nei rapporti selezionati che supportano questa opzione. <BR><BR><BR><BR> <A NAME="audio_store"> - <B>Audio Store -</B> This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here. + <B>Audio Store -</B> Questa utility consente di caricare file audio sul server web in modo che possano essere distribuiti a tutti i server ViciDial in un multi-server cluster. Una nota importante, solo due tipi di file audio funzionerà. File wav che sono 8k Mono PCM 16bit e file. Gsm che sono 8k 8bit. Si prega di verificare che i file siano correttamente formattati prima di caricarli qui. @@ -5991,6 +7027,11 @@ if ($ADD==99999) <A NAME="vicidial_music_on_hold-active"> <B>Attivo -</B> Questa opzione consente di impostare la musica su attesa ingresso attivo o inattivo. Inattivi rimuovere la voce dal file di conf. + <BR> + <A NAME="vicidial_music_on_hold-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_music_on_hold-random"> <B>Ordine casuale -</B> Questa opzione permette di definire la riproduzione dei file audio in ordine casuale. Se impostato su N quindi l-ordine definito saranno utilizzati. @@ -6017,13 +7058,18 @@ if ($ADD==99999) <A NAME="vicidial_tts_prompts-active"> <B>Attivo -</B> Questa opzione consente di impostare la voce TTS di attivi o inattivi. + <BR> + <A NAME="vicidial_tts_prompts-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_tts_prompts-tts_voice"> - <B>TTS Voice -</B> This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz. + <B>TTS Voice -</B> Questo è dove si definisce la voce da utilizzare nella generazione TTS. Il valore predefinito è Allison-8kHz. <BR> <A NAME="vicidial_tts_prompts-tts_text"> - <B>TTS Text -</B> Questo è il testo effettivo ai dati Discorso campo che viene inviato al Cepstral per la creazione del file audio da riprodurre al cliente. è possibile utilizzare Speech Synthesis Markup Language-SSML-in questo campo, per esempio, <break time='1000ms'/> per una pausa di 1 secondo. È inoltre possibile utilizzare diverse variabili, quali nome, cognome e titolo come variabili ViciDial proprio come si fa in uno script: - A first_name - - B -. Ecco una lista delle variabili disponibili:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + <B>TTS Text -</B> Questo è il testo effettivo ai dati Discorso campo che viene inviato al Cepstral per la creazione del file audio da riprodurre al cliente. è possibile utilizzare Speech Synthesis Markup Language-SSML-in questo campo, per esempio, <break time='1000ms'/> per una pausa di 1 secondo. È inoltre possibile utilizzare diverse variabili come il nome, il cognome e il titolo come variabili ViciDial proprio come si fa in uno script: - A - first_name - B -. Se avete statici file audio che si desidera utilizzare in base al valore di uno dei campi che è possibile utilizzare anche quelli con la C e D tag. I nomi dei file devono essere tutti in lettere minuscole e devono essere 8k 16bit i file WAV PCM. Il nome del campo deve essere lo stesso, ma senza l'estensione. Wav nel nome del file. Per esempio - C ---- A - Indirizzo3 - B ---- D - per prima cosa trovare il valore per Indirizzo3, poi avrebbe cercato di trovare un file audio corrispondente a quel valore per metterlo nel prompt. Ecco un elenco delle variabili disponibili: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -6051,12 +7097,22 @@ if ($ADD==99999) <A NAME="vicidial_voicemail-email"> <B>Email -</B> Questa impostazione consente di avere i messaggi vocali inviati a un account di posta elettronica, se il vostro sistema è configurato per inviare e-mail. Se questo campo è vuoto quindi non e-mail verrà inviato. + <BR> + <A NAME="vicidial_voicemail-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_voicemail-delete_vm_after_email"> <B>Eliminare Casella Vocale Dopo Email -</B> Questa impostazione consente di avere i messaggi vocali eliminato dal sistema dopo che sono state inviate fuori. Di default è N. + <BR> + <A NAME="vicidial_voicemail-voicemail_timezone"> + <B>Casella Vocale Zone -</B> Questa impostazione consente di impostare la zona che questa casella voicemail sarà impostato quando il tempo viene registrato un messaggio. Di default è impostato in Impostazioni di sistema. - + <BR> + <A NAME="vicidial_voicemail-voicemail_options"> + <B>Casella Vocale Opzioni -</B> Questa impostazione opzionale consente di definire le impostazioni vocali aggiuntive. Si consiglia di lasciare vuoto questo se non sai cosa stai facendo. <?php if ($SSoutbound_autodial_active > 0) @@ -6073,7 +7129,7 @@ if ($ADD==99999) <LI>Co`digo del plomo del vendedor - demuestra para arriba en el campo de la identificacio`n del vendedor del GUI <LI>Co`digo de fuente - uso interno solamente para los admins y DBAs <LI>Identificacio`n de la lista - el número de la lista que estos plomos demostrarán para arriba debajo - <LI>Co`digo del telefono - el prefijo para el telefono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) + <LI>Phone Code - the prefix for the phone number - 1 for US, 44 for UK, 61 for AUS, etc <LI>Número de telefono - debe ser por lo menos 8 dígitos de largo <LI>Título - título del customer(Mr. Ms señ., etc...) <LI>Nome @@ -6097,6 +7153,15 @@ if ($ADD==99999) <BR>NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. Tambien, los mo`dulos de un Perl de los pares sedeben cargar para ella para trabajar Tambien -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en estos mirando suarchivo del error_log de apache. Tambien, para los cheques deduplicacio`n contra gampaign enumera, la lista que tiene nuevos plomosel entrar e`l necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. + <BR> + <A NAME="vicidial_list_loader-file_layout"> + <BR> + <B>File layout - </B>The layout of the file you are loading. "Standard Format" uses the pre-defined Vicidial standard file format. "Struttura personalizzata" allows the user to define the layout of the file themselves. "Custom template" is a hybrid of the previous two options, which allows the user to use a custom format they have defined previously and saved using the Custom Template Maker. + + <BR> + <A NAME="vicidial_list_loader-template_id"> + <BR> + <B>Template ID -</B> If the user has selected "Struttura personalizzata" from the "File layout" options, then this the the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. @@ -6112,7 +7177,7 @@ if ($ADD==99999) <B><FONT SIZE=3>TABELLA TELEFONI</FONT></B><BR><BR> <A NAME="phones-extension"> <BR> - <B>Extension del telefono -</B> este campo es donde usted pone los nombres del telefono que aparecen al marcar con asterisco no incluyendo el protocolo o la barra vertical del principio. Por ejemplo: para el telefono SIP/test101 del SIP la extension del telefono sería test101. Tambien, para los telefonos IAX2 compruebe que usted utiliza el nombre del telefono completo: IAX2/IAXphone1@IAXphone1 sería IAXphone1@IAXphone1. Para zap los telefonos compruebe que usted pone el canal completo: Zap/25-1 sería 25-1. Otra nota, compruebe que usted fija el protocolo abajo correctamente para su tipo de telefono. + <B>Phone Extension -</B> Questo campo è dove si inserisce il nome di telefoni come appare ad Asterisk non è compreso il protocollo o barra all'inizio. Ad esempio: per il telefono SIP SIP/test101 l'estensione Phone sarebbe test101. Inoltre, per i telefoni IAX2: IAX2/IAXphone1 @ IAXphone1 sarebbe IAXphone1. Per Zap e dahdi allegato channelbank FXS o telefoni assicuratevi di mettere l'intero numero dei canali senza il prefisso: Zap/25-1 sarebbe 25-1. Un'altra nota, assicuratevi di impostare il campo protocollo di seguito correttamente per il tipo di telefono. <BR> <A NAME="phones-dialplan_number"> @@ -6124,11 +7189,24 @@ if ($ADD==99999) <BR> <B>Caja de Buzon de Voz -</B> este campo es para la caja del Buzon de voz donde van los mensajes para al usuario de este telefono. Utilizamos esto para comprobar los mensajes del Buzon de voz y para que el usuario pueda acceder al Buzon de Voz desde astGUIclient. + <BR> + <A NAME="phones-voicemail_timezone"> + <B>Casella Vocale Zone -</B> Questa impostazione consente di impostare la zona che questa casella voicemail sarà impostato quando il tempo viene registrato un messaggio. Di default è impostato in Impostazioni di sistema. + + <BR> + <A NAME="phones-voicemail_options"> + <B>Casella Vocale Opzioni -</B> Questa impostazione opzionale consente di definire le impostazioni vocali aggiuntive. Si consiglia di lasciare vuoto questo se non sai cosa stai facendo. + <BR> <A NAME="phones-outbound_cid"> <BR> <B>CallerID de salida -</B> este campo es donde usted incorporara el número del callerID que usted quiera que aparezca en las llamadas de salida. Esto no funciona en las líneas RTB(non-PRI) T1/E1. + <BR> + <A NAME="phones-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="phones-phone_ip"> <BR> @@ -6147,32 +7225,37 @@ if ($ADD==99999) <BR> <A NAME="phones-login"> <BR> - <B>conexion -</B> la conexion usada para el usuario del telefono a laconexion a los usos del cliente. + <B>Agente schermata di login -</B> L'account di accesso utilizzato per l'utente del telefono per accedere alle applicazioni client, come lo schermo agente ViciDial. <BR> <A NAME="phones-pass"> <BR> - <B>Login Password -</B> The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registrazione Password in the next field. + <B>Login Password -</B> La password utilizzata per l'utente del telefono per accedere alle applicazioni web-based client. IMPORTANTE, questa è la password solo per il login Phone Agent interfaccia web, per cambiare il sip.conf o la password iax.conf, o il segreto, per questo dispositivo cellulare è necessario modificare la password di registrazione nel campo successivo. <BR> <A NAME="phones-conf_secret"> <BR> - <B>Registrazione Password -</B> Questo è il segreto, o la password, per il telefono cellulare in auto o IAX SIP-generated conf file per questo telefono. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. Formerly called Conf file segreto. A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Registrazione password -</B> Questo è il segreto, o la password, per il telefono cellulare in auto o IAX SIP-generated conf file per questo telefono. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. Precedentemente chiamato Secret File Conf. Una password di registrazione forte deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero. <BR> <A NAME="phones-is_webphone"> <BR> - <B>Set As Webphone -</B> Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + <B>Imposta come Webphone -</B> Impostando questa opzione su Y tenterà di caricare un web-based telefono quando l'agente accede a loro schermo agente. Il valore predefinito è N. <BR> <A NAME="phones-webphone_dialpad"> <BR> - <B>Webphone Dialpad -</B> This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. + <B>Webphone Dialpad -</B> Questa impostazione consente di attivare o disattivare la tastiera di questo webphone. Y è predefinita per abilitato. TOGGLE permetterà all'utente di visualizzare e nascondere la tastiera facendo clic su un link. Questa funzione non è disponibile su tutte le versioni webphone. TOGGLE_OFF per impostazione predefinita per non mostrare la tastiera il primo carico, ma permette all'utente di visualizzare la tastiera facendo clic sul link tastiera. + + <BR> + <A NAME="phones-webphone_auto_answer"> + <BR> + <B>Webphone Risposta automatica -</B> Questa impostazione permette al telefono web per essere impostato per rispondere automaticamente alle chiamate che arrivano impostando a Y, o avere anello chiamate impostando per default è N. Y. <BR> <A NAME="phones-use_external_server_ip"> <BR> - <B>Use External IP Server -</B> If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the IP Server. Default is empty. + <B>Utilizzare IP esterno Server -</B> Se si utilizza come un telefono web, è possibile impostare questo valore a Y per utilizzare i server IP esterno per la registrazione al posto del IP del server. Il valore predefinito è vuoto. <BR> <A NAME="phones-status"> @@ -6238,6 +7321,11 @@ if ($ADD==99999) <BR> <B>Phone Ring Timeout -</B> Questa è la quantità di tempo, in secondi, che il telefono squilla nel dialplan prima di inviare la chiamata alla segreteria telefonica. Predefinito è 60 secondi. + <BR> + <A NAME="phones-on_hook_agent"> + <BR> + <B>On-Hook Login Agente -</B> Questa opzione viene utilizzata solo per le chiamate in entrata che vanno ad un agente effettuato l'accesso con questo telefono. Questa funzione consente di chiamare l'agente e non inviare al cliente alla sessione agenti fino a quando la linea si risponde. Il default è n per disabili. + <BR> <A NAME="phones-ASTmgrUSERNAME"> <BR> @@ -6316,12 +7404,12 @@ if ($ADD==99999) <BR> <A NAME="phones-codecs_list"> <BR> - <B>Allowed Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for this phone. Opziones for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty. + <B>Codec ammessi -</B> È possibile definire un elenco delimitato da virgole di codec da impostare come i codec di default per questo telefono. Le opzioni per i codec sono ulaw, alaw, GSM, G729, Speex, G722, G723, G726, iLBC, ... Alcuni di questi codec potrebbero non essere disponibili sul vostro sistema, come il G729 o G726. Se il campo è vuoto, allora i codec di default del sistema o la rubrica telefonica di sopra di questo uno sarà utilizzato per i codec ammissibili. Il valore predefinito è vuoto. <BR> <A NAME="phones-codecs_with_template"> <BR> - <B>Allowed Codecs With Template-</B> Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0. + <B>Codec ammessi Con Template-</B> Impostando questa opzione a 1 includerà i codec di cui sopra, anche se un modello di file di configurazione viene utilizzato. Il default è 0. <BR> <A NAME="phones-dtmf_send_extension"> @@ -6414,12 +7502,12 @@ if ($ADD==99999) <B>Boto`n de VMail -</B> fije para verdad para exhibir el boton de VOICEMAIL y los mensajes cuentan la exhibicio`n en astGUIclient. <BR> - <A NAME="phones-enable_fast_refresh"> + <A NAME="phones-enable_fast_rinfrescare"> <BR> <B>Rápido restaure -</B> fije para verdad para permitir un nuevo índice de restauran de la informacion de la llamada para el astGUIclient. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. <BR> - <A NAME="phones-fast_refresh_rate"> + <A NAME="phones-fast_rinfrescare_rate"> <BR> <B>Rápido restaure la tarifa -</B> en milisegundos. Utilizado solamente si es rápido restaure se permite. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. @@ -6563,6 +7651,11 @@ if ($ADD==99999) <BR> <B>Activo -</B> fije si el servidor del asterisco es activo o inactivo. + <BR> + <A NAME="servers-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="servers-sysload"> <BR> @@ -6631,7 +7724,7 @@ if ($ADD==99999) <BR> <A NAME="servers-conf_secret"> <BR> - <B>Conf file segreto -</B> Questo è il segreto, o la password, per il server in automatico IAX-generated conf file per questo server su altri server. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + <B>Conf file segreto -</B> Questo è il segreto, o la password, per il server in automatico IAX-generated conf file per questo server su altri server. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. Un forte secret file di configurazione deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero. <BR> <A NAME="servers-local_gmt"> @@ -6696,7 +7789,12 @@ if ($ADD==99999) <BR> <A NAME="servers-external_server_ip"> <BR> - <B>External IP Server -</B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External IP Server. Default is empty. + <B>IP Server esterno -</B> Questa impostazione è dove si può mettere un indirizzo IP o il nome del server di altra macchina che può essere utilizzato al posto del IP_server quando si utilizza un webphone nell'interfaccia dell'agente. Per farlo funzionare si deve avere anche la voce telefoni impostato per utilizzare l'IP esterno del server. Il valore predefinito è vuoto. + + <BR> + <A NAME="servers-active_twin_server_ip"> + <BR> + <B>Attivo IP server Twin -</B> Alcuni sistemi vicidial necessario istituire server vicidial a coppie. Questa impostazione è dove si può mettere l'IP del server di un altro server vicidial che questo server è gemellata con. Il valore predefinito è vuota per disabili. <BR> <A NAME="servers-active_asterisk_server"> @@ -6741,7 +7839,7 @@ if ($ADD==99999) <BR> <A NAME="servers-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context. + <B>Personalizzato Entry Dialplan -</B> Questo campo consente di inserire in tutti gli elementi dialplan che si desidera per il server, le linee saranno aggiunti al contesto di default. @@ -6760,6 +7858,11 @@ if ($ADD==99999) <BR> <B>Nome modello - </B> Questo è il nome descrittivo del file di conf modello entrata. + <BR> + <A NAME="vicidial_conf_templates-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_conf_templates-template_contents"> <BR> @@ -6786,6 +7889,11 @@ if ($ADD==99999) <BR> <B>Carrier Descrizione -</B> Questo è messo nei commenti dei file asterisco conf sopra il dialplan e le voci del conto. Massimo 255 caratteri. + <BR> + <A NAME="vicidial_server_carriers-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + <BR> <A NAME="vicidial_server_carriers-registration_string"> <BR> @@ -6894,6 +8002,16 @@ if ($ADD==99999) <BR> <B>URL casero del Admin -</B> esta es la Direccion del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. + <BR> + <A NAME="settings-admin_modify_rinfrescare"> + <BR> + <B>Admin Modificare Auto-Refresh -</B> Questo è l'intervallo di aggiornamento in secondi degli schermi modificano in questa interfaccia di amministrazione. L'impostazione di questo a 0 lo disabilita, impostandolo di sotto del 5 saranno principalmente rendere gli schermi modificano inutilizzabili perché si aggiorna troppo in fretta di modificare i campi. Questa opzione è utile in situazioni in cui più di un manager è il controllo delle impostazioni su una campagna attiva o in gruppo in modo che le impostazioni vengono aggiornate frequentemente. Il default è 0. + + <BR> + <A NAME="settings-nocache_admin"> + <BR> + <B>Admin No-Cache -</B> L'impostazione di questo ad 1 impostare tutte le pagine di amministrazione al browser web no-cache, in modo che ogni schermo deve essere ricaricata ogni volta che viene visualizzato, anche se cliccando di nuovo sul browser. Il default è 0 per disabili. + <BR> <A NAME="settings-enable_agc_xfer_log"> <BR> @@ -6902,13 +8020,28 @@ if ($ADD==99999) <BR> <A NAME="settings-enable_agc_dispo_log"> <BR> - <B>Enable Agent Disposition Logfile -</B> This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled. + <B>Abilita Disposition Logfile agente -</B> Questa opzione si accede ad un file di log di testo sul server web ogni volta che viene dispositioned una chiamata da un agente. Il default è 0, disattivato. <BR> <A NAME="settings-timeclock_end_of_day"> <BR> <B>Orologio End Of Day - </B> Questa impostazione definisce il momento in cui tutti gli utenti devono essere registrati automaticamente dal sistema orologio. Funziona solo una volta al giorno. deve essere solo il 4 cifre 2 cifre 2 cifre ora e 24 minuti in ora di tempo. Il valore di default è 0000. + <BR> + <A NAME="settings-default_local_gmt"> + <BR> + <B>Predefinito locale GMT -</B> Questa impostazione definisce ciò che verrà utilizzato per impostazione predefinita quando nuovi telefoni e server vengono aggiunti utilizzando questa interfaccia di amministrazione web. Il valore predefinito è -5. + + <BR> + <A NAME="settings-default_voicemail_timezone"> + <BR> + <B>Predefinito Casella Vocale Zone -</B> Questa impostazione definisce quale zona verrà utilizzato per impostazione predefinita quando nuovi telefoni e caselle vocali vengono creati. L'elenco delle zone disponibili è direttamente presa dal file voicemail.conf. Il valore predefinito è orientale. + + <BR> + <A NAME="settings-agents_calls_reset"> + <BR> + <B>Agenti chiamate Ripristina -</B> Questa impostazione definisce se connesso in agenti attivi telefonate e le registrazioni devono essere resettato alla fineOrologio del giorno. Il valore predefinito è 1 per abilitato. + <BR> <A NAME="settings-timeclock_last_reset_date"> <BR> @@ -6980,7 +8113,7 @@ if ($ADD==99999) <BR> <A NAME="settings-admin_web_directory"> <BR> - <B>Admin Web Directory -</B> This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes. + <B>Web Directory Admin -</B> Questa è la directory che la vostra Amministrazione di contenuti web, come admin.php, trovi di default è vicidial. Per capire la directory Admin web, è tutto ciò che è tra il nome del dominio e la admin.php l'URL su questa pagina, senza le barre iniziali e finali. <BR> <A NAME="settings-active_voicemail_server"> @@ -7005,7 +8138,17 @@ if ($ADD==99999) <BR> <A NAME="settings-allow_custom_dialplan"> <BR> - <B>Consentire Custom Dialplan Entries -</B> This option allows you to enter custom dialplan lines into Call Menu, Server and System Settings. Default is 0 for inactive. + <B>Consentire Custom Dialplan Entries -</B> Questa opzione consente di inserire linee di dialplan personalizzati in menu chiamate, server e impostazioni di sistema. Il default è 0 per inattiva. + + <BR> + <A NAME="settings-pllb_grouping_limit"> + <BR> + <B>PLLB Raggruppamento Limit -</B> Telefono Accedi Load Balancing Limit Raggruppamento. Se Raggruppamento PLLB è impostato su CASCATA a livello di campagna questa impostazione determinerà il numero di agenti accettabile su ogni server in tutte le campagne. Il valore predefinito è 100. + + <BR> + <A NAME="settings-generate_cross_server_exten"> + <BR> + <B>Genera Cross-Server Extensions Phone -</B> Questa opzione, se impostato a 1 genererà voci dialplan per ogni telefono su un sistema multi-server. Il default è 0 per inattiva. <BR> <A NAME="settings-user_territories_active"> @@ -7025,47 +8168,78 @@ if ($ADD==99999) <BR> <A NAME="settings-callcard_enabled"> <BR> - <B>Enable CallCard -</B> This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled. + <B>Abilita CallCard -</B> Questa impostazione consente le funzioni CallCard con ViciDial per consentire ai chiamanti di utilizzare i numeri pin e card_ids che hanno un equilibrio di minuti e gli equilibri possono avere tempo di conversazione agente per le chiamate dei clienti verso a gruppi dedotte. Il default è 0 per disabili. <BR> <A NAME="settings-custom_fields_enabled"> <BR> - <B>Enable Custom List Fields -</B> This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled. + <B>Abilita campi elenco personalizzati -</B> Questa impostazione consente l'usanza caratteristica dei campi che consente di personalizzare i campi dati da definire l'interfaccia di amministrazione web per ogni base-list e quindi avere a disposizione quei campi in una scheda FORM all'agente nell'interfaccia web agent. Il default è 0 per disabili. + + <BR> + <A NAME="settings-test_campaign_calls"> + <BR> + <B>Abilita chiamate di prova della campagna -</B> Questa impostazione consente la possibilità di inserire un codice telefono e numero di telefono nei campi nella parte inferiore dello schermo Dettagliata campagna ed effettuare una telefonata a quel numero, come se si trattasse di un vantaggio di essere auto-selezionato nel sistema. Il numero di telefono viene memorizzato come una nuova guida nel Manuale delle liste ID lista di selezione. La campagna deve essere attivo per questa funzione deve essere abilitata, e si raccomanda che le liste assegnati alla campagna tutti essere impostato su inattivo. Il prefisso di selezione, timeout di composizione e di tutte le funzioni di selezione altre collegate, fatta eccezione per la DNC opzioni call e di tempo, influenzerà la composizione del numero di test. La telefonata sarà posizionato sul server selezionato come server voicemail nelle impostazioni di sistema. Il default è 0 per disabili. + + <BR> + <A NAME="settings-expanded_list_stats"> + <BR> + <B>Abilita Statistiche elenco esteso -</B> Questa impostazione consente a due colonne aggiuntive per essere visualizzati sulla maggior parte delle tabelle nell'elenco di disaggregazione di stato la modifica dell'elenco e le pagine di modifica della campagna. Penetrazione è definita come la percentuale di cavi che sono pari o superiore al limite di conteggio di campagna chiamata e, oppure lo stato è contrassegnato come completato. Il valore predefinito è 1 per abilitato. + + <BR> + <A NAME="settings-campaign_cid_areacodes_enabled"> + <BR> + <B>Abilita IndicativoLocalità Campagna CID -</B> Questa impostazione consente la possibilità di impostare specifici numeri identificativi dei chiamanti in uscita da utilizzare per campagna. Il valore predefinito è 1 per abilitato. + + <BR> + <A NAME="settings-did_ra_extensions_enabled"> + <BR> + <B>Abilita distanza sostituisce interno di un agente -</B> Questa impostazione consente di avere DID sostituzioni di estensione per agente remoto le chiamate instradate attraverso in-gruppi. Il default è 0 per disabili. + + <BR> + <A NAME="contact_information"> + <A NAME="settings-contacts_enabled"> + <BR> + <B>Contatti Enabled -</B> Questa impostazione consente ai Contatti sotto-sezione in Admin che consente al gestore di aggiungere modificare o cancellare i contatti nel sistema che possono essere utilizzati come parte di un trasferimento personalizzato in una campagna in cui un agente può cercare i contatti in base al nome Cognome o in ufficio numero e quindi selezionare uno dei tanti numeri associati a tale contatto. Questa funzione viene spesso utilizzata dagli operatori o funzioni del quadro in cui l'utente avrebbe bisogno di trasferire una chiamata a un non-agent telefono. Il default è 0 per disabili. <BR> <A NAME="settings-first_login_trigger"> <BR> - <B>First Login Trigger -</B> This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system. + <B>Accedi primo trigger -</B> Questa impostazione consente la configurazione iniziale dello schermo del server da mostrare all'amministratore al primo accesso al sistema. <BR> <A NAME="settings-default_phone_registration_password"> <BR> - <B>Default Phone Registrazione Password -</B> This is the default registration password used when new phones are added to the system. Default is test. + <B>Predefinito Password Telefonoword Registrazione -</B> Questa è la password di registrazione predefinita utilizzata quando nuovi telefoni vengono aggiunte al sistema. Il valore predefinito è di prova. <BR> <A NAME="settings-default_phone_login_password"> <BR> - <B>Default Login Telefono Password -</B> This is the default phone web login password used when new phones are added to the system. Default is test. + <B>Predefinito Password Telefonoword Login -</B> Questo è il telefono predefinito password di accesso utilizzata per la web nuovi telefoni vengono aggiunti al sistema. Il valore predefinito è di prova. <BR> <A NAME="settings-default_server_password"> <BR> - <B>Default Server Password -</B> This is the default server password used when new servers are added to the system. Default is test. + <B>Default Server password -</B> Questa è la password del server predefinito utilizzato quando i server vengono aggiunti nuovi al sistema. Il valore predefinito è di prova. <BR> <A NAME="settings-slave_db_server"> <BR> - <B>Slave Database Server -</B> If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled. + <B>Slave Database Server -</B> Se avete un server slave database MySQL, quindi immettere l'indirizzo IP locale per il server qui. Questa opzione è attualmente utilizzato solo dai rapporti selezionati l'opzione successiva e non ha nulla a che fare con la configurazione automatica di MySQL master-slave di replica. Il valore predefinito è vuota per disabili. <BR> <A NAME="settings-reports_use_slave_db"> <BR> - <B>Rapporti to use Slave DB -</B> This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled. + <B>Rapporti da utilizzare DB Slave -</B> Questa opzione consente di selezionare i report che si desidera utilizzare il database è schiavo MySQL come definito la suddetta opzione al posto del database master che il vostro sistema live ViciDial è in esecuzione. È necessario impostare la replica slave MySQL prima di poter attivare questa opzione. Il valore predefinito è vuota per disabili. <BR> <A NAME="settings-default_field_labels"> <BR> - <B>Default Field Labels -</B> These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. + <B>Di campo predefiniti di etichette -</B> Questi 19 campi permettono di impostare il nome che verrà visualizzato nell'interfaccia agente ViciDial così come la pagina principale modifica amministrativa. Il valore predefinito è vuoto, che utilizzerà i valori predefiniti hardcoded nell'interfaccia agente. È inoltre possibile impostare un'etichetta --- --- NASCONDI per nascondere sia l'etichetta e il campo. + + <BR> + <A NAME="settings-label_hide_field_logs"> + <BR> + <B>Nascondi etichette in registri delle chiamate -</B> Se l'etichetta è impostato su NASCONDI --- --- poi i registri delle chiamate degli agenti, se abilitata sulla campagna, si mostrano ancora sul campo e dati a meno che questa opzione è impostata su Y. Il valore predefinito è N. <BR> <A NAME="settings-qc_features_active"> @@ -7075,32 +8249,57 @@ if ($ADD==99999) <BR> <A NAME="settings-default_webphone"> <BR> - <B>Default Webphone -</B> If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0. + <B>Predefinito Webphone -</B> Se impostato a 1, questa opzione farà tutti i nuovi telefoni sono creati Imposta come predefinito set Webphone a Y. è 0. <BR> <A NAME="settings-webphone_systemkey"> <BR> - <B>Webphone System Key -</B> If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty. + <B>Webphone Key System -</B> Se il vostro sistema o il provider lo richiede, è qui la chiave di sistema per la webphone deve essere inserito dentro di default è vuota. <BR> <A NAME="settings-default_codecs"> <BR> - <B>Default Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for all systems. Opziones for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty. + <B>Predefinite Codecs -</B> È possibile definire un elenco delimitato da virgole di codec da impostare come i codec di default per tutti i sistemi. Le opzioni per i codec sono ulaw, alaw, GSM, G729, Speex, G722, G723, G726, iLBC, ... Il valore predefinito è vuoto. <BR> <A NAME="settings-custom_dialplan_entry"> <BR> - <B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context. + <B>Personalizzato Entry Dialplan -</B> Questo campo consente di inserire in tutti gli elementi dialplan che si desidera per tutti i server Asterisk, le linee saranno aggiunti al contesto di default. + + <BR> + <A NAME="settings-reload_dialplan_on_servers"> + <BR> + <B>Ricarica Dialplan sui server -</B> Questa opzione permette di forzare un reload del dialplan Asterisk su tutti i server nel cluster. Se sono state apportate modifiche nella voce personalizzata Dialplan sopra si consiglia di impostare questo valore a 1 e presentare ad avere tali modifiche entreranno in vigore sui server. + + <BR> + <A NAME="settings-noanswer_log"> + <BR> + <B>Risposta No-Log -</B> Questa opzione consente di registrare le chiamate di auto-selezione che non trovano risposta in una tabella separata. Il valore predefinito è N. + + <BR> + <A NAME="settings-did_agent_log"> + <BR> + <B>DID Log in agenzia -</B> Questa opzione registrerà l'ingresso DID chiamate insieme ad un in-group e l'ID utente, se del caso, in una tabella separata. Il valore predefinito è N. + + <BR> + <A NAME="settings-alt_log_server_ip"> + <BR> + <B>Alt-Log DB Server -</B> Questo è il server di database alternativo log. Questo è opzionale, e permette di alcuni registri di essere scritta in un database separato. Il valore predefinito è vuoto. + + <BR> + <A NAME="settings-tables_use_alt_log_db"> + <BR> + <B>Alt-Log tabelle -</B> Queste sono le tabelle che sono disponibili per la registrazione sul server di database alternativo log. Il valore predefinito è vuoto. <BR> <A NAME="settings-qc_features_active"> <BR> - <B>Default External IP Server -</B> If set to 1, this option will make all new phones created have Use External IP Server set to Y. Default is 0. + <B>IP di default del server esterno -</B> Se impostato a 1, questa opzione farà tutti i nuovi telefoni sono creati Usa IP esterno Server impostato su Y. Il valore predefinito è 0. <BR> <A NAME="settings-qc_features_active"> <BR> - <B>Webphone URL -</B> This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty. + <B>URL webphone -</B> Questo è l'URL del webphone che verrà utilizzato con questo sistema se è abilitato nel record telefoni che un agente sta utilizzando. Il valore predefinito è vuoto. <BR> <A NAME="settings-enable_queuemetrics_logging"> @@ -7145,12 +8344,27 @@ if ($ADD==99999) <BR> <A NAME="settings-queuemetrics_loginout"> <BR> - <B>QueueMetrics Login-Out -</B> This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently. + <B>QueueMetrics Login-Out -</B> Questa opzione influisce sul modo in vicidial registrerà gli accessi e le uscite di un agente nel queue_log. L'impostazione predefinita è STANDARD di utilizzare standard di AGENTLOGIN AGENTLOGOFF, CALLBACK userà AGENTCALLBACKLOGIN e AGENTCALLBACKLOGOFF QM che analizza in modo diverso, NONE non registrerà alcun login e logout all'interno queue_log. <BR> <A NAME="settings-queuemetrics_callstatus"> <BR> - <B>QueueMetrics CallStatus -</B> This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled. + <B>QueueMetrics CallStatus -</B> Questa opzione se impostato a 0 non metterà nella voce CALLSTATUS in queue_log quando un agente disposizioni una chiamata. Il valore predefinito è 1 per abilitato. + + <BR> + <A NAME="settings-queuemetrics_addmember_enabled"> + <BR> + <B>QueueMetrics Addmember Enabled -</B> Questa opzione, se impostato a 1 genererà ADDMEMBER2 e le voci REMOVEMEMBER in queue_log. Il default è 0 per disabili. + + <BR> + <A NAME="settings-queuemetrics_dispo_pause"> + <BR> + <B>QueueMetrics Dispo Pause Codice -</B> Questa opzione, se popolato, permette di definire se un codice di pausa dispo viene inserito in queue_log quando un agente è in stato di dispo. Il valore predefinito è vuota per disabili. + + <BR> + <A NAME="settings-queuemetrics_pe_phone_append"> + <BR> + <B>Telefono Telefono QueueMetrics Ambiente Append -</B> Questa opzione, se attivata, aggiungere il login telefono dell'agente al record data4 nella tabella log coda se il telefono campo Campagna ambiente è popolato. Il default è 0 per disabili. <BR> <A NAME="settings-enable_vtiger_integration"> @@ -7188,7 +8402,40 @@ if ($ADD==99999) <B><FONT SIZE=3>VICIDIAL_STATUSES TABELLA</FONT></B><BR><BR> <A NAME="vicidial_statuses"> <BR> - <B>Con el uso de los estados de sistema, usted puede tener estados queexistan para la campaña y el en-grupo. El estado debe ser 1-6caracteres en longitud, la descripcio`n debe ser 2-30 caracteres enlongitud y seleccionable define si demuestra para arriba en VICIDIALcomo disposicion del agente. Human_answered el campo se utiliza alcalcular el porcentaje de la gota, o la tarifa del abandono. El ajustehuman_answered a Y utilizará este estado al contar las llamadashumano-contestadas. La opcio`n de la categoría permite que ustedagrupe varios estados en un catogy que se pueda utilizar para elanálisis estadístico. Ci sono anche 5 impostazioni aggiuntive che definiscono il tipo di stato: in vendita, DNC, contatto con i clienti, non interessati, impraticabile.</B> + <B>Con el uso de los estados de sistema, usted puede tener estados queexistan para la campaña y el en-grupo. El estado debe ser 1-6caracteres en longitud, la descripcio`n debe ser 2-30 caracteres enlongitud y seleccionable define si demuestra para arriba en VICIDIALcomo disposicion del agente. Human_answered el campo se utiliza alcalcular el porcentaje de la gota, o la tarifa del abandono. El ajustehuman_answered a Y utilizará este estado al contar las llamadashumano-contestadas. La opcio`n de la categoría permite que ustedagrupe varios estados en un catogy que se pueda utilizar para elanálisis estadístico. Ci sono anche 5 impostazioni aggiuntive che definiscono il tipo di stato: in vendita, DNC, contatto con i clienti, non interessati, impraticabile, scheduled callback.</B> + + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS TABELLA</FONT></B><BR><BR> + <A NAME="vicidial_screen_labels"> + <BR> + <B>Screen labels give you the option of setting different labels for the default agent screen fields on a per campagna basis.</B> + + <A NAME="vicidial_screen_labels-label_id"> + <BR> + <B>Schermo Label ID -</B> Questo campo deve essere di almeno 2 caratteri di lunghezza e non più di 20 caratteri, senza spazi o caratteri speciali. Questo è l'ID che verrà utilizzato per identificare l'etichetta schermo tutto il sistema. + + <BR> + <A NAME="vicidial_screen_labels-label_name"> + <BR> + <B>Nome schermata Etichetta -</B> Questo è il nome descrittivo della voce label schermo. + + <BR> + <A NAME="vicidial_screen_labels-user_group"> + <BR> + <B>Admin Gruppo Utente -</B> Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record. + + <BR> + <A NAME="vicidial_screen_labels-label_hide_field_logs"> + <BR> + <B>Nascondi etichette in registri delle chiamate -</B> Se l'etichetta è impostato su NASCONDI --- --- poi i registri delle chiamate degli agenti, se abilitata sulla campagna, si mostrano ancora sul campo e dati a meno che questa opzione è impostata su Y. Il valore predefinito è N. + + <BR> + <A NAME="vicidial_screen_labels-default_field_labels"> + <BR> + <B>Di campo predefiniti di etichette -</B> Questi 19 campi permettono di impostare il nome che verrà visualizzato nell'interfaccia agente ViciDial così come la pagina principale modifica amministrativa. Il valore predefinito è vuoto, che utilizzerà i valori predefiniti hardcoded nell'interfaccia agente. È inoltre possibile impostare un'etichetta --- --- NASCONDI per nascondere sia l'etichetta e il campo. @@ -7200,6 +8447,58 @@ if ($ADD==99999) <B>Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificacio`n de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripcio`n es opcional y la exhibicio`nde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD.</B> La vendita e Dead Categoria Categoria di piombo sono entrambi utilizzati dal sistema quando Elenco Suggerimento analisi statistiche elenco. + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL CUSTOM TEMPLATE MAKER</FONT></B><BR><BR> + <A NAME="vicidial_template_maker"> + <BR> + The Vicidial custom template maker allows you to define your own file layouts for use with the Vicidial listloader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the Vicidial standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter. + + <BR> + <A NAME="vicidial_template_maker-create_template"> + <BR> + <B>Creare un nuovo modello - </B>In order to begin creating your new listloader template, you must first load a lead file that has the layout you wish to create the template for. Click "Choose file", and open the file on your computer you wish to use. This will upload a copy to your server and process it to determine the file type and delimiter (for TXT files). + + <BR> + <A NAME="vicidial_template_maker-delete_template"> + <BR> + <B>Eliminaretemplate -</B> If you have a template you no longer use or you mis-entered information on it and would like to re-enter it, select the template from the drop-down menu and click "Elimina modello". + + <BR> + <A NAME="vicidial_template_maker-template_id"> + <BR> + <B>Template ID -</B> This field is where you enter an arbitrary ID for your new custom template. It must be between 2 and 20 characters and consist of alphanumeric characters and underscores. + + <BR> + <A NAME="vicidial_template_maker-template_name"> + <BR> + <B>Nome modello -</B> This field is where you enter the name for your new custom template. Can be up to 30 characters long. + + <BR> + <A NAME="vicidial_template_maker-template_description"> + <BR> + <B>Template Description -</B> This field is where you enter the description for your new custom template. It can be up to 255 characters long. + + <BR> + <A NAME="vicidial_template_maker-list_id"> + <BR> + <B>ID Lista -</B> All templates must load their records into a list. Select a list ID to load leads into from this drop-down list, which will display any lists available to you given your user settings. + + <BR> + <A NAME="vicidial_template_maker-assign_columns"> + <BR> + <B>Assigning columns -</B> Once you have loaded a sample file matching the layout you wish to make into a template and select a list ID to load leads into, all the available columns from the vicidial_list table and the custom table for the list you selected (if any) will be displayed here. Colonnas highlighted in blue are standard columns from the vicidial_list table. Colonnas highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample file you uploaded. Assign the appropriate fields to the appropriate columns and press "Carica modello" to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard vicidial_list columns, click <a href="#vicidial_list_loader">HERE</a>. + + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>Massimo sistema Statistiche Rapporti</FONT></B><BR><BR> + <A NAME="vicidial_max_stats"> + <BR> + <B>Queste statistiche sono memorizzate nella cache totali che vengono memorizzati nel corso di ogni giorno in tempo reale attraverso processi back-end. Per le chiamate in entrata, le chiamate totali per in-gruppo sono calcolati per ciascuna chiamata che entra nel processo che calcola. Per i conti tutto il sistema, i totali sono generati da voci di registro così come altre totali in gruppo e campagna. I totali potrebbero non corrispondere a causa delle impostazioni che avete nel vostro sistema, nonché quando la chiamata viene riagganciato. + + <?php if ($SSqc_features_active > 0) { @@ -7209,7 +8508,7 @@ if ($ADD==99999) <B><FONT SIZE=3>QC VICIDIAL Codici di stato</FONT></B><BR><BR> <A NAME="vicidial_qc_status_codes"> <BR> - <B>Il Controllo Qualità-QC VICIDIAL sistema ha il proprio set di codici di stato separato da coloro che, nelle funzioni di gestione delle chiamate VICIDIAL. QC statuse codici deve essere compresa tra 2 e 8 caratteri e non contengono caratteri speciali, come uno spazio o due punti. Il codice di stato, QC descrizione deve essere compresa tra 2 e 30 caratteri di lunghezza.</B> + <B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B> <?php } ?> @@ -7249,12 +8548,13 @@ if ($ADD==73) echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $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_query($stmt, $link); $row=mysql_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]; @@ -7264,7 +8564,7 @@ if ($ADD==73) } } - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -7289,13 +8589,15 @@ if ($ADD==73) echo "<BR><BR>\n"; echo "<B>Demuestre La Cuenta De los Plomos De Dialable</B> -<BR><BR>\n"; echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n"; - echo "<B>LISTE:</B> $camp_lists<BR>\n"; + echo "<B>LISTS:</B> $camp_lists<BR>\n"; echo "<B>ESITI:</B> $dial_statuses<BR>\n"; echo "<B>FILTRO:</B> $lead_filter_id<BR>\n"; + echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $single_status=0; + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "<BR><BR>\n"; echo "</BODY></HTML>\n"; @@ -7387,13 +8689,14 @@ if ($ADD==7111111) $xfercallid = 'xfercallid'; $agent_log_id = 'agent_log_id'; $entry_list_id = 'entry_list_id'; + $call_id = 'call_id'; 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';"; + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $script_name = $row[1]; @@ -7537,6 +8840,7 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + $script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -7557,8 +8861,10 @@ if ($ADD==7111111) $ADMIN=$PHP_SELF; require("admin_header.php"); - - +if ( ($SSadmin_modify_rinfrescare > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "
    "; + } ###################################################################################################### @@ -7603,33 +8909,22 @@ if ($ADD=="1") echo "Numero Utente: $NWB#vicidial_users-user$NWE\n"; } - echo "Password: $NWB#vicidial_users-pass$NWE     Strength: \n"; + echo "Password: $NWB#vicidial_users-pass$NWE     Forza: \n"; echo "Nome Completo: $NWB#vicidial_users-full_name$NWE\n"; echo "Livello Utente: $NWB#vicidial_users-user_level$NWE\n"; echo "Gruppo Utente: $NWB#vicidial_users-phone_login$NWE\n"; echo "Password Telefono: $NWB#vicidial_users-phone_pass$NWE\n"; echo "$NWB#vicidial_users-user_group$NWE\n"; @@ -7679,7 +8974,7 @@ if ($ADD=="1A") echo "Numero Utente: $NWB#vicidial_users-user$NWE\n"; } - echo "Password: $NWB#vicidial_users-pass$NWE     Strength: \n"; + echo "Password: $NWB#vicidial_users-pass$NWE     Forza: \n"; echo "Nome Completo: $NWB#vicidial_users-full_name$NWE\n"; @@ -7688,7 +8983,7 @@ if ($ADD=="1A") echo "Utente Da Copiare: $NWB#vicidial_campaigns-campaign_name$NWE\n"; echo "Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE\n"; + echo "Admin Gruppo Utente: $NWB#vicidial_campaigns-user_group$NWE\n"; echo "Attivo: $NWB#vicidial_campaigns-active$NWE\n"; - echo "Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE\n"; - echo "Web Form: $NWB#vicidial_campaigns-web_form_address$NWE\n"; + echo "Parco della Musica-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE\n"; + echo "Web Form: $NWB#vicidial_campaigns-web_form_address$NWE\n"; if ($SSoutbound_autodial_active > 0) { echo "Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE\n"; - echo "Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE\n"; + echo "Hopper Livello Minimo: $NWB#vicidial_campaigns-hopper_level$NWE\n"; echo "Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE\n"; } - echo "Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE\n"; + echo "Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE\n"; echo "Orario Chiamate: $NWB#vicidial_campaigns-local_call_time$NWE\n"; @@ -7879,7 +9178,7 @@ if ($ADD==12) echo "Campagna da copiare:$NWB#vicidial_lists-list_description$NWE\n"; echo "Campagna: $NWB#vicidial_inbound_groups-group_name$NWE\n"; echo "Colore Gruppo: $NWB#vicidial_inbound_groups-group_color$NWE\n"; echo "Attivo: $NWB#vicidial_inbound_groups-active$NWE\n"; - echo "Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE\n"; + echo "Admin Gruppo Utente: $NWB#vicidial_inbound_groups-user_group$NWE\n"; + echo "Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE\n"; echo "Casella Vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE\n"; - echo "Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_inbound_groups-next_agent_call$NWE\n"; + echo "Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_inbound_groups-next_agent_call$NWE\n"; echo "Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE\n"; echo "Script: \n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $groups_to_print = mysql_num_rows($rslt); $groups_list=''; @@ -8380,6 +9683,10 @@ if ($ADD==1311) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    HA Estensione: (senza spazi or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
    HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
    Admin Gruppo Utente: $NWB#vicidial_inbound_dids-user_group$NWE
    \n"; } @@ -8410,7 +9717,7 @@ if ($ADD==1411) echo "HA Fonte: (senza spazi or special characters)$NWB#vicidial_call_menu-menu_id$NWE\n"; } echo "Menu Nome: $NWB#vicidial_call_menu-menu_name$NWE\n"; + echo "Admin Gruppo Utente: $NWB#vicidial_call_menu-user_group$NWE\n"; echo "\n"; echo "\n"; } @@ -8518,7 +9829,7 @@ if ($ADD==1611) echo "Fonte Menu: \n"; echo "
    \n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Filter Phone ID Gruppo: (senza spazi or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Filter Phone Nome Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descrizione: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Filter Nome Telefono Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Descrizione Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Admin Gruppo Utente: $NWB#vicidial_filter_phone_groups-user_group$NWE
    \n"; } @@ -8586,7 +9901,7 @@ if ($ADD==11111) echo "
    NUOVO OPERATORE REMOTO
    \n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8916,6 +10245,10 @@ if ($ADD==1111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8935,7 +10268,7 @@ if ($ADD==1111111111) if ($ADD==131111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo "
    Inizio ID Utente: (solo cifre, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Inizio ID Utente: (solo cifre, incremented, deve essere un utente esistente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Server: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; - echo "
    Add Extension Group Entry\n"; + echo "
    Aggiungi gruppo Entry Extension\n"; echo "\n"; echo "
    \n"; echo "\n"; @@ -8639,7 +9954,7 @@ if ($ADD==12111) $n--; } echo " $NWB#vicidial_extension_groups-rank$NWE\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Extension Gruppo: (senza spazi)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Campagnas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Campagne Gruppi: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; } @@ -8652,7 +9967,7 @@ if ($ADD==12111) ###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN +# ADD=111111 display the ADD NEW USER GROUP SCREEN ###################### if ($ADD==111111) @@ -8733,9 +10048,14 @@ if ($ADD==1111111) echo "
    Nome Script: (titolo script)$NWB#vicidial_scripts-script_name$NWE
    Note Script: $NWB#vicidial_scripts-script_comments$NWE
    Attivo: $NWB#vicidial_scripts-active$NWE
    Admin Gruppo Utente: $NWB#vicidial_scripts-user_group$NWE
    Testo Script: "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -8856,6 +10177,10 @@ if ($ADD==11111111) } echo "
    Nome Del Filtro: (breve descrizione del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Commenti Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_lead_filters-user_group$NWE
    Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -8885,6 +10210,10 @@ if ($ADD==111111111) echo "
    ID Orario Chiamate: (senza spazi e punteggiatura)$NWB#vicidial_call_times-call_time_id$NWE
    Nome Orario Chiamate: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
    Note Orario Chiamate: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_call_times-user_group$NWE
    Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
    State Call Time State: (senza spazi e punteggiatura)$NWB#vicidial_call_times-state_call_time_state$NWE
    _ Estado Llamar Tiempo Nombre: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_call_times-user_group$NWE
    Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -8945,6 +10278,10 @@ if ($ADD==131111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -8958,6 +10295,7 @@ if ($ADD==131111111) echo "Venerdì
    \n"; echo "Sabato
    \n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Maiusc ID: (senza spazi e punteggiatura)$NWB#vicidial_shifts-shift_id$NWE
    Maiusc Nome: (breve descrizione del turno)$NWB#vicidial_shifts-shift_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_shifts-user_group$NWE
    Maiusc Start Time:\n"; echo "   Fine Time Shift:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Segnala Opzione: $NWB#vicidial_shifts-report_option$NWE
    \n"; } @@ -8975,7 +10313,7 @@ if ($ADD==131111111) if ($ADD==11111111111) { - if ($LOGast_admin_access==1) + 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';"; @@ -8998,24 +10336,28 @@ if ($ADD==11111111111) echo "
    \n"; if ($voi_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"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -9023,7 +10365,7 @@ if ($ADD==11111111111) # echo "\n"; # echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Interno Telefono: Auto-Generated $NWB#phones-extension$NWE
    Estensione Telefono:Auto-Generated $NWB#phones-extension$NWE
    Interno Telefono: $NWB#phones-extension$NWE
    Estensione Telefono:$NWB#phones-extension$NWE
    Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
    Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
    CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    IP Server:
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    IP Server: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Agente schermata di login: $NWB#phones-login$NWE
    Login Password: $NWB#phones-pass$NWE
    Registrazione Password: $NWB#phones-conf_secret$NWE     Strength:
    Registrazione password: $NWB#phones-conf_secret$NWE     Forza:
    Esito: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del telefono: $NWB#phones-phone_type$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Protocollo Client: $NWB#phones-protocol$NWE
    Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    \n"; } @@ -9041,7 +10383,7 @@ if ($ADD==11111111111) if ($ADD==12111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9053,6 +10395,10 @@ if ($ADD==12111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -9072,7 +10418,7 @@ if ($ADD==12111111111) if ($ADD==13111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo "
    Alias ID:$NWB#phones-alias_id$NWE
    Alias Nome: $NWB#phones-alias_name$NWE
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    Telefono Login Lista: (comma separated)$NWB#phones-logins_list$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9087,6 +10433,10 @@ if ($ADD==13111111111) echo "
    Numero CallerID: $NWB#phones-caller_id_number$NWE
    CallerID Nome: $NWB#phones-caller_id_name$NWE
    Attivo:
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    \n"; @@ -9118,6 +10468,10 @@ if ($ADD==111111111111) echo "
    Indirizzo IP del Server: $NWB#servers-server_ip$NWE
    Attivo: $NWB#servers-active$NWE
    Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
    Admin Gruppo Utente: $NWB#servers-user_group$NWE
    \n"; } @@ -9146,6 +10500,10 @@ if ($ADD==131111111111) echo "
    Template ID: $NWB#vicidial_conf_templates-template_id$NWE
    Nome modello: $NWB#vicidial_conf_templates-template_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_conf_templates-user_group$NWE
    Template Sommario: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -9164,7 +10522,7 @@ if ($ADD==131111111111) if ($ADD==141111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9176,10 +10534,14 @@ if ($ADD==141111111111) echo "
    Vettore ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Nome del vettore: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Descrizione: $NWB#vicidial_server_carriers-carrier_description$NWE
    Admin Gruppo Utente: $NWB#vicidial_server_carriers-user_group$NWE
    Stringa di registrazione: $NWB#vicidial_server_carriers-registration_string$NWE
    Template ID:
    \n"; echo ""; - echo "
    ADD COPIED CARRIER\n"; + echo "
    AGGIUNGI CARRIER COPIATO\n"; echo "\n"; echo "
    \n"; echo "\n"; @@ -9235,9 +10597,9 @@ if ($ADD==140111111111) echo "$NWB#vicidial_server_carriers-server_ip$NWE\n"; - echo "
    Vettore ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Source Carrier:
    Fonte Carrier: \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9282,6 +10644,10 @@ if ($ADD==151111111111) echo "
    TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
    TTS Nome: $NWB#vicidial_tts_prompts-tts_name$NWE
    Attivo:
    Admin Gruppo Utente: $NWB#vicidial_tts_prompts-user_group$NWE
    \n"; @@ -9300,7 +10666,7 @@ if ($ADD==151111111111) if ($ADD==161111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    \n"; echo ""; @@ -9312,6 +10678,10 @@ if ($ADD==161111111111) echo "
    Music On Hold ID: $NWB#vicidial_music_on_hold-moh_id$NWE
    Music On Hold Nome: $NWB#vicidial_music_on_hold-moh_name$NWE
    Ordine casuale:
    Admin Gruppo Utente: $NWB#vicidial_music_on_hold-user_group$NWE
    \n"; @@ -9330,7 +10700,7 @@ if ($ADD==161111111111) if ($ADD==171111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    \n"; echo ""; @@ -9344,6 +10714,81 @@ if ($ADD==171111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Attivo:
    Email:$NWB#vicidial_voicemail-email$NWE
    Admin Gruppo Utente: $NWB#vicidial_voicemail-user_group$NWE
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 "
    Aggiungere la nuova etichetta SCREEN\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
    Schermo Label ID: $NWB#vicidial_screen_labels-label_id$NWE
    Nome schermata Etichetta: $NWB#vicidial_screen_labels-label_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_screen_labels-user_group$NWE
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 "
    Aggiungere la nuova etichetta 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 "
    Nome: $NWB#contact_information$NWE
    Cognome: $NWB#contact_information$NWE
    Office Number: $NWB#contact_information$NWE
    Cell Number: $NWB#contact_information$NWE
    Numero Altro 1: $NWB#contact_information$NWE
    Numero Altro 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Gruppo: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; @@ -9651,7 +11096,7 @@ if ($ADD=="2") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -9788,7 +11233,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -9943,7 +11388,7 @@ if ($ADD=="2A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -10056,12 +11501,30 @@ if ($ADD==21) { echo "
    CAMPAGNA AGGIUNTA: $campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -10120,13 +11583,31 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns + if ( (!eregi("-ALL",$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_query($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_rinfrescare,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) 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_rinfrescare,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_query($stmtA, $link); - $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,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_query($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; @@ -10188,7 +11669,7 @@ if ($ADD==22) { echo "
    STATO PERSONALIZZATO PER CAMPAGNA AGGIUNTO: $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) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10439,12 +11920,12 @@ if ($ADD==201) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    PRESET NOT ADDED - there is already an entry for this campaign with this preset\n";} + {echo "
    PRESET NON AGGIUNTO - esiste già una voce per questa campagna con questo preset\n";} else { if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    PRESET NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    PRESET NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\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"; } @@ -10472,6 +11953,133 @@ if ($ADD==201) } +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + 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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Prefisso NON CID AGGIUNTO - esiste già una voce per questa campagna con questo CID
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    Prefisso NON CID AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti
    \n"; + } + else + { + echo "
    Prefisso CID AGGIUNTO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    Prefisso CID non vengono eliminati - questa voce non esiste
    \n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
    Prefisso CID non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti
    \n"; + } + else + { + echo "
    Prefisso 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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_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 "
    Prefisso CID NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti
    \n"; + } + else + { + echo "Prefisso CID MODIFICATO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_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_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -10518,7 +12126,7 @@ if ($ADD==211) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTE', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -10571,12 +12179,15 @@ if ($ADD==2111) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url,add_lead_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','');"; + $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) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPPO AGGIUNTO: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -10636,9 +12247,15 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + echo "
    GRUPPO AGGIUNTO: $group_id\n"; ### LOG INSERTION Admin Log Table ### @@ -10683,7 +12300,7 @@ if ($ADD==2311) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -10728,7 +12345,7 @@ if ($ADD==2411) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where did_id=\"$source_did\";"; + $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_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -10785,7 +12402,7 @@ if ($ADD==2511) 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 non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + echo "
    Call ID Menu non è possibile utilizzare parole riservate: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; $ADD=1500; } else @@ -10798,7 +12415,7 @@ if ($ADD==2511) } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,user_group) values('$menu_id','$menu_name','$user_group');"; $rslt=mysql_query($stmt, $link); echo "
    CALL MENU AGGIUNTO: $menu_id $menu_name\n"; @@ -10852,7 +12469,7 @@ if ($ADD==2611) 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 non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + echo "
    Call ID Menu non è possibile utilizzare parole riservate: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; $ADD=1500; } else @@ -10865,7 +12482,7 @@ if ($ADD==2611) } 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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; + $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) 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 from vicidial_call_menu where menu_id=\"$source_menu\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; @@ -10899,20 +12516,20 @@ if ($ADD==2711) $rslt=mysql_query($stmt, $link); $row=mysql_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";} + {echo "
    GRUPPO FILTRO TELEFONO NON AGGIUNTO - c'è già un gruppo PHONE FILTER nel sistema con questo ID\n";} else { if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) { echo "
    PHONE FILTER GRUPPO NON AGGIUNTO - per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Phone Filter L`ID deve essere lungo tra i 2 e i 20 caratteri e non deve contenere ' '.\n"; + echo "
    Telefono ID Group filtro deve essere compresa tra 2 e 20 caratteri e non contengono ' '.\n"; } else { - $stmt="INSERT INTO vicidial_filter_phone_groups (filter_phone_group_id,filter_phone_group_name,filter_phone_group_description) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description');"; + $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_query($stmt, $link); - echo "
    PHONE FILTER GRUPPO AGGIUNTO: $filter_phone_group_id $filter_phone_group_name\n"; + echo "
    TELEFONO GRUPPO FILTRO AGGIUNTO: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -10942,11 +12559,11 @@ if ($ADD==21111) else { ### check for a valid user that will be associated with this account - $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "
    OPERATORI REMOTI NOT ADDED - you must use a valid user as the user_start for remote agents\n";} + {echo "
    OPERATORI REMOTI NOT ADDED - è necessario utilizzare un utente valido come user_start per gli agenti remoti\n";} else { ### check for closest remote agents to this account to ensure no overlapping @@ -10955,7 +12572,7 @@ if ($ADD==21111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    OPERATORI REMOTI NOT ADDED - your number of lines overlaps with another remote agent\n";} + {echo "
    OPERATORI REMOTI NOT ADDED - il tuo numero di sovrapposizioni di linee con un altro agente remoto\n";} else { if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) @@ -10996,12 +12613,12 @@ if ($ADD==22111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";} + {echo "
    GRUPPO ENTRY ESTENSIONE NON AGGIUNTO - c'è già una voce gruppo di interni con questi valori\n";} else { if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    GRUPPO ENTRY ESTENSIONE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else @@ -11014,7 +12631,7 @@ if ($ADD==22111) $row=mysql_fetch_row($rslt); $extension_id = $row[0]; - echo "
    EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension\n"; + echo "
    GRUPPO ENTRY ESTENSIONE AGGIUNTO: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -11064,9 +12681,34 @@ if ($ADD==211111) } else { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; + $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_query($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 ( (!eregi("-ALL",$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_query($stmt, $link); + echo "
    GRUPPO UTENTI AGGIUNTO: $user_group\n"; ### LOG INSERTION Admin Log Table ### @@ -11192,7 +12834,7 @@ if ($ADD==2111111) } else { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active','$user_group');"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
    SCRIPT AGGIUNTO: $script_id\n"; @@ -11245,7 +12887,7 @@ if ($ADD==21111111) } else { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $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='" . mysql_real_escape_string($lead_filter_sql) . "';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11285,7 +12927,7 @@ if ($ADD==211111111) } 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';"; + $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';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11325,7 +12967,7 @@ if ($ADD==2111111111) } 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';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11389,7 +13031,7 @@ if ($ADD==231111111) $SHIFT_weekdays .= "$shift_weekdays[$p]"; $p++; } - $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $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_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -11466,7 +13108,7 @@ if ($ADD==21111111111) { echo "
    TELEFONO AGGIUNTO\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) 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');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11515,7 +13157,7 @@ if ($ADD==22111111111) { echo "
    TELEFONO ALIAS AGGIUNTO\n"; - $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11556,7 +13198,7 @@ if ($ADD==23111111111) { echo "
    GRUPPO ALIAS AGGIUNTO\n"; - $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11593,7 +13235,7 @@ if ($ADD==211111111111) { echo "
    SERVER AGGIUNTO\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11690,7 +13332,7 @@ if ($ADD==231111111111) { echo "
    CONF TEMPLATE AGGIUNTO\n"; - $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11726,7 +13368,7 @@ if ($ADD==241111111111) { 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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11763,9 +13405,9 @@ if ($ADD==240111111111) {echo "
    Vettore non AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - echo "
    COPIED CARRIER ADDED\n"; + echo "
    CARRIER copiati hanno aggiunto\n"; - $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -11804,7 +13446,7 @@ if ($ADD==251111111111) { echo "
    TTS Entry Aggiunto\n"; - $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11840,7 +13482,7 @@ if ($ADD==261111111111) { echo "
    Music On Hold Entry Aggiunto\n"; - $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -11883,7 +13525,7 @@ if ($ADD==271111111111) { echo "
    VOICEMAIL BOX AGGIUNTO\n"; - $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $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_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -11908,6 +13550,86 @@ if ($ADD==271111111111) } +###################### +# ADD=281111111111 adds new screen label to the system +###################### + +if ($ADD==281111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    LABEL SCREEN NON AGGIUNTO - c'è già una etichetta nel sistema con questo ID\n";} + else + { + if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) + {echo "
    LABEL SCREEN NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
    LABEL SCREEN AGGIUNTO\n"; + + $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=381111111111; + } + + +###################### +# ADD=291111111111 adds new contact to the system +###################### + +if ($ADD==291111111111) + { + 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_query($stmt, $linkALT); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Contatto non AGGIUNTO - c'è già un contatto nel sistema con questo nome e numero di\n";} + else + { + if (strlen($last_name) < 2) + {echo "
    Contatto non AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
    CONTATTO AGGIUNTO\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_query($stmt, $linkALT); + $contact_id = mysql_insert_id($linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + } + $ADD=391111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -11971,7 +13693,7 @@ if ($ADD==21111111111111) if ($ADD==221111111111111) { echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -11995,7 +13717,7 @@ if ($ADD==221111111111111) { echo "
    ESITO DI DEFAULT AGGIUNTO: $status_name - $status_id\n"; - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12136,7 +13858,7 @@ if ($ADD=="4A") } echo "
    UTENTE MODIFICATO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12285,7 +14007,7 @@ if ($ADD=="4A") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12379,7 +14101,7 @@ if ($ADD=="4B") } echo "
    UTENTE MODIFICATO - 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' where user='$user';"; + $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' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12528,7 +14250,7 @@ if ($ADD=="4B") if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12616,7 +14338,7 @@ if ($ADD==4) { echo "
    UTENTE MODIFICATO: $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' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12765,7 +14487,7 @@ if ($ADD==4) if ($usergroupcount < 1) { - $stmt="SELECT user_group FROM vicidial_user_groups;"; + $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysql_num_rows($rslt); @@ -12846,6 +14568,7 @@ if ($ADD==41) 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'; @@ -12874,6 +14597,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -12888,32 +14613,121 @@ if ($ADD==41) $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'; } - if (ereg('list_activation',$stage)) + if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) ) { - $p=0; - echo "
    ATTIVO LISTE CAMBIAMENTO"; - $list_active_change_ct = count($list_active_change); - while ($p < $list_active_change_ct) + if (ereg('test_call',$stage)) { - $LIST_ACTIVATE .= "'$list_active_change[$p]',"; - $p++; + $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='Prova chiamate in uscita';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + + ### LOG INSERTION Admin Log Table, for lead ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + ### gather list_id overrides + $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $CIDor_ct = mysql_num_rows($rslt); + $campaign_cid_override=''; + if ($CIDor_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_cid_override = $row[0]; + } + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";} + else {$VDAD_dial_exten = "$SSanswer_transfer_agent";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';} + if (strlen($ext_context) < 1) {$ext_context='default';} + if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} + else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + # Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + + ### insert a NEW record to the vicidial_manager table to be processed + $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; + $rslt=mysql_query($stmtB, $link); + + ### insert a SENT record to the vicidial_auto_calls table + $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table, for campaign ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} + echo " PLACED TO $phone_code $phone_number\n
    "; + } } - - $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $rslt=mysql_query($stmtB, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtB|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTE', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
    ATTIVO LISTE CAMBIAMENTO"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); - if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } } else { @@ -12925,77 +14739,124 @@ if ($ADD==41) } else { - echo "
    CAMPAGNA MODIFICATA: $campaign_id\n"; - - if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) + if ($form_end != 'END') { - $no_hopper_dialing='N'; - $agent_dial_owner_only='NONE'; - } - if ($no_hopper_dialing == 'Y') - { - $auto_alt_dial='NONE'; - $list_order_mix='DISABLED'; - } - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - $campaign_allow_inbound='N'; + echo "
    CAMPAIGN NOT MODIFIED - Si prega di attendere per l'intera pagina da caricare prima di inviare il modulo\n"; } else { - if ($dial_level_override > 0) + echo "
    CAMPAGNA MODIFICATA: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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_method == 'RATIO') + if ($dial_level_override > 0) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} $adlSQL = "auto_dial_level='$auto_dial_level',"; } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } } } - } - if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) - {$hopper_level='100';} + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + $closer_campaignsSQL = "'$groups_value'"; + if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') ) + { + $closer_campaignsSQL = 'closer_campaigns'; + $groups_list=''; - $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', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mcloser_campaigns = $row[0]; + $Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns); + $groups = explode(" ", $Mcloser_campaigns); - if ($reset_hopper == 'Y') - { - echo "
    REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
    - Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); + $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 .= " -";} + } + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_rinfrescare='$campaign_stats_rinfrescare',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
    REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; + echo "
    - Espera 1 minuto antes de marcar el número siguiente\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); } } } @@ -13048,7 +14909,7 @@ if ($ADD==42) { echo "
    ESITO PERSONALIZZATO PER CAMPAGNA MODIFICATO: $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' where campaign_id='$campaign_id' and status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13155,6 +15016,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -13177,7 +15040,7 @@ if ($ADD==44) $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTE', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -13226,7 +15089,7 @@ if ($ADD==44) $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -13417,7 +15280,7 @@ if ($ADD=='40A') { echo "
    INDAGINE SETTINGS MODIFICATI: $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' where campaign_id='$campaign_id';"; + $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13503,7 +15366,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $OLDlist_mix_container = $row[0]; @@ -13537,7 +15400,7 @@ if ($ADD==49) } else { - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $MIXentries = $MT; @@ -13611,7 +15474,7 @@ if ($ADD==49) } else { - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -13715,7 +15578,7 @@ if ($ADD==401) if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { - echo "
    PRESET NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    PRESET NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\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"; } @@ -13751,51 +15614,81 @@ if ($ADD==401) if ($ADD==411) { - if ($LOGmodify_lists==1) + if ( ($LOGmodify_lists==1) and (strlen($list_id) > 1) ) { echo ""; - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + if ($stage == 'territory_reset') { - echo "
    LISTA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    el nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - if (strlen($reset_time) < 4) {$reset_time='';} - - echo "
    LISTA MODIFICATA: $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' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTE', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') + $p=0; + echo "
    TERRITORIES RESET"; + $territory_reset_ct = count($territory_reset); + while ($p < $territory_reset_ct) { - echo "
    RESET ESITI CONTATTI DELLA LISTA CHIAMATI\n"; - $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmtB, $link); + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTE', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + $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_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n";} } - if ($campaign_id != "$old_campaign_id") + } + else + { + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { - echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; - $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmtC, $link); + echo "
    LISTA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    el nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
    LISTA MODIFICATA: $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='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
    RESET ESITI CONTATTI DELLA LISTA CHIAMATI\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } } } } @@ -13814,84 +15707,184 @@ if ($ADD==411) if ($ADD==4111) { - if ($LOGmodify_ingroups==1) + if ($SUB=='agents_select') { - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + if ($LOGmodify_users==1) { - echo "
    GRUPO NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    el color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; + echo ""; + + if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) + { + echo "
    USERS NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + $ARIUG_changenotes=''; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_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_query($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_query($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 = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$ARIUG_user[$o]', event_code='$ARIUG_code', event_sql=\"$SQL_log\", event_notes='$ARIUG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + $o++; + } + } } 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"];} - - $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; - } - - if ($no_agent_action == "EXTENSION") - { - if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} - elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} - if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} - elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} - - $no_agent_action_value = "$EXextension,$EXcontext"; - } - - $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); - - echo "
    GRUPPO MODIFICATO: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } } else { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
    GRUPO NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    el color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; + } + else + { + if ($form_end != 'END') + { + echo "
    GROUP NOT MODIFIED - Si prega di attendere per l'intera pagina da caricare prima di inviare il modulo\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + if (strlen($IGhandle_method)<1) + { + if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];} + elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];} + } + if (strlen($IGsearch_method)<1) + { + if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];} + elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];} + } + if (strlen($IGlist_id)<1) + { + if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];} + elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];} + } + if (strlen($IGcampaign_id)<1) + { + if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];} + elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];} + } + if (strlen($IGphone_code)<1) + { + if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];} + elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];} + } + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";} + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
    GRUPPO MODIFICATO: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time',na_call_url='" . mysql_real_escape_string($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' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } $ADD=3111; # go to in-group modification form below } @@ -13916,7 +15909,7 @@ if ($ADD==4311) { echo "
    HA MODIFICATO: $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' where did_id='$did_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13956,12 +15949,12 @@ if ($ADD==4511) { echo "
    CALL MENU MODIFICATI: $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' where menu_id='$menu_id';"; + $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' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; $option_value_list='|'; - while ($h <= 18) + while ($h <= 20) { $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; @@ -14004,9 +15997,9 @@ if ($ADD==4511) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); - $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -14047,7 +16040,7 @@ if ($ADD==4511) $h++; } ## delete existing database records that were not in the submit - while ($h <= 18) + while ($h <= 20) { if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) { @@ -14101,14 +16094,14 @@ if ($ADD==4711) if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { echo "
    FILTER PHONE GRUPO NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Filter Phone Nome Gruppo and ID must be at least 2 characters in length\n"; + echo "
    Filter Nome Telefono Group and ID must be at least 2 characters in length\n"; } else { - $stmt="UPDATE vicidial_filter_phone_groups set filter_phone_group_name='$filter_phone_group_name', filter_phone_group_description='$filter_phone_group_description' where filter_phone_group_id='$filter_phone_group_id';"; + $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_query($stmt, $link); - echo "
    FILTER PHONE GRUPPO MODIFICATO\n"; + echo "
    GRUPPO DI TELEFONO FILTRO MODIFICATO\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -14138,11 +16131,11 @@ if ($ADD==41111) { echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "
    OPERATORI REMOTI NOT MODIFIED - you must use a valid user as the user_start for remote agents\n";} + {echo "
    OPERATORI REMOTI NOT MODIFIED - è necessario utilizzare un utente valido come user_start per gli agenti remoti\n";} else { ### check for closest remote agents to this account to ensure no overlapping @@ -14151,7 +16144,7 @@ if ($ADD==41111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    OPERATORI REMOTI NOT MODIFIED - your number of lines overlaps with another remote agent\n";} + {echo "
    OPERATORI REMOTI NOT MODIFIED - il tuo numero di sovrapposizioni di linee con un altro agente remoto\n";} else { if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) @@ -14161,7 +16154,7 @@ if ($ADD==41111) } 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' where remote_agent_id='$remote_agent_id';"; + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); echo "
    LOS AGENTES ALEJADOS SE MODIFICARON\n"; @@ -14198,7 +16191,7 @@ if ($ADD==42111) 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 - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    GRUPPO ENTRY ESTENSIONE NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
    Extension group id and extension must be at least 2 characters in length\n"; } else @@ -14206,7 +16199,7 @@ if ($ADD==42111) $stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';"; $rslt=mysql_query($stmt, $link); - echo "
    EXTENSION GROUP ENTRY MODIFIED\n"; + echo "
    GRUPPO ENTRY proroga modificata\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -14243,126 +16236,152 @@ if ($ADD==411111) } else { - $p=0; - $GROUP_shifts=' '; - $group_shifts_ct = count($group_shifts); - while ($p <= $group_shifts_ct) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); - $GROUP_shifts .= "$group_shifts[$p] "; - $p++; + echo "Non sei autorizzato a modificare il tuo gruppo utente\n"; + exit; } - $p=0; - $VGROUP_vgroups=' '; - $vgroup_vgroups_ct = count($agent_status_viewable_groups); - while ($p <= $vgroup_vgroups_ct) + else { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); - $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; - $p++; - } - $k=0; - $multi_count = count($allowed_reports); - $multi_array = $allowed_reports; - while ($k < $multi_count) - { - $new_field_value .= "$multi_array[$k],"; - $k++; - } - $allowed_reports = preg_replace("/,$/","",$new_field_value); + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + $p=0; + $Vadmin_viewable_groups=' '; + $admin_viewable_groups_ct = count($admin_viewable_groups); + while ($p <= $admin_viewable_groups_ct) + { + $admin_viewable_groups[$p] = ereg_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] = ereg_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); - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); - echo "
    GRUPPO UTENTI MODIFICATO\n"; + echo "
    GRUPPO UTENTI MODIFICATO\n"; - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY Utente Group', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY Utente Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - ############################################################### - ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ss_conf_ct = mysql_num_rows($rslt); - if ($ss_conf_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_vtiger_integration = $row[0]; - $vtiger_server_ip = $row[1]; - $vtiger_dbname = $row[2]; - $vtiger_login = $row[3]; - $vtiger_pass = $row[4]; - $vtiger_url = $row[5]; - } - ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### - ############################################################# - - if ($enable_vtiger_integration > 0) - { - ### connect to your vtiger database - $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); - if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} - echo 'Connected successfully'; - mysql_select_db("$vtiger_dbname", $linkV); - - ###################################### - ##### BEGIN Add/Update group info in Vtiger - $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; - $rslt=mysql_query($stmt, $linkV); + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} - if (!$rslt) {die('Could not execute: ' . mysql_error());} - $row=mysql_fetch_row($rslt); - $group_found_count = $row[0]; - - ### group exists in vtiger, update it - if ($group_found_count > 0) + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) { - $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_query($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysql_error());} $row=mysql_fetch_row($rslt); - $groupid = $row[0]; + $group_found_count = $row[0]; - $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### } - - ### user doesn't exist in vtiger, insert it - else - { - #### BEGIN CREATE NEW GROUP RECORD IN VTIGER - # Get next available id from vtiger_users_seq to use as groupid - $stmt="SELECT id from vtiger_users_seq;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - $row=mysql_fetch_row($rslt); - $groupid = ($row[0] + 1); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - # Increase next available groupid with 1 so next record gets proper id - $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; - if ($DB) {echo "|$stmtA|\n";} - $rslt=mysql_query($stmtA, $linkV); - if (!$rslt) {die('Could not execute: ' . mysql_error());} - - #### END CREATE NEW GROUP RECORD IN VTIGER - } - ##### END Add/Update group info in Vtiger - ###################################### } } } @@ -14394,7 +16413,7 @@ if ($ADD==4111111) } else { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); echo "
    SCRIPT MODIFICATO\n"; @@ -14436,7 +16455,7 @@ if ($ADD==41111111) } else { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); echo "
    FILTRO MODIFICATO\n"; @@ -14492,7 +16511,7 @@ if ($ADD==411111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop', default_afterhours_filename_override='$default_afterhours_filename_override', sunday_afterhours_filename_override='$sunday_afterhours_filename_override', monday_afterhours_filename_override='$monday_afterhours_filename_override', tuesday_afterhours_filename_override='$tuesday_afterhours_filename_override', wednesday_afterhours_filename_override='$wednesday_afterhours_filename_override', thursday_afterhours_filename_override='$thursday_afterhours_filename_override', friday_afterhours_filename_override='$friday_afterhours_filename_override', saturday_afterhours_filename_override='$saturday_afterhours_filename_override' where call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    TIEMPO DE LA LLAMADA MODIFICADO\n"; @@ -14548,7 +16567,7 @@ if ($ADD==4111111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $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_query($stmt, $link); echo "
    TIEMPO DE LA LLAMADA DEL ESTADO MODIFICADO\n"; @@ -14577,7 +16596,7 @@ if ($ADD==4111111111) if ($ADD==431111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; @@ -14599,7 +16618,7 @@ if ($ADD==431111111) $p++; } $shift_start_time = preg_replace('/\D/', '', $shift_start_time); - $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $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_query($stmt, $link); echo "
    SHIFT MODIFICATI\n"; @@ -14628,14 +16647,14 @@ if ($ADD==431111111) if ($ADD==41111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
    TELEFONO NON MODIFICATO - Esiste gia` un Telefono nel sistema con questo interno\/server\n";} else { @@ -14645,7 +16664,7 @@ if ($ADD==41111111111) { echo "
    TELEFONO MODIFICATO: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_rinfrescare='$enable_fast_rinfrescare', fast_rinfrescare_rate='$fast_rinfrescare_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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -14676,7 +16695,7 @@ if ($ADD==41111111111) if ($ADD==42111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -14689,7 +16708,7 @@ if ($ADD==42111111111) { echo "
    TELEFONO ALIAS MODIFICATI: $alias_id\n"; - $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id' and user_group='$user_group';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14716,7 +16735,7 @@ if ($ADD==42111111111) if ($ADD==43111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { echo ""; @@ -14729,7 +16748,7 @@ if ($ADD==43111111111) { echo "
    GRUPPO ALIAS MODIFICATI: $alias_id\n"; - $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -14763,14 +16782,14 @@ if ($ADD==411111111111) $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + 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_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
    SERVIDOR NO MODIFICADO - hay ya un servidor en el sistema con este server_ip\n";} else { @@ -14778,7 +16797,7 @@ if ($ADD==411111111111) {echo "
    SERVIDOR NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -14881,7 +16900,7 @@ if ($ADD==431111111111) $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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_query($stmtA, $link); echo "
    CONF TEMPLATE MODIFIED: $template_id\n"; @@ -14910,7 +16929,7 @@ if ($ADD==431111111111) if ($ADD==441111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_carriers==1) ) { echo ""; @@ -14918,7 +16937,7 @@ if ($ADD==441111111111) {echo "
    VETTORE NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -14950,7 +16969,7 @@ if ($ADD==441111111111) if ($ADD==451111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_tts==1) ) { echo ""; @@ -14958,7 +16977,7 @@ if ($ADD==451111111111) {echo "
    TTS iscrizione non MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $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_query($stmt, $link); echo "
    TTS voce modificata: $tts_id\n"; @@ -14987,7 +17006,7 @@ if ($ADD==451111111111) if ($ADD==461111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_moh==1) ) { echo ""; @@ -15020,7 +17039,7 @@ if ($ADD==461111111111) {echo "
    Music On Hold iscrizione non MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $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_query($stmt, $link); $stmtLIST = $stmt; @@ -15088,7 +17107,7 @@ if ($ADD==461111111111) if ($ADD==471111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_voicemail==1) ) { echo ""; @@ -15096,7 +17115,7 @@ if ($ADD==471111111111) {echo "
    VOICEMAIL BOX NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $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' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -15127,6 +17146,87 @@ if ($ADD==471111111111) } +###################### +# 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 "
    LABEL SCREEN NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\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_query($stmt, $link); + + echo "
    LABEL SCREEN MODIFICATO: $label_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 "
    CONTATTO NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\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_query($stmt, $linkALT); + + echo "
    CONTACT MODIFIED: $contact_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN Modifica contatto', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=391111111111; # go to contact entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -15140,7 +17240,7 @@ if ($ADD==4111111111111) $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    CONFERENCIA - hay ya una conferencia en el sistema con esta extension - servidor NO MODIFICADO\n";} else { @@ -15177,7 +17277,7 @@ if ($ADD==41111111111111) $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
    VICIDIAL CONFERENCIA - hay ya una conferencia en el sistema con esta extension - servidor NO MODIFICADO\n";} else { @@ -15224,11 +17324,27 @@ if ($ADD==411111111111111) } $reports_use_slave_db = preg_replace("/,$/","",$new_field_value); - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $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='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_rinfrescare='$admin_modify_rinfrescare',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';"; $rslt=mysql_query($stmt, $link); + if ($reload_dialplan_on_servers > 0) + { + $stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';"; + $rslt=mysql_query($stmtB, $link); + } + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmtB|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; @@ -15250,7 +17366,7 @@ if ($ADD==411111111111111) if ($ADD==421111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -15293,7 +17409,7 @@ if ($ADD==421111111111111) { echo "
    ESITO DI DEFAULT MODIFICATO: $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' where status='$status';"; + $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_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15321,7 +17437,7 @@ if ($ADD==421111111111111) if ($ADD==431111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { echo ""; @@ -15544,7 +17660,7 @@ if ($ADD==53) else { echo "
    CONFIRMACIo`N CLARA DE VDAC: $campaign_id\n"; - echo "

    Chasque aquí para suprimir el más viejo VIVEN expediente en VDACpara $campaign_id


    \n"; + echo "

    Chasque aquí para suprimir el más viejo VIVEN expediente en VDACpara $campaign_id


    \n"; } # go to campaign modification below @@ -15652,13 +17768,13 @@ if ($ADD==5711) if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) ) { - echo "
    FILTER PHONE GROUP NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    TELEFONO GRUPPO FILTRO non cancellato - Per favore torna indietro e ricontrolla i dati inseriti\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 "

    Clicca qui per cancellareFILTER PHONE GROUP $filter_phone_group_id


    \n"; + echo "
    FILTRO TELEFONO GROUP CONFERMA CANCELLAZIONE: $filter_phone_group_id\n"; + echo "

    Clicca qui per cancellare GRUPPO FILTRO TELEFONO $filter_phone_group_id


    \n"; } $ADD='3711'; # go to filter phone group modification below @@ -15696,13 +17812,13 @@ if ($ADD==52111) if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    GRUPPO ENTRY ESTENSIONE non cancellato - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
    extension_id be at least 1 characters in length\n"; } else { - echo "
    EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id\n"; - echo "

    Clicca qui per cancellareextension group entry $extension_id


    \n"; + echo "
    EXTENSION GROUP ENTRY conferma dell'eliminazione: $extension_id\n"; + echo "

    Clicca qui per cancellare gruppo voce dell'estensione $extension_id


    \n"; } $ADD='32111'; # go to extension group modification below @@ -16040,6 +18156,50 @@ if ($ADD==571111111111) } +###################### +# ADD=581111111111 confirmation before deletion of screen label record +###################### + +if ($ADD==581111111111) + { + echo ""; + + if (strlen($label_id) < 2) + { + echo "
    LABEL SCREEN non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Label ID be at least 2 characters in length\n"; + } + else + { + echo "
    SCREEN LABEL conferma dell'eliminazione: $label_id - $label_name\n"; + echo "

    Clicca qui per cancellare l'etichetta sullo schermo $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 "
    CONTATTO non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Contact ID must be at least 1 character in length\n"; + } + else + { + echo "
    CONTATTO CONFERMA CANCELLAZIONE: $contact_id - $first_name - $last_name\n"; + echo "

    Clicca qui per cancellarecontact $contact_id - $first_name - $last_name


    \n"; + } + $ADD='391111111111'; # go to contact entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -16109,27 +18269,34 @@ if ($ADD==6) } else { - $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmtA, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) + { + echo "Non sei autorizzato a modificare il proprio utente\n"; + exit; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; - $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    CANCELADURA DEL USUARIO TERMINADA: $user\n"; - echo "

    \n"; + echo "
    CANCELADURA DEL USUARIO TERMINADA: $user\n"; + echo "

    \n"; + } } - $ADD='0'; # go to user list } @@ -16148,50 +18315,53 @@ if ($ADD==61) } else { - $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); - $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16229,7 +18399,7 @@ if ($ADD==62) { $now_date_epoch = date('U'); $inactive_epoch = ($now_date_epoch - 60); - $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $vla_ct = mysql_num_rows($rslt); @@ -16240,6 +18410,7 @@ if ($ADD==62) $VLA_user[$k] = $row[0]; $VLA_campaign_id[$k] = $row[1]; $VLA_update_time[$k] = $row[2]; + $VLA_extension[$k] = $row[3]; $k++; } @@ -16279,7 +18450,7 @@ if ($ADD==62) if ($DB) {echo "\n
    VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -16329,7 +18500,7 @@ if ($ADD==62) if (strlen($VAL_user_group) < 1) { - $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $val_ct = mysql_num_rows($rslt); @@ -16340,27 +18511,30 @@ if ($ADD==62) } } - $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]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + $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_query($stmt, $link); ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; - $queuemetrics_loginout = $row[6]; + $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 ##### ########################################### @@ -16375,26 +18549,101 @@ if ($ADD==62) $agents='@agents'; $agent_logged_in=''; - $time_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') order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; - $phone_logged_in = $row[2]; + $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;} - $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_query($stmtB, $linkB); + if ($queuemetrics_loginout == 'NONE') + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
    $stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') ) + { + $stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
    $stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + $RAWtime_logged_in = $row[1]; + $phone_logged_in = $row[2]; + } + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + } + $stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id[$k]; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "
    $stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "\n"; @@ -16442,7 +18691,7 @@ if ($ADD==63) } else { - $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16491,7 +18740,7 @@ if ($ADD==65) { echo "
    EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $campaign_id - $status - $attempt_delay\n"; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16522,7 +18771,7 @@ 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 %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -16538,12 +18787,12 @@ if ($ADD==66) { echo "
    ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $campaign_id - $status\n"; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16585,7 +18834,7 @@ if ($ADD==67) { 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';"; + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16616,7 +18865,7 @@ if ($ADD==68) if ($LOGmodify_campaigns==1) { echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] < 1) @@ -16632,12 +18881,12 @@ if ($ADD==68) { echo "
    ESITO CAMPAGNA RIMOSSO: $campaign_id - $status\n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_statuses = eregi_replace(" $status "," ",$row[0]); - $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16672,17 +18921,17 @@ if ($ADD==601) if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) ) { - echo "
    CAMPAIGN PRESET NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    PRESET CAMPAGNA non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti\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';"; + $stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16719,11 +18968,11 @@ if ($ADD==611) } else { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); echo "
    QUITAR LOS PLOMOS DE LA LISTA DE LA TABLA DE VICIDIAL_LIST\n"; @@ -16734,7 +18983,7 @@ if ($ADD==611) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTE', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -16760,7 +19009,7 @@ if ($ADD==6111) } else { - $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; @@ -16772,6 +19021,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -16803,7 +19055,7 @@ if ($ADD==6311) } else { - $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16836,7 +19088,7 @@ if ($ADD==6511) } else { - $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; @@ -16867,12 +19119,12 @@ if ($ADD==6711) if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { - echo "
    FILTER PHONE GROUP NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    TELEFONO GRUPPO FILTRO non cancellato - Per favore torna indietro e ricontrolla i dati inseriti\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' limit 1;"; + $stmt="DELETE from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; @@ -16886,7 +19138,7 @@ if ($ADD==6711) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "
    FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id\n"; + echo "
    CANCELLAZIONE DEL GRUPPO FILTRO TELEFONO COMPLETATO: $filter_phone_group_id\n"; echo "

    \n"; } @@ -16936,7 +19188,7 @@ if ($ADD==62111) if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
    EXTENSION GROUP ENTRY NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    GRUPPO ENTRY ESTENSIONE non cancellato - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
    extension_id be at least 1 characters in length\n"; } else @@ -16952,7 +19204,7 @@ if ($ADD==62111) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "
    EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id\n"; + echo "
    GRUPPO DI CANCELLAZIONE ESTENSIONE di iscrizione compilata: $extension_id\n"; echo "

    \n"; } @@ -16976,21 +19228,28 @@ if ($ADD==611111) } else { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) + { + echo "Non sei autorizzato a modificare il tuo gruppo utente\n"; + exit; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmt, $link); - ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; - $SQL_log = ereg_replace(';','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE Utente Group', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE Utente Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); - echo "
    CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; - echo "

    \n"; + echo "
    CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; + echo "

    \n"; + } } - $ADD='100000'; # go to user group list } @@ -17009,7 +19268,7 @@ if ($ADD==6111111) } else { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17043,7 +19302,7 @@ if ($ADD==61111111) } else { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17077,7 +19336,7 @@ if ($ADD==611111111) } else { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17111,7 +19370,7 @@ if ($ADD==6111111111) } else { - $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmtA, $link); $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; @@ -17169,7 +19428,7 @@ if ($ADD==631111111) } else { - $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17204,7 +19463,7 @@ if ($ADD==61111111111) } else { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -17240,7 +19499,7 @@ if ($ADD==62111111111) } else { - $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17273,7 +19532,7 @@ if ($ADD==63111111111) } else { - $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17307,7 +19566,7 @@ if ($ADD==611111111111) } else { - $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17390,7 +19649,7 @@ if ($ADD==631111111111) $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_query($stmt, $link); - $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17428,7 +19687,7 @@ if ($ADD==641111111111) $row=mysql_fetch_row($rslt); $CARRIERserver_ip = $row[0]; - $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; @@ -17464,7 +19723,7 @@ if ($ADD==651111111111) } else { - $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17500,7 +19759,7 @@ if ($ADD==661111111111) $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; $rslt=mysql_query($stmt, $link); - $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmtA, $link); ### LOG INSERTION Admin Log Table ### @@ -17533,7 +19792,7 @@ if ($ADD==671111111111) } else { - $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -17559,6 +19818,79 @@ if ($ADD==671111111111) } +###################### +# ADD=681111111111 delete screen labels record +###################### + +if ($ADD==681111111111) + { + echo ""; + + if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
    LABEL SCREEN non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti\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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CANCELLAZIONE LABEL SCREEN COMPLETATO: $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 "
    CONTATTO non vengono eliminati - Per favore torna indietro e ricontrolla i dati inseriti\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_query($stmt, $linkALT); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN Elimina contatto', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    CONTACT DELETION COMPLETED: $contact_id\n"; + echo "

    \n"; + } + $ADD='190000000000'; # go to contacts entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -17647,10 +19979,16 @@ if ($ADD==3) { if ($LOGmodify_users==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3&user=$user"; + $modify_footer_rinfrescare=1; + } + echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20547,7 +23672,7 @@ if ($ADD==32) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20609,7 +23734,7 @@ if ($ADD==33) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20671,7 +23796,7 @@ if ($ADD==35) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20733,7 +23858,7 @@ if ($ADD==36) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20795,7 +23920,7 @@ if ($ADD==37) echo ""; echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -20857,7 +23982,7 @@ if ($ADD==39) echo ""; 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 from vicidial_users where user='$user';"; + $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 from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -17734,8 +20072,23 @@ if ($ADD==3) $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]; - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
    Non hai l`autorizzazione per modificare questo utente: $user\n"; } @@ -17760,13 +20113,16 @@ if ($ADD==3) 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) { echo "\n"; @@ -17836,19 +20192,22 @@ if ($ADD==3) echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -17870,9 +20229,11 @@ if ($ADD==3) } if ($LOGuser_level > 8) { - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -17898,7 +20259,7 @@ if ($ADD==3) if ($SScustom_fields_enabled > 0) { - echo "\n"; + echo "\n"; } echo "\n"; @@ -17926,7 +20287,19 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -17934,6 +20307,15 @@ if ($ADD==3) echo "\n"; echo "\n"; + + if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) + { + echo "\n"; + } + else + { + echo "\n"; + } } echo "\n"; echo "
    Numero Utente: $user$NWB#vicidial_users-user$NWE
    Password: $NWB#vicidial_users-pass$NWE     Strength:
    Password: $NWB#vicidial_users-pass$NWE     Forza:
    Force Change Password: $NWB#vicidial_users-force_change_password$NWE
    Forza Cambia password: $NWB#vicidial_users-force_change_password$NWE
    Nome Completo: $NWB#vicidial_users-full_name$NWE
    Livello Utente: $NWB#vicidial_users-user_level$NWE
    Gruppo Utente:
    OPZIONI INTERFACCIA OPERATORE:
    El Agente Elige Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Agent Choose Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agente Scegli Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agente Scegli Territori: $NWB#vicidial_users-agent_choose_territories$NWE
    Agente Alter clienti Sovrascrive Telefono:$NWB#vicidial_users-alter_custphone_override$NWE
    Agente Maiusc esecuzione Sovrascrive: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Agent Call Log View Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Call Agent View Log Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Agente di piombo Override Search: $NWB#vicidial_users-agent_lead_search_override$NWE
    Alert Attivato: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    Consentire Alerts: $NWB#vicidial_users-allow_alerts$NWE
    Ricerca Contatto Preset: $NWB#vicidial_users-preset_contact_search$NWE
    Classifiche Campagna:$NWB#vicidial_users-campaign_ranks$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKcampaigns_list"; echo "
    \n"; echo "
    Gruppi Inbound: $NWB#vicidial_users-closer_campaigns$NWE
    \n"; - echo "\n"; + echo "
    \n"; echo "$RANKgroups_list"; echo "
    \n"; echo "
    ADMIN REPORT OPTIONS:
    OPZIONI DI RELAZIONE ADMIN:
    Realtime Block Utente Info: $NWB#vicidial_users-realtime_block_user_info$NWE
    Realtime Block Info Utente: $NWB#vicidial_users-realtime_block_user_info$NWE
    Admin nascondere i dati di piombo: $NWB#vicidial_users-admin_hide_lead_data$NWE
    Admin nascondere i dati del telefono: $NWB#vicidial_users-admin_hide_phone_data$NWE
    OPZIONI INTERFACCIA AMMINISTRATORE:
    Custom Fields Modify: $NWB#vicidial_users-custom_fields_modify$NWE
    Modifica campi personalizzati: $NWB#vicidial_users-custom_fields_modify$NWE
    Modifica Campagne: $NWB#vicidial_users-modify_sections$NWE
    Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
    EliminareOrari Chiamata: $NWB#vicidial_users-delete_call_times$NWE
    Modifica Server: $NWB#vicidial_users-modify_sections$NWE
    CallCard Access: $NWB#vicidial_users-modify_sections$NWE
    Modificare Maiuscs: $NWB#vicidial_users-modify_sections$NWE
    ModificareCellulari: $NWB#vicidial_users-modify_sections$NWE
    ModificareVettori: $NWB#vicidial_users-modify_sections$NWE
    ModificareLabels: $NWB#vicidial_users-modify_sections$NWE
    ModificareEsiti: $NWB#vicidial_users-modify_sections$NWE
    ModificareCasella Vocale: $NWB#vicidial_users-modify_sections$NWE
    ModificareAudio Store: $NWB#vicidial_users-modify_sections$NWE
    ModificareMusic On Hold: $NWB#vicidial_users-modify_sections$NWE
    ModificareTTS: $NWB#vicidial_users-modify_sections$NWE
    ModificareContacts: $NWB#vicidial_users-modify_sections$NWE
    CallCard accesso: $NWB#vicidial_users-modify_sections$NWE
    Agente API Accesso:$NWB#vicidial_users-vdc_agent_api_access$NWE
    Aggiungi orologio Entra record: $NWB#vicidial_users-add_timeclock_log$NWE
    Elimina orologio Entra record: $NWB#vicidial_users-delete_timeclock_log$NWE
    Shift Manager esecuzione Sovrascrive: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    Modificare stesso livello utente: $NWB#vicidial_users-modify_same_user_level$NWE
    \n"; @@ -17949,7 +20331,7 @@ if ($ADD==3) echo "

    Clicca qui per i richiami dell`utente\n"; if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo record
    \n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo record\n"; } } } @@ -17974,6 +20356,11 @@ if ($ADD==31) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_rinfrescare=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -17984,6 +20371,16 @@ if ($ADD==31) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); @@ -17991,16 +20388,19 @@ if ($ADD==31) $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 from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; + $campaign_active = $row[2]; $dial_status_a = $row[3]; $dial_status_b = $row[4]; $dial_status_c = $row[5]; $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; + $park_ext = $row[9]; + $park_file_name = $row[10]; $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; @@ -18050,7 +20450,7 @@ if ($ADD==31) $agent_pause_codes_active = $row[56]; $campaign_description = $row[57]; $campaign_changedate = $row[58]; - $campaign_stats_refresh = $row[59]; + $campaign_stats_rinfrescare = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $disable_alter_custdata = $row[62]; @@ -18153,14 +20553,61 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + 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_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -18171,7 +20618,7 @@ if ($ADD==31) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -18199,7 +20646,7 @@ if ($ADD==31) $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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -18243,7 +20690,7 @@ if ($ADD==31) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -18274,7 +20721,7 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); @@ -18298,9 +20745,11 @@ if ($ADD==31) 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 order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -18323,6 +20772,31 @@ if ($ADD==31) else {$Xgroups_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_query($stmt, $link); + $labels_to_print = mysql_num_rows($rslt); + $labels_menu=''; + $o=0; + while ($labels_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $labels_menu .= "\n"; + $o++; + } + + $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_servers_count=$row[0]; + + $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phones_alias_count=$row[0]; + if ($SUB<1) {$camp_detail_color=$subcamp_color;} else {$camp_detail_color=$campaigns_color;} @@ -18344,9 +20818,11 @@ if ($ADD==31) 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 ""; echo ""; echo ""; @@ -18361,7 +20837,11 @@ if ($ADD==31) echo ""; if ($enable_xfer_presets == 'ENABLED') { - echo ""; + echo ""; + } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; } if ($SSqc_features_active > 0) { @@ -18371,7 +20851,7 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "
    $row[0]: Basic   Basic Dettagliata EsitiHot-KeyCodici PausaPresets Presets/font>AC-CID Real-Time Real-Time
    \n"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } - echo "\n"; - echo "
    \n"; @@ -18384,20 +20864,31 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; 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"; @@ -18426,137 +20917,198 @@ if ($ADD==31) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$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"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -18617,7 +21169,11 @@ if ($ADD==31) } echo "(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       FORZA LIVELLO ANCHE CON MODALITA` ADAPT\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + 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"; @@ -18770,11 +21328,17 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + 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) { @@ -18844,43 +21410,65 @@ if ($ADD==31) } 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"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; @@ -18899,6 +21487,11 @@ if ($ADD==31) } 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"; @@ -18912,13 +21505,21 @@ if ($ADD==31) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -18930,18 +21531,18 @@ if ($ADD==31) echo "\n"; - 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' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -18993,27 +21594,43 @@ if ($ADD==31) 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"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; if ($campaign_allow_inbound == 'Y') { @@ -19035,6 +21652,8 @@ if ($ADD==31) echo "\n"; } + echo "\n"; + echo "\n"; echo "
    ID Campagna: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID Campagna: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
    Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE
    Campagna Cambia Data: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Campagna Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
    \n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Admin Gruppo Utente: $NWB#vicidial_campaigns-user_group$NWE
    Parco della Musica-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Web Form Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Web Form Two: $NWB#vicidial_campaigns-web_form_address$NWE
    Web Form Target: $NWB#vicidial_campaigns-web_form_target$NWE
    Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Aggiungi Un Esito Chiamata:
    Aggiungere un titolo Comp. per chiamare:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
    Elenco Mix:
    Ordine Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Order List Randomize: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_randomize$NWE"; + } + echo "
    Elenco Ordine Secondario: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_order_secondary$NWE"; + } + echo "
    Elenco Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Filtro Contatti: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Drop Lockout Time: $NWB#vicidial_campaigns-drop_lockout_time$NWE
    Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
    Conteggio chiamate Limit: $NWB#vicidial_campaigns-call_count_limit$NWE
    Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Conteggio chiamate di destinazione: $NWB#vicidial_campaigns-call_count_target$NWE
    Hopper Livello Minimo: $NWB#vicidial_campaigns-hopper_level$NWE
    Hopper Automatic Level: $NWB#vicidial_campaigns-use_auto_hopper$NWE
    Hopper Moltiplicatore automatico: $NWB#vicidial_campaigns-hopper_level$NWE
    Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE
    Hopper VLC Dup Verifica: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE
    Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    Metodo Chiamata: $NWB#vicidial_campaigns-dial_method$NWE
    Conta Solo Disponibili: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Auto Dial Threshold Level: $NWB#vicidial_campaigns-dial_level_threshold$NWE       agents:
    Conta Solo Disponibili: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
    Disponibile Soglia Tally Solo: $NWB#vicidial_campaigns-available_only_tally_threshold$NWE       agents:
    Limita Percentuale Abbattuti: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
    Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Comporre Differenza Metodo Target Level: $NWB#vicidial_campaigns-dl_diff_target_method$NWE
    Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
    Coda di priorità:$NWB#vicidial_campaigns-drop_rate_group$NWE
    Inbound Queue No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    Coda in ingresso No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    El Marcar Auto Del Alt-Nu`mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    El Marcar Auto Del Alt-Nu`mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK
    Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE
    Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE
    Orario Chiamate:
    Prefisso Chiamata: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Manual Prefisso Chiamata: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Selezione prefisso manuale: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Ometti Prefisso Telefono: $NWB#vicidial_campaigns-omit_phone_code$NWE
    CallerID della Campagna: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Personalizzato CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Routing Estensione:$NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Interno Registrazioni Per Questa Campagna: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
    Ritardo Registrazione: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
    Chiama Note per chiamata: $NWB#vicidial_campaigns-per_call_notes$NWE
    Agente di piombo Search: $NWB#vicidial_campaigns-agent_lead_search$NWE
    Agente di piombo Metodo di ricerca: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
    Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -18788,8 +21352,8 @@ if ($ADD==31) {$cfwHTML = '';} echo "
    Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
    Messaggio Segreteria Telefonica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + echo "
    Messaggio Segreteria Telefonica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) @@ -18818,25 +21382,27 @@ if ($ADD==31) echo "
    Transfiera -Conf El Número 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Enable Transfer Presets: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Abilita Presets di trasferimento: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Hide Transfer Number to Dial: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Nascondi numero di trasferimento da chiamare: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Trasferimento rapido Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Custom 3-Way Button Transfer: $NWB#vicidial_campaigns-custom_3way_button_transfer$NWE
    Trasferimento PrePopulate Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Park Call IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Parcheggia chiamata IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Park Call IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Parcheggia chiamata IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Timer azione: $NWB#vicidial_campaigns-timer_action$NWE
    Timer azione: $NWB#vicidial_campaigns-timer_action$NWE
    Timer azione Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Timer azione Secondi: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer azione Destination: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Timer Azione Destination: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Scheduled Callbacks Alert: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Richiamate pianificate Alert: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Scheduled Callbacks Count: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Richiamate pianificate Conte: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Programmato richiamate Giorni Limit: $NWB#vicidial_campaigns-callback_days_limit$NWE
    Programmato richiamate Ore Block: $NWB#vicidial_campaigns-callback_hours_block$NWE
    Richiamate pianificate blocco Calltime: $NWB#vicidial_campaigns-callback_list_calltime$NWE
    Il mio richiamate Casella di default: $NWB#vicidial_campaigns-my_callback_option$NWE
    Secondi Abbattimento Telefonata: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Goccia dazione:$NWB#vicidial_campaigns-drop_action$NWE
    Goccia dazione:$NWB#vicidial_campaigns-drop_action$NWE
    Interno Messaggio Telefonata Abbattuta: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
    Casella Vocale: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Safe Harbor Audio: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
    Safe Harbor Menu chiamata: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
    Casella Vocale: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
    Trasferimento Drop Group:$NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; - $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
    Disable Screen Dispo: $NWB#vicidial_campaigns-disable_dispo_screen$NWE
    Disabilita Stato Dispo: $NWB#vicidial_campaigns-disable_dispo_status$NWE
    Secondi Riposo Operatore: $NWB#vicidial_campaigns-wrapup_seconds$NWE
    Messaggio Riposo Operatore: $NWB#vicidial_campaigns-wrapup_message$NWE
    Controlla In Lista Contatti Da NON CHIAMARE: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Controlla In Lista Contatti Da NON CHIAMARE: $NWB#vicidial_campaigns-use_internal_dnc$NWE
    Usa campagna DNC Elenco: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    Usa campagna DNC Elenco: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
    AgentCodici PausaAttivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
    Aggiornamento Statistiche Campagna: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Auto Pause Pre-Call Work: $NWB#vicidial_campaigns-auto_pause_precall$NWE
    Real-Time Agent Time Stats: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Auto Resume Pre-Call Work: $NWB#vicidial_campaigns-auto_resume_precall$NWE
    Auto Pause Pre-Call Codice: $NWB#vicidial_campaigns-auto_pause_precall_code$NWE
    Aggiornamento Statistiche Campagna: $NWB#vicidial_campaigns-campaign_stats_rinfrescare$NWE
    Real-Time Agente Statistiche temporali: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Disabilita modifica dati clienti: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Disattiva Alter Clienti Telefono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agent Visualizzare Dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
    Agente schermo etichette: $NWB#vicidial_campaigns-screen_labels$NWE
    Visualizzazione dello stato Fields: $NWB#vicidial_campaigns-status_display_fields$NWE
    Agente Mostra Coda Count:$NWB#vicidial_campaigns-display_queue_count$NWE
    Agente di pausa dopo ogni chiamata: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Manual Dial Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    Selezione manuale Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    ID Lista Chiamate Manuali:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Manuale Dial Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manuale Dial Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manual Preview Dial: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Anteprima composizione manuale: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Tempo di chiamata Controllo manuale: $NWB#vicidial_campaigns-manual_dial_call_time_check$NWE
    Selezione manuale API: $NWB#vicidial_campaigns-api_manual_dial$NWE
    Selezione manuale CID: $NWB#vicidial_campaigns-manual_dial_cid$NWE
    Phone messaggio Ora Alert Difference: $NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE
    Appunti di agente Schermata Copia: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    3-Way Call Prefisso Chiamata: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Customer 3-Way Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Clienti 3-Way Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Customer 3-Way Hangup Seconds: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Cliente 3-Way Hangup Secondi: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Customer 3-Way Hangup Action: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Clienti 3-Way Hangup Action: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Gruppo Alias ammessi: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    QM Phone Ambiente: $NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE
    PLLB Raggruppamento: $NWB#vicidial_campaigns-pllb_grouping$NWE
    PLLB Raggruppamento Limit: $NWB#vicidial_campaigns-pllb_grouping_limit$NWE
    CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Popup Indirizzo: $NWB#vicidial_campaigns-crm_login_address$NWE
    CRM Popup Indirizzo: $NWB#vicidial_campaigns-crm_login_address$NWE
    Start Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Start Call URL: $NWB#vicidial_campaigns-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Extension Append CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Nessun agente URL chiamata: $NWB#vicidial_campaigns-na_call_url$NWE
    Blind Monitor Warning: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Extension Aggiunge CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Blind Monitor Notice: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Monitor Warning cieca: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Blind Monitor Filename: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    Cieco Monitor Notice: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Cieco Monitor Filename: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    \n"; @@ -19054,6 +21673,7 @@ if ($ADD==31) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -19061,6 +21681,8 @@ if ($ADD==31) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -19069,14 +21691,14 @@ if ($ADD==31) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); echo "
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -19121,8 +21743,6 @@ if ($ADD==31) echo "\n"; echo "
    ID LISTANOME LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVO

    \n"; - echo "
    \n"; - $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); @@ -19131,13 +21751,195 @@ if ($ADD==31) else {$fSQL = '';} - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

    \n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "
    Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $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_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + # end grab status names + + echo "
    STATUS all'interno delle liste ATTIVI PER QUESTA CAMPAGNA:\n"; + echo " - NASCONDI
    "; + + 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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ESITONOME ESITOCHIAMATINON CHIAMATIDIALABLEPENETRATION
    \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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $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 "
    ESITONOME ESITOCHIAMATINON CHIAMATI
    $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]."
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]    
    TOTALE$lead_list[count]$dialable_total $total_complete_pct%  
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "MOSTRA STATUS PIOMBO IN QUESTA CAMPAGNA

    "; + } + + + + echo "
    \n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + $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 " - NASCONDI

    "; } else @@ -19146,7 +21948,7 @@ if ($ADD==31) echo " - MOSTRA

    "; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); @@ -19157,9 +21959,36 @@ if ($ADD==31) echo "Clicca qui per vedere il report VDAD per questa campagna

    \n"; } echo "Clicca qui per visualizzare tutti i richiami in attesa per questa campagna

    \n"; + + if ($SSoutbound_autodial_active > 0) + { + if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Prova chiamate in uscita: "; + echo "code:   "; + echo "number:   "; + echo "   $NWB#settings-test_campaign_calls$NWE


    \n"; + } + else + { + echo "Test chiamando disattivato

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

    Clicca qui per visualizzare Admin chages a questa campagna
    \n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questa campagna\n"; } echo "
    \n"; } @@ -19170,7 +21999,7 @@ if ($ADD==31) { ##### get status category listings for dynamic pulldown - $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc;"; $rslt=mysql_query($stmt, $link); $cats_to_print = mysql_num_rows($rslt); $cats_list=""; @@ -19187,17 +22016,45 @@ if ($ADD==31) echo "
    \n"; echo "
    ESITI PERSONALIZZATI PER QUESTA CAMPAGNA:   $NWB#vicidial_campaign_statuses$NWE
    \n"; - echo "\n"; - echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + echo "
    ESITODESCRIZIONESELEZIONABILERISPOSTA UMANACATEGORIAMODIFY-DELETE
    \n"; + echo "\n"; + 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_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $AScategory = $rowx[5]; + $AScategory = $rowx[4]; $o++; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -19212,42 +22069,52 @@ if ($ADD==31) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } echo "
    S
    T
    A
    T
    U
    S
    DESCRIZIONECATEGORIA
    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
    MODIFICA/CANCELLA
    \n"; echo "\n"; - echo "         \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "         \n"; echo "   \n"; - echo "CANCELLA\n"; - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "CANCELLA\n"; + } + else + { + echo "CANCELLA\n"; + } echo "
    \n"; + echo "
    AGGIUNGI NUOVO ESITO PERSONALIZZATO PER CAMPAGNA
    \n"; echo "\n"; echo "\n"; echo "Esito:   \n"; echo "Descrizione:   \n"; - echo "Selezionabile:  
    \n"; - echo "Risposta Umana:   \n"; + echo "Selezionabile:   \n"; + echo "Risposta Umana:  
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoria: \n"; echo "\n"; echo "\n"; - $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -19313,7 +22180,7 @@ if ($ADD==31) 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'"; + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $camp_lists=''; @@ -19326,7 +22193,7 @@ if ($ADD==31) } $camp_lists = eregi_replace(".$","",$camp_lists); - $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -19452,7 +22319,7 @@ if ($ADD==31) echo "
    HOT KEYESITODESCRIZIONECANCELLA
    \n"; echo "\n"; - $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $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_query($stmt, $link); $pause_codes_to_print = mysql_num_rows($rslt); $o=0; @@ -19492,7 +22359,7 @@ if ($ADD==31) ##### 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'"; + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $qc_lists_list=''; @@ -19517,7 +22384,7 @@ if ($ADD==31) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -19530,7 +22397,7 @@ if ($ADD==31) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -19584,7 +22451,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -19603,6 +22470,9 @@ if ($ADD==31) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
    CODICI PAUSAFATTURABILEMODIFICACANCELLA
    Indagine non interessa Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
    Indagine Opt-in File Audio: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
    Indagine non interessa File Audio: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
    Indagine Metodo: $NWB#vicidial_campaigns-survey_method$NWE
    Indagine Metodo: $NWB#vicidial_campaigns-survey_method$NWE
    Indagine n.-Azione di risposta: $NWB#vicidial_campaigns-survey_no_response_action$NWE
    Indagine Stato non è interessato: $NWB#vicidial_campaigns-survey_ni_status$NWE
    Indagine Campagna Registrazione Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
    Casella Vocale: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
    Indagine chiamate Menu: $NWB#vicidial_campaigns-survey_menu_id$NWE
    Indagine di registrazione: $NWB#vicidial_campaigns-survey_recording$NWE
    \n"; echo "

    \n"; @@ -19612,13 +22482,25 @@ if ($ADD==31) ##### CAMPAIGN PRESETS ##### if ($SUB==201) { - echo "

    PRESETS FOR THIS CAMPAGNA:   $NWB#vicidial_xfer_presets$NWE
    \n"; - echo "
    \n"; - echo "\n"; - - $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' order by preset_name"; + $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_query($stmt, $link); $presets_to_print = mysql_num_rows($rslt); + + echo "

    $presets_to_print PRESETS di questa campagna:   $NWB#vicidial_xfer_presets$NWE
    \n"; + + echo "
    ADD NEW PRESET -
    \n"; + echo "\n"; + echo "\n"; + echo "Nome Preset: \n"; + echo " Number: \n"; + echo " DTMF: \n"; + echo "   Nascondi numero:  \n"; + echo "
    \n"; + echo "

    \n"; + + echo "
    PRESET NAMENUMERODTMFNASCONDIMODIFICACANCELLA
    \n"; + echo "\n"; + $o=0; while ($presets_to_print > $o) { @@ -19630,31 +22512,108 @@ if ($ADD==31) else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } echo "
    # PRESET NAMENUMERODTMFNASCONDIMODIFICACANCELLA
    $rowx[0]\n"; + echo "
    $o $rowx[0]\n"; echo "\n"; echo "\n"; echo "  CANCELLA
    CANCELLA
    \n"; + } - echo "
    ADD NEW PRESET
    \n"; - echo "\n"; + + ##### CAMPAIGN Prefisso CID ##### + if ($SUB==202) + { + echo "

    CIDS IndicativoLocalità di questa campagna:   $NWB#vicidial_campaign_cid_areacodes$NWE
    \n"; + if ($use_custom_cid != 'Prefisso') + {echo "
    The campaign setting Personalizzato CallerID is not set to Prefisso!
    ";} + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "Preset Name: \n"; - echo "Preset Number:
    \n"; - echo "Preset DTMF: \n"; - echo "   Hide Number: \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_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 "
    #PrefissoCID NUMERODESCRIZIONEATTIVOCALLSCANCELLA
      $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   CANCELLA
    \n"; + echo "

    \n"; + + echo "
    AGGIUNGI IndicativoLocalità NEW CID
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Areacode: \n"; + echo "Outbound CID:
    \n"; + echo "Descrizione: \n"; echo "
    \n"; echo "

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

    \n"; @@ -19686,6 +22645,11 @@ if ($ADD==34) { if ($LOGmodify_campaigns==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB"; + $modify_footer_rinfrescare=1; + } if ($stage=='show_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; @@ -19696,8 +22660,18 @@ if ($ADD==34) $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); } + if ($stage=='show_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_leadscount') + { + $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $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 from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $dial_status_a = $row[3]; @@ -19722,9 +22696,10 @@ if ($ADD==34) $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_stats_rinfrescare = $row[59]; $campaign_logindate = $row[60]; $dial_statuses = $row[61]; $list_order_mix = $row[64]; @@ -19732,13 +22707,20 @@ if ($ADD==34) $campaign_allow_inbound = $row[65]; $default_xfer_group = $row[67]; $drop_lockout_time = $row[116]; + $display_leads_count = $row[130]; + $user_group = $row[131]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + 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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $statuses_list=''; @@ -19756,7 +22738,7 @@ if ($ADD==34) $o++; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -19777,7 +22759,7 @@ if ($ADD==34) $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'"; + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) @@ -19788,7 +22770,7 @@ if ($ADD==34) else { ##### get list_mix listings for dynamic pulldown - $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $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_query($stmt, $link); $mixes_to_print = mysql_num_rows($rslt); $mixes_list="\n"; @@ -19818,14 +22800,14 @@ if ($ADD==34) if ($SUB==29) {$camp_listmix_color=$subcamp_color;} else {$camp_listmix_color=$campaigns_color;} echo "\n"; - echo ""; + echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { @@ -19840,15 +22822,18 @@ if ($ADD==34) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: $campaign_id: Vista Generale Vista Dettagliata Elenco Mix Schermata Tempo Reale Schermata Tempo Reale  
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19875,133 +22860,160 @@ if ($ADD==34) } } - echo "\n"; - echo "\n"; - - echo "\n"; + { + echo "$NWB#vicidial_campaigns-lead_order$NWE"; + } + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -20101,6 +23113,7 @@ if ($ADD==34) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -20108,6 +23121,8 @@ if ($ADD==34) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -20116,99 +23131,208 @@ if ($ADD==34) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $whereLOGallowed_campaignsSQL group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); - echo "
    ID Campagna: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    ID Campagna: $campaign_id$NWB#vicidial_campaigns-campaign_id$NWE
    Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
    Descrizione Campagna: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
    Campagna Cambia Data: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
    Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Admin Gruppo Utente: $user_group $NWB#vicidial_campaigns-user_group$NWE
    Parco della Musica-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    Aggiungi Un Esito Chiamata:
    Aggiungere un titolo Comp. per chiamare:   \n"; echo "     $NWB#vicidial_campaigns-dial_status$NWE
    Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
    Elenco Mix:
    Ordine Lista: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } else - {echo "\n";} - echo "$NWB#vicidial_campaigns-list_order_mix$NWE
    Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
    Elenco Mix: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-list_order_mix$NWE"; + } + echo "
    Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
    Filtro Contatti: "; + if ($ALTmultiDISABLE > 0) + { + echo " $ALTmultiLINK"; + } + else + { + echo "$NWB#vicidial_campaigns-lead_filter_id$NWE"; + } + echo "
    Hopper Livello Minimo: $NWB#vicidial_campaigns-hopper_level$NWE
    Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
    \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; + echo "
    ID LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVODATA ULTIMA CHIAMATAMODIFICA
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
    ID LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVODATA ULTIMA CHIAMATAMODIFICA
    $row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]MODIFICA

    \n"; + echo "
    \n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

    \n"; + + + if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) ) + { + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); $o=0; - while ($lists_to_print > $o) + while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4]"; - - if (ereg('Y',$row[4])) - { - $active_lists++; - $camp_lists .= "'$row[0]',"; - echo ""; - } - else - { - $inactive_lists++; - echo ""; - echo " $row[5]MODIFICA

    \n"; - echo "
    \n"; + $stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = preg_replace("/\\\\/","",$filterSQL); - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

    \n"; - - - if ($display_dialable_count == 'Y') + $o=0; + while ($Cstatuses_to_print > $o) { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); - echo " - NASCONDI

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

    "; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; + $statuses_name_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names - echo "Questa campagna ha $hopper_leads contatti nella coda chiamate

    \n"; - echo "Clicca qui per vedere quali numeri sono nella coda chiamate in questo momento

    \n"; - echo "Clicca qui per vedere il report VDAD per questa campagna

    \n"; + echo "
    STATUS all'interno delle liste ATTIVI PER QUESTA CAMPAGNA:\n"; + echo " - NASCONDI
    "; + 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
    ESITONOME ESITOCHIAMATINON CHIAMATI
    $CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]

    \n"; + unset($lead_list); + } + else + { + echo "MOSTRA STATUS PIOMBO IN QUESTA CAMPAGNA

    "; + } + + + 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 " - NASCONDI

    "; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - MOSTRA

    "; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Questa campagna ha $hopper_leads contatti nella coda chiamate

    \n"; + echo "Clicca qui per vedere quali numeri sono nella coda chiamate in questo momento

    \n"; + echo "Clicca qui per vedere il report VDAD per questa campagna

    \n"; } echo "Clicca qui per visualizzare tutti i richiami in attesa per questa campagna

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

    Clicca qui per visualizzare Admin chages a questa campagna\n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questa campagna\n"; } echo "
    \n"; @@ -20218,24 +23342,25 @@ if ($ADD==34) ### list of agent rank or skill-level for this campaign echo "
    \n"; echo "
    CLASSIFICA OPERATORI PER QUESTA CAMPAGNA:
    \n"; - echo "\n"; - echo "\n"; + echo "
    UTENTE     CLASSIFICA     CHIAMATE OGGI
    \n"; + echo "\n"; - $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); - $o=0; - while ($users_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; + echo "\n"; } echo "
    UTENTE     CLASSIFICA     GRADE     CHIAMATE OGGI
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]
    $rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

    \n"; @@ -20272,7 +23397,7 @@ if ( ($ADD==34) or ($ADD==31) ) if ($SUB==29) { ##### get list_id listings for dynamic pulldown - $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); $mixlists_to_print = mysql_num_rows($rslt); $mixlists_list=""; @@ -20291,7 +23416,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
    ATTENZIONE, si limita a raccomandareMix Listeper utenti avanzati, Si prega di leggere il manuale ViciDial Manager
    \n"; - $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $statuses = mysql_num_rows($rslt); if ($statuses > 0) @@ -20300,7 +23425,7 @@ if ( ($ADD==34) or ($ADD==31) ) $LMdial_statuses=$rowy[0]; } - $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $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_query($stmt, $link); $listmixes = mysql_num_rows($rslt); $o=0; @@ -20523,7 +23648,7 @@ if ($ADD==32) echo "
    MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20585,7 +23710,7 @@ if ($ADD==33) echo "MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by hotkey"; + $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by hotkey;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20647,7 +23772,7 @@ if ($ADD==35) echo "MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20709,7 +23834,7 @@ if ($ADD==36) echo "MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20771,7 +23896,7 @@ if ($ADD==37) echo "MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by pause_code;"; $rslt=mysql_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20833,7 +23958,7 @@ if ($ADD==39) echo "MODIFICA
    $campaigns_name_list[$o] "; - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $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_query($stmt, $link); $campstatus_to_print = mysql_num_rows($rslt); $p=0; @@ -20884,9 +24009,9 @@ if ($ADD==39) if ($ADD==301) { echo "
    \n"; - echo ""; + echo ""; - echo "
    CAMPAIGN PRESET LISTINGS:\n"; + echo "
    ANNUNCI DI CAMPAGNA PRESET:\n"; echo "
    \n"; echo "\n"; echo "\n"; @@ -20895,59 +24020,125 @@ if ($ADD==301) echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $enable_xfer_presets_list[$o] = $row[2]; - $o++; - } + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $enable_xfer_presets_list[$o] = $row[2]; + $o++; + } - $o=0; - $k=0; - while ($campaigns_to_print > $o) + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if ($enable_xfer_presets_list[$o] == 'ENABLED') { - if ($enable_xfer_presets_list[$o] == 'ENABLED') + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; - echo ""; - echo ""; - echo "\n"; - - $k++; + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; } - $o++; + if ($p<1) + {echo "NESSUNO";} + echo ""; + echo "\n"; + + $k++; } + $o++; + } echo "
    CAMPAGNAMODIFICA
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) { - if (eregi("1$|3$|5$|7$|9$", $k)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; - $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) - { - $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; - } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFY PRESETS
    MODIFY PRESETS
    \n"; } +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "
    \n"; + echo ""; + + echo "
    CAMPAGNA IN LISTA Prefisso CID:\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_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    CAMPAGNANOMECUSTOM CIDAC-CIDSMODIFICA
    $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_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + echo "MODIFY AC-CIDS
    \n"; + } + + ###################### # ADD=311 modify list info in the system @@ -20957,10 +24148,15 @@ if ($ADD==311) { if ($LOGmodify_lists==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311&list_id=$list_id"; + $modify_footer_rinfrescare=1; + } echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -21098,19 +24306,58 @@ if ($ADD==311) echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $list_name = $row[1]; @@ -20979,9 +24175,13 @@ if ($ADD==311) $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]; # 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 from vicidial_statuses order by status"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -20990,10 +24190,11 @@ if ($ADD==311) { $rowx=mysql_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 from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $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_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -21002,13 +24203,14 @@ if ($ADD==311) { $rowx=mysql_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 order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $o=0; @@ -21021,7 +24223,7 @@ if ($ADD==311) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -21055,7 +24257,7 @@ if ($ADD==311) echo "
    Descrizione Lista: $NWB#vicidial_lists-list_description$NWE
    Campagna:
    Messaggio Segreteria Telefonica Override: audio chooser $NWB#vicidial_lists-am_message_exten_override$NWE
    Drop Inbound Group Override:
    Drop Inbound Group Override: $NWB#vicidial_lists-drop_inbound_group_override$NWE
    Web Form: $NWB#vicidial_lists-web_form_address$NWE
    Web Form Two: $NWB#vicidial_lists-web_form_address$NWE
    Transfiera -Conf El Número 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Transfiera -Conf El Número 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Transfiera -Conf El Número 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
    Inventory report: $NWB#vicidial_lists-inventory_report$NWE
    Impostazione del fuso orario: $NWB#vicidial_lists-time_zone_setting$NWE
    \n"; echo "
    \n"; echo "
    ESITI IN QUESTA LISTA:
    \n"; - echo "\n"; - echo "\n"; + + if ($SSexpanded_list_stats > 0) + { + echo "
    ESITONOME ESITOCHIAMATINON CHIAMATI
    \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_query($stmt, $link); + $row=mysql_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_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + if ($filters_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $filterSQL = $rowx[0]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + } + echo "\n"; + } + else + { + echo "
    ESITONOME ESITOCHIAMATINON CHIAMATIDIALABLEPENETRATION
    \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"; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -21164,15 +24411,53 @@ if ($ADD==311) $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); - echo "\n"; + ### 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++; } } - echo "\n"; - echo "\n"; - + 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 "
    ESITONOME ESITOCHIAMATINON CHIAMATI
    $CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
    $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]."
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]    
    TOTALE$lead_list[count]$dialable_total $total_complete_pct%  
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]

    \n"; unset($lead_list); @@ -21182,7 +24467,7 @@ if ($ADD==311) 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"; + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); @@ -21221,7 +24506,7 @@ if ($ADD==311) while (list($tzone,) = each($lead_list[$since_reset])) { $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} @@ -21243,67 +24528,142 @@ if ($ADD==311) echo "
    \n"; echo "
    PROPRIETARI all-interno di questa mailing:
    \n"; - echo "
    FUSO ORARIO ATTUALE (ora locale)CHIAMATINON CHIAMATI
    \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_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) + if ($SSuser_territories_active > 0) { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + ### 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 "
    OWNERCHIAMATINON CHIAMATI
    \n"; + echo "\n"; - $CLB=''; - $CLE=''; + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); - echo "\n"; + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } $o++; } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "
    OWNERCHIAMATINON CHIAMATIRESET
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]
    \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_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + } echo "
    OWNERCHIAMATINON CHIAMATI
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]
    $CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
    SUBTOTALI$lead_list[Y_count]$lead_list[N_count]
    TOTALE$lead_list[count]

    \n"; unset($lead_list); @@ -21316,7 +24676,7 @@ if ($ADD==311) $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"; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $ranks_to_print = mysql_num_rows($rslt); @@ -21378,7 +24738,7 @@ if ($ADD==311) $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"; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count;"; $rslt=mysql_query($stmt, $link); $status_called_to_print = mysql_num_rows($rslt); @@ -21501,7 +24861,7 @@ if ($ADD==311) $rslt=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rslt); - echo "

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

    I campi personalizzati definiti per questa lista: $rowx[0]
    \n"; } echo "

    Clicca qui per visualizzare tutti i richiami in attesa in questa lista
    \n"; @@ -21513,7 +24873,7 @@ if ($ADD==311) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo elenco
    \n"; + echo "

    Clicca qui per vedere i cambiamenti Admin a questa lista\n"; } } else @@ -21533,10 +24893,15 @@ if ($ADD==3111) { if ($LOGmodify_ingroups==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id"; + $modify_footer_rinfrescare=1; + } 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 "\n"; + echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) @@ -21806,32 +25218,36 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -21839,10 +25255,12 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -21927,67 +25351,67 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; @@ -21997,13 +25421,13 @@ if ($ADD==3111) echo "$Tgroups_menu"; echo "$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -22016,7 +25440,7 @@ if ($ADD==3111) echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; ##### get groups_alias listings for dynamic default group alias pulldown list menu - $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_query($stmt, $link); $group_alias_to_print = mysql_num_rows($rslt); $group_alias_menu=''; @@ -22054,30 +25478,33 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + 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"; ##### 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 from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $qc_statuses_list=''; @@ -22101,7 +25528,7 @@ if ($ADD==3111) $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; + $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); @@ -22127,7 +25554,7 @@ if ($ADD==3111) } ##### get scripts listings for pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); $QCscripts_list=""; @@ -22140,7 +25567,7 @@ if ($ADD==3111) $o++; } ##### get shifts listings for pulldown - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); $QCshifts_list=""; @@ -22177,13 +25604,12 @@ if ($ADD==3111) ### list of agent rank or skill-level for this inbound group - # ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ - echo "
    \n"; + echo "
    \n"; echo "
    CLASSIFICA OPERATORI PER QUESTO GRUPPO INBOUND:
    \n"; - 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 from vicidial_inbound_groups where group_id='$group_id';"; + $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 from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21640,32 +25005,52 @@ if ($ADD==3111) $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]; ##### get callmenu listings for dynamic pulldown - $stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id"; + $stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $Xmenus_to_print = mysql_num_rows($rslt); $o=0; $Xmenuslist=''; + $Wmenuslist=''; while ($Xmenus_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xmenuslist .= "\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') order by group_id"; + $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_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -21676,6 +25061,8 @@ if ($ADD==3111) $Agroups_selected=0; $Hgroups_menu=''; $Hgroups_selected=0; + $Wgroups_menu=''; + $Wgroups_selected=0; $Tgroups_menu=''; $Tgroups_selected=0; $o=0; @@ -21686,6 +25073,7 @@ if ($ADD==3111) $Dgroups_menu .= "\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++; @@ -21738,6 +25132,10 @@ if ($ADD==3111) {$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 @@ -21754,12 +25152,22 @@ if ($ADD==3111) echo "
    Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
    Colore Gruppo: $NWB#vicidial_inbound_groups-group_color$NWE
    Attivo: $NWB#vicidial_inbound_groups-active$NWE
    Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    In-Group Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE
    \n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "
    Admin Gruppo Utente: $NWB#vicidial_inbound_groups-user_group$NWE
    Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Web Form Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Web Form Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
    Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_inbound_groups-next_agent_call$NWE
    Coda di priorità: $NWB#vicidial_inbound_groups-queue_priority$NWE
    On-Hook squilli: $NWB#vicidial_inbound_groups-on_hook_ring_time$NWE
    On-Hook CID: $NWB#vicidial_inbound_groups-on_hook_cid$NWE
    Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Ignore List Script Override: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Ignora Script Override List: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Transfiera -Conf El Número 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Timer azione: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer azione: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer azione Message: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Timer azione Secondi: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Timer azione Destination: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Timer Azione Destination: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Secondi Abbattimento Telefonata: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Goccia dazione:$NWB#vicidial_inbound_groups-drop_action$NWE
    Goccia dazione:$NWB#vicidial_inbound_groups-drop_action$NWE
    Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
    Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Trasferimento Drop Group:
    Drop Transfer Group: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
    Menu a discesa chiamata:$NWB#vicidial_inbound_groups-drop_callmenu$NWE
    Tempo Chiamata: $NWB#vicidial_inbound_groups-call_time_id$NWE
    Despue`s De la Accio`n De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Azione Transfer CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
    Despue`s De la Accio`n De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Despue`s De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Despue`s De las Horas Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Dopo ore di trasferimento del gruppo:
    After Hours Transfer Group: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
    After Hours chiamate Menu:$NWB#vicidial_inbound_groups-after_hours_callmenu$NWE
    N. agenti n. Queueing: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
    Nessun agente Nessuna azione di coda: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; @@ -21873,9 +25291,9 @@ if ($ADD==3111) echo ""; echo " "; - echo "   Handle Method: "; echo "$IGhandle_method_list\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID Lista: "; echo "
    ID Campagna: audio chooser\n"; + echo "file Audio: audio chooser\n"; } if ($no_agent_action=='EXTENSION') { @@ -21917,6 +25335,12 @@ if ($ADD==3111) echo "
     
    Max Chiama il metodo: $NWB#vicidial_inbound_groups-max_calls_method$NWE
    Chiamate Conte Max: $NWB#vicidial_inbound_groups-max_calls_count$NWE
    Max chiamate Azione: $NWB#vicidial_inbound_groups-max_calls_action$NWE
    Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Lettura del messaggio di benvenuto:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
    On Hold Prompt No Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    In attesa Prompt No Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    On Hold Prompt Seconds: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    In attesa Secondi Prompt: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Gioca Luogo in Linea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Gioca Tenere Tempo stimato:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Calculate Estimated Hold Seconds: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Calcolare Secondi Attesa stimato: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Estimated Hold Time Minimum Filename: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Tenere minimo stimato Filename Tempo: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Estimated Hold Time Minimum Prompt No Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Tempo di attesa stimato minimo Prompt No Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Estimated Hold Time Minimum Prompt Seconds: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Tempo di attesa stimato secondi minimo Prompt: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Wait Time Opzione: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Attendere Opzione Tempo: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Wait Time Second Opzione: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Attendere Opzione Second Time: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Wait Time Third Opzione: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Attendere Opzione terza volta: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Wait Time Opzione Seconds: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Attendere seconds Tempo: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Wait Time Opzione Estensione:$NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Attendere Opzione proroga: $NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Wait Time Opzione Callmenu:
    Attendere Opzione Callmenu Tempo: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Wait Time Opzione Casella Vocale: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Attendere Opzione Casella Vocale Tempo: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Wait Time Opzione Transfer In-Gruppo:
    Attendere Opzione Transfer Time In-Gruppo: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Wait Time Opzione Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Attendere opzione filename Tempo Press: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Wait Time Opzione Press No Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Attendere Opzione Press Tempo No Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Wait Time Opzione Press Filename Seconds: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Attendere opzione di secondi Nome del file Stampa: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Wait Time Opzione After Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Attendere opzione Time After Nome Press: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Wait Time Opzione Callback ID Lista: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Attendere Opzione Tempo ID Callback List: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Wait Hold Opzione Priority: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Attendere Tenere Priority Opzione: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Estimated Tenere Tempo Opzione:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Tempo di attesa stimato Opzione: $NWB#vicidial_inbound_groups-hold_time_option$NWE
    Hold Time Second Opzione: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Tenere Opzione Second Time: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Hold Time Third Opzione: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Tenere Opzione terza volta: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Tenere Opzione Secondi Tempo:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Hold Time Opzione Minimum: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Tenere Opzione Tempo minimo: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Tenere Opzione Tempo Estensione:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Hold Time Opzione Callmenu:
    Tenere Opzione Callmenu Tempo: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Hold Time Opzione Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Tenere opzione filename Tempo Press: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Hold Time Opzione Press No Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Tenere Opzione Press Tempo No Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Opzione Press Filename Seconds: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Tenere opzione di secondi Nome del file Stampa: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Hold Time Opzione After Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Tenere Opzione Time After Nome Press: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Tenere Opzione Tempo richiamata Elenco ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Statistiche per cento delle chiamate risposta entro X secondi 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
    Start Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Start Call URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Add Lead URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Aggiungi URL piombo: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Extension Append CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Nessun agente URL chiamata: $NWB#vicidial_inbound_groups-na_call_url$NWE
    Uniqueid Status Visualizzare: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Extension Aggiunge CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Uniqueid Status Prefix: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
    Visualizzare di stato UniqueID: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Stato Prefisso UniqueID: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
     
    Inbound Gruppo QC Impostazioni:
     Inbound Gruppo QC Impostazioni:
    \n"; - echo "\n"; + echo "
    UTENTESELECTED     CLASSIFICA     CHIAMATE OGGI
    \n"; + echo "\n"; - $stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y';"; + $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -22196,6 +25622,7 @@ if ($ADD==3111) $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';} @@ -22207,7 +25634,7 @@ if ($ADD==3111) while ($users_to_print > $o) { $o++; - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; + $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_query($stmt, $link); $viga_to_print = mysql_num_rows($rsltx); if ($viga_to_print > 0) @@ -22215,16 +25642,18 @@ if ($ADD==3111) $rowx=mysql_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';"; + $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_query($stmtD, $link); if ($DB > 0) {echo "|$stmtD|";} $stmtDlog .= "$stmtD|"; $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; $ARIG_rank[$o] = '0'; $ARIG_calls[$o] = '0'; + $ARIG_grade[$o] = '1'; } } if (strlen($ARIG_changenotes) > 10) @@ -22248,16 +25677,21 @@ if ($ADD==3111) $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 = ereg_replace("[^A-Z]","",$ARIG_checked); $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + $ARIG_graded = ereg_replace("[^-0-9]","",$ARIG_graded); $stmtA=''; $stmtB=''; @@ -22290,6 +25724,14 @@ if ($ADD==3111) $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_query($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 ### @@ -22302,7 +25744,7 @@ if ($ADD==3111) } } - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $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_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -22317,6 +25759,7 @@ if ($ADD==3111) $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';} @@ -22336,10 +25779,12 @@ if ($ADD==3111) $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"; + $users_output .= "\n"; + echo "\n"; echo "$users_output"; @@ -22362,18 +25818,16 @@ if ($ADD==3111) echo "
    UTENTEGRUPPOSELECTED     CLASSIFICA     GRADE     CHIAMATE OGGI
    $ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]   select all  
        select all  

    \n"; - echo "

    \n"; - echo "Clicca qui per visualizzare un report per questo gruppo inbound

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

    \n"; + echo "Clicca qui per vedere gli agenti collegati a questo gruppo in entrata

    \n"; echo "
    \n"; - echo "DIDS USING THIS IN-GROUP:
    \n"; + echo "DIDS UTILIZZO DI QUESTO GRUPPO IN:
    \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';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -22385,10 +25839,10 @@ if ($ADD==3111) } echo "

    \n"; - echo "CALL MENUS USING THIS IN-GROUP:
    \n"; + echo "CALL MENUS UTILIZZO DI QUESTO GRUPPO IN:
    \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';"; + $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_query($stmt, $link); $cms_to_print = mysql_num_rows($rslt); $o=0; @@ -22423,7 +25877,7 @@ if ($ADD==3111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages per questo gruppo di in -\n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo In-Group\n"; } } else @@ -22431,6 +25885,7 @@ if ($ADD==3111) echo "Non hai l`autorizzazione per accedere a questa pagina\n"; exit; } + } @@ -22443,13 +25898,18 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -22602,7 +26072,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu order by menu_id;"; + $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -22624,7 +26094,7 @@ if ($ADD==3311) 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 order by filter_phone_group_id;"; + $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_query($stmt, $link); $Fgroups_to_print = mysql_num_rows($rslt); $Fgroups_list=''; @@ -22650,10 +26120,10 @@ if ($ADD==3311) $i++; } - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22674,7 +26144,7 @@ if ($ADD==3311) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - - - - + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; 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 from vicidial_inbound_dids where $didSQL;"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -22494,9 +25954,15 @@ if ($ADD==3311) $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"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -22509,7 +25975,7 @@ if ($ADD==3311) } ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; @@ -22547,7 +26013,7 @@ if ($ADD==3311) ##### get in-groups listings for dynamic pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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_query($stmt, $link); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -22591,8 +26057,12 @@ if ($ADD==3311) echo "
    HA Estensione:$NWB#vicidial_inbound_dids-did_pattern$NWE
    HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
    Attivo: $NWB#vicidial_inbound_dids-did_active$NWE
    Admin Gruppo Utente: $NWB#vicidial_inbound_dids-user_group$NWE
    HA Percorso:$NWB#vicidial_inbound_dids-did_route$NWE
    Record Call: $NWB#vicidial_inbound_dids-record_call$NWE
    Record di chiamata: $NWB#vicidial_inbound_dids-record_call$NWE
    Estensione:$NWB#vicidial_inbound_dids-extension$NWE
    Estensione Contesto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Buzon de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    In-ID Gruppo: $NWB#vicidial_inbound_dids-group_id$NWE
    Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Nel gruppo di agente Metodo di ricerca:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Nel gruppo Elenco ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Nel gruppo-ID campagna:
    Nel gruppo Codice Telefono:$NWB#vicidial_inbound_dids-phone_code$NWE
    Clean CID Number: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Pulire Numero CID: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Filter Inbound Number: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filter Number Inbound: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filter Phone ID Gruppo: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Filter Phone ID Group: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Filter URL: $NWB#vicidial_inbound_dids-filter_url$NWE
    Filter Action: $NWB#vicidial_inbound_dids-filter_action$NWE
    URL Filter: $NWB#vicidial_inbound_dids-filter_url$NWE
    Action Filter: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Estensione:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Estensione Contesto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter In-ID Gruppo: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter Nel gruppo di agente Metodo di ricerca:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter Nel gruppo Elenco ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter Nel gruppo-ID campagna:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter Nel gruppo Codice Telefono:$NWB#vicidial_inbound_dids-phone_code$NWE
    Custom 1: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 2: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 3: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 4: $NWB#vicidial_inbound_dids-custom_one$NWE
    Custom 5: $NWB#vicidial_inbound_dids-custom_one$NWE
    \n"; echo "

    \n"; echo "
    Clicca qui per vedere una relazione di traffico per questo DID

    \n"; - echo "
    Click here to see a list of recordings and calls for this DID

    \n"; + echo "
    Clicca qui per vedere un elenco delle registrazioni e chiede per questo DID
    \n"; + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    VEDERE LO distanza sostituisce agente di estensione PER QUESTA DID\n"; + } if ($LOGdelete_dids > 0) { echo "

    CANCELLA QUESTO HA\n"; } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo DID\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin a questo DID\n"; } } else @@ -22713,6 +26188,306 @@ if ($ADD==3311) + +###################### +# ADD=1320 display did remote agent extension override summary +###################### +if ($ADD==1320) + { + echo "
    \n"; + echo ""; + + echo "
    Remote Agent ESTENSIONE Override ANNUNCI:\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_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_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 (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
    DIDNOMERA-EXTENSMODIFICA
    $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_query($stmt, $link); + $didstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($didstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_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/ModificareDID Remote Agent Extensions section ##### + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    NON REMOTE OVERRIDE PROLUNGA AGENTE AGGIUNTO - esiste già una voce per questo DID con questa estensione RA
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    NON REMOTE OVERRIDE PROLUNGA AGENTE AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti
    \n"; + } + else + { + echo "
    HA REMOTE OVERRIDE ESTENSIONE AGENTE AGGIUNTO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    DID Remote Agent OVERRIDE non cancellato - questa voce non esiste
    \n";} + else + { + if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) + { + echo "
    DID Remote Agent OVERRIDE non cancellato - Per favore torna indietro e ricontrolla i dati inseriti
    \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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fdescription_value); + $Factive_value = ereg_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 - Per favore torna indietro e ricontrolla i dati inseriti
    \n"; + } + else + { + echo "DID Remote Agent OVERRIDE MODIFICATO: $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_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='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_query($stmt, $link); + } + $o++; + } + } + ##### END Add/Delete/ModificareDID Remote Agent Extensions section ##### + + + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; + $modify_footer_rinfrescare=1; + } + echo "
    \n"; + echo ""; + echo "

    Distanza sostituisce agente di estensione PER QUESTA DID:   $NWB#vicidial_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_query($stmt, $link); + $raextens_to_print = mysql_num_rows($rslt); + $o=0; + while ($raextens_to_print > $o) + { + $rowx=mysql_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 (eregi("1$|3$|5$|7$|9$", $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 STARTINTERNODESCRIZIONEATTIVOCALLSCANCELLA
      $ct   $Xuser_start[$o]   $Xextension[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   CANCELLA
    \n"; + echo "

    \n"; + + echo "
    ADD NEW REMOTE AGENT EXTENSION OVERRIDE
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Utente Start: \n"; + echo "Estensione:
    \n"; + echo "Descrizione: \n"; + echo "
    \n"; + + echo "

    \n"; + + echo "

    MODIFICARE QUESTO DID\n"; + + if ($LOGuser_level >= 9) + { + echo "

    Clicca qui per vedere i cambiamenti Admin a questo DID
    \n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + + + + ###################### # ADD=3511 modify call menu info in the system ###################### @@ -22721,10 +26496,15 @@ if ($ADD==3511) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id"; + $modify_footer_rinfrescare=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 from vicidial_call_menu where menu_id='$menu_id';"; + $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 from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -22738,6 +26518,9 @@ if ($ADD==3511) $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]; echo "
    MODIFICARE UNA CHIAMATA menu Record: $menu_id
    \n"; @@ -22746,6 +26529,10 @@ if ($ADD==3511) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -22782,6 +26569,18 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -22813,7 +26612,7 @@ if ($ADD==3511) $dtmf_list = ""; echo "$ingroup_list"; - echo "   Handle Method: "; echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; - echo "
    Search Method: "; echo "$IGsearch_method_list\n"; echo "   ID Lista: "; echo "
    ID Campagna: \n"; echo "   Phone Code: "; - echo "
      VID Enter Filename: audio chooser"; + echo "
      Inserisci il Nome del file VID: audio chooser"; echo "
      VID ID Number Filename: audio chooser"; - echo "
      VID Confirm Filename: audio chooser"; - echo "   VID Digits: "; + echo "
      VID Conferma Filename: audio chooser"; + echo "   VID cifre: "; } if ($option_route=='DID') { - $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $did_id = $row[0]; @@ -22901,7 +26700,7 @@ if ($ADD==3511) } if ($option_route=='HANGUP') { - echo "Audio File: audio chooser\n"; + echo "file Audio: audio chooser\n"; } if ($option_route=='EXTENSION') { @@ -22925,12 +26724,12 @@ if ($ADD==3511) $j++; } - while ($j <= 18) + while ($j <= 20) { $choose_height = (($j * 40) + 400); $dtmf_list = "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; echo "
    Menu ID: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
    Menu Nome: $NWB#vicidial_call_menu-menu_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_call_menu-user_group$NWE
    Menu Prompt: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
    Timeout menu: $NWB#vicidial_call_menu-menu_timeout$NWE
    Menu prompt timeout: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
    Log pressione di un tasto: $NWB#vicidial_call_menu-dtmf_log$NWE     Log campo: \n"; + echo "$NWB#vicidial_call_menu-dtmf_field$NWE
    Call Menu Opzioni:
    Custom Dialplan entrata:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan:
    $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Custom Dialplan entrata: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
    \n"; echo "

    \n"; - echo "DIDS USING THIS CALL MENU:
    \n"; + echo "DIDS UTILIZZO DI QUESTO MENU CALL:
    \n"; echo "\n"; - $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $o=0; @@ -22993,7 +26792,7 @@ if ($ADD==3511) echo "

    \n"; - echo "CALL MENUS USING THIS CALL MENU:
    \n"; + echo "CALL MENUS UTILIZZO DI QUESTO MENU CALL:
    \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';"; @@ -23012,11 +26811,11 @@ if ($ADD==3511) if ($LOGdelete_dids > 0) { - echo "

    DELETE THIS CALL MENU\n"; + echo "

    CANCELLA QUESTO MENU CALL\n"; } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per vedere chages Admin a questo menu CALL\n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo MENU CALL\n"; } } else @@ -23036,10 +26835,15 @@ if ($ADD==31111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id"; + $modify_footer_rinfrescare=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 from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -23050,56 +26854,94 @@ if ($ADD==31111) $status = $row[5]; $campaign_id = $row[6]; $extension_group = $row[8]; + $on_hook_agent = $row[9]; + $on_hook_ring_time =$row[10]; - ##### get extension group listing for dynamic pulldown - $stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;"; + ##### get user_group of start_user + $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); - $extengrp_to_print = mysql_num_rows($rsltx); - $extengrp_list=''; - $o=0; - while ($extengrp_to_print > $o) + $vu_to_print = mysql_num_rows($rsltx); + if ($vu_to_print > 0) { $rowx=mysql_fetch_row($rsltx); - $extengrp_list .= "\n"; - $o++; + $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_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } + + echo "
    MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $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 "
    Inizio ID Utente: (solo cifre, incremented, deve essere un utente esistente vicidial)$NWB#vicidial_remote_agents-user_start$NWE
    Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Server: $NWB#vicidial_remote_agents-server_ip$NWE
    Numero Di Interno Remoto: (numero del dialplan usato per raggiungere gli operatori)$NWB#vicidial_remote_agents-conf_exten$NWE
    Extension Gruppo: $NWB#vicidial_remote_agents-extension_group$NWE
    Esito: $NWB#vicidial_remote_agents-status$NWE
    Campagna: $NWB#vicidial_remote_agents-campaign_id$NWE
    On-Hook agente: $NWB#vicidial_remote_agents-on_hook_agent$NWE
    On-Hook squilli: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE
    \n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "
    Gruppi Inbound: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; + echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n"; + + ##### get count of did ra extens + $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; + $rsltx=mysql_query($stmt, $link); + $didraext_to_print = mysql_num_rows($rsltx); + $didraext_count='0'; + if ($didraext_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $didraext_count = $rowx[0]; + } + + if ($SSdid_ra_extensions_enabled > 0) + { + echo "

    CI SONO $didraext_count DID distanza sostituisce agente di estensione per l'agente REMOTE\n"; + } + if ($LOGdelete_remote_agents > 0) + { + echo "

    SUPRIMA ESTE AGENTE ALEJADO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Clicca qui per vedere i cambiamenti Admin a questo agente remoto
    \n"; + } } - - echo "
    MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $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 "
    Inizio ID Utente: (solo cifre, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Server: $NWB#vicidial_remote_agents-server_ip$NWE
    Numero Di Interno Remoto: (numero del dialplan usato per raggiungere gli operatori)$NWB#vicidial_remote_agents-conf_exten$NWE
    Extension Gruppo: $NWB#vicidial_remote_agents-extension_group$NWE
    Esito: $NWB#vicidial_remote_agents-status$NWE
    Campagna: $NWB#vicidial_remote_agents-campaign_id$NWE
    Gruppi Inbound: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
    \n"; - echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n"; - - - if ($LOGdelete_remote_agents > 0) + else { - echo "

    SUPRIMA ESTE AGENTE ALEJADO\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Clicca qui per visualizzare Admin chages a questo agente remoto\n"; + echo "Avvio utente per questo agente remoto non esiste: $user_start\n"; + exit; } } else @@ -23118,40 +26960,50 @@ if ($ADD==3711) { if ($LOGmodify_dids==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; - $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $filter_phone_group_id = $row[0]; $filter_phone_group_name = $row[1]; $filter_phone_group_description = $row[2]; + $user_group = $row[3]; - echo "
    Modifica Filtro Phone Gruppo: $filter_phone_group_id\n"; + echo "
    Modifica gruppo Filter Phone: $filter_phone_group_id\n"; echo "\n"; echo "\n"; echo "
    \n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Filter Phone ID Gruppo: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Filter Phone Nome Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descrizione: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Filter Nome Telefono Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Descrizione Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    Admin Gruppo Utente: $NWB#vicidial_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_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "

    Numbers in this Filter Phone Gruppo: $row[0]"; + echo "

    I numeri in questo Gruppo Phone Filter: $row[0]"; if ($LOGdelete_dids > 0) { - echo "

    CANCELLA QUESTO FILTRO PHONE GROUP\n"; + echo "

    Eliminare il gruppo FILTRO TELEFONO\n"; } if ($LOGuser_level >= 9) { - echo "

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

    Clicca qui per scaricare i numeri in questo gruppo cellulare filtro\n"; - echo "

    Clicca qui per visualizzare Admin chages a questo filtro phone group\n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo gruppo cellulare filtro\n"; } } else @@ -23170,6 +27022,11 @@ if ($ADD==32111) { if ($LOGmodify_remoteagents==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; @@ -23185,7 +27042,7 @@ if ($ADD==32111) $last_call_time = $row[6]; $last_callerid = $row[7]; - echo "
    MODIFY AN EXTENSION GROUP ENTRY: $row[0]\n"; + echo "
    Modificare una voce gruppo di interni: $row[0]\n"; echo "\n"; echo "\n"; echo "
    \n"; @@ -23208,20 +27065,20 @@ if ($ADD==32111) {echo "\n";} echo " $NWB#vicidial_extension_groups-rank$NWE\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
    Campagnas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Call Count Today: $call_count_today
    Last Tempo Chiamata: $last_call_time
    Last Call ID: $last_callerid
    Campagne Gruppi: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Chiama contare oggi: $call_count_today
    Chiamata Last Time: $last_call_time
    Chiamata ID Ultimo: $last_callerid
    \n"; if ($LOGdelete_remote_agents > 0) { - echo "

    DELETE THIS EXTENSION GROUP ENTRY\n"; + echo "

    Eliminare questa voce gruppo di interni\n"; } if ($LOGuser_level >= 9) { - echo "

    Click here to see Admin chages to this extension group entry
    \n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this extension group entry\n"; } } else @@ -23240,220 +27097,330 @@ if ($ADD==311111) { if ($LOGmodify_usergroups==1) { - echo "\n"; + echo "\n"; + } - echo "

    Clicca qui per visualizzare tutti i richiami di questo utente

    \n"; - echo "

    Clicca qui per visualizzare lorologio di stato per questo gruppo di utenti

    \n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + 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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; - $agent_call_log_view = $row[10]; - $agent_xfer_consultative = $row[11]; - $agent_xfer_dial_override = $row[12]; - $agent_xfer_vm_transfer = $row[13]; - $agent_xfer_blind_transfer = $row[14]; - $agent_xfer_dial_with_customer = $row[15]; - $agent_xfer_park_customer_dial = $row[16]; - $agent_fullscreen = $row[17]; - $allowed_reports = $row[18]; - $webphone_url_override = $row[19]; - $webphone_systemkey_override = $row[20]; - $webphone_dialpad_override = $row[21]; - - echo ""; - - echo "
    MODIFICA UN GRUPPO UTENTI\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - 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"; + echo "Non sei autorizzato a modificare il tuo gruppo utente\n"; + exit; } else { - echo " "; - echo " "; - echo " "; - } + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group"; + $modify_footer_rinfrescare=1; + } + echo "
    Gruppo: (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE
    Descrizione: (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE
    Forza orologio Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Maiusc esecuzione: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campagne Permesse:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; - echo "$campaigns_list
     "; - echo "
    Gruppo Turni:
    $NWB#vicidial_user_groups-group_shifts$NWE
    \n"; - $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; - $rslt=mysql_query($stmt, $link); - $shifts_to_print = mysql_num_rows($rslt); - $o=0; - while ($shifts_to_print > $o) + if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { - $rowx=mysql_fetch_row($rslt); - $shift_id_value = $rowx[0]; - $shift_name_value = $rowx[1]; - echo " $shift_id_value - $shift_name_value
    \n"; - $o++; - } - echo "
     
    Stato agente Viewable Gruppi:
    $NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
    \n"; - echo "ALL-GROUPS - All user groups in the system
    \n"; - echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; - 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 order by user_group"; - $rslt=mysql_query($stmt, $link); - $view_groups_to_print = mysql_num_rows($rslt); - $o=0; - while ($view_groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $vgroups_id_value = $rowx[0]; - $vgroups_name_value = $rowx[1]; - echo " $vgroups_id_value - $vgroups_name_value
    \n"; - $o++; - } - echo "
     
    Visualizza stato agente Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Agent Call Log View: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agent Allow Consultative Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial Override Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Casella Vocale Message Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Blind Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial With Customer Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Park Customer Dial Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Allowed Rapporti: $NWB#vicidial_user_groups-allowed_reports$NWE
    Webphone URL Override: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone System Key Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    \n"; + echo "\n"; - ### list of users in this user group + echo "\n"; - $active_confs = 0; - $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); + echo "\n"; - echo "
    \n"; - echo "
    UTENTI IN QUESTO GRUPPO: $users_to_print
    \n"; - echo "
    \n"; + echo ""; - if ($SSqc_features_active > 0) - { - echo "
    QC ammessi Campagne:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; - echo "$qc_campaigns_list"; + $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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; + $admin_viewable_groups = $row[22]; + $admin_viewable_call_times = $row[23]; + + echo ""; + + echo "
    MODIFICA UN GRUPPO UTENTI\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
    Gruppo: (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE
    Descrizione: (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE
    Forza orologio Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
    Maiusc esecuzione: $NWB#vicidial_user_groups-shift_enforcement$NWE
    Campagne Permesse:
    $NWB#vicidial_user_groups-allowed_campaigns$NWE
    \n"; + echo "$campaigns_list
     "; + echo "
    Gruppo Turni:
    $NWB#vicidial_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_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
    \n"; + $o++; + } echo "
     
    QC ammessi Inbound Gruppi:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; - echo "$qc_groups_list"; + + + echo "
    Stato agente Viewable Gruppi:
    $NWB#vicidial_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 - Tutti gli utenti del sistema, neppure gli utenti registrati
    \n"; + } + + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } echo "
     
    \n"; + echo "
    Visualizza stato agente Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Call Agent View Log: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agente Consenti Xfer consultivo: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Lasciare Override Xfer Dial: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    \n"; - echo "\n"; + echo "\n"; - $o=0; - while ($users_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $o++; + echo "\n"; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } else - {$bgcolor='bgcolor="#9BB9FB"';} + { + echo " "; + echo " "; + echo " "; + } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "
    UTENTENOME COMPLETOLIVELLOATTIVO
    Agente Permetti messaggi Xfer Casella Vocale: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Consenti Xfer Ciechi: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente di permettere chiamate Con Xfer clienti: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Lasciare Xfer Clienti Parco Dial: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agente Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Rapporti ammessi: $NWB#vicidial_user_groups-allowed_reports$NWE
    URL Override webphone: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone Key System Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    $rowx[0]$rowx[1]$rowx[2]$rowx[3]

    \n"; + if ($SSqc_features_active > 0) + { + echo "
    QC ammessi Campagne:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; + echo "$qc_campaigns_list"; + echo "
     
    QC ammessi Inbound Gruppi:
    $NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
    \n"; + echo "$qc_groups_list"; + echo "
     
    Gruppi di utenti ammessi:
    $NWB#vicidial_user_groups-admin_viewable_groups$NWE
    \n"; + if ($admin_viewable_groupsALL > 0) + { + echo "ALL-GROUPS - All user groups in the system
    \n"; + } - if ($LOGdelete_user_groups > 0) - { - echo "

    CANCELLA QUESTO GRUPPO UTENTI\n"; - } - if ($LOGuser_level >= 9) - { - echo "

    Clicca qui per visualizzare Admin chages a questo gruppo di utenti\n"; + $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
    \n"; + $o++; + } + echo "
     
    Tempi di chiamata ammessi:
    $NWB#vicidial_user_groups-admin_viewable_call_times$NWE
    \n"; + echo "ALL-CALLTIMES - Tutti gli orari delle chiamate del sistema
    \n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $view_calltimes_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_calltimes_to_print > $o) + { + $rowx=mysql_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_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
    \n"; + echo "
    UTENTI IN QUESTO GRUPPO: $users_to_print
    \n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    UTENTENOME COMPLETOLIVELLOATTIVO
    $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 "
    Aggiungi o rimuovi In-gruppo selezionato per gli utenti attivi in ​​questo gruppo di utenti
    \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_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + echo "   \n"; + echo "In-Gruppo:
    \n"; + echo "
    \n"; + ##### END add/remove in-group as selected for all active users in this group ##### + + echo "

    Clicca qui per visualizzare tutti i richiami di questo utente

    \n"; + echo "

    Clicca qui per visualizzare lorologio di stato per questo gruppo di utenti

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

    CANCELLA QUESTO GRUPPO UTENTI\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo gruppo di utenti\n"; + } } } else @@ -23472,32 +27439,47 @@ if ($ADD==3111111) { if ($LOGmodify_scripts==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFICA SCRIPT
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    ID Script:: $script_id$NWB#vicidial_scripts-script_name$NWE
    Nome Script: (titolo script)$NWB#vicidial_scripts-script_name$NWE
    Note Script: $NWB#vicidial_scripts-script_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_scripts-user_group$NWE
    Attivo: $NWB#vicidial_scripts-active$NWE
    Testo Script:

    Anteprima Script
    "; # BEGIN Insert Field echo ""; echo "
    "; # END Insert Field @@ -23573,7 +27556,7 @@ if ($ADD==3111111) echo "


    \n"; - echo " CAMPAGNE USING THIS SCRIPT:
    \n"; + echo " CAMPAGNE utilizzando questo script:
    \n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; @@ -23588,10 +27571,10 @@ if ($ADD==3111111) } echo "


    \n"; - echo " GRUPPI INBOUND USING THIS SCRIPT:
    \n"; + echo " IN-GRUPPI utilizzando questo script:
    \n"; echo "\n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -23603,7 +27586,7 @@ if ($ADD==3111111) } echo "


    \n"; - echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; + echo " Elenca gli override utilizzando questo script:
    \n"; echo "\n"; $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; @@ -23617,17 +27600,15 @@ if ($ADD==3111111) $o++; } - echo "
    \n"; - - if ($LOGdelete_scripts > 0) { echo "

    CANCELLA QUESTO SCRIPT\n"; } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo script
    \n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo script
    \n"; } + } else { @@ -23645,24 +27626,36 @@ if ($ADD==31111111) { if ($LOGmodify_filters==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $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_query($stmt, $link); $row=mysql_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 "
    MODIFICA UN FILTRO\n"; echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    ID Filtro:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
    Nome Del Filtro: (breve descrizione del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
    Commenti Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_lead_filters-user_group$NWE
    Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
    \n"; @@ -23697,7 +27690,7 @@ if ($ADD==31111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo filtro
    \n"; + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo filtro
    \n"; } } else @@ -23716,6 +27709,11 @@ if ($ADD==321111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_rinfrescare=1; + } if ( ($stage=="ADD") and (strlen($state_rule)>0) ) { $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; @@ -23761,10 +27759,15 @@ if ($ADD==311111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id"; + $modify_footer_rinfrescare=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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -23794,6 +27797,7 @@ if ($ADD==311111111) $thursday_afterhours_filename_override = $row[25]; $friday_afterhours_filename_override = $row[26]; $saturday_afterhours_filename_override = $row[27]; + $user_group = $row[28]; echo ""; @@ -23801,9 +27805,14 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -23841,10 +27850,10 @@ if ($ADD==311111111) { $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)"; + $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='';} + {$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_query($stmt, $link); $sct_to_print = mysql_num_rows($rslt); @@ -23885,7 +27894,7 @@ if ($ADD==311111111) echo "GRUPPI INBOUND CHE UTILIZZANO QUESTO ORARIO:
    \n"; echo "
    ID Orario Chiamate: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Nome Orario Chiamate: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
    Note Orario Chiamate: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_call_times-user_group$NWE
    Inizio di Default: Fine di Default: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Domenica: Fine Domenica: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Lunedi: Fine Lunedi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    \n"; - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id';"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -23905,7 +27914,7 @@ if ($ADD==311111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages tempo al presente invito\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this call time\n"; } } else @@ -23924,10 +27933,15 @@ if ($ADD==3111111111) { if ($LOGmodify_call_times==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id"; + $modify_footer_rinfrescare=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 from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $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 from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $state_call_time_state =$row[1]; @@ -23949,6 +27963,7 @@ if ($ADD==3111111111) $ct_friday_stop = $row[17]; $ct_saturday_start = $row[18]; $ct_saturday_stop = $row[19]; + $user_group = $row[20]; echo ""; @@ -23956,10 +27971,15 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -23974,7 +27994,7 @@ if ($ADD==3111111111) echo "TIEMPOS DE LA LLAMADA USANDO ESTE TIEMPO DE LA LLAMADA DEL ESTADO:
    \n"; echo "
    ID Orario Chiamate: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
    _ Estado Llamar Tiempo Nombre: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
    Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
    Admin Gruppo Utente: $NWB#vicidial_call_times-user_group$NWE
    Inizio di Default: Fine di Default: $NWB#vicidial_call_times-ct_default_start$NWE
    Inizio Domenica: Fine Domenica: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Lunedi: Fine Lunedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    \n"; - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $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_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -24006,18 +28026,26 @@ if ($ADD==3111111111) if ($ADD==331111111) { - if ($LOGmodify_call_times==1) + if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; + $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); @@ -24047,6 +28075,10 @@ if ($ADD==331111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -24074,6 +28106,17 @@ if ($ADD==331111111) if (ereg('6',$shift_weekdays)) {echo " CHECKED";} echo ">Sabato
    \n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "
    Maiusc ID:$shift_id
    Maiusc Nome: (breve descrizione del turno)$NWB#vicidial_shifts-shift_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_shifts-user_group$NWE
    Maiusc Start Time:\n"; echo "   Fine Time Shift:\n"; echo " $NWB#vicidial_shifts-shift_start_time$NWE
    Segnala Opzione: $NWB#vicidial_shifts-report_option$NWE
    Segnala Rango: $NWB#vicidial_shifts-report_rank$NWE
    \n"; @@ -24081,7 +28124,7 @@ if ($ADD==331111111) echo "LUSO DI QUESTO MANUALE GRUPPI SHIFT:
    \n"; echo "\n"; - $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -24101,7 +28144,7 @@ if ($ADD==331111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo passaggio\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this shift\n"; } } else @@ -24118,12 +28161,17 @@ if ($ADD==331111111) if ($ADD==31111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip"; + $modify_footer_rinfrescare=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 from phones where extension='$extension' and server_ip='$server_ip';"; + $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 from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24135,10 +28183,14 @@ if ($ADD==31111111111) echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24165,6 +28236,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24181,8 +28253,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -24200,8 +28272,8 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24218,7 +28290,7 @@ if ($ADD==31111111111) echo "\n"; echo "
    Interno Telefono: $NWB#phones-extension$NWE (Agent Screen Login Telefono)
    Estensione Telefono:$NWB#phones-extension$NWE
    Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
    Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
    CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    Direccion IP del telefono: (optional)$NWB#phones-phone_ip$NWE
    Direccion IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
    IP Server: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Agente schermata di login: $NWB#phones-login$NWE
    Login Password: $NWB#phones-pass$NWE
    Registrazione Password: $NWB#phones-conf_secret$NWE     Strength:
    Set As Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Use External IP Server: $NWB#phones-use_external_server_ip$NWE
    Registrazione password: $NWB#phones-conf_secret$NWE     Forza:
    Imposta come Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Webphone Risposta automatica: $NWB#phones-webphone_auto_answer$NWE
    Utilizzare IP esterno Server: $NWB#phones-use_external_server_ip$NWE
    Esito: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del telefono: $NWB#phones-phone_type$NWE
    Nome Completo: $NWB#phones-fullname$NWE
    Email: $NWB#phones-email$NWE
    Eliminare Casella Vocale Dopo Email:$NWB#phones-delete_vm_after_email$NWE
    Casella Vocale Zone: $NWB#phones-voicemail_timezone$NWE
    Casella Vocale Opzioni: $NWB#phones-voicemail_options$NWE
    Compania: $NWB#phones-company$NWE
    Foto: $NWB#phones-picture$NWE
    Messaggi Nuovi: $row[14]$NWB#phones-messages$NWE
    Protocollo Client: $NWB#phones-protocol$NWE
    Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    Phone Ring Timeout: $NWB#phones-phone_ring_timeout$NWE
    On-Hook agente: $NWB#phones-on_hook_agent$NWE
    Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
    Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
    Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
    Contexto De Exten: $NWB#phones-ext_context$NWE
    Telefono Contesto: $NWB#phones-phone_context$NWE
    Allowed Codecs: $NWB#phones-codecs_list$NWE
    Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE
    Codec ammessi: $NWB#phones-codecs_list$NWE
    Codec ammessi Con Template: $NWB#phones-codecs_with_template$NWE
    Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
    Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
    Colas permitidas: $NWB#phones-QUEUE_ACTION_enabled$NWE
    Ventana emergente del CallerID: $NWB#phones-CallerID_popup_enabled$NWE
    Boto`n Vmail: $NWB#phones-voicemail_button_enabled$NWE
    Aggiornamento Veloce: $NWB#phones-enable_fast_refresh$NWE
    Intervallo Aggiornamento Veloce: (in ms)$NWB#phones-fast_refresh_rate$NWE
    Aggiornamento Veloce: $NWB#phones-enable_fast_rinfrescare$NWE
    Intervallo Aggiornamento Veloce: (in ms)$NWB#phones-fast_rinfrescare_rate$NWE
    Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
    Auto Marcar el Siguiente Número: $NWB#phones-auto_dial_next_number$NWE
    Parar de Grabar despue`s de cada llamada: $NWB#phones-VDstop_rec_after_each_call$NWE
    Puerto de DBY: (Secondario DB Port)$NWB#phones-DBY_port$NWE
    Template ID:
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24280,7 +28357,11 @@ if ($ADD==32111111111) 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 Nome: $NWB#phones-alias_name$NWE
    Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    Cellulari Logins List: (comma separated)$NWB#phones-logins_list$NWE
    \n"; @@ -24293,15 +28374,16 @@ if ($ADD==32111111111) echo "\n"; echo "\n"; - $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; - if ($DB) {echo "|$stmt|";} - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); + $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_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -24319,7 +28401,7 @@ if ($ADD==32111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo telefono cellulare alias\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this phone alias\n"; } } else @@ -24336,12 +28418,17 @@ if ($ADD==32111111111) if ($ADD==33111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_phones==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id"; + $modify_footer_rinfrescare=1; + } echo "
    LOGININTERNOSERVERPROTOCOLIP
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -24351,6 +28438,10 @@ if ($ADD==33111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24364,7 +28455,7 @@ if ($ADD==33111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo gruppo alias\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this group alias\n"; } } else @@ -24383,10 +28474,15 @@ if ($ADD==311111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip"; + $modify_footer_rinfrescare=1; + } echo "
    Gruppo Alias ID:$row[0] $NWB#phones-group_alias_id$NWE
    Alias Nome Gruppo: $NWB#phones-group_alias_name$NWE
    Admin Gruppo Utente: $NWB#phones-user_group$NWE
    Numero CallerID: $NWB#phones-caller_id_number$NWE
    CallerID Nome: $NWB#phones-caller_id_name$NWE
    Attivo:
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -24462,7 +28564,7 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24473,7 +28575,8 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -24484,11 +28587,11 @@ if ($ADD==311111111111) if ($SSallow_custom_dialplan > 0) { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } @@ -24502,7 +28605,7 @@ if ($ADD==311111111111) 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 from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -24430,6 +28526,8 @@ if ($ADD==311111111111) $conf_secret = $row[38]; $external_server_ip = $row[39]; $custom_dialplan_entry = $row[40]; + $active_twin_server_ip = $row[41]; + $user_group = $row[42]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -24448,6 +28546,10 @@ if ($ADD==311111111111) echo "
    Sistema di carico: $sysload - $cpu%   $NWB#servers-sysload$NWE
    Live Canali: $channels_total   $NWB#servers-channels_total$NWE
    Utilizzo del disco: $disk_usage   $NWB#servers-disk_usage$NWE
    Admin Gruppo Utente: $NWB#servers-user_group$NWE
    Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
    Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
    Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf file segreto: $NWB#servers-conf_secret$NWE     Strength:
    Conf file segreto: $NWB#servers-conf_secret$NWE     Forza:
    Fuso Orario Locale: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
    Extension de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
    Extension del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
    Carrier Logging Attivo: $NWB#servers-carrier_logging_active$NWE
    Registrazione Web Link: $NWB#servers-recording_web_link$NWE
    Alternate Recording IP Server: $NWB#servers-alt_server_ip$NWE
    External IP Server: $NWB#servers-external_server_ip$NWE
    IP Server esterno: $NWB#servers-external_server_ip$NWE
    Attivo IP server Twin: $NWB#servers-active_twin_server_ip$NWE
    Attivo Server Asterisk: $NWB#servers-active_asterisk_server$NWE
    Attivo Server Agent: $NWB#servers-active_agent_login_server$NWE
    Genera file di configurazione: $NWB#servers-generate_vicidial_conf$NWE
    Custom Dialplan entrata: $NWB#servers-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan: $NWB#servers-custom_dialplan_entry$NWE
    Custom Dialplan entrata: Disabled $NWB#servers-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; echo "\n"; - $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $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_query($stmt, $link); $recycle_to_print = mysql_num_rows($rslt); $o=0; @@ -24549,7 +28652,7 @@ if ($ADD==311111111111) $active_carriers = 0; $inactive_carriers = 0; - $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $carriers_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24581,7 +28684,7 @@ if ($ADD==311111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24679,7 +28782,7 @@ if ($ADD==311111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo server\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this server\n"; } } else @@ -24698,15 +28801,21 @@ if ($ADD==331111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id"; + $modify_footer_rinfrescare=1; + } echo "
    CAMPAGNA TRONCOS RESTRICCIo`N DELETE
    \n"; echo ""; - $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; + $user_group = $row[3]; echo "
    MODIFICARE UN RECORD CONF TEMPLATE: $row[0]
    \n"; echo "\n"; @@ -24715,6 +28824,10 @@ if ($ADD==331111111111) echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
    Template ID: $template_id
    Nome modello: $NWB#vicidial_conf_templates-template_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_conf_templates-user_group$NWE
    Template Sommario: $NWB#vicidial_conf_templates-template_contents$NWE
    \n"; @@ -24729,7 +28842,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24760,7 +28873,7 @@ if ($ADD==331111111111) $active_phones = 0; $inactive_phones = 0; - $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rsltx); $camp_lists=''; @@ -24791,7 +28904,7 @@ if ($ADD==331111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages a questo modello di conf
    \n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this conf template\n"; } } else @@ -24808,12 +28921,17 @@ if ($ADD==331111111111) if ($ADD==341111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_carriers==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id"; + $modify_footer_rinfrescare=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; 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 from vicidial_server_carriers where carrier_id='$carrier_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $carrier_id = $row[0]; @@ -24827,6 +28945,7 @@ if ($ADD==341111111111) $server_ip = $row[8]; $active = $row[9]; $carrier_description = $row[10]; + $user_group = $row[11]; echo "
    MODIFICARE UN RECORD DEL VETTORE: $row[0]\n"; echo "\n"; @@ -24836,10 +28955,14 @@ if ($ADD==341111111111) echo "
    Vettore ID: $carrier_id
    Nome del vettore: $NWB#vicidial_server_carriers-carrier_name$NWE
    Carrier Descrizione: $NWB#vicidial_server_carriers-carrier_description$NWE
    Admin Gruppo Utente: $NWB#vicidial_server_carriers-user_group$NWE
    Stringa di registrazione: $NWB#vicidial_server_carriers-registration_string$NWE
    Template ID: \n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -24928,7 +29062,7 @@ if ($ADD==351111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per vedere chages Admin a questa voce TTS\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this TTS entry\n"; } } else @@ -24945,18 +29079,24 @@ if ($ADD==351111111111) if ($ADD==361111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_moh==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';"; + $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_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; @@ -24905,6 +29033,7 @@ if ($ADD==351111111111) $active = $row[2]; $tts_text = $row[3]; $tts_voice = $row[4]; + $user_group = $row[5]; echo "
    MODIFICA A TTS RECORD: $tts_id\n"; echo "\n"; @@ -24914,6 +29043,11 @@ if ($ADD==351111111111) echo "
    TTS ID: $tts_id
    TTS Nome: $NWB#vicidial_tts_prompts-tts_name$NWE
    Attivo: $NWB#vicidial_tts_prompts-active$NWE
    Admin Gruppo Utente: $NWB#vicidial_tts_prompts-user_group$NWE
    TTS Voice: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Text: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $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_query($stmt, $link); $row=mysql_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"; @@ -24965,10 +29105,16 @@ if ($ADD==361111111111) 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 Nome: $NWB#vicidial_music_on_hold-moh_name$NWE
    Admin Gruppo Utente: $NWB#vicidial_music_on_hold-user_group$NWE
    Attivo: $NWB#vicidial_music_on_hold-active$NWE
    Ordine casuale: $NWB#vicidial_music_on_hold-random$NWE
    Audio Files: \n"; + echo "
    file Audios: \n"; ##### get files listing for rank/delete options $stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;"; $rsltx=mysql_query($stmt, $link); @@ -25006,7 +29152,7 @@ if ($ADD==361111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per vedere chages Admin a questo Music On Hold entrata\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this Music On Hold entry\n"; } } else @@ -25023,12 +29169,17 @@ if ($ADD==361111111111) if ($ADD==371111111111) { - if ($LOGast_admin_access==1) + if ( ($LOGast_admin_access==1) or ($LOGmodify_voicemail==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id"; + $modify_footer_rinfrescare=1; + } echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -25064,7 +29240,7 @@ if ($ADD==371111111111) } if ($LOGuser_level >= 9) { - echo "

    Clicca qui per vedere chages Admin a questa casella vocale\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to this voicemail box\n"; } } else @@ -25075,6 +29251,223 @@ if ($ADD==371111111111) } +###################### +# ADD=381111111111 modify screen label in the system +###################### +if ($ADD==381111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_labels==1) ) + { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id"; + $modify_footer_rinfrescare=1; + } + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $voicemail_id = $row[0]; @@ -25039,6 +29190,9 @@ if ($ADD==371111111111) $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]; echo "
    MODIFICARE un messaggio vocale BOX: $tts_id\n"; echo "\n"; @@ -25050,7 +29204,29 @@ if ($ADD==371111111111) echo "
    Name: $NWB#vicidial_voicemail-fullname$NWE
    Email:$NWB#vicidial_voicemail-email$NWE
    Attivo: $NWB#vicidial_voicemail-active$NWE
    Admin Gruppo Utente: $NWB#vicidial_voicemail-user_group$NWE
    Eliminare Casella Vocale Dopo Email:$NWB#vicidial_voicemail-delete_vm_after_email$NWE
    Casella Vocale Zone: $NWB#vicidial_voicemail-voicemail_timezone$NWE
    Casella Vocale Opzioni: $NWB#vicidial_voicemail-voicemail_options$NWE
    Messaggi Nuovi: $messages
    Messaggi Vecchi: $old_messages
    \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_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $label_id = $row[0]; + $label_name = $row[1]; + $active = $row[2]; + $label_hide_field_logs = $row[3]; + $label_title = $row[4]; + $label_first_name = $row[5]; + $label_middle_initial = $row[6]; + $label_last_name = $row[7]; + $label_address1 = $row[8]; + $label_address2 = $row[9]; + $label_address3 = $row[10]; + $label_city = $row[11]; + $label_state = $row[12]; + $label_province = $row[13]; + $label_postal_code = $row[14]; + $label_vendor_lead_code = $row[15]; + $label_gender = $row[16]; + $label_phone_number = $row[17]; + $label_phone_code = $row[18]; + $label_alt_phone = $row[19]; + $label_security_phrase = $row[20]; + $label_email = $row[21]; + $label_comments = $row[22]; + $user_group = $row[23]; + + echo "
    Modificare l'etichetta SCREEN: $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#vicidial_screen_labels-label_name$NWE
    Attivo: $NWB#vicidial_screen_labels-active$NWE
    Admin Gruppo Utente: $NWB#vicidial_screen_labels-user_group$NWE
    Nascondi etichette in registri delle chiamate: $NWB#vicidial_screen_labels-label_hide_field_logs$NWE
    Titolo Label: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Nome: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Secondo Nome: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Cognome: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Indirizzo1: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Indirizzo2: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Indirizzo3: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Città: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Stato: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Provincia: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Codice Etichetta postale: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Vendor Code Piombo: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta di genere: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Numero di telefono: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Telefono Codice: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta Alt Phone: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Security frase: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Etichetta e-mail: $NWB#vicidial_screen_labels-default_field_labels$NWE
    Label Note: $NWB#vicidial_screen_labels-default_field_labels$NWE
    \n"; + + echo "
    \n"; + + + echo "


    \n"; + echo " Campagne che utilizzano QUESTA ETICHETTA SCREEN:
    \n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
    $row[0] $row[1]


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

    CANCELLARE QUESTA ETICHETTA SCREEN\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questa etichetta sullo schermo\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + + +###################### +# ADD=391111111111 modify contact in the system +###################### +if ($ADD==391111111111) + { + if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) + { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; + $modify_footer_rinfrescare=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_query($stmt, $linkALT); + $row=mysql_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 "
    Modifica contatto: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
    Nome: $NWB#contact_information$NWE
    Cognome: $NWB#contact_information$NWE
    Office Number: $NWB#contact_information$NWE
    Cell Number: $NWB#contact_information$NWE
    Numero Altro 1: $NWB#contact_information$NWE
    Numero Altro 2: $NWB#contact_information$NWE
    BU Name: $NWB#contact_information$NWE
    Department: $NWB#contact_information$NWE
    Gruppo: $NWB#contact_information$NWE
    Job Title: $NWB#contact_information$NWE
    Location: $NWB#contact_information$NWE
    \n"; + + echo "
    \n"; + + if ($LOGast_delete_phones > 0) + { + echo "

    Cancellare questo contatto\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Clicca qui per vedere i cambiamenti di amministratore per questo contatto\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -25083,6 +29476,11 @@ if ($ADD==3111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_rinfrescare=1; + } echo "\n"; + + } -echo "\n"; - - -} - echo "
    \n"; echo ""; @@ -25129,6 +29527,11 @@ if ($ADD==31111111111111) { if ($LOGast_admin_access==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; @@ -25176,10 +29579,68 @@ if ($ADD==311111111111111) { if ($LOGmodify_servers==1) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=311111111111111"; + $modify_footer_rinfrescare=1; + } 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"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + 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"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -25481,11 +30009,32 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -25507,10 +30056,13 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; - + echo "\n"; + echo "\n"; + echo "\n"; echo "
    \n"; echo ""; - $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 from system_settings;"; + $stmt="SELECT count(*) from vicidial_phone_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_phone_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_postal_codes_count = $row[0]; + + $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vicidial_nanpa_prefix_codes_count = $row[0]; + + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $rowx=mysql_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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -25264,7 +29725,29 @@ if ($ADD==311111111111111) $default_phone_registration_password = $row[79]; $default_phone_login_password = $row[80]; $default_server_password = $row[81]; - + $admin_modify_rinfrescare = $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]; echo "
    MODIFICA IMPOSTAZIONI DI SISTEMA\n"; echo "\n"; @@ -25275,6 +29758,10 @@ if ($ADD==311111111111111) echo "
    DB Schema Update Date: $db_schema_update_date
    Auto Utente-add Value: $auto_user_add_value
    Installare Data: $install_date
    Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE
    Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
    UsA Non-Latino: $NWB#settings-use_non_latin$NWE
    Webroot Escribible: $NWB#settings-webroot_writable$NWE
    El Agente de VICIDIAL Inhabilita La Exhibicio`n:$NWB#settings-vicidial_agent_disable$NWE
    Permetti messaggi SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
    URL Home Amministrazione: $NWB#settings-admin_home_url$NWE
    Admin Modificare Auto-Refresh: $NWB#settings-admin_modify_rinfrescare$NWE
    Admin No-Cache: $NWB#settings-nocache_admin$NWE
    Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
    Enable Agent Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
    Abilita Disposition Logfile agente: $NWB#settings-enable_agc_dispo_log$NWE
    Orologio End of Day:$NWB#settings-timeclock_end_of_day$NWE
    Predefinito locale GMT: (No ajustar para el DST)$NWB#settings-default_local_gmt$NWE
    Predefinito Casella Vocale Zone: $NWB#settings-default_voicemail_timezone$NWE
    Agenti chiamate Ripristina: $NWB#settings-agents_calls_reset$NWE
    Ultimo Logout orologio automatico: $timeclock_last_reset_date
    Agente Screen Formato Data Header:
    Centrale Sound Control Attivo: $NWB#settings-sounds_central_control_active$NWE
    Suoni Web Server: $NWB#settings-sounds_web_server$NWE
    Suoni Web Directory: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
    Admin Web Directory: $NWB#settings-admin_web_directory$NWE
    Web Directory Admin: $NWB#settings-admin_web_directory$NWE
    Attivo Server Casella Vocale:
    Consentire Custom Dialplan Entries: $NWB#settings-allow_custom_dialplan$NWE
    PLLB Raggruppamento Limit: $NWB#settings-pllb_grouping_limit$NWE
    Genera Cross-Server Extensions Phone: $NWB#settings-generate_cross_server_exten$NWE
    Territori Utente Attivo: $NWB#settings-user_territories_active$NWE
    Consentire Webform Seconda: $NWB#settings-enable_second_webform$NWE
    Consentire l-integrazione TTS: $NWB#settings-enable_tts_integration$NWE
    Enable CallCard: $NWB#settings-callcard_enabled$NWE
    Abilita CallCard: $NWB#settings-callcard_enabled$NWE
    Enable Custom List Fields: $NWB#settings-custom_fields_enabled$NWE
    Abilita campi elenco personalizzati: $NWB#settings-custom_fields_enabled$NWE
    First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Abilita chiamate di prova della campagna: $NWB#settings-test_campaign_calls$NWE
    Default Phone Registrazione Password: $NWB#settings-default_phone_registration_password$NWE     Strength:
    Abilita Statistiche elenco esteso: $NWB#settings-expanded_list_stats$NWE
    Default Login Telefono Password: $NWB#settings-default_phone_login_password$NWE     Strength:
    Abilita IndicativoLocalità Campagna CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
    Default Server Password: $NWB#settings-default_server_password$NWE     Strength:
    Abilita distanza sostituisce interno di un agente: $NWB#settings-did_ra_extensions_enabled$NWE
    Enable Contacts: $NWB#settings-contacts_enabled$NWE
    Accedi primo trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Predefinito Password Telefonoword Registrazione: $NWB#settings-default_phone_registration_password$NWE     Forza:
    Predefinito Password Telefonoword Login: $NWB#settings-default_phone_login_password$NWE     Forza:
    Default Server password: $NWB#settings-default_server_password$NWE     Forza:
    Slave Database Server: $NWB#settings-slave_db_server$NWE
    Rapporti to use Slave DB:
    Rapporti da utilizzare DB Slave:
    Custom Dialplan entrata: $NWB#settings-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan: $NWB#settings-custom_dialplan_entry$NWE
    Ricarica Dialplan sui server: $NWB#settings-reload_dialplan_on_servers$NWE
    Custom Dialplan entrata: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Personalizzato Entry Dialplan: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Nascondi etichette in registri delle chiamate: $NWB#settings-label_hide_field_logs$NWE
    Label Title: $NWB#settings-default_field_labels$NWE
    Titolo Label: $NWB#settings-default_field_labels$NWE
    Label Nome: $NWB#settings-default_field_labels$NWE
    Etichetta Nome: $NWB#settings-default_field_labels$NWE
    Label Secondo Nome: $NWB#settings-default_field_labels$NWE
    Label Cognome: $NWB#settings-default_field_labels$NWE
    Etichetta Cognome: $NWB#settings-default_field_labels$NWE
    Label Address1: $NWB#settings-default_field_labels$NWE
    Etichetta Indirizzo1: $NWB#settings-default_field_labels$NWE
    Label Address2: $NWB#settings-default_field_labels$NWE
    Etichetta Indirizzo2: $NWB#settings-default_field_labels$NWE
    Label Address3: $NWB#settings-default_field_labels$NWE
    Etichetta Indirizzo3: $NWB#settings-default_field_labels$NWE
    Label Citta`: $NWB#settings-default_field_labels$NWE
    Label Città: $NWB#settings-default_field_labels$NWE
    Label State: $NWB#settings-default_field_labels$NWE
    Etichetta Stato: $NWB#settings-default_field_labels$NWE
    Label Provincia: $NWB#settings-default_field_labels$NWE
    Etichetta Provincia: $NWB#settings-default_field_labels$NWE
    Label CAP: $NWB#settings-default_field_labels$NWE
    Codice Etichetta postale: $NWB#settings-default_field_labels$NWE
    Label Vendor Lead Code: $NWB#settings-default_field_labels$NWE
    Etichetta Vendor Code Piombo: $NWB#settings-default_field_labels$NWE
    Label Sesso: $NWB#settings-default_field_labels$NWE
    Etichetta di genere: $NWB#settings-default_field_labels$NWE
    Label Numero di Telefono: $NWB#settings-default_field_labels$NWE
    Label Numero di telefono: $NWB#settings-default_field_labels$NWE
    Label Phone Code: $NWB#settings-default_field_labels$NWE
    Etichetta Telefono Codice: $NWB#settings-default_field_labels$NWE
    Label Alt Phone: $NWB#settings-default_field_labels$NWE
    Etichetta Alt Phone: $NWB#settings-default_field_labels$NWE
    Label Frase De Seguridad: $NWB#settings-default_field_labels$NWE
    Label Security frase: $NWB#settings-default_field_labels$NWE
    Label Email:$NWB#settings-default_field_labels$NWE
    Etichetta e-mail: $NWB#settings-default_field_labels$NWE
    Label Note: $NWB#settings-default_field_labels$NWE
    QC Attivo Caratteristiche: $NWB#settings-qc_features_active$NWE
    QC Ultimo Tirare Tempo: $qc_last_pull_time
    Default Codecs: $NWB#settings-default_codecs$NWE
    Default Webphone: $NWB#settings-default_webphone$NWE
    Default External IP Server: $NWB#settings-default_external_server_ip$NWE
    Webphone URL: $NWB#settings-webphone_url$NWE
    Webphone System Key: $NWB#settings-webphone_systemkey$NWE
    Predefinite Codecs: $NWB#settings-default_codecs$NWE
    Predefinito Webphone: $NWB#settings-default_webphone$NWE
    IP di default del server esterno: $NWB#settings-default_external_server_ip$NWE
    URL webphone: $NWB#settings-webphone_url$NWE
    Webphone Key System: $NWB#settings-webphone_systemkey$NWE
    Risposta No-Log: $NWB#settings-noanswer_log$NWE
    DID Log in agenzia: $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 tabelle: $NWB#settings-tables_use_alt_log_db$NWE
    Permita La Registracion De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
    IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
    QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallEsito: $NWB#settings-queuemetrics_callstatus$NWE
    QueueMetrics Addmember Enabled: $NWB#settings-queuemetrics_addmember_enabled$NWE
    QueueMetrics Dispo Pause Codice: $NWB#settings-queuemetrics_dispo_pause$NWE
    Telefono Telefono QueueMetrics Ambiente Append: $NWB#settings-queuemetrics_pe_phone_append$NWE
    Attiva Vtiger Integrazione: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Clicca qui per sincronizzare gli utenti con Vtiger\n"; @@ -25527,7 +30079,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages per le impostazioni di sistema\n"; + echo "

    Clicca qui per vedere i cambiamenti Admin to the system settings\n"; } } else @@ -25548,15 +30100,32 @@ if ($ADD==311111111111111) if ($ADD==321111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) or ($LOGmodify_statuses==1) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=321111111111111"; + $modify_footer_rinfrescare=1; + } echo "
    \n"; echo ""; echo "
    \n"; echo "ESITI DI DEFAULT IN QUESTO SISTEMA:   $NWB#vicidial_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"; + echo "\n"; ##### get status category listings for dynamic pulldown $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; @@ -25573,8 +30142,7 @@ if ($ADD==321111111111111) $o++; } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $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_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -25595,15 +30163,22 @@ if ($ADD==321111111111111) echo "\n"; echo "$rowx[0]\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; } @@ -25631,14 +30197,16 @@ if ($ADD==321111111111111) echo "
    AGGIUNGI UN NUOVO ESITO DI DEFAULT
    \n"; echo "\n"; echo "Esito:   \n"; - echo "Descrizione:
    \n"; + echo "Descrizione:   \n"; echo "Selezionabile:   \n"; - echo "Risposta Umana:   \n"; + echo "Risposta Umana:
    \n"; echo "Sale:   \n"; echo "DNC:   \n"; - echo "Customer Contact:  
    \n"; - echo "Not Interested:   \n"; + echo "Customer Contact:   \n"; + echo "Not Interested:  
    \n"; echo "Unworkable:   \n"; + echo "Callback:   \n"; + echo "Completed:   \n"; echo "Categoria: \n"; echo "
    ESITODESCRIZIONESELEZIO
    NABILE
    RISPOSTA
    UMANA
    CATEGORIAMODIFICA/CANCELLA
    S
    T
    A
    T
    U
    S
    DESCRIZIONECATEGORIA
    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
    MODIFICA/CANCELLA
    \n"; echo "\n"; - echo "         \n"; + 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])) @@ -25614,15 +30189,6 @@ if ($ADD==321111111111111) { echo "CANCELLA\n"; } - - echo "
    \n"; - - echo "  Sale:   \n"; - echo "  DNC:   \n"; - echo "  Customer Contact:   \n"; - echo "  Not Interested:   \n"; - echo "  Unworkable:   \n"; - echo "
    \n"; echo ""; @@ -25710,7 +30283,7 @@ if ($ADD==331111111111111) $CATstatuses.=" $rowx[0]"; $q++; } - $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $q=0; @@ -25774,6 +30347,11 @@ if ($ADD==341111111111111) { if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_rinfrescare_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=341111111111111"; + $modify_footer_rinfrescare=1; + } echo "\n"; echo "
    \n"; echo ""; @@ -25862,7 +30440,7 @@ if ($ADD==550) echo "
    Livello Utente:
    Gruppo Utente: "; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -26219,6 +30801,7 @@ if ($ADD==10) echo ""; echo ""; echo ""; + echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; @@ -26243,6 +30826,7 @@ if ($ADD==100) echo ""; $LISTlink='stage=LISTIDDOWN'; + $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; @@ -26250,6 +30834,8 @@ if ($ADD==100) $SQLorder='order by list_id'; if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} + if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} @@ -26266,7 +30852,7 @@ if ($ADD==100) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $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_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -26199,6 +30780,7 @@ if ($ADD==10) echo "CAMPAGNA ID
    NOME
    ACTIVE   GROUP   DIAL METODO  
    $row[0]   $row[1]   $row[2]   $row[7]   $row[3]  
    \n"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -26333,7 +30919,7 @@ if ($ADD==1000) echo "
    ID LISTANOME LISTANOME LISTADESCRIZIONERTIMEPORTA CONTE
    "; echo "\n"; echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -26361,6 +30948,7 @@ if ($ADD==1000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26379,7 +30967,7 @@ if ($ADD==1300) echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $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_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); @@ -26344,6 +30930,7 @@ if ($ADD==1000) echo "NOMEPRIORITYATTIVOGRUPPO ADMINTIMECOLORMODIFICA $row[1] $row[2] $row[3] $row[6] $row[4]  MODIFICA
    "; echo "\n"; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26407,6 +30996,7 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -26425,7 +31015,7 @@ if ($ADD==1500) echo "
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call from vicidial_inbound_dids order by did_pattern"; + $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_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); @@ -26390,6 +30978,7 @@ if ($ADD==1300) echo "DIDDESCRIZIONEATTIVOGRUPPO ADMINROUTERECMODIFICA $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -26450,6 +31041,7 @@ if ($ADD==1500) $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; + $menu_group[$o] = $row[4]; $o++; } @@ -26465,6 +31057,7 @@ if ($ADD==1500) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -26484,16 +31077,17 @@ if ($ADD==1700) echo "
    \n"; echo ""; - $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $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_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); @@ -26434,6 +31024,7 @@ if ($ADD==1500) echo "
    MENU IDNOMEGRUPPOPROMPTTIMEOUTOPTIONS
    $menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]
    \n"; echo ""; - $stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id group by filter_phone_group_id order by filter_phone_group_id"; + $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_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); - echo "
    FILTER PHONE GROUP LISTINGS:\n"; + echo "
    FILTRO TELEFONO ANNUNCI DI GRUPPO:\n"; echo "
    \n"; echo ""; echo ""; echo ""; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -26510,13 +31104,14 @@ if ($ADD==1700) 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 from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') order by filter_phone_group_id;"; + $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_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -26530,6 +31125,7 @@ if ($ADD==1700) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; $o++; @@ -26547,7 +31143,28 @@ if ($ADD==10000) echo "
    FPG IDFPG NAMEDESCRIZIONEGRUPPO ADMINPHONES COUNTMODIFICA
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFICA
    $row[0] $row[1] $row[2] $row[4] $row[3]MODIFICA
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start"; + # gather list of allowed users + $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; + $rslt=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rslt); + $o=0; + $user_start_SQL=''; + while ($users_to_print > $o) + { + $row=mysql_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_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -26594,11 +31211,11 @@ 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 order by extension_group_id,rank,extension"; + $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_query($stmt, $link); $extensiongroups_to_print = mysql_num_rows($rslt); - echo "
    EXTENSION GROUP LISTINGS:\n"; + echo "
    ESTENSIONE DEL GRUPPO ANNUNCI:\n"; echo "
    \n"; echo ""; echo ""; @@ -26641,7 +31258,7 @@ if ($ADD==100000) echo "
    GRUPPO
    \n"; echo ""; - $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); $usergroups_to_print = mysql_num_rows($rslt); @@ -26680,7 +31297,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26703,6 +31321,7 @@ if ($ADD==1000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26719,7 +31338,7 @@ if ($ADD==10000000) echo "
    \n"; echo ""; - $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_query($stmt, $link); $scripts_to_print = mysql_num_rows($rslt); @@ -26690,6 +31307,7 @@ if ($ADD==1000000) echo "SCRIPT IDNome scriptACTIVE   GRUPPO ADMIN   MODIFICA
    $row[0] $row[1] $row[2] $row[3]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26740,6 +31360,7 @@ if ($ADD==10000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26756,7 +31377,10 @@ if ($ADD==100000000) echo "
    \n"; echo ""; - $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_query($stmt, $link); $filters_to_print = mysql_num_rows($rslt); @@ -26728,6 +31347,7 @@ if ($ADD==10000000) echo "
    FILTER IDFILTER NAMEGRUPPO ADMINMODIFICA
    $row[0] $row[1] $row[2]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26781,6 +31406,7 @@ if ($ADD==100000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26796,7 +31422,7 @@ if ($ADD==1000000000) echo "
    \n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + 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_query($stmt, $link); $calltimes_to_print = mysql_num_rows($rslt); @@ -26767,6 +31391,7 @@ if ($ADD==100000000) echo "CALLTIME NOMEINIZIO DI MORADEFAULT STOPGRUPPO ADMINMODIFICA
    $row[1] $row[2] $row[3] $row[4] MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26823,6 +31450,7 @@ if ($ADD==1000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26838,7 +31466,7 @@ if ($ADD==130000000) echo "
    \n"; echo ""; - $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $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_query($stmt, $link); $statecalltimes_to_print = mysql_num_rows($rslt); @@ -26808,6 +31434,7 @@ if ($ADD==1000000000) echo "CALLTIME NOMEINIZIO DI MORADEFAULT STOPGRUPPO ADMINMODIFICA
    $row[2] $row[3] $row[4] $row[5] MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26865,6 +31494,7 @@ if ($ADD==130000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26893,7 +31523,7 @@ if ($ADD==10000000000) if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} - $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $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_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); @@ -26907,6 +31537,7 @@ if ($ADD==10000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26925,7 +31556,8 @@ if ($ADD==10000000000) - "; + + "; echo "\n"; $o++; } @@ -26941,7 +31573,7 @@ if ($ADD==12000000000) echo "
    \n"; echo ""; - $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $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_query($stmt, $link); $shifts_to_print = mysql_num_rows($rslt); @@ -26850,6 +31478,7 @@ if ($ADD==130000000) echo "SHIFT INIZIOSHIFT DURATASETTIMANALEGRUPPO ADMINMODIFICA
    $row[2] $row[3] $row[4] $row[5] MODIFICA
    ESITONOMEVMAILGRUPPOLINK
    $row[5] $row[6] $row[7]$row[8]$row[8]$row[9]MODIFICA | STATISTICHE
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -26964,6 +31597,7 @@ if ($ADD==12000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -26979,7 +31613,7 @@ if ($ADD==13000000000) echo "
    \n"; echo ""; - $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -26951,6 +31583,7 @@ if ($ADD==12000000000) echo "ALIAS IDALIAS NOMELogin ELENCO TELEFONICOGRUPPOMODIFICA
    $row[0]$row[1]$row[2]$row[3]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27006,6 +31641,7 @@ if ($ADD==13000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27021,7 +31657,7 @@ if ($ADD==100000000000) echo "
    \n"; echo ""; - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $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_query($stmt, $link); $phonealias_to_print = mysql_num_rows($rslt); @@ -26991,6 +31625,7 @@ if ($ADD==13000000000) echo "CID NUMEROCID NOMEATTIVOGRUPPO ADMINMODIFICA
    $row[2]$row[3]$row[4]$row[5]MODIFICA
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $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_query($stmt, $link); $servers_to_print = mysql_num_rows($rslt); @@ -27067,7 +31703,7 @@ if ($ADD==130000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27088,6 +31725,7 @@ if ($ADD==130000000000) {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27103,7 +31741,7 @@ if ($ADD==140000000000) echo "
    \n"; echo ""; - $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_query($stmt, $link); $templates_to_print = mysql_num_rows($rslt); @@ -27076,6 +31712,7 @@ if ($ADD==130000000000) echo "
    Template IDNome modelloGRUPPO ADMINMODIFICA
    $row[0]$row[1]$row[2]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27132,6 +31771,7 @@ if ($ADD==140000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27148,7 +31788,7 @@ if ($ADD==150000000000) echo "
    \n"; echo ""; - $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $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_query($stmt, $link); $carriers_to_print = mysql_num_rows($rslt); @@ -27116,6 +31754,7 @@ if ($ADD==140000000000) echo "ProtocolRegistrazioneAttivoGRUPPO ADMINMODIFICA
    $row[3]$row[4]$row[5]$row[6]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27179,6 +31820,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27195,7 +31837,7 @@ if ($ADD==160000000000) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id"; + $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_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -27160,6 +31800,7 @@ if ($ADD==150000000000) echo "AttivoTTS VoiceTTS TextGRUPPO ADMINMODIFICA
    $row[2]$row[4]$row[3]$row[5]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27224,6 +31867,7 @@ if ($ADD==160000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27240,7 +31884,7 @@ if ($ADD==170000000000) echo "
    \n"; echo ""; - $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $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_query($stmt, $link); $moh_to_print = mysql_num_rows($rslt); @@ -27206,6 +31848,7 @@ if ($ADD==160000000000) echo "MOH NameAttivoOrdine casualeGRUPPO ADMINMODIFICA
    $row[1]$row[2]$row[3]$row[4]MODIFICA
    "; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -27270,6 +31915,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -27278,6 +31924,108 @@ if ($ADD==170000000000) } +###################### +# ADD=180000000000 display all screen label entries +###################### +if ($ADD==180000000000) + { + echo "
    \n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $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_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -27253,6 +31897,7 @@ if ($ADD==170000000000) echo "Messaggi NuoviMessaggi VecchiDeleteGRUPPO ADMINMODIFICA
    $row[3]$row[4]$row[5]$row[6]MODIFICA
    "; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; @@ -277,22 +349,31 @@ else { if (strlen($log_lead_id)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "' $LOGallowed_listsSQL"; } if (strlen($log_phone)>0) { - $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; - $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "' $LOGallowed_listsSQL"; $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; } - + + if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $rslt=mysql_query("$stmtA", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no outbound calls matching your search criteria

    \n"; + echo "Esistono no outbound calls matching your search criteria

    \n"; echo "
    \n"; } else @@ -315,6 +396,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -342,7 +439,7 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound calls matching your search criteria

    \n"; + echo "Esistono no inbound calls matching your search criteria

    \n"; echo "
    \n"; } else @@ -364,6 +461,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -392,7 +505,7 @@ else if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo "\n

    \n"; - echo "There are no inbound did calls matching your search criteria

    \n"; + echo "Esistono no inbound did calls matching your search criteria

    \n"; echo "
    \n"; } else @@ -410,6 +523,22 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[1]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[1] = preg_replace("/./",'X',$phone_temp);} + } + } $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -457,7 +586,7 @@ else ##### BEGIN Lead search ##### if ($vendor_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' $LOGallowed_listsSQL"; } else { @@ -465,18 +594,18 @@ else { if ($alt_phone_search=="Yes") { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } else { - $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL"; } } else { if ($lead_id) { - $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' $LOGallowed_listsSQL"; } else { @@ -499,7 +628,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; } else { @@ -516,7 +645,7 @@ else if ($SQLctA > 0) {$andA = 'and';} $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; } - $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; } else { @@ -532,7 +661,7 @@ else $results_to_printX=0; if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) { - $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' $LOGallowed_listsSQL limit 1000;"; $rsltX=mysql_query($stmtX, $link); $results_to_printX = mysql_num_rows($rsltX); if ($DB) @@ -556,6 +685,16 @@ else echo "\n\n$stmt\n\n"; } + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); if ( ($results_to_print < 1) and ($results_to_printX < 1) ) @@ -589,6 +728,59 @@ else while ($results_to_print > $o) { $row=mysql_fetch_row($rslt); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "NASCONDILEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + $o++; $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) @@ -619,6 +811,13 @@ else $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $STARTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); } ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php index 1a8e7bcb..ad441c1a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # @@ -9,10 +9,12 @@ # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel # 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# 110922-2331 - Added modify_audiostore user option for access +# 111122-1332 - Added more filename filtering # -$version = '2.2.0-3'; -$build = '100401-1037'; +$version = '2.4-5'; +$build = '111122-1332'; $MT[0]=''; @@ -126,7 +128,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -196,8 +198,24 @@ if ($action == "AUTOUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,8 +302,24 @@ if ($action == "MANUALUPLOAD") { $AF_path = preg_replace("/ /",'\ ',$AF_path); $AF_path = preg_replace("/@/",'\@',$AF_path); + $AF_path = preg_replace("/\(/",'\(',$AF_path); + $AF_path = preg_replace("/\)/",'\)',$AF_path); + $AF_path = preg_replace("/\#/",'\#',$AF_path); + $AF_path = preg_replace("/\&/",'\&',$AF_path); + $AF_path = preg_replace("/\*/",'\*',$AF_path); + $AF_path = preg_replace("/\!/",'\!',$AF_path); + $AF_path = preg_replace("/\%/",'\%',$AF_path); + $AF_path = preg_replace("/\^/",'\^',$AF_path); $audiofile_name = preg_replace("/ /",'',$audiofile_name); $audiofile_name = preg_replace("/@/",'',$audiofile_name); + $audiofile_name = preg_replace("/\(/",'',$audiofile_name); + $audiofile_name = preg_replace("/\)/",'',$audiofile_name); + $audiofile_name = preg_replace("/\#/",'',$audiofile_name); + $audiofile_name = preg_replace("/\&/",'',$audiofile_name); + $audiofile_name = preg_replace("/\*/",'',$audiofile_name); + $audiofile_name = preg_replace("/\!/",'',$audiofile_name); + $audiofile_name = preg_replace("/\%/",'',$audiofile_name); + $audiofile_name = preg_replace("/\^/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/calendar_db.js b/agc_2-X/trunk/LANG_www/vicidial_it/calendar_db.js index ee6c8dd3..1d19986b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/calendar_db.js +++ b/agc_2-X/trunk/LANG_www/vicidial_it/calendar_db.js @@ -9,7 +9,7 @@ var A_TCALDEF = { 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. - 'imgpath' : 'images/' // directory with calendar images + 'imgpath' : '../vicidial/images/' // directory with calendar images } // date parsing function function f_tcalParseDate (s_date) { diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php index a3d3f05f..2f8a3f94 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -25,6 +25,14 @@ # 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # Allow level 7 users to view this report +# 110224-1135 - Added call_notes export option +# 110316-2121 - Added export_fields option +# 110329-1330 - Added more fields to EXTENDED option +# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495 +# 110721-2027 - Added IVR export options +# 110911-1445 - Added did fields to the EXTENDED format +# 111010-1930 - Added ALTERNATE_1 format +# 111104-1240 - Added user_group restrictions for selecting in-groups # require("dbconnect.php"); @@ -56,14 +64,20 @@ if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["ivr_export"])) {$ivr_export=$_GET["ivr_export"];} + elseif (isset($_POST["ivr_export"])) {$ivr_export=$_POST["ivr_export"];} 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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} if (strlen($shift)<2) {$shift='ALL';} -$report_name = 'Export Calls Report'; +$report_name = 'Esporta invita Relazione'; $db_source = 'M'; ############################################# @@ -90,7 +104,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; +# echo "\n"; } $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -113,7 +127,7 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + echo "Utentename/Password non validi or no export report permission: |$PHP_AUTH_USER|\n"; exit; } @@ -123,18 +137,20 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; -if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -149,6 +165,25 @@ if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) } $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -268,6 +303,18 @@ if ($run_export > 0) $status_SQL = "and vl.status IN($status_SQL)"; } + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + if ($export_fields == 'ALTERNATE_1') + { + $export_fields_SQL = ",called_count,last_local_call_time"; + $EFheader = "|called_count|last_local_call_time"; + } if ($DB > 0) { @@ -289,13 +336,13 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); if ($outbound_to_print < 1) { - echo "There are no outbound calls during this time period for these parameters\n"; + echo "Esistono no outbound calls during this time period for these parameters\n"; exit; } else @@ -310,9 +357,25 @@ if ($run_export > 0) $export_status[$k] = $row[2]; $export_list_id[$k] = $row[8]; $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; $export_vicidial_id[$k] = $row[36]; $export_entry_list_id[$k] = $row[37]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[39]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[38]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[38]\t$row[39]\t$row[40]\t$row[41]\t$row[42]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; $outbound_calls++; @@ -322,13 +385,13 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) { - echo "There are no inbound calls during this time period for these parameters\n"; + echo "Esistono no inbound calls during this time period for these parameters\n"; exit; } else @@ -345,7 +408,23 @@ if ($run_export > 0) $export_lead_id[$k] = $row[35]; $export_vicidial_id[$k] = $row[36]; $export_entry_list_id[$k] = $row[37]; - $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $export_uniqueid[$k] = $row[38]; + $export_fieldsDATA=''; + if ($export_fields == 'ALTERNATE_1') + { + $ALTcall_date = $row[0]; + $LASTcall_date = $row[40]; + $ALTcall_date = preg_replace("/-| |:|\d\d$/",'',$ALTcall_date); + $LASTcall_date = preg_replace("/-| |:|\d\d$/",'',$LASTcall_date); + $export_fieldsDATA = "$row[39]|$LASTcall_date|"; + $export_rows[$k] = "$ALTcall_date|$row[1]|$row[2]|$row[5]|$row[6]|$row[7]|$row[13]|$row[15]|$row[30]|$export_fieldsDATA"; + } + else + { + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + } $i++; $k++; } @@ -359,7 +438,7 @@ if ($run_export > 0) $SQL_log = "$stmt|$stmtA|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN ESPORTAZIONE CHIAMATE RELAZIONE', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -378,10 +457,11 @@ if ($run_export > 0) if ($header_row=='YES') { - $CFheader = ''; $RFheader = ''; - if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) - {$CFheader = "\tcustom_fields";} + $NFheader = ''; + $CFheader = ''; + $IVRheader = ''; + $EXheader = ''; if ($rec_fields=='ID') {$RFheader = "\trecording_id";} if ($rec_fields=='FILENAME') @@ -390,8 +470,29 @@ if ($run_export > 0) {$RFheader = "\trecording_location";} if ($rec_fields=='ALL') {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";} + if ($export_fields == 'ALTERNATE_1') + {$EXheader = "|caller_code";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ($ivr_export=='YES') + { + $IVRheader = "\tivr_path"; + if ($export_fields == 'ALTERNATE_1') + {$IVRheader = "|ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} - echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name$RFheader$CFheader\r\n"; + if ($export_fields == 'ALTERNATE_1') + { + echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } + else + { + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; + } } $i=0; @@ -468,12 +569,157 @@ if ($run_export > 0) {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} } + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='ALTERNATE_1') + { + $extended_data = ''; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "$row[0]"; + $export_call_id[$i] = $row[0]; + } + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "";} + $extended_data .= "$extended_data_a"; + } + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + $stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdid_ct = mysql_num_rows($rslt); + if ($vcdid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d = "\t$row[0]\t$row[1]"; + + $stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcdidx_ct = mysql_num_rows($rslt); + if ($vcdidx_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_d .= "\t$row[0]"; + } + else + {$extended_data_d .= "\t";} + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + if (strlen($extended_data_d)<1) + {$extended_data_d = "\t\t\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + $ivr_data=''; + if ($ivr_export=='YES') + { + $ivr_path=''; + if (strlen($export_uniqueid[$i]) > 0) + { + $IVRdelimiter='|'; + if ($export_fields=='ALTERNATE_1') + {$IVRdelimiter='^';} + $stmt="select menu_id,UNIX_TIMESTAMP(event_date) from vicidial_outbound_ivr_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;"; + $rslt=mysql_query($stmt, $link); + # $ivr_path = "$stmt|$export_uniqueid[$i]|"; + if ($DB) {$MAIN.="$stmt\n";} + $logs_to_print = mysql_num_rows($rslt); + $u=0; + while ($u < $logs_to_print) + { + $row=mysql_fetch_row($rslt); + $ivr_path .= "$row[0]$IVRdelimiter"; + $u++; + } + $ivr_path = preg_replace("/\|$|\^$/",'',$ivr_path); + } + $ivr_data = "\t$ivr_path"; + if ($export_fields=='ALTERNATE_1') + {$ivr_data = "|$ivr_path";} + } + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) { $CF_list_id = $export_list_id[$i]; if ($export_entry_list_id[$i] > 99) {$CF_list_id = $export_entry_list_id[$i];} - $stmt="SHOW TABLES LIKE \"custom_$CF_list_id\";"; + $stmt="MOSTRA TABELLAS LIKE \"custom_$CF_list_id\";"; if ($DB>0) {echo "$stmt";} $rslt=mysql_query($stmt, $link); $tablecount_to_print = mysql_num_rows($rslt); @@ -512,13 +758,20 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$custom_data\r\n"; + if ($export_fields=='ALTERNATE_1') + { + echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } + else + { + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; + } $i++; } } else { - echo "There are no calls during this time period for these parameters\n"; + echo "Esistono no calls during this time period for these parameters\n"; exit; } } @@ -549,7 +802,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -564,7 +817,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -630,6 +883,8 @@ else echo "\n"; echo "ADMINISTRATION: $report_name"; + if ($ivr_export == 'YES') + {echo " IVR";} ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -654,13 +909,17 @@ else echo "<CENTER><BR>\n"; - echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Esporta invita Relazione"; + if ($ivr_export == 'YES') + {echo " IVR";} + echo "</B></FONT><BR><BR>\n"; echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; - echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<font class=\"select_bold\"><B>Date:</B></font><BR><CENTER>\n"; echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; ?> @@ -672,7 +931,7 @@ else 'controlname': 'query_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lunedi week start </script> <?php @@ -688,37 +947,49 @@ else 'controlname': 'end_date' }); o_cal.a_tpl.yearscroll = false; - // o_cal.a_tpl.weekstart = 1; // Monday week start + // o_cal.a_tpl.weekstart = 1; // Lunedi week start </script> <?php echo "<BR><BR>\n"; - echo "Header Row:<BR>\n"; + echo "<B>Header Row:</B><BR>\n"; echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; echo "<BR><BR>\n"; - echo "Recording Fields:<BR>\n"; + echo "<B>Recording Fields:</B><BR>\n"; echo "<select size=1 name=rec_fields>"; echo "<option>ID</option>"; echo "<option>FILENAME</option>"; echo "<option>LOCATION</option>"; echo "<option>ALL</option>"; - echo "<option selected>NONE</option>"; + echo "<option selected>NESSUNO</option>"; echo "</select>\n"; if ($custom_fields_enabled > 0) { echo "<BR><BR>\n"; - echo "Custom Fields:<BR>\n"; + echo "<B>campo personalizzatos:</B><BR>\n"; echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; } + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option><option>ALTERNATE_1</option></select>\n"; + + ### bottom of first column + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; - echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Campagnas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; $o=0; while ($campaigns_to_print > $o) { @@ -730,22 +1001,25 @@ else } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; - $o=0; - while ($groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTgroups[$o]\|",$group_string)) - {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - else - {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Gruppi Inbound:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Liste:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; $o=0; while ($lists_to_print > $o) { @@ -757,8 +1031,8 @@ else } echo "</SELECT>\n"; echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + echo "<font class=\"select_bold\"><B>Esiti:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; $o=0; while ($statuses_to_print > $o) { @@ -769,24 +1043,26 @@ else $o++; } echo "</SELECT>\n"; - echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; - echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; - echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; - $o=0; - while ($user_groups_to_print > $o) + if ($ivr_export != 'YES') { - if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} - $o++; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Gruppi Utenti:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; } - echo "</SELECT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; - - echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; echo "</TD></TR></TABLE>\n"; echo "</FORM>\n\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/callcard_admin.php b/agc_2-X/trunk/LANG_www/vicidial_it/callcard_admin.php new file mode 100644 index 00000000..d0789929 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/callcard_admin.php @@ -0,0 +1,943 @@ +<?php +# callcard_admin.php +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This callcard script is to administer the callcard accounts in ViciDial +# it is separate from the standard admin.php script. callcard_enabled in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 100311-2325 - first build +# 100525-1824 - Added generate option +# 100616-0847 - Fixed batch issue +# 100823-1342 - Added Search option and display for level 7 users, added pin number search +# 120117-1457 - Security fix, issue #544 +# + +$version = '2.4-5'; +$build = '120117-1457'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run"])) {$run=$_GET["run"];} + elseif (isset($_POST["run"])) {$run=$_POST["run"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["starting_batch"])) {$starting_batch=$_GET["starting_batch"];} + elseif (isset($_POST["starting_batch"])) {$starting_batch=$_POST["starting_batch"];} +if (isset($_GET["pack"])) {$pack=$_GET["pack"];} + elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];} +if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];} + elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];} +if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} + elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} +if (isset($_GET["pin"])) {$pin=$_GET["pin"];} + elseif (isset($_POST["pin"])) {$pin=$_POST["pin"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} +if (isset($_GET["balance_minutes"])) {$balance_minutes=$_GET["balance_minutes"];} + elseif (isset($_POST["balance_minutes"])) {$balance_minutes=$_POST["balance_minutes"];} +if (isset($_GET["initial_value"])) {$initial_value=$_GET["initial_value"];} + elseif (isset($_POST["initial_value"])) {$initial_value=$_POST["initial_value"];} +if (isset($_GET["initial_minutes"])) {$initial_minutes=$_GET["initial_minutes"];} + elseif (isset($_POST["initial_minutes"])) {$initial_minutes=$_POST["initial_minutes"];} +if (isset($_GET["note_purchase_order"])) {$note_purchase_order=$_GET["note_purchase_order"];} + elseif (isset($_POST["note_purchase_order"])) {$note_purchase_order=$_POST["note_purchase_order"];} +if (isset($_GET["note_printer"])) {$note_printer=$_GET["note_printer"];} + elseif (isset($_POST["note_printer"])) {$note_printer=$_POST["note_printer"];} +if (isset($_GET["note_did"])) {$note_did=$_GET["note_did"];} + elseif (isset($_POST["note_did"])) {$note_did=$_POST["note_did"];} +if (isset($_GET["inbound_group_id"])) {$inbound_group_id=$_GET["inbound_group_id"];} + elseif (isset($_POST["inbound_group_id"])) {$inbound_group_id=$_POST["inbound_group_id"];} +if (isset($_GET["note_language"])) {$note_language=$_GET["note_language"];} + elseif (isset($_POST["note_language"])) {$note_language=$_POST["note_language"];} +if (isset($_GET["note_name"])) {$note_name=$_GET["note_name"];} + elseif (isset($_POST["note_name"])) {$note_name=$_POST["note_name"];} +if (isset($_GET["note_comments"])) {$note_comments=$_GET["note_comments"];} + elseif (isset($_POST["note_comments"])) {$note_comments=$_POST["note_comments"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$report_name = 'CallCard Search'; +$SEARCHONLY=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $callcard_enabled = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($callcard_enabled < 1) + { + echo "ERROR: CallCard is not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $card_id = ereg_replace("[^-\_0-9]","",$card_id); + $run = ereg_replace("[^0-9]","",$run); + $batch = ereg_replace("[^0-9]","",$batch); + $pack = ereg_replace("[^0-9]","",$pack); + $sequence = ereg_replace("[^0-9]","",$sequence); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + $pin = ereg_replace("[^0-9a-zA-Z]","",$pin); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 6 and view_reports='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authreport=$row[0]; + + if ($authreport > 0) + { + $stmt="SELECT full_name,user_group from vicidial_users where user='$USER' and pass='$PASS';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + $stmt="SELECT allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_reports = $row[0]; + + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + else + { + $SEARCHONLY=1; + } + } + else + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$USER|$PASS|\n"; + exit; + } + } + } + +if ($SEARCHONLY > 0) + { + if ( ($action != 'SEARCH') and ($action != 'SEARCH_RESULTS') and ($action != 'CALLCARD_DETAIL') ) + {$action = 'SEARCH';} + } + +if (strlen($action) < 1) + {$action = 'CALLCARD_SUMMARY';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSIONE: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: CallCard Admin +<?php + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'admin'; +$sh = 'cc'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$cc_color = '#FFFF99'; +$cc_font = 'BLACK'; +$cc_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AIUTO\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + +### BEGIN modify card status page +if ($action == "CALLCARD_STATUS") + { + if ( (strlen($card_id)<1) or (strlen($status)<1) ) + { + echo "ERROR: Card ID and Status must be filled in<BR>\n"; + } + else + { + $stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This card_id is not in the system<BR>\n"; + } + else + { + if ($status == 'RESET') + { + $initial_minutes=1; + $stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $im_ct = mysql_num_rows($rslt); + if ($im_ct > 0) + { + $row=mysql_fetch_row($rslt); + $initial_minutes = $row[0]; + } + + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';"; + } + if ($status == 'VOID') + { + $stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';"; + } + if ($status == 'ACTIVE') + { + $stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';"; + $stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';"; + } + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + if ($DB) {echo "|$stmt|$stmtB|\n";} + + echo "Card ID Status Modified: $card_id - $status<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "CALLCARD_DETAIL"; + } +### END modify card status page + + + +### BEGIN CallCard record Detail page +if ($action == "CALLCARD_DETAIL") + { + $stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $details_to_print = mysql_num_rows($rslt); + if ($details_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $card_id = $rowx[0]; + $run = $rowx[1]; + $batch = $rowx[2]; + $pack = $rowx[3]; + $sequence = $rowx[4]; + $status = $rowx[5]; + $balance_minutes = $rowx[6]; + $initial_value = $rowx[7]; + $initial_minutes = $rowx[8]; + $note_purchase_order = $rowx[9]; + $note_printer = $rowx[10]; + $note_did = $rowx[11]; + $inbound_group_id = $rowx[12]; + $note_language = $rowx[13]; + $note_name = $rowx[14]; + $note_comments = $rowx[15]; + $create_user = $rowx[16]; + $activate_user = $rowx[17]; + $used_user = $rowx[18]; + $void_user = $rowx[19]; + $create_time = $rowx[20]; + $activate_time = $rowx[21]; + $used_time = $rowx[22]; + $void_time = $rowx[23]; + + $stmt="SELECT pin from callcard_accounts where card_id='$card_id';"; + $rslt=mysql_query($stmt, $link); + $pin_to_print = mysql_num_rows($rslt); + if ($pin_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $pin = $rowx[0]; + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Dettagliata<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n"; + echo "<input type=hidden name=card_id value=\"$card_id\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Esito: </td><td align=left><B>$status</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Gruppo: </td><td align=left><B>$inbound_group_id</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Note: </td><td align=left><B>$note_comments</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Create Utente/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Activate Utente/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Used Utente/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Void Utente/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n"; + echo "</TABLE>\n"; + echo "<BR><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n"; + echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n"; + echo "<BR><BR>\n"; + } + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Call Log for this Card ID:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> $row[0] </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + if ($SEARCHONLY < 1) + { + echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n"; + } + } + else + { + echo "ERROR: Card ID not found: $card_id<BR>\n"; + } + } +### END card id detail page + + + +### BEGIN callcard summary +if ($action == "CALLCARD_SUMMARY") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Summary:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ESITO</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + $stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $db_ct = mysql_num_rows($rslt); + if ($db_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DBcount = $row[0]; + + echo "<b>Esistono $DBcount batches in the system\n"; + } + echo "<BR><BR>\n"; + + ### call log + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Last 10 Calls:\n"; + echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $i </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>"; + echo "<td><font size=1> $row[1] </td>"; + echo "<td><font size=1> $row[2] </td>"; + echo "<td><font size=1> $row[3] </td>"; + echo "<td><font size=1> $row[4] </td>"; + echo "<td><font size=1> $row[5] </td>"; + echo "<td><font size=1> $row[6] </td>"; + echo "<td><font size=1> $row[7] </td>"; + echo "<td><font size=1> $row[8] </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END callcard summary + + + +### BEGIN list runs +if ($action == "CALLCARD_RUNS") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),run FROM callcard_accounts_details group by run order by run;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lrun[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lrun[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&run=$Lrun[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list runs + + + +### BEGIN list batches +if ($action == "CALLCARD_BATCHES") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CUENTA</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcount[$i] = $row[0]; + $Lbatch[$i] = $row[1]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> $Lbatch[$i] </td>"; + echo "<td><font size=1> $Lcount[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } +### END list batches + + + +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($starting_batch) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields<BR><BR>\n"; + $action = 'GENERATE'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard GENERATE:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PIN</B></TD>"; + echo "</TR>\n"; + + $i=0; + $Gbatch=$starting_batch; + $Gbatch_count=-1; + $Gsequence=$sequence; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count >= $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE',balance_minutes='$balance_minutes';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Pcard_id&DB=$DB\"><font color=black>$Pcard_id</font></a> </td>"; + echo "<td><font size=1> $Ppin </td>"; + echo "</tr>\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id<BR>\n"; + } + } + else + { + echo "ERROR - cannot query system<BR>\n"; + } + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Generate IDs<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=GENERATE_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Batch: </td><td align=left><input type=text name=starting_batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>IDs in Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Starting Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Total: </td><td align=left><input type=text name=total size=8 maxlength=7></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><input type=text name=balance_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><input type=text name=initial_value size=7 maxlength=6></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><input type=text name=initial_minutes size=3 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><input type=text name=note_purchase_order size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><input type=text name=note_printer size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><input type=text name=note_did size=18 maxlength=18></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>In-Gruppo: </td><td align=left><input type=text name=inbound_group_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><input type=text name=note_language size=10 maxlength=10></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=note_name size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Comment: </td><td align=left><input type=text name=note_comments size=50 maxlength=255></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### GENERATE search + + + +### BEGIN search results +if ($action == "SEARCH_RESULTS") + { + if (strlen($pin) > 1) + { + $searchSQL = "pin='$pin'"; + + $stmt = "SELECT card_id FROM callcard_accounts where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $card_id = $row[0]; + } + } + if (strlen($card_id) > 1) + {$searchSQL = "card_id='$card_id'";} + if (strlen($run) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and run='$run'"; + } + if (strlen($batch) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and batch='$batch'"; + } + if (strlen($pack) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and pack='$pack'"; + } + if (strlen($sequence) > 1) + { + $and=''; + if (strlen($searchSQL) > 1) {$and=' and';} + $searchSQL .= "$and sequence='$sequence'"; + } + + if (strlen($searchSQL) < 5) + { + echo "you must enter something to search for<BR><BR>\n"; + $action = 'SEARCH'; + } + else + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>CallCard Batches:\n"; + echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; + echo "<TR BGCOLOR=BLACK>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ESITO</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>"; + echo "</TR>\n"; + + $stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lcard_id[$i] = $row[0]; + $Lstatus[$i] = $row[1]; + $Lbalance_minutes[$i] = $row[2]; + $Lcreate_time[$i] = $row[3]; + $Lactivate_time[$i] = $row[4]; + $Lused_time[$i] = $row[5]; + $Lvoid_time[$i] = $row[6]; + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "<tr $bgcolor>\n"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>"; + echo "<td><font size=1> $Lstatus[$i] </td>"; + echo "<td><font size=1> $Lbalance_minutes[$i] </td>"; + echo "<td><font size=1> $Lcreate_time[$i] </td>"; + echo "<td><font size=1> $Lactivate_time[$i] </td>"; + echo "<td><font size=1> $Lused_time[$i] </td>"; + echo "<td><font size=1> $Lvoid_time[$i] </td>"; + echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>"; + echo "</tr>\n"; + + $i++; + } + echo "</TABLE><BR><BR>\n"; + + echo "\n"; + echo "</center>\n"; + } + } +### END search results + + + +### BEGIN search +if ($action == "SEARCH") + { + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + + echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=action value=SEARCH_RESULTS>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><input type=text name=pin size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "\n"; + echo "</center>\n"; + } +### END search + + + + + +?> + + + +<BR><font size=1>CallCard     VERSIONE: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +</TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/campaign_debug.php b/agc_2-X/trunk/LANG_www/vicidial_it/campaign_debug.php new file mode 100644 index 00000000..dddedaba --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/campaign_debug.php @@ -0,0 +1,191 @@ +<?php +# campaign_debug.php +# +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 110514-1231 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>Campaign Debug\n"; + + $short_header=1; + + require("admin_header.php"); + +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_query($stmt, $link); + $lb_to_print = mysql_num_rows($rslt); + + echo "
    Agente schermo etichette:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($lb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    LABEL IDNameAttivoGRUPPO ADMINMODIFICA
    $row[0]$row[1]$row[2]$row[3]MODIFICA
    \n"; + } + + +###################### +# ADD=190000000000 display all contacts entries +###################### +if ($ADD==190000000000) + { + echo "
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27432,6 +32181,7 @@ if ($ADD==700000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27453,7 +32203,7 @@ if ($ADD==710000000000000) 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_query($stmt, $linkALT); + $lb_to_print = mysql_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=mysql_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 (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    NOMEOffice NumberBU NameDepartmentGroupJob TitleLocationMODIFICA
    $row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFICA
    \n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -27378,7 +32126,7 @@ if ($ADD==700000000000000) $limitSQL = "10000"; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27392,6 +32140,7 @@ if ($ADD==700000000000000) echo "
    SECTIONTYPERECORD IDGRUPPODESCRIZIONEGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27517,6 +32268,7 @@ if ($ADD==710000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27540,7 +32292,13 @@ if ($ADD==720000000000000) echo "
    \n"; echo ""; - $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) @@ -27462,7 +32212,7 @@ if ($ADD==710000000000000) $user_name = $row[0]; } - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27476,6 +32226,7 @@ if ($ADD==710000000000000) echo "SECTIONTYPERECORD IDGRUPPODESCRIZIONEGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -27596,6 +32355,7 @@ if ($ADD==720000000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -27625,7 +32385,8 @@ if ($ADD==730000000000000) echo "
    \n"; echo ""; - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $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 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27554,6 +32312,7 @@ if ($ADD==720000000000000) echo "SECTIONTYPERECORD IDGRUPPODESCRIZIONEGOTO
    $row[4] $row[5] $row[6] $row[8] $row[7] GOTO
    "; echo ""; echo "\n"; + echo ""; + echo ""; + echo "\n"; echo ""; echo ""; echo "\n"; @@ -27690,7 +32454,7 @@ if ($ADD==999999) 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 from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $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_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -27659,6 +32420,9 @@ if ($ADD==730000000000000) echo "DESCRIZIONE: $row[7]
    GRUPPO ADMIN: $row[11]
    NOTES: $row[8]
    \n"; if ($stage == 'TIME') { - $stmt="select last_update from server_updater where server_ip='$server_ip[$o]';"; + $stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servertime_to_print = mysql_num_rows($rslt); @@ -27908,7 +32703,7 @@ if ($ADD==999999) { echo ""; - $stmt="select NOW();"; + $stmt="SELECT NOW();"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $dbtime_to_print = mysql_num_rows($rslt); @@ -27919,6 +32714,11 @@ if ($ADD==999999) } } 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;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); @@ -27712,13 +32476,19 @@ if ($ADD==999999) $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $queuemetrics_url_LU = $row[0]; - $vtiger_url_LU = $row[1]; + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $list_update_count = $row[0]; + $list_update_count = $row[0]; + + $stmt="SELECT count(*) from dialable_inventory_snapshots;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $inventory_report_count = $row[0]; + ?> @@ -27736,7 +32506,7 @@ if ($ADD==999999) echo "Real-Time Rapporti
    \n"; echo "
      \n"; if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) - {echo "
    • Real-Time Main Report\n";} + {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 Campagna Summary/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) @@ -27747,11 +32517,13 @@ if ($ADD==999999) if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$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 REPORT/",$LOGallowed_reports)) ) - {echo "
    • Inbound Report by DID\n";} + {echo "
    • Relazione ingresso da DID\n";} if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
    • Inbound Service Level Report\n";} if ( (preg_match("/Inbound Sintesi Resoconto/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
    • Inbound Sintesi Resoconto\n";} + if ( (preg_match("/Inbound Daily Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Inbound Daily Report\n";} if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
    • Inbound DID Report\n";} if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) @@ -27760,14 +32532,32 @@ if ($ADD==999999) {echo "
    • Outbound Calling Report\n";} if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
    • Outbound Summary Interval Report\n";} + if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + echo "
    • Outbound IVR Report"; + if ($LOGexport_reports >= 1) + { + if ( (preg_match("/Esporta invita Relazione/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo " - Export";} + } + echo "\n"; + } if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
    • Fronter - Closer Report\n";} if ( (preg_match("/Liste Esiti Campagna Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) - {echo "
    • Liste Esiti Campagna Report\n";} + {echo "
    • Liste Esiti Campagna Report\n";} + if ( (preg_match("/Campagna Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Campagna Status List Report\n";} # echo "
    • AGENT SPREADSHEET PERFORMANCE\n"; + if ( ( (preg_match("/Dialer Inventory report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) and ($inventory_report_count > 0) ) + {echo "
    • Dialer Inventory report\n";} + if ($LOGexport_reports >= 1) { - echo "
    • Esporta invita Relazione\n"; + if ( (preg_match("/Esporta invita Relazione/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Esporta invita Relazione\n";} + if ( (preg_match("/Export Leads Rapporto/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Export Leads Rapporto\n";} } echo "
    \n"; echo "
    \n"; @@ -27781,6 +32571,8 @@ if ($ADD==999999) {echo "
  • Agent Status Dettagliata\n";} if ( (preg_match("/Agent Performance Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
  • Agent Performance Dettagliata\n";} + if ( (preg_match("/Team Performance Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
  • Team Performance Dettagliata\n";} if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
  • Single Agent Daily\n";} if ( (preg_match("/Statistiche utente/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) @@ -27802,6 +32594,9 @@ if ($ADD==999999) if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) {echo "
  • Server Performance Report\n";} + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
  • Maximum System Stats\n";} + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) { echo "
  • Administration Change Log\n"; @@ -27877,7 +32672,7 @@ if ($ADD==999999) echo "
  • $disk
      PHP Time   " . date("Y-m-d H:i:s") . "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) + { + echo "

      Utilities Admin\n"; + } } } else @@ -27955,6 +32755,7 @@ if ($ADD==999998) echo "
  • Server \n"; echo "
  • Conferencias \n"; echo "
  • Impostazioni di Sistema \n"; + echo "
  • Agente schermo etichette \n"; echo "
  • Esiti di Default\n"; echo "
  • Casella Vocale \n"; @@ -27971,6 +32772,10 @@ if ($ADD==999998) { echo "
  • CallCard Admin \n"; } + if ($SScontacts_enabled > 0) + { + echo "
  • Contacts \n"; + } echo "\n"; echo "
  •   \n"; @@ -27987,20 +32792,20 @@ if ($ADD==999997) if ($stage=='INVIA') { 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);} + {echo "La password non è stato modificato, riprova |1|" . strlen($pass);} else { - $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysql_num_rows($rslt); if ($userpass_to_print < 1) - {echo "Password has not been changed, please try again |2|$userpass_to_print";} + {echo "La password non è stato modificato, riprova |2|$userpass_to_print";} else { $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "Password has not been changed, please try again |3|$row[0]";} + {echo "La password non è stato modificato, riprova |3|$row[0]";} else { $show_form=0; @@ -28012,11 +32817,11 @@ if ($ADD==999997) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGE PASSWORD', event_sql=\"$SQL_log\", event_notes='';"; + $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 CAMBIO PASSWORD', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "Password has been updated, you may now continue\n"; + echo "La password è stata aggiornata, ora è possibile continuare\n"; } } } @@ -28026,16 +32831,16 @@ if ($ADD==999997) echo "
    \n"; echo ""; - echo "
    CHANGE PASSWORD\n"; + echo "
    CAMBIO PASSWORD\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    New Password:     Strength:
    Nuova password:     Forza:
    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
    Si sono tenuti a modificare la password prima di poter continuare a Administration. Una password complessa ha sia lettere minuscole e maiuscole, nonché almeno un numero. La password deve contenere da 2 a 20 caratteri e non può contenere qualsiasi carattere che non siano lettere o numeri. Assicurarsi che la password è qualcosa che si possa ricordare, perché non appena si apporta questa modifica vi verrà richiesto di inserire la nuova password per riaccedere ad Amministrazione
    \n"; @@ -28055,20 +32860,20 @@ if ($ADD==999996) if ($stage=='INVIA') { 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);} + {echo "La password non è stato modificato, riprova |1|" . strlen($pass);} else { - $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysql_num_rows($rslt); if ($userpass_to_print < 1) - {echo "Password has not been changed, please try again |2|$userpass_to_print";} + {echo "La password non è stato modificato, riprova |2|$userpass_to_print";} else { $row=mysql_fetch_row($rslt); if ($row[0] < 1) - {echo "Password has not been changed, please try again |3|$row[0]";} + {echo "La password non è stato modificato, riprova |3|$row[0]";} else { $show_form=0; @@ -28076,14 +32881,16 @@ if ($ADD==999996) if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;} + if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;} $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; $rslt=mysql_query($stmt, $link); - $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';"; $rslt=mysql_query($stmtA, $link); - $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password';"; + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';"; $rslt=mysql_query($stmtB, $link); $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; @@ -28097,7 +32904,7 @@ if ($ADD==999996) if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($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"; + echo "Le password sono state aggiornate, si può ora continuare in Amministrazione.

    Si consiglia di iniziare leggendo il manuale ViciDial Manager disponibile a vicidial.org (c'è una versione gratuita disponibile)\n"; } } } @@ -28107,26 +32914,50 @@ if ($ADD==999996) echo "
    \n"; echo ""; - echo "
    Benvenuto to ViciDial, initial setup screen

    \n"; + echo "
    Benvenuti a ViciDial, schermata di impostazione iniziale

    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -28146,27 +32977,215 @@ if ($ADD==999995) 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
    Si sono tenuti a modificare la password prima di poter continuare a Administration. Una password complessa ha sia lettere minuscole e maiuscole, nonché almeno un numero. La password deve contenere da 2 a 20 caratteri e non può contenere qualsiasi carattere che non siano lettere o numeri. Assicurarsi che la password è qualcosa che si possa ricordare, perché non appena completata questa schermata iniziale di installazione vi verrà richiesto di inserire la nuova password per accedere di nuovo tornare ad Amministrazione
    New Password:     Strength:
    Nuova password:     Forza:
     
    The next three default passwords are defined in the Impostazioni di Sistema 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.
    I prossimi tre password di default sono definiti nella sezione Impostazioni di sistema, ed è possibile cambiare dopo che li definiscono qui. E 'una buona idea fare queste password forte in modo che nessuno possa incidere sul tuo account di telefono e telefonate luogo senza di voi saperlo. La password di registrazione predefinito utilizzato quando nuovi telefoni vengono aggiunti al sistema come il SIP o IAX password del telefono VOIP. Il telefono password predefinita Web di accesso utilizzata quando nuovi telefoni vengono aggiunti al sistema, come la password del telefono che un agente avrebbe usato nell'interfaccia agente ViciDial. La password di default del server utilizzato quando nuovi server vengono aggiunti al sistema per i server di comunicare con l'altro.
    Default Phone Registrazione Password:     Strength:
    Predefinito Password Telefonoword Registrazione:     Forza:
    Default Login Telefono Password:     Strength:
    Predefinito Password Telefonoword Login:     Forza:
    Default Server Password:     Strength:
    Default Server password:     Forza:
     
    I prossimi due impostazioni sono anche definiti nella sezione Impostazioni di sistema, ed è possibile cambiare dopo che li definiscono qui. È necessario impostare di default locale GMT per il fuso orario che gli agenti vogliono essere dentro la zona Casella Vocale è l'elenco dei fusi orari segreteria telefonica che i messaggi vocali sarà tempo registrato con nuovi messaggi vengono lasciati.
    Predefinito locale GMT: (No ajustar para el DST)$NWB#settings-default_local_gmt$NWE
    Predefinito Casella Vocale Zone: $NWB#settings-default_voicemail_timezone$NWE
     
    \n"; echo ""; - echo "
    Benvenuti to ViciDial: copyright, trademark and license page

    \n"; + echo "
    Benvenuti a ViciDial: copyright, marchi e licenze pagina

    \n"; echo "
    \n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "
    Copyright:   The ViciDial Call Center Suite is maintained by the ViciDial Group, © 2010
    Copyright:   Il ViciDial Call Center Suite è gestito dal ViciDial Group, © 2012
    Trademark:   \"VICIDIAL\" is a registered trademark of the ViciDial Group. Here is our trademark use policy
    Trademark:   \"VICIDIAL\" è un marchio registrato della ViciDial Group. Ecco la nostra marchio di fabbrica 'utilizzo politica
    License:   The ViciDial Call Center Suite is released under the AGPLv2 open source license
    License:   Il ViciDial Call Center Suite è rilasciato sotto la AGPLv2 licenza open source
    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
    Source Code:   Il Centro ViciDial software chiamata Suite è disponibile per il download, e per l'uso, gratuitamente. È possibile scaricare il facile da installare ViciBox CD ISO versione, o solo codice sorgente
    \n"; if ($first_login_link > 0) { echo "

    "; - echo "
    Continue on to the Initial Setup

      \n"; + echo "
    Proseguimento per la configurazione iniziale

      \n"; } } ##### END copyright trademark license page ##### +###################### +# ADD=999994 - admin hidden utilities page +###################### +if ($ADD==999994) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: hidden page utilità - Se non sai cosa fare queste utilità, probabilmente non dovrebbe usarli

    \n"; + echo "
    \n"; + + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) + { + echo "\n
     \n"; + } + + echo "
    \n"; + } +##### END admin hidden utilities page ##### + + +###################### +# ADD=999993 - max stats detail report +###################### +if ($ADD==999993) + { + echo "
    \n"; + echo ""; + + if ( (preg_match("/Maximum Stats Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $campaign_name = $rowx[0]; + } + else + {echo "Not found"; exit;} + } + + echo "
    Administration: Maximum Stats Dettagliata for $stage $modify_link$campaign_id
    - $campaign_name   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ($stage == 'remote-agent') + { + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + } + else + {echo "Non hai l`autorizzazione per accedere a questa pagina";} + + 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) + { + echo "
    \n"; + echo ""; + + echo "
    Administration: Maximum System Stats   $NWB#vicidial_max_stats$NWE

    \n"; + echo "
    \n"; + + if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_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_query($stmt, $link); + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + {echo "Non hai l`autorizzazione per accedere a questa pagina";} + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls','total call count in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_inbound_all','total inbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'total_calls_outbound_all','total outbound call count',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_inbound','most concurrent calls inbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_outbound','most concurrent calls outbound total',0); + echo "
    \n"; + horizontal_bar_chart($campaign_id,'30','system',$link,'max_agents','most concurrent agents',0); + echo "
    \n"; + } +##### END max system stats report ##### + + + + + echo "
    \n"; echo "
    \n"; @@ -28180,24 +33199,125 @@ echo "

    "; echo "VERSIONE: $admin_version
    "; echo "BUILD: $build\n"; if (!preg_match("/_BUILD_/",$SShosted_settings)) - {echo "
    © 2010 ViciDial Group
    ";} + {echo "
    © 2012 ViciDial Group
    ";} echo "
    \n"; ?>
    - - 1) and ($modify_footer_rinfrescare > 0) and (strlen($modify_url)>10) ) ) + { + echo "\n"; + if ($SSnocache_admin=='1') + { + echo "\n"; + echo "\n"; + echo "\n"; + } + if ( ($SSadmin_modify_rinfrescare > 1) and ($modify_footer_rinfrescare > 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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_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 "Esistono $complete_leads cavi completati in tali elenchi\n";} + } + else + { + echo "nessun esito di chiamata selezionato per questa campagna\n"; + } + } + else + { + echo "nessuna lista attiva selezionata per questa campagna\n"; + } + } +else + { + echo "nessuna lista attiva selezionata per questa campagna\n"; + } +} ##### CALCULATE DIALABLE LEADS ##### -function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL) +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)) @@ -28520,7 +33640,13 @@ if (isset($camp_lists)) $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; } - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $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"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -28533,7 +33659,10 @@ if (isset($camp_lists)) else {$active_leads = '0';} if ($DB > 0) {echo "|$DB|\n";} - echo "Questa campagna ha $active_leads contatti da chiamare in queste liste\n"; + if ($single_status > 0) + {return $active_leads;} + else + {echo "Questa campagna ha $active_leads contatti da chiamare in queste liste\n";} } else { diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_campaign_multi_alt.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_campaign_multi_alt.php new file mode 100644 index 00000000..ca64232d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_campaign_multi_alt.php @@ -0,0 +1,435 @@ + LICENSE: AGPLv2 +# +# this screen will control the campaign settings needed for alternate number +# dialing using multiple leads with the same account number and different phone +# numbers. the leads will use different owner values and this script will alter +# the ranks for those leads as well as alter the special campaign filter and +# change some campaign settings. +# +# changes: +# 110317-1219 - First Build +# 110406-1818 - Updated logging +# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-3'; +$build = '120223-2335'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); + $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$camp_multi=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_campaigns = $row[1]; + $LOGuser_level = $row[2]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +AMMINISTRAZIONE: campagna multi-Alt-Leads +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '31'; +$SUB = '26'; +$hh = 'campaigns'; +$sh = 'detail'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$campaigns_color = '#FFFF99'; +$campaigns_font = 'BLACK'; +$campaigns_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } +if ($camp_multi < 1) + { + echo "Questa campagna non è impostata su Auto-Alt-Dial MULTI_LEAD\n"; + exit; + } + +if ($DB > 0) + { + echo "$DB,$action,$campaign_id,$lead_order_randomize,$lead_order_secondary\n<BR>"; + } + +$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign_id' order by list_id;"; +$rslt=mysql_query($stmt, $link); +$lists_to_print = mysql_num_rows($rslt); +$o=0; +while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (ereg('Y',$row[1])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + } + else + { + $inactive_lists++; + $camp_lists .= "'$row[0]',"; + } + $o++; + } +$camp_lists = eregi_replace(".$","",$camp_lists); + + + + +################################################################################ +##### BEGIN multi-lead alt dial submit form +if ($action == "ALT_MULTI_INVIA") + { + $settings_updated=0; + if ( (strlen($lead_order_randomize) > 0) and (strlen($lead_order_secondary) > 0) ) + { + $stmt="SELECT distinct owner from vicidial_list where list_id IN($camp_lists) limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $do_values_ct = mysql_num_rows($rslt); + $o=0; + while ($do_values_ct > $o) + { + $row=mysql_fetch_row($rslt); + $owners[$o] = $row[0]; + $o++; + } + + $o=0; + $update_stmts=''; + $new_filter_sql=''; + while ($do_values_ct > $o) + { + $owner_check=''; + $owner_rank=''; + $owner_raw = $owners[$o]; + $owner = preg_replace('/ |\n|\r|\t/','',$owner_raw); + if (isset($_GET["$campaign_id$US$owner"])) {$owner_check=$_GET["$campaign_id$US$owner"];} + elseif (isset($_POST["$campaign_id$US$owner"])) {$owner_check=$_POST["$campaign_id$US$owner"];} + if (isset($_GET["rank_$campaign_id$US$owner"])) {$owner_rank=$_GET["rank_$campaign_id$US$owner"];} + elseif (isset($_POST["rank_$campaign_id$US$owner"])) {$owner_rank=$_POST["rank_$campaign_id$US$owner"];} + + if ($owner_check=='YES') + {$new_filter_sql .= "'$owner_raw',";} + + $stmt = "UPDATE vicidial_list SET rank='$owner_rank' where list_id IN($camp_lists) and owner='$owner_raw';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "OWNER: $o|$campaign_id|$owner|$owner_check|$owner_rank|$affected_rows\n<BR>";} + $update_stmts .= "|$affected_rows|$owner_check|$stmt"; + $o++; + } + + $filter_stmt="INSERT IGNORE INTO vicidial_lead_filters SET lead_filter_id='ML$campaign_id',lead_filter_name='DO NOT DELETE MULTI_$campaign_id',lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\" ON DUPLICATE KEY UPDATE lead_filter_comments=NOW(),lead_filter_sql=\"owner IN($new_filter_sql'99827446572348452235')\";"; + $rslt=mysql_query($filter_stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$affected_rows|$filter_stmt\n<BR>";} + + $stmt = "UPDATE vicidial_campaigns SET lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',lead_filter_id='ML$campaign_id',lead_order='DOWN RANK',campaign_changedate=NOW() where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$campaign_id|$lead_order_randomize|$lead_order_secondary|ML$campaign_id|DOWN RANK|$affected_rows|$stmt\n<BR>";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$filter_stmt|$update_stmts|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "$campaign_id|$stmt\n<BR>";} + + echo "<BR><b>MULTI-LEAD ALT DIAL SETTINGS UPDATED</b><BR><BR>"; + + } + else + {echo "ERROR: Problem updating campaign: $affected_rows|$stmt\n<BR>";} + + } + else + {echo "ERROR: problem with data: $campaign_id\n<BR>";} + + $action='BLANK'; + } +### END multi-lead alt dial submit form + + + + + +################################################################################ +##### BEGIN multi-lead alt dial control form +if ($action == "BLANK") + { + $stmt = "SELECT lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vc_values_ct = mysql_num_rows($rslt); + if ($vc_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_order_randomize = $row[0]; + $lead_order_secondary = $row[1]; + } + + $lead_filter_sql=''; + $lead_filter_comments=''; + $stmt = "SELECT lead_filter_sql,lead_filter_comments FROM vicidial_lead_filters where lead_filter_id='ML$campaign_id' and lead_filter_name='DO NOT DELETE MULTI_$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vlf_values_ct = mysql_num_rows($rslt); + if ($vlf_values_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_sql = $row[0]; + $lead_filter_comments = $row[1]; + if ($DB) {echo "$lead_filter_sql|$lead_filter_comments";} + } + + echo "<TABLE><TR><TD>\n"; + echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; + echo "<br>Multi-Lead automatica delle impostazioni di composizione Alt Forma<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n"; + echo "<input type=hidden name=action value=ALT_MULTI_INVIA>\n"; + echo "<center><TABLE width=$section_width cellspacing=3>\n"; + echo "<tr><td align=center colspan=2>\n"; + + + echo "<br><b>PHONE TYPES WITHIN THE LISTS FOR THIS CAMPAGNA: <a href=\"./admin.php?ADD=31&campaign_id=$campaign_id\">$campaign_id</a></b>\n"; + echo "<TABLE width=700 cellspacing=3>\n"; + echo "<tr><td>PHONE NUMBER TYPE</td><td>CHIAMATI</td><td>NON CHIAMATI</td><td>SELECTED</td><td>OLD CLASSIFICA</td><td>NEW CLASSIFICA</td></tr>\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*),rank from vicidial_list where list_id IN($camp_lists) group by owner,rank,called_since_last_reset order by rank,owner,called_since_last_reset limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $types_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($types_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + $owner_var = preg_replace('/ |\n|\r|\t/','',$owner); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $o++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$owner</td>"; + echo "<td><font size=1>".$lead_list['Y'][$owner]."</td>"; + echo "<td><font size=1>".$lead_list['N'][$owner]." </td>"; + echo "<td><font size=1>"; + if (preg_match("/\\\'$owner\\\'|'$owner'/",$lead_filter_sql)) + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\" CHECKED>";} + else + {echo "<input type=checkbox name=\"$campaign_id$US$owner_var\" id=\"$campaign_id$US$owner_var\" value=\"YES\">";} + echo "</td>"; + echo "<td><font size=1>$o</td>"; + echo "<td><font size=1><input type=text size=3 maxlength=3 name=\"rank_$campaign_id$US$owner_var\" id=\"rank_$campaign_id$US$owner_var\" value=\"$o\"></td>"; + echo "</tr>\n"; + } + } + + echo "<tr><td colspan=2><font size=1>SUBTOTALI</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; + echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTALE</td><td colspan=3 align=center><font size=1>$lead_list[count]</td><td align=center><font size=1>$o</td></tr>\n"; + + echo "</table></center><br>\n"; + unset($lead_list); + + + echo "</td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=right>Order List Randomize: </td><td align=left><select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Elenco Ordine Secondario: </td><td align=left><select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select></td></tr>\n"; + + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; + echo "</TABLE></center>\n"; + echo "</TD></TR></TABLE>\n"; + } +### END multi-lead alt dial control form + + + + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds         Versione: $admin_version     Build: $build</font>"; + +?> + +</body> +</html> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php index 9c33758f..f8cb734e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php @@ -1,7 +1,7 @@ <?php # admin_header.php - VICIDIAL administration header # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES @@ -27,6 +27,16 @@ # 100831-2255 - Added password strength checking function # 100914-1311 - Removed other links for reports-only users # 101022-1323 - Added IGU_selectall function +# 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link +# 110322-1228 - Added user ID logged in as next to Logout link +# 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu +# 110922-1707 - Added RA-EXTEN to campaign submenu +# 111015-2305 - Added Contacts menu to Admin +# 111106-0939 - Changes for user group restrictions +# 111116-0208 - Added ALT and ADDR3 in-group handle methods +# 120402-2134 - Changed lead loader link to fourth gen # @@ -336,12 +346,12 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php } ?> - var weak = Image(); - weak.src = "images/weak.png"; - var medium = Image(); - medium.src = "images/medium.png"; - var strong = Image(); - strong.src = "images/strong.png"; + var weak = new Image(); + weak.src = "../vicidial/images/weak.png"; + var medium = new Image(); + medium.src = "../vicidial/images/medium.png"; + var strong = new Image(); + strong.src = "../vicidial/images/strong.png"; function pwdChanged(pwd_field_str, pwd_img_str) { @@ -405,10 +415,30 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c <?php +#### Javascript for auto-generate of user ID Button +if ( ($SSadmin_modify_rinfrescare > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + ?> + var ar_seconds=<?php echo "$SSadmin_modify_rinfrescare;"; ?> + + function modify_refresh_display() + { + if (ar_seconds > 0) + { + ar_seconds = (ar_seconds - 1); + document.getElementById("rinfrescare_countdown").innerHTML = "<font color=black> screen rinfrescare in: " + ar_seconds + " seconds</font>"; + setTimeout("modify_rinfrescare_display()",1000); + } + } + + <?php + } + #### Javascript for auto-generate of user ID Button if ( ($ADD==1) or ($ADD=="1A") ) { ?> + function user_auto() { var user_toggle = document.getElementById("user_toggle"); @@ -599,22 +629,22 @@ if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) } +$stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1]</option>"; - $i++; - } - - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; + $stmt="SELECT did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' $LOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); $did_list=''; @@ -626,7 +656,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" order by group_id;"; + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active='Y' and group_id NOT LIKE \"AGENTDIRECT%\" $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_query($stmt, $link); $ingroups_to_print = mysql_num_rows($rslt); $ingroup_list=''; @@ -638,7 +668,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); $IGcampaigns_to_print = mysql_num_rows($rslt); $IGcampaign_id_list=''; @@ -650,11 +680,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; + $IGhandle_method_list = '<option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>CIDLOOKUPALT</option><option>CIDLOOKUPRLALT</option><option>CIDLOOKUPRCALT</option><option>CIDLOOKUPADDR3</option><option>CIDLOOKUPRLADDR3</option><option>CIDLOOKUPRCADDR3</option><option>CIDLOOKUPALTADDR3</option><option>CIDLOOKUPRLALTADDR3</option><option>CIDLOOKUPRCALTADDR3</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option>'; $IGsearch_method_list = '<option value="LB">LB - Load Balanced</option><option value="LO">LO - Load Balanced Overflow</option><option value="SO">SO - Server Only</option>'; - $stmt="select login,server_ip,extension,dialplan_number from phones where active='Y' order by login,server_ip;"; + $stmt="SELECT login,server_ip,extension,dialplan_number from phones where active='Y' $LOGadmin_viewable_groupsSQL order by login,server_ip;"; $rslt=mysql_query($stmt, $link); $phones_to_print = mysql_num_rows($rslt); $phone_list=''; @@ -724,19 +754,19 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + '<a href="admin.php?ADD=3111&group_id=' + value + '">In-Group:</a> </span>'; new_content = new_content + '<select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + ' onChange="call_menu_link("' + option + '","INGROUP");">'; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Maniglia Metodo: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; new_content = new_content + '   <a href="javascript:openNewWindow(\'admin.php?ADD=99999#vicidial_call_menu-ingroup_settings\')"><IMG SRC="help.gif" WIDTH=20 HEIGHT=20 Border=0 ALT="AIUTO" ALIGN=TOP></a>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Metodo di ricerca: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID Campagna: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; - new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + "<BR>   Inserisci il Nome del file VID: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; new_content = new_content + "<BR>   VID ID Number Filename: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - new_content = new_content + "<BR>   VID Confirm Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + new_content = new_content + "<BR>   VID Conferma Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = new_content + '   VID cifre: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') { @@ -756,7 +786,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } else {value='vm-goodbye';} - new_content = "Audio File: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "file Audio: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=40 maxlength=255 value=\"" + selected_value + "\"> <a href=\"javascript:launch_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -892,18 +922,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> '; new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">"; new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>'; - new_content = new_content + '   Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; + new_content = new_content + '   Maniglia Metodo: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>'; new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>'; - new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; + new_content = new_content + '<BR>Metodo di ricerca: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>'; new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>'; new_content = new_content + '   ID Lista: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">'; new_content = new_content + '<BR>ID Campagna: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>'; new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>'; new_content = new_content + '   Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">'; - // new_content = new_content + "<BR>   VID Enter Filename: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + "<BR>   Inserisci il Nome del file VID: <input type=text name=IGvid_enter_filename_" + option + " id=IGvid_enter_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_enter_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; // new_content = new_content + "<BR>   VID ID Number Filename: <input type=text name=IGvid_id_number_filename_" + option + " id=IGvid_id_number_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_id_number_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - // new_content = new_content + "<BR>   VID Confirm Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; - // new_content = new_content + '   VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; + // new_content = new_content + "<BR>   VID Conferma Filename: <input type=text name=IGvid_confirm_filename_" + option + " id=IGvid_confirm_filename_" + option + " size=40 maxlength=255 value=\"" + IGvid_confirm_filename + "\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_" + option + "','date'," + chooser_height + ");\">audio chooser</a>"; + // new_content = new_content + '   VID cifre: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_' + option + ' id=IGvid_validate_digits_' + option + ' value="' + IGvid_validate_digits + '">'; } if (selected_route=='DID') @@ -924,7 +954,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 } else {value = 'nbdy-avail-to-take-call|vm-goodbye';} - new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; + new_content = "file Audio: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>"; } if (selected_route=='EXTENSION') { @@ -990,8 +1020,37 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 <?php } echo "</script>\n"; + +##### BEGIN - bar chart CSS style ##### +?> + +<style type="text/css"> +<!-- +.auraltext + { + position: absolute; + font-size: 0; + left: -1000px; + } +.chart_td + {background-image: url(../vicidial/images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;} + +--> +</style> + +<?php +##### END - bar chart CSS style ##### + echo "</head>\n"; -echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; +if ( ($SSadmin_modify_rinfrescare > 1) and (preg_match("/^3|^4/",$ADD)) ) + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"modify_rinfrescare_display();\">\n"; + } +else + { + echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + } + echo "<!-- ILPV -->\n"; echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../vicidial_en/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../vicidial_it/admin.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Italiano <img src=\"../agc/images/it.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; $stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; @@ -1070,6 +1129,8 @@ $SScustom_fields_enabled = $row[3]; else {$listmix_sh=''; $listmix_fc='BLACK';} if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $campaigns_color ?>> @@ -1094,10 +1155,18 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> <TD ALIGN=LEFT <?php echo $pause_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=37"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $pause_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Codici Pausa</a></TD> </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> - <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?>>Presets</a></TD> - <?php } + <TD ALIGN=LEFT <?php echo $preset_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=301"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $preset_fc ?> SIZE=<?php echo $subcamp_font_size ?><> Presets/a></TD> + <?php + if ($SScampaign_cid_areacodes_enabled > 0) + { + ?> + </TR><TR BGCOLOR=<?php echo $campaigns_color ?>> + <TD ALIGN=LEFT <?php echo $accid_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=302"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $accid_fc ?> SIZE=<?php echo $subcamp_font_size ?>>AC-CID</a></TD> + <?php + } + } ?> - <!-- LISTE NAVIGATION --> + <!-- LISTS NAVIGATION --> <?php if ($SSoutbound_autodial_active > 0) { @@ -1106,8 +1175,8 @@ $SScustom_fields_enabled = $row[3]; <?php if (strlen($lists_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-EliminareDNC Number';} - else {$DNClink = 'Add DNC Number';} + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-Cancellare il numero DNC';} + else {$DNClink = 'Aggiungi numero DNC';} ?> <TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Visualizza Liste </a> @@ -1116,17 +1185,19 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Ricerca Contatti </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   + <a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi un nuovo elettrocatetere </a> + </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $DNClink ?> </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_listloader_third_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Carica Nuovi Contatti </a> + <a href="./admin_listloader_fourth_gen.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Carica Nuovi Contatti </a> <?php if ($SScustom_fields_enabled > 0) { ?> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> List Custom Fields </a> + <a href="./admin_lists_custom.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Elenco Campi Personalizzati </a> </TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT>   - <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiaCustom Fields </a> + <a href="./admin_lists_custom.php?action=COPY_FIELDS_FORM"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia campi personalizzati </a> <?php } ?> @@ -1170,36 +1241,48 @@ $SScustom_fields_enabled = $row[3]; ?> <!-- INGROUPS NAVIGATION --> <TR><TD <?php echo $ingroups_hh ?>> - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Inbound </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $ingroups_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $ingroups_bold ?> Inbound </a> </TD></TR> <?php if (strlen($ingroups_hh) > 1) { - if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-EliminareFPG Number';} - else {$FPGlink = 'Add FPG Number';} + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-FPG Numero Elimina';} + else {$FPGlink = 'Aggiungi numero FPG';} ?> <TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Visualizza Gruppi Inbound </a> + <a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Visualizza Gruppi Inbound </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi Gruppo Inbound </a> + <a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi Gruppo Inbound </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia Gruppo Inbound </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia Gruppo Inbound </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Visualizza DIDs </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi un nuovo DID </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiaDID </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiaDID </a> + <?php + if ($SSdid_ra_extensions_enabled > 0) + { + ?> + </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   + <a href="<?php echo $ADMIN ?>?ADD=1320"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>RA Extensions</a> + <?php + } + ?> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Call Menu </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi un nuovo menu Call </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia Call Menu </a><HR> + <a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia Call Menu </a> + <HR> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filter Phone Groups </a> + <a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Gruppi di Telefono filtro </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Filter Phone Group </a> + <a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi gruppo Filter Phone </a> </TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a> </TD></TR> @@ -1237,9 +1320,9 @@ $SScustom_fields_enabled = $row[3]; </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   <a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Aggiungi Operatore Remoto </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Extension Groups </a> + <a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Gruppi di estensione </a> </TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>   - <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Extension Group </a> + <a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi gruppo Extension </a> </TD></TR> <?php } ?> @@ -1266,6 +1349,8 @@ $SScustom_fields_enabled = $row[3]; else {$conference_sh=''; $conference_fc='BLACK';} if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='label') {$label_sh="bgcolor=\"$label_color\""; $label_fc="$label_font";} + else {$label_sh=''; $label_fc='BLACK';} if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} else {$status_sh=''; $status_fc='BLACK';} if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} @@ -1278,6 +1363,8 @@ $SScustom_fields_enabled = $row[3]; else {$tts_sh=''; $tts_fc='BLACK';} if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} else {$cc_sh=''; $cc_fc='BLACK';} + if ($sh=='cts') {$cts_sh="bgcolor=\"$cts_color\""; $cts_fc="$cc_font";} + else {$cts_sh=''; $cts_fc='BLACK';} ?> <TR BGCOLOR=<?php echo $admin_color ?>> @@ -1297,6 +1384,8 @@ $SScustom_fields_enabled = $row[3]; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $conference_fc ?> SIZE=<?php echo $header_font_size ?>> Conferencias </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $settings_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> Impostazioni di Sistema </a></TD> + </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $label_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> Etichette schermo </a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>> Esiti di Default</a></TD> </TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>   @@ -1326,6 +1415,14 @@ $SScustom_fields_enabled = $row[3]; </TR> <?php } + if ($SScontacts_enabled > 0) + { ?> + <TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cts_sh ?>>   + <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cts_fc ?> SIZE=<?php echo $header_font_size ?>> Contacts </a></TD> + </TR> + + <?php } + } } ?> @@ -1343,7 +1440,7 @@ $SScustom_fields_enabled = $row[3]; </span> <TABLE BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0 WIDTH=<?php echo $page_width ?> HEIGHT=15> -<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HOME</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Orologio</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> +<TR BGCOLOR=#015B91><TD ALIGN=LEFT BGCOLOR=#015B91><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><a href="<?php echo $admin_home_url_LU ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>HOME</a> | <A HREF="../agc/timeclock.php?referrer=admin"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Orologio</A> | <a href="<?php echo $ADMIN ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a> <FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>(<?php echo $PHP_AUTH_USER ?>)</FONT></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><?php echo date("l F j, Y G:i:s A") ?>   </B></TD></TR> <TR BGCOLOR=#015B91> @@ -1386,7 +1483,7 @@ $SScustom_fields_enabled = $row[3]; <?php } if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Vettori </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CopiaA Carrier </a></TD></TR> + <TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Vettori </a>   |   <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a>   |   <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copia A Carrier </a></TD></TR> <?php } if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> @@ -1394,7 +1491,7 @@ $SScustom_fields_enabled = $row[3]; <?php } if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> - <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Generate New Numbers </a></TD></TR> + <TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a>   |   <a href="callcard_admin.php?action=CALLCARD_RUNS"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Runs </a>   |   <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Batches </a>   |   <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a>   |   <a href="callcard_report_export.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Log Export </a>   |   <a href="callcard_admin.php?action=GENERATE"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard generazione di numeri nuovi </a></TD></TR> <?php } if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) { ?> @@ -1408,6 +1505,14 @@ $SScustom_fields_enabled = $row[3]; ?> <TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Impostazioni di Sistema </a></TD></TR> <?php } + if (strlen($label_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Etichette schermo </a>   |   <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungi un Label schermo </a></TD></TR> + <?php } + if (strlen($cts_sh) > 1) { + ?> + <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a>   |   <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Aggiungere un contatto </a></TD></TR> + <?php } if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { ?> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2>   <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Esiti di Default</a>   |   <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Categorie di esiti</a>   |   <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Codici di stato, QC</a></TD></TR> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_fourth_gen.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_fourth_gen.php new file mode 100644 index 00000000..33a235b0 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_fourth_gen.php @@ -0,0 +1,2862 @@ +<?php +# admin_listloader_fourth_gen.php - version 2.4 +# (based upon - new_listloader_superL.php script) +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs <mikec> +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link <mikec> +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# 120402-2128 - Added template options +# + +$version = '2.4-44'; +$build = '120402-2128'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); +$admDIR = "/vicidial/"; +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AIUTO\" ALIGN=TOP></A>"; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "<html>\n"; +echo "<head>\n"; +echo "<!-- VERSIONE: $version BUILD: $build -->\n"; +echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL FUSO ORARIO ATTUALE: $LOCAL_GMT_OFF DST: $isdst -->\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "<style type=\"text/css\">\n +<!--\n +.title { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(18)."pt}\n +.standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt}\n +.small_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(8)."pt}\n +.tiny_standard { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(6)."pt}\n +.standard_bold { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.standard_header { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +.standard_bold_highlight { font-family: Arial, Helvetica, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold; color: white; BACKGROUND-COLOR: black}\n +.standard_bold_blue_highlight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; BACKGROUND-COLOR: blue}\n +A.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none}\n +.employee_standard { font-family: garamond, sans-serif; font-size: ".macfontfix(10)."pt; font-weight: bold}\n +.employee_title { font-family: Garamond, sans-serif; font-size: ".macfontfix(14)."pt; font-weight: bold}\n +\\\\-->\n +</style>\n"; + +?> + + +<script language="JavaScript1.2"> +function openNewWindow(url) + { + window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes'); + } +function ShowProgress(good, bad, total, dup, inv, post) + { + parent.lead_count.document.open(); + parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Stato attuale del file:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>   </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>   </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>'); + parent.lead_count.document.close(); + } +function ParseFileName() + { + if (!document.forms[0].OK_to_process) + { + var endstr=document.forms[0].leadfile.value.lastIndexOf('\\'); + if (endstr>-1) + { + endstr++; + var filename=document.forms[0].leadfile.value.substring(endstr); + document.forms[0].leadfile_name.value=filename; + } + } + } + +</script> +<title>ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_layout!="template") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Carica Contatti Da Questo File:
    Sovrascrittura ID Lista: + +
    Sovrascrittura Codice Telefono: + +
    Struttura del file da usare:Standard Format    Struttura personalizzata    Custom Template
    Template personalizzato da utilizzare: template builder
    Controlla Contatti Duplicati:
    USA-Canada Check:
    Ricerca Fusi Orari (Solo USA):
            
            TORNA AD AMMINISTRAZIONE         Old Lead Loader     LIST LOADER 4th Gen-     VERSIONE:     BUILD:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    Sovrascrittura ID Lista:
    Sovrascrittura Codice Telefono:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=get onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSIONE:     BUILD: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Elaborazione in corsofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Prefisso/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Prefisso"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRORE: Il file non ha il numero di campi necessare per essere elaborato.
    "; + } + } +##### END custom fields submission ##### + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ##### BEGIN process TEMPLATE file layout ##### + if ($file_layout=="template" && $template_id) + { + + $template_stmt="select * from vicidial_custom_leadloader_templates where template_id='$template_id'"; + $template_rslt=mysql_query($template_stmt, $link); + if (mysql_num_rows($template_rslt)==0) + { + echo "Error - template no longer exists"; die; + } + else + { + $template_row=mysql_fetch_array($template_rslt); + $template_id=$template_row["template_id"]; + $template_name=$template_row["template_name"]; + $template_description=$template_row["template_description"]; + $list_id_override=$template_row["list_id"]; + $standard_variables=$template_row["standard_variables"]; + $custom_table=$template_row["custom_table"]; + $custom_variables=$template_row["custom_variables"]; + $standard_fields_ary=explode("|", $standard_variables); + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $standard_fields_ary[$i]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_fields_ary=explode("|", $custom_variables); + if (count($custom_fields_ary)>0 && strlen($custom_table)>0) + { + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($i=0; $i0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$i]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES ("; + } + } + + print ""; + flush(); + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Elaborazione in corso$delim_name file using template $template_id... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + $custom_fields_row=$row; + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Prefisso/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Prefisso"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + +/* if ($multi_insert_counter > 8) +# { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; */ + $multi_insert_counter=0; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + #$custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + #$rslt=mysql_query($custom_SQL_query, $link); + #$affected_rows = mysql_affected_rows($link); + + $custom_ins_stmt="INSERT INTO $custom_table(lead_id"; + $custom_SQL_values=""; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + $custom_ins_stmt.=",$fieldno_ary[0]"; + $custom_SQL_values.=",'".$custom_fields_row[$$varname]."'"; + } + } + $custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)"; + $custom_rslt=mysql_query($custom_ins_stmt, $link); + $affected_rows = mysql_affected_rows($link); + echo "\n"; + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} +/* + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + + $custom_multistmt.="("; + for ($q=0; $q0) + { + $custom_fieldno_ary=explode(",", $custom_fields_ary[$q]); + $varname=$custom_fieldno_ary[0]; + $$varname=$row[$custom_fieldno_ary[1]]; + $custom_multistmt.="'".$$varname."',"; + } + } + $custom_multistmt=substr($custom_multistmt, 0, -1)."),"; + $multi_insert_counter++; + } */ + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + + $custom_ins_stmt="INSERT INTO $custom_table("; + for ($q=0; $q0) + { + $fieldno_ary=explode(",", $custom_fields_ary[$q]); + $custom_ins_stmt.="$fieldno_ary[0],"; + $varname=$fieldno_ary[0]."_field"; + $$varname=$fieldno_ary[1]; + } + } + $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); + mysql_query($custom_ins_stmt, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $custom_ins_stmt."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRORE: Il file non ha il numero di campi necessare per essere elaborato.
    "; + } + + } + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Elaborazione in corso$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Prefisso/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Prefisso"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRORE: Il file non ha il numero di campi necessare per essere elaborato.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else if ($file_layout=="custom") + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Elaborazione in corso$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColonnaDati File
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domenica March to First Domenica November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domenica March to First Domenica November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domenica, to 6=Sabato) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # ora locale calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domenica April to Last Domenica October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in April and last Domenica in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # ora locale calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domenica March to Last Domenica October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in March and last Domenica in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domenica October to Last Domenica March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in October and last Domenica in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domenica October to Last Domenica March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and last Domenica in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domenica in October to First Domenica in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and first Domenica in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domenica October to Third Domenica March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and third Domenica in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domenica in September to First Domenica in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in September and first Domenica in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domenica October to Last Domenica February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domenica October to Last Domenica February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_third_gen.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_third_gen.php new file mode 100644 index 00000000..dbd7d177 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_listloader_third_gen.php @@ -0,0 +1,2356 @@ + LICENSE: AGPLv2 +# +# ViciDial web-based lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100706-1250 - Forked script to create new script that will only load TXT(tab- +# delimited files) and use a perl script to convert others to TXT +# 100707-1040 - Converted List Id Override and Phone Code Override to drop downs +# 100707-1156 - Made it so you cannot submit with no lead file selected. Also fixed Start Over Link +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100728-0900 - Filtered uploaded filenames for unsupported characters +# 110424-0926 - Added option for time zone code in the owner field +# 110705-1947 - Added USACAN check for prefix and areacode +# 120221-0140 - Added User Group restrictions +# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled +# + +$version = '2.4-43'; +$build = '120223-2318'; + + +require("dbconnect.php"); + + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} + elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} + + +# if the didnt select an over ride wipe out in_file +if ( $list_id_override == "in_file" ) { $list_id_override = ""; } +if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads = $row[0]; + $LOGuser_group = $row[1]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; + } + } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"AIUTO\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) + { + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) + { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + } + else return $fontsize; /* Browser is not a Mac - don't touch fonts */ + } + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
    "; + +if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) ) + { + ?> +
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Carica Contatti Da Questo File:
    Sovrascrittura ID Lista: + +
    Sovrascrittura Codice Telefono: + +
    Struttura del file da usare:Standard Format    Struttura personalizzata
    Controlla Contatti Duplicati:
    USA-Canada Check:
    Ricerca Fusi Orari (Solo USA):
            
            TORNA AD AMMINISTRAZIONE         Old Lead Loader     LIST LOADER 3rd Gen-     VERSIONE:     BUILD:    
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Lead file:
    Sovrascrittura ID Lista:
    Sovrascrittura Codice Telefono:
    USA-Canada Check:
    Lead Duplicate Check:
    Lead Time Zone Lookup:
    + method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + Load Another Lead File         VERSIONE:     BUILD: +
    +



    + document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + print "
    Elaborazione in corsofile...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    "; + } + + if ($custom_fields_enabled > 0) + { + $tablecount_to_print=0; + $fieldscount_to_print=0; + $fields_to_print=0; + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + + if ($fieldscount_to_print > 0) + { + $stmt="SELECT field_label,field_type from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[0]; + $A_field_type[$o] = $rowx[1]; + $A_field_value[$o] = ''; + $o++; + } + } + } + } + + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + # print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + if ($tablecount_to_print > 0) + { + if ($fieldscount_to_print > 0) + { + $o=0; + while ($fields_to_print > $o) + { + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o] . "_field"; + + # if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Prefisso/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Prefisso"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRORE: Il file non ha il numero di campi necessare per essere elaborato.
    "; + } + } +##### END custom fields submission ##### + + + +if (($leadfile) && ($LF_path)) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + + + ##### BEGIN process standard file layout ##### + if ($file_layout=="standard") + { + print ""; + flush(); + + + $delim_set=0; + # csv xls xlsx ods sxc conversion + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=2) + { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
    Elaborazione in corso$delim_name file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    \n"; + } + while (!feof($file)) + { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) + { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + $valid_number=1; + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER LENGTH"; + } + if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) ) + { + $USprefix = substr($phone_number, 3, 1); + if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";} + if ($USprefix < 2) + { + $valid_number=0; + $invalid_reason = "INVALID PHONE NUMBER PREFIX"; + } + } + if ( (preg_match("/Prefisso/",$usacan_check)) and ($valid_number > 0) ) + { + $phone_areacode = substr($phone_number, 0, 3); + $stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';"; + if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_number=$row[0]; + if ($valid_number < 1) + { + $invalid_reason = "INVALID PHONE NUMBER Prefisso"; + } + } + + if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 )) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code,$owner); + + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + $good++; + } + else + { + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + if ($valid_number < 1) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + } + $bad++; + } + $total++; + if ($total%100==0) + { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($webroot_writable > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + print "

    Done
    GOOD: $good       BAD: $bad       TOTAL: $total
    "; + } + else + { + print "
    ERRORE: Il file non ha il numero di campi necessare per essere elaborato.
    "; + } + } + ##### END process standard file layout ##### + + + ##### BEGIN field chooser ##### + else + { + print "
    "; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); + + # csv xls xlsx ods sxc conversion + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) + { + $leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); + copy($LF_path, "/tmp/$leadfile_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $leadfile_name)) {$delim_name="CSV: Comma Separated Values";} + if (preg_match("/\.xls$/i", $leadfile_name)) {$delim_name="XLS: MS Excel 2000-XP";} + if (preg_match("/\.xlsx$/i", $leadfile_name)) {$delim_name="XLSX: MS Excel 2007+";} + if (preg_match("/\.ods$/i", $leadfile_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet";} + if (preg_match("/\.sxc$/i", $leadfile_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
    Elaborazione in corso$delim_name file...\n"; + + if (strlen($list_id_override)>0) + { + print "

    ID LISTA OVERRIDE FOR THIS FILE: $list_id_override

    "; + } + if (strlen($phone_code_override)>0) + { + print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    "; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } + else + { + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
    VICIDIAL ColonnaDati File
    ".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
            
    \r\n"; + + print ""; + } + ##### END field chooser ##### + + } + +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } + if ( ($postalgmt=="TZCODE") && (strlen($owner)>1) ) + { + $dst_range=''; + $dst='N'; + $gmt_offset=0; + + $stmt="select GMT_offset from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $PC_processed++; + $postalgmt_found++; + $post++; + } + + $stmt = "select distinct DST_range from vicidial_phone_codes where tz_code='$owner' and country_code='$phone_code' order by DST_range desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dst_range = $row[0]; + if (strlen($dst_range)>2) {$dst = 'Y';} + } + } + + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domenica March to First Domenica November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domenica March to First Domenica November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domenica, to 6=Sabato) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # ora locale calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domenica April to Last Domenica October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in April and last Domenica in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # ora locale calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domenica March to Last Domenica October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in March and last Domenica in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domenica October to Last Domenica March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in October and last Domenica in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domenica October to Last Domenica March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and last Domenica in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domenica in October to First Domenica in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and first Domenica in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domenica October to Third Domenica March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domenica in October and third Domenica in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domenica in September to First Domenica in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domenica in September and first Domenica in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + + if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domenica October to Last Domenica February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domenica October to Last Domenica February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # ora locale calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # ora locale calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + return $gmt_offset; + } + +?> +
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_lists_custom.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_lists_custom.php new file mode 100644 index 00000000..20cd865d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_lists_custom.php @@ -0,0 +1,1802 @@ + LICENSE: AGPLv2 +# +# this screen manages the custom lists fields in ViciDial +# +# changes: +# 100506-1801 - First Build +# 100507-1027 - Added name position and options position, added extra space for name and help +# 100508-1855 - Added field_order to allow for multiple fields on the same line +# 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option +# 100629-0200 - Added SCRIPT field type option +# 100722-1313 - Added field validation for label and name +# 100728-1724 - Added field validation for select lists and checkbox/radio buttons +# 100916-1754 - Do not show help in example form if help is empty +# 101228-2049 - Fixed missing PHP long tag +# 110629-1438 - Fixed change from DISPLAY or SCRIPT to other field type error, added HIDDEN and READONLY field types +# 110719-0910 - Added HIDEBLOB field type +# 110730-1106 - Added mysql reserved words check for add-field action +# 111025-1432 - Fixed case sensitivity on list fields +# 120122-1349 - Force vicidial_list custom field labels to be all lower case +# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-16'; +$build = '120223-2315'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["field_id"])) {$field_id=$_GET["field_id"];} + elseif (isset($_POST["field_id"])) {$field_id=$_POST["field_id"];} +if (isset($_GET["field_label"])) {$field_label=$_GET["field_label"];} + elseif (isset($_POST["field_label"])) {$field_label=$_POST["field_label"];} +if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} + elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +if (isset($_GET["field_description"])) {$field_description=$_GET["field_description"];} + elseif (isset($_POST["field_description"])) {$field_description=$_POST["field_description"];} +if (isset($_GET["field_rank"])) {$field_rank=$_GET["field_rank"];} + elseif (isset($_POST["field_rank"])) {$field_rank=$_POST["field_rank"];} +if (isset($_GET["field_help"])) {$field_help=$_GET["field_help"];} + elseif (isset($_POST["field_help"])) {$field_help=$_POST["field_help"];} +if (isset($_GET["field_type"])) {$field_type=$_GET["field_type"];} + elseif (isset($_POST["field_type"])) {$field_type=$_POST["field_type"];} +if (isset($_GET["field_options"])) {$field_options=$_GET["field_options"];} + elseif (isset($_POST["field_options"])) {$field_options=$_POST["field_options"];} +if (isset($_GET["field_size"])) {$field_size=$_GET["field_size"];} + elseif (isset($_POST["field_size"])) {$field_size=$_POST["field_size"];} +if (isset($_GET["field_max"])) {$field_max=$_GET["field_max"];} + elseif (isset($_POST["field_max"])) {$field_max=$_POST["field_max"];} +if (isset($_GET["field_default"])) {$field_default=$_GET["field_default"];} + elseif (isset($_POST["field_default"])) {$field_default=$_POST["field_default"];} +if (isset($_GET["field_cost"])) {$field_cost=$_GET["field_cost"];} + elseif (isset($_POST["field_cost"])) {$field_cost=$_POST["field_cost"];} +if (isset($_GET["field_required"])) {$field_required=$_GET["field_required"];} + elseif (isset($_POST["field_required"])) {$field_required=$_POST["field_required"];} +if (isset($_GET["name_position"])) {$name_position=$_GET["name_position"];} + elseif (isset($_POST["name_position"])) {$name_position=$_POST["name_position"];} +if (isset($_GET["multi_position"])) {$multi_position=$_GET["multi_position"];} + elseif (isset($_POST["multi_position"])) {$multi_position=$_POST["multi_position"];} +if (isset($_GET["field_order"])) {$field_order=$_GET["field_order"];} + elseif (isset($_POST["field_order"])) {$field_order=$_POST["field_order"];} +if (isset($_GET["source_list_id"])) {$source_list_id=$_GET["source_list_id"];} + elseif (isset($_POST["source_list_id"])) {$source_list_id=$_POST["source_list_id"];} +if (isset($_GET["copy_option"])) {$copy_option=$_GET["copy_option"];} + elseif (isset($_POST["copy_option"])) {$copy_option=$_POST["copy_option"];} +if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];} + elseif (isset($_POST["ConFiRm"])) {$ConFiRm=$_POST["ConFiRm"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $SScustom_fields_enabled = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ( (strlen($action) < 2) and ($list_id > 99) ) + {$action = 'MODIFY_CUSTOM_FIELDS';} +if (strlen($action) < 2) + {$action = 'LIST';} +if (strlen($DB) < 1) + {$DB=0;} +if ($field_size > 100) + {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $list_id = ereg_replace("[^0-9]","",$list_id); + $field_id = ereg_replace("[^0-9]","",$field_id); + $field_rank = ereg_replace("[^0-9]","",$field_rank); + $field_size = ereg_replace("[^0-9]","",$field_size); + $field_max = ereg_replace("[^0-9]","",$field_max); + $field_order = ereg_replace("[^0-9]","",$field_order); + $source_list_id = ereg_replace("[^0-9]","",$source_list_id); + + $field_required = ereg_replace("[^NY]","",$field_required); + + $field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); + $ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); + $name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); + $multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); + + $field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); + $copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); + + $field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); + $field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); + $field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); + $field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|status|entry_date|entry_list_id|modify_date|user|'; + +$mysql_reserved_words = +'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|'; + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads,custom_fields_modify,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGcustom_fields_modify = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + + + + + + + + + +ADMINISTRATION: Elenca Campo personalizzatos +<?php + +################################################################################ +##### BEGIN help section +if ($action == "AIUTO") + { + ?> + + + +
    +
    +
    + ViciDial Elenca Campo personalizzatos Help +

    + + +
    + Campo Etichetta - Questo è l'identificatore di campo del database per questo campo. Questo deve essere un identificatore univoco all'interno dei campi personalizzati per questa lista. Non utilizzare spazi o segni di punteggiatura per questo campo. max 50 caratteri, un minimo di 2 caratteri. È inoltre possibile includere i campi predefiniti ViciDial in un campo personalizzato di configurazione, e li vedrete in rosso nella lista. Questi campi non verranno aggiunti alla tabella di database personalizzato lista, l'interfaccia agente invece riferimento alla tabella vicidial_list direttamente. Le etichette che è possibile utilizzare per includere le fieds di default sono - + lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner +

    + +
    +
    + Nome del campo - Questo è il nome del campo come apparirà di un agente attraverso la loro interfaccia. È possibile utilizzare gli spazi in questo campo, ma senza punteggiatura caratteri, massimo di 50 caratteri e un minimo di 2 caratteri. +

    + +
    +
    + Campo Descrizione - La descrizione di questo campo come apparirà nell'interfaccia di amministrazione. Questo è un campo opzionale con un massimo di 100 caratteri. +

    + +
    +
    + Classifica di Campo - L'ordine in cui viene visualizzato questi campi per l'agente dal basso in alto al più alto sul fondo. +

    + +
    +
    + Field Order - If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. +

    + +
    +
    + Guida campi - Campo opzionale, se lo compila, l'agente sarà in grado di vedere questo testo quando si fa clic su un link di aiuto accanto al campo nella loro interfaccia agente. +

    + +
    +
    + Tipo di campo - Questa opzione definisce il tipo di campo che verrà visualizzato. TEXT è uno standard a riga singola scheda di iscrizione, AREA è un multi-line casella di testo, SELECT è una selezione singola menu a discesa, è un multiplo MULTI-select box, RADIO è un elenco di pulsanti di opzione in cui una sola opzione può essere selezionato, CHECKBOX è una lista di caselle di controllo, dove molteplici opzioni possono essere selezionate, DATE è un giorno mese anno di calendario popup in cui l'agente può selezionare la data e ora è tempo di una casella di selezione. Il valore predefinito è TEXT. Per le opzioni SELECT, MULTI, RADIO e CHECKBOX è necessario definire i valori di opzione di seguito nella casella Opzioni per campo. DISPLAY visualizzerà solo e non consentire la modifica da parte dell'agente. SCRIPT mostrerà anche solo, ma voi siete in grado di utilizzare le variabili dello script, proprio come nella funzione Script. Campi SCRIPT anche solo visualizzare il contenuto nelle opzioni, e non il nome del campo come il tipo DISPLAY fa. HIDDEN non mostrerà l'agente del campo, ma permetterà al settore di disporre di dati importati ed esportati in esso da esso, così come hanno a disposizione la scheda script e forma l'indirizzo web. READONLY visualizzare il valore dei dati nel campo, ma non consentirà l'agente di modificare i dati. NASCONDIBLOB è simile al HIDDEN eccezione del tipo di memorizzazione dei dati nel database è di tipo BLOB, adatto per i dati binari o dati che deve essere garantito. +

    + +
    +
    + Opzioni dei campi - Per la SELECT, MULTI, RADIO e tipi di campo CheckBox, è necessario definire i valori di opzione in questa casella. È necessario inserire un elenco di etichetta opzionale separati da virgola e il testo qui con opzione di ciascuna opzione una sua propria linea. Il primo valore non deve avere spazi, e né i valori dovrebbero avere alcun segno di punteggiatura. Per esempio - electric_meter, contatore elettrico +

    + +
    +
    + Opzione di posizione - Per i tipi di campo CheckBox e RADIO solo, se impostato su ORIZZONTALE le opzioni appariranno sulla stessa linea eventualmente capo alla riga qui sotto se ci sono molte opzioni. Se è impostato su VERTICAL ci sarà una sola opzione per riga. Il valore predefinito è ORIZZONTALE. +

    + +
    +
    + Dimensione campo - Questa impostazione significa cose diverse a seconda di quale sia il tipo di campo. Per i campi di testo, la dimensione è il numero di caratteri che mostrerà sul campo. Per i campi di AREA, la dimensione è la larghezza della casella di testo in caratteri. Per i campi MULTI, questa impostazione definisce il numero di opzioni per essere mostrati nella lista multi selezione. Per SELECT, RADIO, CHECKBOX, DATE e TIME questa impostazione viene ignorata. +

    + +
    +
    + Campo Max - Questa impostazione significa cose diverse a seconda di quale sia il tipo di campo. Per il testo, i campi nascosti e READONLY, la dimensione è il numero massimo di caratteri consentiti nel campo. Per i campi della zona, questo campo definisce il numero di righe di testo visibili nella casella di testo. Per MULTI, SELECT, RADIO, CHECKBOX, DATE e TIME questa impostazione viene ignorata. +

    + +
    +
    + Campo di default - Questo campo facoltativo consente di definire il valore da assegnare a un campo se non viene caricato in quel campo. Il valore predefinito è NULL che disabilita la funzione predefinita. Per i tipi di campo DATE, il default è sempre impostato a oggi meno che un numero viene inserito in nel qual caso la data sarà che molti giorni più o meno oggi. Per i tipi di campo TIME, il default è sempre impostato al tempo corrente del server a meno che un numero viene inserito in nel qual caso il tempo sarà che molti minuti più o meno ora corrente. +

    + +
    +
    + Campo Costo - Questo campo di sola lettura indica che il costo di questo campo è nella tabella campo personalizzato per questa lista. Non vi è alcun limite per il numero di campi personalizzati si possono avere in un elenco, ma il totale del costo di tutti i campi per la lista deve essere inferiore a 65000. Questo permette in genere di centinaia di campi, ma se si specificare i campi di testo che sono centinaia o migliaia di caratteri di lunghezza quindi si può colpire questo limite in fretta. Se avete bisogno di molto più che il testo in un campo si consiglia di scegliere un tipo di AREA, che vengono memorizzati in modo diverso e non utilizzare lo spazio tabella come più. +

    + +
    +
    + Un campo obbligatorio - Se impostato su Y, in questo campo forzerà l'agente per inserire il testo o selezionare un'opzione per questo campo. Il valore predefinito è N. +

    + +
    +
    + Nome del campo Posizione - Se impostato a sinistra, questo il nome del campo appare alla sinistra del campo, se impostato al TOP il nome del campo assumerà tutta la linea e appaiono sopra il campo. Predefinito è left. +

    + +
    +
    + CopiaOpzione - Quando si copiano le definizioni dei campi da un elenco ad un altro, avete alcune opzioni per come funziona il processo di copia. APPEND aggiungere i campi che non sono presenti nella lista di destinazione, se vi sono corrispondenti etichette dei campi volontà quelli rimasti intatti, non di dati di campo personalizzati saranno cancellati o modificati utilizzando questa opzione. UPDATE aggiornare i campi comuni field_label nella lista di destinazione per le definizioni dei campi dalla lista sorgente. dati di campo personalizzato può essere modificato o perso con questa opzione. SOSTITUIRE rimuoverà tutti i campi personalizzati esistenti nella lista di destinazione e sostituirli con i campi personalizzati dalla lista sorgente, tutti i dati di campo personalizzato saranno eliminati utilizzando questa opzione. +

    + +
    + + + '; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGcustom_fields_modify < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + +if ($SScustom_fields_enabled < 1) + { + echo "ERRORE: I campi personalizzati non sono attivi su questo sistema\n"; + exit; + } + + +$NWB = "   \"AIUTO\""; + + +if ($DB > 0) +{ +echo "$DB,$action,$ip,$user,$copy_option,$field_id,$list_id,$source_list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order"; +} + + + + + +################################################################################ +##### BEGIN copy fields to a list form +if ($action == "COPY_FIELDS_FORM") + { + ##### get lists listing for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists order by list_id"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $lists_list=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $lists_list .= "\n"; + $o++; + } + + echo "
    \n"; + echo ""; + echo "
    Copia campi ad un'altra lista
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Elencare ID per copiare i campi da:
    Elencare ID Copia Campi:
    CopiaOpzione: $NWB#vicidial_lists_fields-copy_option$NWE
    \n"; + echo "
    \n"; + } +### END copy fields to a list form + + + + +################################################################################ +##### BEGIN copy list fields submit +if ( ($action == "COPY_FIELDS_INVIA") and ($list_id > 99) and ($source_list_id > 99) and (strlen($copy_option) > 2) ) + { + if ($list_id=="$source_list_id") + {echo "ERRORE: Non è possibile copiare i campi alla stessa lista: $list_id|$source_list_id";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$source_list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $source_field_exists = $rowx[0]; + } + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($source_field_exists < 1) + {echo "ERROR: nell'elenco Sorgente non ha campi personalizzati\n
    ";} + else + { + ##### REPLACE option ##### + if ($copy_option=='REPLACE') + { + if ($DB > 0) {echo "Starting REPLACE copy\n
    ";} + if ($table_exists > 0) + { + $stmt="SELECT field_id,field_label from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCCESSO: Campo personalizzato eliminata - $list_id|$A_field_label[$o]\n
    "; + $o++; + } + } + $copy_option='APPEND'; + } + ##### APPEND option ##### + if ($copy_option=='APPEND') + { + if ($DB > 0) {echo "Starting APPEND copy\n
    ";} + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + + $o=0; + while ($fields_to_print > $o) + { + $new_field_exists=0; + if ($table_exists > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $new_field_exists = $rowx[0]; + } + } + if ($new_field_exists < 1) + { + $temp_field_label = $A_field_label[$o]; + if (preg_match("/\|$temp_field_label\|/i",$vicidial_list_fields)) + {$A_field_label[$o] = strtolower($A_field_label[$o]);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCCESSO: Campo personalizzato Aggiunto - $list_id|$A_field_label[$o]\n
    "; + + if ($table_exists < 1) {$table_exists=1;} + } + $o++; + } + } + ##### UPDATE option ##### + if ($copy_option=='UPDATE') + { + if ($DB > 0) {echo "Starting UPDATE copy\n
    ";} + if ($table_exists < 1) + {echo "ERRORE: La tabella non esiste custom_$list_id\n
    ";} + else + { + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$source_list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $o++; + } + + $o=0; + while ($fields_to_print > $o) + { + $stmt="SELECT field_id from vicidial_lists_fields where list_id='$list_id' and field_label='$A_field_label[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $current_field_id = $rowx[0]; + + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields); + + echo "SUCCESSO: Campo personalizzato modificato - $list_id|$A_field_label[$o]\n
    "; + } + $o++; + } + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } + } +### END copy list fields submit + + + + + +################################################################################ +##### BEGIN delete custom field confirmation +if ( ($action == "DELETE_CUSTOM_FIELD_CONFIRMATION") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRORE: Il campo non esiste\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERRORE: La tabella non esiste custom_$list_id\n
    ";} + else + { + echo "

    CLICCA QUI per confermare l'eliminazione di questo campo CUSTOM: $field_label - $field_id - $list_id

    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field confirmation + + + + +################################################################################ +##### BEGIN delete custom field +if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0) and (strlen($field_label) > 0) and ($ConFiRm=='YES') ) + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRORE: Il campo non esiste\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERRORE: La tabella non esiste custom_$list_id\n
    ";} + else + { + ### delete field function + delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCCESSO: Campo personalizzato eliminata - $list_id|$field_label\n
    "; + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END delete custom field + + + + +################################################################################ +##### BEGIN add new custom field +if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label='$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + if ( (strlen($field_label)<1) or (strlen($field_name)<2) or (strlen($field_size)<1) ) + {echo "ERROR: You must enter a field label, field name and field size - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + if (preg_match("/\|$field_label\|/i",$mysql_reserved_words)) + {echo "ERRORE: Non è possibile utilizzare le parole riservate per le etichette dei campi - $list_id|$field_label|$field_name|$field_size\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Devi inserire opzioni di campo quando si aggiunge un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + if ($field_exists > 0) + {echo "ERRORE: Il campo esiste già per questa lista - $list_id|$field_label\n
    ";} + else + { + $table_exists=0; + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + ### add field function + add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields,$mysql_reserved_words); + + echo "SUCCESSO: Campo personalizzato Aggiunto - $list_id|$field_label\n
    "; + } + } + } + } + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END add new custom field + + + + +################################################################################ +##### BEGIN modify custom field submission +if ( ($action == "MODIFY_CUSTOM_FIELD_INVIA") and ($list_id > 99) and ($field_id > 0) ) + { + ### connect to your vtiger database + $linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysql_error());} + mysql_select_db("$VARDB_database", $linkCUSTOM); + + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_id='$field_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $field_exists = $rowx[0]; + } + + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($field_exists < 1) + {echo "ERRORE: Il campo non esiste\n
    ";} + else + { + if ($table_exists < 1) + {echo "ERRORE: La tabella non esiste\n
    ";} + else + { + $TEST_valid_options=0; + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + { + $TESTfield_options_array = explode("\n",$field_options); + $TESTfield_options_count = count($TESTfield_options_array); + $te=0; + while ($te < $TESTfield_options_count) + { + if (preg_match("/,/",$TESTfield_options_array[$te])) + { + $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); + if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) + {$TEST_valid_options++;} + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + } + + if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) + {echo "ERROR: Devi inserire opzioni di campo quando si aggiorna un SELECT, MULTI, RADIO or CHECKBOX field type - $list_id|$field_label|$field_type|$field_options\n
    ";} + else + { + ### modify field function + modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields); + + echo "SUCCESSO: Campo personalizzato modificato - $list_id|$field_label\n
    "; + } + } + } + + $action = "MODIFY_CUSTOM_FIELDS"; + } +### END modify custom field submission + + + + + +################################################################################ +##### BEGIN modify custom fields for list +if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) + { + echo "\n"; + echo "
    \n"; + + $custom_records_count=0; + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + } + } + + echo ""; + echo "
    Modificarecampo personalizzatos: ID Lista $list_id         "; + echo "Record in questa tabella personalizzata: $custom_records_count
    \n"; + echo "
    \n"; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + + ### SINTESI DEI CAMPI ### + echo "
    SINTESI DEI CAMPI:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $total_cost = ($total_cost + $A_field_cost[$o]); + $o++; + } + + if ($fields_to_print < 1) + {echo "";} + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + } + echo "
    RANK     LABEL     NAME     TYPE     COST    
    $A_field_rank[$o] - $A_field_order[$o]     $LcolorB$A_field_label[$o]$LcolorE     $A_field_name[$o]     $A_field_type[$o]     $A_field_cost[$o]    
    Esistono no custom fields for this list
    TOTALI: $o             $total_cost    


    \n"; + + + ### ESEMPIO DI MODULO CUSTOM ### + echo "\n"; + echo "
    ESEMPIO DI MODULO CUSTOM:\n"; + echo "
    \n"; + if ($fields_to_print < 1) + {echo "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "         ";} + else + { + echo "\n"; + echo "
    Esistono no custom fields for this list
    "; + } + echo "$A_field_name[$o]"; + if ($A_name_position[$o]=='TOP') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo "     $helpHTML
    "; + } + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {echo "  ";} + else + {echo "
    ";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
    \n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='READONLY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='HIDDEN') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='NASCONDIBLOB') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "-- HIDDEN --\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ($A_name_position[$o]=='LEFT') + { + $helpHTML = "help+"; + if (strlen($A_field_help[$o])<1) + {$helpHTML = '';} + echo " $field_HTML   $helpHTML"; + } + else + { + echo " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + echo "


    \n"; + + + ### Modificare i campi ### + echo "
    Modificare i campi ESISTENTI:\n"; + $o=0; + while ($fields_to_print > $o) + { + $LcolorB=''; $LcolorE=''; + $reserved_test = $A_field_label[$o]; + if (preg_match("/\|$reserved_test\|/i",$vicidial_list_fields)) + { + $LcolorB=''; + $LcolorE=''; + } + if (eregi("1$|3$|5$|7$|9$", $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Campo Etichetta $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#vicidial_lists_fields-field_label$NWE
    Classifica di Campo $A_field_rank[$o]:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Nome del campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_name$NWE
    Nome del campo Posizione $A_field_rank[$o]: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descrizione $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_description$NWE
    Guida campi $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo di campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_type$NWE
    Opzioni dei campi $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE
    Opzione di posizione $A_field_rank[$o]: $NWB#vicidial_lists_fields-multi_position$NWE
    Dimensione campo $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_max$NWE
    Campo di default $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_default$NWE
    Un campo obbligatorio $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_required$NWE
                 \n"; + echo "DELETE THIS CUSTOM FIELD"; + echo "


    \n"; + + $o++; + } + + $bgcolor = ' bgcolor=#BDFFBD'; + + echo "
    \n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Aggiungere un nuovo campo personalizzato per questo LIST:
    New Classifica di Campo:   $NWB#vicidial_lists_fields-field_rank$NWE \n"; + echo "         Field Order:   $NWB#vicidial_lists_fields-field_order$NWE
    Campo Etichetta: $NWB#vicidial_lists_fields-field_label$NWE
    Nome del campo: $NWB#vicidial_lists_fields-field_name$NWE
    Nome del campo Posizione: $NWB#vicidial_lists_fields-name_position$NWE
    Campo Descrizione: $NWB#vicidial_lists_fields-field_description$NWE
    Guida campi: $NWB#vicidial_lists_fields-field_help$NWE
    Tipo di campo: $NWB#vicidial_lists_fields-field_type$NWE
    Opzioni dei campi: $NWB#vicidial_lists_fields-field_options$NWE
    Opzione di posizione: $NWB#vicidial_lists_fields-multi_position$NWE
    Dimensione campo: $NWB#vicidial_lists_fields-field_size$NWE
    Campo Max: $NWB#vicidial_lists_fields-field_max$NWE
    Campo di default: $NWB#vicidial_lists_fields-field_default$NWE
    Un campo obbligatorio: $NWB#vicidial_lists_fields-field_required$NWE


    \n"; + echo "


    \n"; + echo "
    \n"; + + echo "  Vai alla pagina di modifica della lista per questa lista

    \n"; + + echo "  Clicca qui per vedere i cambiamenti Admin a questa listas custom fields


      \n"; + } +### END modify custom fields for list + + + + +################################################################################ +##### BEGIN list lists as well as the number of custom fields in each list +if ($action == "LIST") + { + $stmt="SELECT list_id,list_name,active,campaign_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_list_id[$o] = $rowx[0]; + $A_list_name[$o] = $rowx[1]; + $A_active[$o] = $rowx[2]; + $A_campaign_id[$o] = $rowx[3]; + $o++; + } + + echo "
    ANNUNCI DI LISTINO CON campi personalizzati COUNT:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $A_list_fields_count[$o]=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$A_list_id[$o]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $A_list_fields_count[$o] = $rowx[0]; + } + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "
    ID LISTANOME LISTAATTIVOCAMPAGNACUSTOM FIELDSMODIFICA
    $A_list_id[$o] $A_list_name[$o] $A_active[$o] $A_campaign_id[$o] $A_list_fields_count[$o]Modificare i campi
    \n"; + } +### END list lists as well as the number of custom fields in each list + + + + + +################################################################################ +##### BEGIN admin log display +if ($action == "ADMIN_LOG") + { + if ($LOGuser_level >= 9) + { + echo "\n"; $call_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + } + } + $campaign_id = $row[3]; } @@ -532,6 +640,21 @@ else $closer_log .= "\n"; $closer_log .= "\n"; + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysql_real_escape_string($lead_id) . "' and vicidial_id='$row[0]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + if (strlen($rowA[0]) > 0) + { + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + } + } + $campaign_id = $row[3]; } @@ -540,6 +663,60 @@ else $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[11]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[11]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[11] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[11] = preg_replace("/./",'X',$phone_temp);} + } + } + if ($LOGadmin_hide_lead_data != '0') + { + if ($DB > 0) {echo "NASCONDILEADDATA|$row[5]|$row[6]|$row[12]|$row[13]|$row[14]|$row[15]|$row[16]|$row[17]|$row[18]|$row[19]|$row[20]|$row[21]|$row[22]|$row[26]|$row[27]|$row[28]|$LOGadmin_hide_lead_data|\n";} + if (strlen($row[5]) > 0) + {$data_temp = $row[5]; $row[5] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[6]) > 0) + {$data_temp = $row[6]; $row[6] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[12]) > 0) + {$data_temp = $row[12]; $row[12] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[13]) > 0) + {$data_temp = $row[13]; $row[13] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[14]) > 0) + {$data_temp = $row[14]; $row[14] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[15]) > 0) + {$data_temp = $row[15]; $row[15] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[16]) > 0) + {$data_temp = $row[16]; $row[16] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[17]) > 0) + {$data_temp = $row[17]; $row[17] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[18]) > 0) + {$data_temp = $row[18]; $row[18] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[19]) > 0) + {$data_temp = $row[19]; $row[19] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[20]) > 0) + {$data_temp = $row[20]; $row[20] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[21]) > 0) + {$data_temp = $row[21]; $row[21] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[22]) > 0) + {$data_temp = $row[22]; $row[22] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[26]) > 0) + {$data_temp = $row[26]; $row[26] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[27]) > 0) + {$data_temp = $row[27]; $row[27] = preg_replace("/./",'X',$data_temp);} + if (strlen($row[28]) > 0) + {$data_temp = $row[28]; $row[28] = preg_replace("/./",'X',$data_temp);} + } + if (strlen($row[0]) > 0) {$lead_id = $row[0];} $dispo = $row[3]; @@ -573,7 +750,34 @@ else $owner = $row[33]; $entry_list_id = $row[34]; - echo "
    Informazioni Chiamata: $first_name $last_name - $phone_number

    \n"; + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
    Aggiungi un nuovo elettrocatetere\n";} + else + {echo "
    Informazioni Chiamata: $first_name $last_name - $phone_number\n";} + + echo "

    \n"; echo "\n"; echo "\n"; echo "\n"; @@ -587,298 +791,568 @@ else echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='CUSTOM_FIELDS' and record_id='$list_id' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
    ADMIN Change Log: Sezione 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"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUTENTEIPSECTIONTYPERECORD IDDESCRIZIONEGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Versione: $admin_version     Build: $build"; + +?> + + + + + + 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if ($table_exists < 1) + {$field_sql = "CREATE TABELLA custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";} + else + {$field_sql = "ALTER TABELLA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + if ($field_cost < 1) {$field_cost=1;}; + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + if ($field_max < 1) {$field_max=1;}; + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='NASCONDIBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default != 'NULL') and ($field_type!='AREA') and ($field_type!='DATE') and ($field_type!='TIME') ) + {$field_sql .= "default '$field_default'";} + + if ($table_exists < 1) + {$field_sql .= ");";} + else + {$field_sql .= ";";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END add field function + + + + + +################################################################################ +##### BEGIN modify field function +function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + $field_db_exists=0; + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + {$field_db_exists=1;} + else + { + $stmt="MOSTRA COLUMNS from custom_$list_id LIKE '$field_label';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $field_db_exists = mysql_num_rows($rslt); + } + if ($field_db_exists > 0) + {$field_sql = "ALTER TABELLA custom_$list_id MODIFY $field_label ";} + else + {$field_sql = "ALTER TABELLA custom_$list_id ADD $field_label ";} + + $field_options_ENUM=''; + $field_cost=1; + if ( ($field_type=='SELECT') or ($field_type=='RADIO') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_sql .= "ENUM($field_options_ENUM) "; + $field_cost = strlen($field_options_ENUM); + } + if ( ($field_type=='MULTI') or ($field_type=='CHECKBOX') ) + { + $field_options_array = explode("\n",$field_options); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_options_value_array = explode(",",$field_options_array[$te]); + $field_options_ENUM .= "'$field_options_value_array[0]',"; + } + $te++; + } + $field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM); + $field_cost = strlen($field_options_ENUM); + $field_sql .= "VARCHAR($field_cost) "; + } + if ( ($field_type=='TEXT') or ($field_type=='HIDDEN') or ($field_type=='READONLY') ) + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } + if ($field_type=='NASCONDIBLOB') + { + $field_sql .= "BLOB "; + $field_cost = 15; + } + if ($field_type=='AREA') + { + $field_sql .= "TEXT "; + $field_cost = 15; + } + if ($field_type=='DATE') + { + $field_sql .= "DATE "; + $field_cost = 10; + } + if ($field_type=='TIME') + { + $field_sql .= "TIME "; + $field_cost = 8; + } + $field_cost = ($field_cost * 3); # account for utf8 database + + if ( ($field_default == 'NULL') or ($field_type=='AREA') or ($field_type=='DATE') or ($field_type=='TIME') ) + {$field_sql .= ";";} + else + {$field_sql .= "default '$field_default';";} + + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END modify field function + + + + + +################################################################################ +##### BEGIN delete field function +function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields) + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) + { + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + } + else + { + $stmtCUSTOM="ALTER TABELLA custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {echo('Could not execute: ' . mysql_error());} + } + + $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + $field_update = mysql_affected_rows($link); + if ($DB) {echo "$field_update|$stmt\n";} + if (!$rslt) {echo('Could not execute: ' . mysql_error());} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtCUSTOM"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } +##### END delete field function diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php index d199d2b9..9aeab4fd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -39,6 +39,13 @@ # 100703-1122 - Added custom fields display/edit # 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time +# 110212-2041 - Added compatibility with definable scheduled callback statuses +# 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display +# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -128,6 +135,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -140,6 +149,12 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} + elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -150,7 +165,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -159,6 +174,7 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $custom_fields_enabled = $row[1]; + $webroot_writable = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -187,7 +203,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -203,26 +219,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } else { - if($auth>0) { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -272,25 +289,67 @@ if (strlen($row[16])>0) {$label_security_phrase = $row[16];} if (strlen($row[17])>0) {$label_email = $row[17];} if (strlen($row[18])>0) {$label_comments = $row[18];} + +### find out if status(dispo) is a scheduled callback status +$scheduled_callback=''; +$stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } +$stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; +$rslt=mysql_query($stmt, $link); +$scb_count_to_print = mysql_num_rows($rslt); +if ($scb_count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + } + ?> ADMINISTRATION: Registro del Lead modificado + +
    ADMINISTRATION: Registro del Lead modificado
    \n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "Il piombo è stato aggiunto: $lead_id

    \n"; + $end_call=0; + } + else + {echo "ERRORE: Il piombo non sono stati aggiunti, per favore torna indietro e guardare a ciò che hai inserito

    \n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "informazione modificata

    \n"; + echo "Go back to the lead modification page

    \n"; echo "
    \n"; ### LOG INSERTION Admin Log Table ### @@ -310,7 +369,7 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + if ( ($dispo != $status) and ( ($dispo == 'CALLBK') or ($scheduled_callback == 'Y') ) ) { ### inactivate vicidial_callbacks record for this lead $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; @@ -320,6 +379,31 @@ if ($end_call > 0) echo "
    vicidial_callback record inactivated: $lead_id
    \n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    Scheduled Callback added: $lead_id - $phone_number
    \n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -368,7 +452,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -377,7 +461,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -386,7 +470,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -394,7 +478,16 @@ else echo "
    vicidial_callback record changed to USERONLY, user: $CBuser
    \n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "',lead_status='" . mysql_real_escape_string($CBstatus) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    vicidial_callback record changed to $appointment_date $appointment_time $CBstatus
    \n"; + } + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -465,6 +558,21 @@ else $call_log .= "
    $row[15]   $row[10]
    NOTES:   $rowA[0]
      $row[14]   $row[17]
    NOTES:   $rowA[0]
    \n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + 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"; + 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 status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses where selectable='Y' order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - $DS=0; - while ($statuses_to_print > $o) + if ($lead_id != 'NEW') { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + { + echo "\n"; } - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where selectable='Y' and campaign_id='$list_campaign' order by status"; - $rslt=mysql_query($stmt, $link); - $CAMPstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($CAMPstatuses_to_print > $o) + if ( ($LOGadmin_hide_lead_data == '0') or ($lead_id == 'NEW') ) { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "\n"; } - - - if ($DS < 1) {$statuses_list .= "\n";} - echo "$statuses_list"; - echo "(with $list_campaign statuses)\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; echo "
    $label_vendor_lead_code: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID Lista: $list_id     Called Count: $called_count
    Lead ID: $lead_id     ID Lista: $list_id
    Fronter: $tsr     Called Count: $called_count
    $label_title:   \n"; - echo "$label_first_name:
    $label_middle_initial:   \n"; - echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; - echo " $label_postal_code:
    $label_province :
    Stato :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    Rank :
    Owner :
    $label_comments :
    Esito:
    $label_title: $title   \n"; + echo "$label_first_name: $first_name
    $label_middle_initial: $middle_initial   \n"; + echo " $label_last_name: $last_name
    $label_address1 : $address1
    $label_address2 : $address2
    $label_address3 : $address3
    $label_city : $city
    $label_state: $state   \n"; + echo " $label_postal_code: $postal_code
    $label_province : $province
    Stato : $country_code
    $label_phone_number : $phone_number
    $label_phone_code : $phone_code
    $label_alt_phone : $alt_phone
    $label_email : $email
    $label_security_phrase : $security
    $label_vendor_lead_code : $vendor_id>
    Rank : $rank
    Owner : $owner
    $label_comments : $comments
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    Stato :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    $label_vendor_lead_code :
    Rank :
    Owner :
    $label_comments :
    Esito: (with $list_campaign statuses)
    Modificarevicidial log
    Modificareagent log
    Modificarecloser log
    Add closer log record
    Modificarevicidial log
    Modificareagent log
    Modificarecloser log
    Add closer log record
    \n"; echo "


    \n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + if ($lead_id != 'NEW') { - ### find any vicidial_callback records for this lead - $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 lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) + echo "
    \n"; + echo "Callback Dettagliatas:
    \n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { - if ($rowx[9] == 'USERONLY') - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    \n"; + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

    \n"; + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

    \n"; + } + else + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

    \n"; + } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
    +
    Change Scheduled Callback Date:
    + + + + + + + + + + + + + + + + + +
    + > + + + + +
    CallBack Date/Time: + + +     + + : + + +
    + Callback Disposition: +
    + Note: + + +
    + + + + +
    + +
    + +
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

    \n"; + echo "
    No Callback records found
    \n"; } + } else { - echo "
    No Callback records found
    \n"; + echo "
    Se si desidera modificare il cavo a un callback previsto, innanzitutto modificare la disposizione a CBHOLD, quindi inviare e sarete in grado di impostare la data e l'ora callback.
    \n"; } - } + echo "
    \n"; + echo "

    \n"; - echo "

    \n"; + echo "
    \n"; - echo "
    \n"; - - if ($c > 0) - { - echo "EXTENDED ALTERNATE NUMERI DI TELEFONO PER QUESTA PIOMBO:\n"; - echo "\n"; - echo "\n"; - - echo "$alts_output\n"; - - echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; - echo "

    \n"; - } - - - - ### iframe for custom fields display/editing - if ($custom_fields_enabled > 0) - { - $CLlist_id = $list_id; - if (strlen($entry_list_id) > 2) - {$CLlist_id = $entry_list_id;} - $stmt="MOSTRA TABELLAS LIKE \"custom_$CLlist_id\";"; - if ($DB>0) {echo "$stmt";} - $rslt=mysql_query($stmt, $link); - $tablecount_to_print = mysql_num_rows($rslt); - if ($tablecount_to_print > 0) + if ($c > 0) { - $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + echo "EXTENDED ALTERNATE NUMERI DI TELEFONO PER QUESTA PIOMBO:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
    # ALT PHONE ALT NOTE ALT COUNT ACTIVE
    \n"; + echo "

    \n"; + } + + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="MOSTRA TABELLAS LIKE \"custom_$CLlist_id\";"; if ($DB>0) {echo "$stmt";} $rslt=mysql_query($stmt, $link); - $fieldscount_to_print = mysql_num_rows($rslt); - if ($fieldscount_to_print > 0) + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) { - $rowx=mysql_fetch_row($rslt); - $custom_records_count = $rowx[0]; - - echo "CUSTOM FIELDS FOR THIS LEAD:
    \n"; - echo "\n"; - echo "

    "; - } - } - } - - - echo "CHIAMATE VERSO QUESTO CONTATTO:\n"; - echo "\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNA LIST LEAD HANGUP REASON PHONE
    \n"; - echo "

    \n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNA LIST LEAD WAIT HANGUP REASON
    \n"; - echo "

    \n"; - - - echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
    # DATE/TIME CAMPAGNA TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; - echo "

    \n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - if ($DB) {echo "$logs_to_print|$stmt|\n";} - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) - { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) - { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if (eregi("ALT_IP",$rowx[0])) + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "Campi personalizzati per QUESTO FILO:
    \n"; + echo "\n"; + echo "

    "; } } } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "CHIAMATE VERSO QUESTO CONTATTO:\n"; + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
    \n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNA LIST LEAD HANGUP REASON PHONE
    \n"; + echo "

    \n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNA LIST LEAD WAIT HANGUP REASON
    \n"; + echo "

    \n"; + + + echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
    # DATE/TIME CAMPAGNA TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
    \n"; + echo "

    \n"; + + + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # CAMPAGNADATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
    $u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modificarechanges to this lead\n"; + } + + echo "\n"; } - - - echo "


    \n"; - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $admin_display=$row[0]; - if ($admin_display > 0) - { - echo "Click here to see Lead Modificarechanges to this lead\n"; - } - - echo "\n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_phones_bulk_insert.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_phones_bulk_insert.php new file mode 100644 index 00000000..cb77407c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_phones_bulk_insert.php @@ -0,0 +1,538 @@ + LICENSE: AGPLv2 +# +# this screen will insert phones into your multi-server system with aliases +# +# changes: +# 101230-0501 - First Build +# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP +# 120104-2023 - Added webphone options +# 120209-1545 - Added phone context option +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# + +$admin_version = '2.4-5'; +$build = '120223-2249'; + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["servers"])) {$servers=$_GET["servers"];} + elseif (isset($_POST["servers"])) {$servers=$_POST["servers"];} +if (isset($_GET["phones"])) {$phones=$_GET["phones"];} + elseif (isset($_POST["phones"])) {$phones=$_POST["phones"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["alias_option"])) {$alias_option=$_GET["alias_option"];} + elseif (isset($_POST["alias_option"])) {$alias_option=$_POST["alias_option"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["alias_suffix"])) {$alias_suffix=$_GET["alias_suffix"];} + elseif (isset($_POST["alias_suffix"])) {$alias_suffix=$_POST["alias_suffix"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +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["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["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} + + +if (strlen($action) < 2) + {$action = 'BLANK';} +if (strlen($DB) < 1) + {$DB=0;} + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $servers = ereg_replace("'|\"|\\\\|;","",$servers); + $phones = ereg_replace("'|\"|\\\\|;","",$phones); + $action = ereg_replace("[^-_0-9a-zA-Z]","",$action); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); + $alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ast_delete_phones='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($webroot_writable > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$user = $PHP_AUTH_USER; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,ast_delete_phones,ast_admin_access,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGast_delete_phones = $row[1]; + $LOGast_admin_access = $row[2]; + $LOGuser_level = $row[3]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + + +ADMINISTRATION: Phones Bulk Insert +<?php + +################################################################################ +##### BEGIN help section +if ($action == "HELP") + { + ?> + + + +
    +
    +
    + Bulk Phones Insert Help +

    + + +
    + Servers - This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box. +

    + +
    +
    + Phones - This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box. +

    + +
    +
    + Registration Password - This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons. +

    + +
    +
    + Login Password - This is the agent screen login password that will be used for all of the phones that are created. +

    + +
    +
    + Create Alias Entries - Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface. +

    + +
    +
    + Alias Suffix - This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x. +

    + +
    +
    + Client Protocol - This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers. +

    + +
    +
    + Local GMT - This is the time zone that all of the phones will be created with. +

    + +
    +
    + Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. +

    + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link. + +
    +
    +
    + Webphone Auto-Answer - This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y. + +
    +
    +
    + Use External Server IP - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. + + +
    + + + '; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +if ( ($LOGast_admin_access < 1) or ($LOGuser_level < 8) ) + { + echo "You are not authorized to view this section\n"; + exit; + } + + +if ($DB > 0) +{ +echo "$DB,$action,$servers,$phones,$conf_secret,$pass,$alias_option,$protocol,$logal_gmt,$alias_suffix\n
    "; +} + +$NWB = "   \"HELP\""; + + + + +################################################################################ +##### BEGIN blank add phones form +if ($action == "BLANK") + { + echo "
    \n"; + echo ""; + echo "
    Add Multi-Server Phones Form
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Servers:

    (one server_ip per line only)
    $NWB#servers$NWE
    Phones:

    (one extension per line only)
    $NWB#phones$NWE
    Registration Password: $NWB#registration_password$NWE
    Login Password: $NWB#login_password$NWE
    Create Alias Entries: $NWB#create_alias$NWE
    Alias Suffix: $NWB#alias_suffix$NWE
    Client Protocol: $NWB#protocol$NWE
    Local GMT: (Do NOT Adjust for DST) $NWB#gmt$NWE
    Phone Context: $NWB#phone_context$NWE
    Set As Webphone: $NWB#is_webphone$NWE
    Webphone Dialpad: $NWB#webphone_dialpad$NWE
    Webphone Auto-Answer: $NWB#webphone_auto_answer$NWE
    Use External Server IP: $NWB#use_external_server_ip$NWE
    \n"; + echo "
    \n"; + } +### END blank add phones form + + + + +################################################################################ +##### BEGIN add phones submit +if ($action == "ADD_PHONES_SUBMIT") + { + $phones_inserted=0; + $phone_alias_inserted=0; + if (strlen($phones) > 2) + { + $PN = explode("\n",$phones); + $PNct = count($PN); + + if (strlen($servers) > 6) + { + $SN = explode("\n",$servers); + $SNct = count($SN); + + $s=0; + while ($s < $SNct) + { + $SN[$s] = preg_replace('/\n|\r|\t| /','',$SN[$s]); + $server_exists=0; + $stmt="SELECT count(*) from servers where server_ip='$SN[$s]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $servercount_to_print = mysql_num_rows($rslt); + if ($servercount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $server_exists = $rowx[0]; + } + if ($server_exists > 0) + { + $p=0; + while ($p < $PNct) + { + $PN[$p] = preg_replace('/\n|\r|\t| /','',$PN[$p]); + $phone_exists=0; + $stmt="SELECT count(*) from phones where server_ip='$SN[$s]' and extension='$PN[$p]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $phonecount_to_print = mysql_num_rows($rslt); + if ($phonecount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $phone_exists = $rowx[0]; + } + if ( ($phone_exists < 1) and (strlen($PN[$p]) > 1) ) + { + if ($s < 1) {$dialplan_prefix=''; $login_suffix = 'a';} + else {$dialplan_prefix = $s;} + if ($s == '1') {$login_suffix = 'b';} + if ($s == '2') {$login_suffix = 'c';} + if ($s == '3') {$login_suffix = 'd';} + if ($s == '4') {$login_suffix = 'e';} + if ($s == '5') {$login_suffix = 'f';} + if ($s == '6') {$login_suffix = 'g';} + if ($s == '7') {$login_suffix = 'h';} + if ($s == '8') {$login_suffix = 'i';} + if ($s == '9') {$login_suffix = 'j';} + if ($s == '10') {$login_suffix = 'k';} + if ($s == '11') {$login_suffix = 'l';} + if ($s == '12') {$login_suffix = 'm';} + if ($s == '13') {$login_suffix = 'n';} + if ($s == '14') {$login_suffix = 'o';} + if ($s == '15') {$login_suffix = 'p';} + if ($s == '16') {$login_suffix = 'q';} + if ($s == '17') {$login_suffix = 'r';} + if ($s == '18') {$login_suffix = 's';} + if ($s == '19') {$login_suffix = 't';} + if ($s == '20') {$login_suffix = 'u';} + if ($s == '21') {$login_suffix = 'v';} + if ($s == '22') {$login_suffix = 'w';} + if ($s == '23') {$login_suffix = 'x';} + if ($s == '24') {$login_suffix = 'y';} + if ($s == '25') {$login_suffix = 'z';} + if ($s == '26') {$login_suffix = 'aa';} + if ($s == '27') {$login_suffix = 'ab';} + if ($s == '28') {$login_suffix = 'ac';} + if ($s == '29') {$login_suffix = 'ad';} + if ($s == '30') {$login_suffix = 'ae';} + if ($s == '31') {$login_suffix = 'af';} + if ($s == '32') {$login_suffix = 'ag';} + if ($s == '33') {$login_suffix = 'ah';} + if ($s == '34') {$login_suffix = 'ai';} + if ($s == '35') {$login_suffix = 'aj';} + if ($s == '36') {$login_suffix = 'ak';} + if ($s == '37') {$login_suffix = 'al';} + if ($s == '38') {$login_suffix = 'am';} + if ($s == '39') {$login_suffix = 'an';} + if ($s == '40') {$login_suffix = 'ao';} + if ($s == '41') {$login_suffix = 'ap';} + if ($s == '42') {$login_suffix = 'aq';} + if ($s == '43') {$login_suffix = 'ar';} + if ($s == '44') {$login_suffix = 'as';} + if ($s == '45') {$login_suffix = 'at';} + if ($s == '46') {$login_suffix = 'au';} + if ($s == '47') {$login_suffix = 'av';} + if ($s == '48') {$login_suffix = 'aw';} + if ($s >= 49) {$login_suffix = 'ax';} + + $extension = $PN[$p]; + if ( ($protocol == 'SIP') or ($protocol == 'IAX2') ) + {$dialplan_number = "$dialplan_prefix$PN[$p]";} + else + {$dialplan_number = "$PN[$p]";} + if (strlen($phone_context) < 1) + {$phone_context = 'default';} + $dialplan_number = preg_replace('/\D/', '', $dialplan_number); + $voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id); + $phone_server_ip = $SN[$s]; + $login = "$PN[$p]$login_suffix"; + $phone_type = "CCagent"; + $fullname = "ext $PN[$p]"; + + $stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + $phone_alias_entry[$p] .= "$login,"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phones_inserted++; + } + else + {echo "ERROR: Problem inserting phone: $affected_rows|$stmt\n
    ";} + } + else + {echo "ERROR: Phone already exists: $SN[$s]|$PN[$p]|$phone_exists\n
    ";} + $p++; + } + } + else + {echo "ERROR: Server does not exist: $SN[$s]|$server_exists\n
    ";} + $s++; + } + + if ( ($phones_inserted > 0) and ($alias_option == 'YES') ) + { + $p=0; + while ($p < $PNct) + { + if ( (strlen($phone_alias_entry[$p]) > 1) and (strlen($PN[$p]) > 1) ) + { + $phone_alias_entry[$p] = preg_replace('/,$/','',$phone_alias_entry[$p]); + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$PN[$p]$alias_suffix','$PN[$p]','$phone_alias_entry[$p]');"; + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "$p|$phone_alias_entry[$p]|$PN[$p]|$affected_rows|$stmt\n
    ";} + + if ($affected_rows > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + # if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $phone_alias_inserted++; + } + else + {echo "ERROR: Problem inserting phone alias: $affected_rows|$stmt\n
    ";} + } + $p++; + } + } + + echo "Phones Inserted: $phones_inserted\n
    "; + echo "Phones Aliases Inserted: $phone_alias_inserted\n
    "; + echo "
    Start Over
    \n"; + } + else + {echo "ERROR: You must enter servers: $servers\n
    ";} + } + else + {echo "ERROR: You must enter extensions: $phones\n
    ";} + } +### END add phones submit + + + + + + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "\n\n\n


    \n runtime: $RUNtime seconds         Version: $admin_version     Build: $build"; + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php index 941ccfe8..01c81255 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -24,6 +24,11 @@ # 100224-1621 - Added first/last name search and changed format of the page # 100405-1331 - Added log search ability # 100622-0928 - Added field labels +# 110218-1237 - Added vicidial_lead_search_log logging +# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120221-0118 - Added User Group campaign list restrictions to search queries +# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled +# 120409-1131 - Added option for log searches done through slave DB server # require("dbconnect.php"); @@ -60,6 +65,29 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $slave_db_server = $row[4]; + $reports_use_slave_db = $row[5]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$report_name = 'Search Leads Logs'; + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); @@ -77,7 +105,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); @@ -97,28 +125,72 @@ else { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $stmt="SELECT full_name,modify_leads,admin_hide_lead_data,admin_hide_phone_data,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $LOGmodify_leads = $row[1]; + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + $LOGadmin_hide_lead_data = $row[2]; + $LOGadmin_hide_phone_data = $row[3]; + $LOGuser_group = $row[4]; - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$camp_lists=''; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +$LOGallowed_listsSQL=''; +$whereLOGallowed_listsSQL=''; +if (!eregi("-ALL",$LOGallowed_campaigns)) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + + $stmt="SELECT list_id from vicidial_lists $whereLOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + if (strlen($camp_lists)<2) {$camp_lists="''";} + $LOGallowed_listsSQL = "and list_id IN($camp_lists)"; + $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + ?> @@ -207,7 +279,7 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo "
    Ricerca Contatti Opziones:
    $label_vendor_lead_code(co`digo del vendedor del Lead):   $label_vendor_lead_code(co`digo del vendedor del Lead):  
     
    "; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFY \n"; +echo "\n\n"; + +echo "
    \n\n";
    +
    +
    +if (!$group)
    +	{
    +	echo "\n\n";
    +	echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
    +	}
    +
    +else
    +	{
    +
    +	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$row=mysql_fetch_row($rslt);
    +	$TOTALcalls =	sprintf("%10s", $row[0]);
    +
    +	echo "\n";
    +	echo "---------- ADAPT DEBUG\n";
    +	echo "\n";
    +
    +	$stmt="select campaign_name,closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$camps_to_print = mysql_num_rows($rslt);
    +	if ($camps_to_print > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$closer_campaigns = $row[1];
    +
    +		echo "Campaign Debug: $group - $row[0]           $NOW_TIME\n\n";
    +		echo "Total leads in hopper right now:       $TOTALcalls\n\n";
    +		}
    +
    +	$stmt="select update_time,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip='ADAPT' limit 1;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Adapt Debug:     $row[0]\n";
    +		echo "$row[1]\n";
    +		echo "$row[2]\n";
    +
    +		$i++;
    +		}
    +
    +	$stmt="select update_time,server_ip,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id='" . mysql_real_escape_string($group) . "' and server_ip!='ADAPT' order by server_ip limit 100;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "$row[1] Debug:     $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
    +	$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);
    +
    +	$stmt="select update_time,campaign_id,debug_output,adapt_output from vicidial_campaign_stats_debug where campaign_id IN('$closer_groupsSQL') and server_ip='INBOUND' order by campaign_id limit 10000;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$debugs_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($debugs_to_print > $i)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +
    +		echo "Inbound Debug: $row[1]    $row[0]\n";
    +		echo "$row[2]\n";
    +		echo "$row[3]\n";
    +
    +		$i++;
    +		}
    +
    +	}
    +
    +
    +?>
    +
    +
    + +
    + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/count_functions.inc b/agc_2-X/trunk/LANG_www/vicidial_it/count_functions.inc new file mode 100644 index 00000000..4c4a0855 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/count_functions.inc @@ -0,0 +1,456 @@ +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_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $complete_statuses.="'$rowx[0]',"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where completed='Y';"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $complete_leads = $rowx[0]; + } + else {$complete_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $complete_leads;} + else + {$HTML_header.="There are $complete_leads completed leads in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="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) +{ + +global $full_dialable_SQL; + +##### 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) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = $rowx[3]; + $Gct_default_stop = $rowx[4]; + $Gct_sunday_start = $rowx[5]; + $Gct_sunday_stop = $rowx[6]; + $Gct_monday_start = $rowx[7]; + $Gct_monday_stop = $rowx[8]; + $Gct_tuesday_start = $rowx[9]; + $Gct_tuesday_stop = $rowx[10]; + $Gct_wednesday_start = $rowx[11]; + $Gct_wednesday_stop = $rowx[12]; + $Gct_thursday_start = $rowx[13]; + $Gct_thursday_stop = $rowx[14]; + $Gct_friday_start = $rowx[15]; + $Gct_friday_stop = $rowx[16]; + $Gct_saturday_start = $rowx[17]; + $Gct_saturday_stop = $rowx[18]; + $Gct_state_call_times = $rowx[19]; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = $row[0]; + $Gstate_call_time_state = $row[1]; + $Gsct_default_start = $row[4]; + $Gsct_default_stop = $row[5]; + $Gsct_sunday_start = $row[6]; + $Gsct_sunday_stop = $row[7]; + $Gsct_monday_start = $row[8]; + $Gsct_monday_stop = $row[9]; + $Gsct_tuesday_start = $row[10]; + $Gsct_tuesday_stop = $row[11]; + $Gsct_wednesday_start = $row[12]; + $Gsct_wednesday_stop = $row[13]; + $Gsct_thursday_start = $row[14]; + $Gsct_thursday_stop = $row[15]; + $Gsct_friday_start = $row[16]; + $Gsct_friday_stop = $row[17]; + $Gsct_saturday_start = $row[18]; + $Gsct_saturday_stop = $row[19]; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $CCLsql=''; + if ($call_count_limit > 0) + { + $CCLsql = "and (called_count < $call_count_limit)"; + } + + $stmt="SELECT count(*) FROM vicidial_list where status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + $full_dialable_SQL="status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL"; + #$DB=1; + if ($DB) {$HTML_header.="$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + if ($DB > 0) {$HTML_header.="|$DB|\n";} + if ($single_status > 0) + {return $active_leads;} + else + {$HTML_header.="This campaign has $active_leads leads to be dialed in those lists\n";} + } + else + { + $HTML_header.="no dial statuses selected for this campaign\n"; + } + } + else + { + $HTML_header.="no active lists selected for this campaign\n"; + } + } +else + { + $HTML_header.="no active lists selected for this campaign\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php index c6011134..cf109aba 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php @@ -63,9 +63,9 @@ mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; -$ext_context = 'demo'; +$ext_context = 'default'; $recording_exten = '8309'; -$WeBRooTWritablE = '1'; +$webroot_writable = '0'; $non_latin = '0'; # set to 1 for UTF rules $AM_shift_BEGIN = '03:45:00'; $AM_shift_END = '17:45:00'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php index 8c587aaf..b9c1de98 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1828 - Added download option +# 111104-1213 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -36,6 +39,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -45,12 +52,14 @@ if (strlen($shift)<2) {$shift='ALL';} $report_name = 'Fronter - Closer Report'; $db_source = 'M'; +$JS_text="\n"; +$HTML_head.="\n"; +$HTML_head.="\n"; - - +#if (strlen($group) > 0) +# { +# if (preg_match("/\|$group\|/i",$groups_string)) +# { +# # $HTML_head.="\n"; +# } +# else +# { +# # $HTML_head.="\n"; +# $group=''; +# } +# } -\n"; -echo "$report_name\n"; +$HTML_head.="\n"; +$HTML_head.="$report_name\n"; $short_header=1; - require("admin_header.php"); +# require("admin_header.php"); -echo "
    "; +$HTML_text.="
    "; -echo "
    \n"; -echo ""; +$HTML_text.="\n"; +$HTML_text.=""; -?> - -\n"; +$HTML_text.="var o_cal = new tcal ({\n"; +$HTML_text.=" // form name\n"; +$HTML_text.=" 'formname': 'vicidial_report',\n"; +$HTML_text.=" // input name\n"; +$HTML_text.=" 'controlname': 'query_date'\n"; +$HTML_text.="});\n"; +$HTML_text.="o_cal.a_tpl.yearscroll = false;\n"; +$HTML_text.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$HTML_text.="\n"; -echo "\n"; $o=0; while ($groups_to_print > $o) { - if ($groups[$o] == $group) {echo "\n";} - else {echo "\n";} + if ($groups[$o] == $group) {$HTML_text.="\n";} + else {$HTML_text.="\n";} $o++; } -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICA | REPORT \n"; -echo "
    \n\n"; +$HTML_text.="\n"; +$HTML_text.="   "; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="\n"; +$HTML_text.="           DOWNLOAD | MODIFICA | REPORT
    Visualizzare as:
    ASCII
    HTML
    \n"; +$HTML_text.="\n\n"; -echo "
    \n\n";
    +$HTML_text.="
    \n\n";
     
     
     if (!$group)
     {
    -echo "\n\n";
    -echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK INVIA\n";
    +$HTML_text.="\n\n";
    +$HTML_text.="PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK INVIA\n";
     }
     
     else
    @@ -227,14 +274,14 @@ if ($shift == 'ALL')
     	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
     	}
     
    -echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
    +$HTML_text.="In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
     
    -echo "\n";
    -echo "---------- TOTALI FOR $query_date_BEGIN to $query_date_END\n";
    +$HTML_text.="\n";
    +$HTML_text.="---------- TOTALI FOR $query_date_BEGIN to $query_date_END\n";
     
     $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
     $rslt=mysql_query($stmt, $link);
    -if ($DB) {echo "$stmt\n";}
    +if ($DB) {$HTML_text.="$stmt\n";}
     $row=mysql_fetch_row($rslt);
     $A1_points = ($row[0] * 1);
     $A1_points =	sprintf("%10s", $A1_points);
    @@ -245,10 +292,10 @@ $TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
     $TOT_tally =	sprintf("%10s", $TOT_tally);
     $TOT_points =	sprintf("%10s", $TOT_points);
     
    -echo "STATUS   CUSTOMERS\n";
    -echo "SALES:   $A1_tally\n";
    +$HTML_text.="STATUS   CUSTOMERS\n";
    +$HTML_text.="SALES:   $A1_tally\n";
     
    -echo "\n";
    +$HTML_text.="\n";
     
     
     
    @@ -276,17 +323,45 @@ $totA9=0;
     $totDROP=0;
     $totOTHER=0;
     
    -echo "\n";
    -echo "---------- FRONTER STATS\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    -echo "| AGENT                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    -echo "+--------------------------+-------+--------+--------+------+------+------+\n";
    +$CSV_fronter_header="\"TOTALI FOR $query_date_BEGIN to $query_date_END\"\n";
    +$CSV_fronter_header.="\"STATUS   CUSTOMERS\"\n";
    +$CSV_fronter_header.="\"SALES:   $A1_tally\"\n\n";
    +$CSV_fronter_header.="\"FRONTER STATS\"\n";
    +$CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DROP\",\"OTHER\"\n";
    +$CSV_fronter_lines="";
    +$CSV_fronter_footer="";
    +
    +$ASCII_text="\n";
    +$ASCII_text.="---------- FRONTER STATS\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +$ASCII_text.="| AGENT                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
    +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
    +
    +######## GRAPHING #########
    +$graph_stats=array();
    +$max_success=1;
    +$max_xfers=1;
    +$max_success_pct=1;
    +$max_sales=1;
    +$max_drops=1;
    +$max_other=1;
    +$GRAPH="";
    +$GRAPH.="";
    +$GRAPH.="
    SUCCESSXFERSSUCCESS %SALEDROPOTHER

     


    "; +$graph_header=""; +$SUCCESS_graph=$graph_header.""; +$XFERS_graph=$graph_header.""; +$SUCCESSPCT_graph=$graph_header.""; +$SALE_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +########################### #$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;"; $stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -306,10 +381,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -330,7 +405,7 @@ while ($i < $users_to_print) $stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -369,6 +444,19 @@ while ($i < $users_to_print) $Spct = round($Spct, 2); $Spct = sprintf("%01.2f", $Spct); + if ($sales>$max_success) {$max_success=$sales;} + if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];} + if ($Spct>$max_success_pct) {$max_success_pct=$Spct;} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$sales; + $graph_stats[$i][2]=$USERcalls[$i]; + $graph_stats[$i][3]=$Spct; + $graph_stats[$i][4]=$A1; + $graph_stats[$i][5]=$DROP; + $graph_stats[$i][6]=$OTHER; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -384,7 +472,8 @@ while ($i < $users_to_print) $sales = sprintf("%5s", $sales); $Spct = sprintf("%6s", $Spct); - echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n"; + $CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n"; $i++; } @@ -414,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER); $stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $row=mysql_fetch_row($rslt); $AVGwait = $row[0]; @@ -429,15 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S"; $AVGwait = sprintf("%6s", $AVGwait_MS); -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; -echo "| Average time in Queue for customers: $AVGwait |\n"; -echo "+--------------------------+-------+--------+--------+------+------+------+\n"; - - +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n"; +$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n"; +$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n"; +$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n"; + for ($d=0; $d"; + $XFERS_graph.=" "; + $SUCCESSPCT_graph.=" "; + $SALE_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + } + $SUCCESS_graph.="
    FRONTER STATS
    AGENTSUCCESS
    XFERS
    SUCCESS %
    SALE
    DROP
    OTHER
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    TOTAL:".trim($TOTsales)."
    "; + $XFERS_graph.="
    TOTAL:".trim($TOTcalls)."
    "; + $SUCCESSPCT_graph.="
    TOTAL:".trim($totSpct)."%
    "; + $SALE_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n"; + $JS_text.="function DrawFronterGraph(graph, th_id) {\n"; + $JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n"; + $JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n"; + $JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n"; + $JS_text.=" var SALE_graph=\"$SALE_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"frontergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"frontergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; ############################## ######### CLOSER STATS @@ -457,16 +580,42 @@ $totDROP=0; $totOTHER=0; $TOTsales=0; -echo "\n"; -echo "---------- CLOSER STATS\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_header=""; +$CSV_closer_lines=""; +$CSV_closer_footer=""; + +$ASCII_text.="\n"; +$ASCII_text.="---------- CLOSER STATS\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; + +$CSV_closer_header="\"CLOSER STATS\"\n"; +$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n"; + +######## GRAPHING ######### +$max_calls=1; +$max_sales=1; +$max_drops=1; +$max_other=1; +$max_sales2=1; +$max_conv_pct=1; +$GRAPH="

    "; +$GRAPH.=""; +$GRAPH.="
    CALLSSALESDROPOTHERSALESCONV %

     


    "; +$graph_header=""; +$CALLS_graph=$graph_header.""; +$SALES_graph=$graph_header.""; +$DROP_graph=$graph_header.""; +$OTHER_graph=$graph_header.""; +$SALES2_graph=$graph_header.""; +$CONVPCT_graph=$graph_header.""; +########################### $stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$ASCII_text.="$stmt\n";} $users_to_print = mysql_num_rows($rslt); $i=0; while ($i < $users_to_print) @@ -485,10 +634,10 @@ while ($i < $users_to_print) $i=0; while ($i < $users_to_print) { - $stmt="select full_name from vicidial_users where user='$userRAW[$i]';"; + $stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $names_to_print = mysql_num_rows($rslt); if ($names_to_print > 0) { @@ -509,7 +658,7 @@ while ($i < $users_to_print) $stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} + if ($DB) {$ASCII_text.="$stmt\n";} $lead_ids_to_print = mysql_num_rows($rslt); $j=0; while ($j < $lead_ids_to_print) @@ -592,6 +741,19 @@ while ($i < $users_to_print) $ppc = sprintf("%01.2f", $ppc); $ppc = sprintf("%4s", $ppc); + if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];} + if ($A1>$max_sales) {$max_sales=$A1;} + if ($DROP>$max_drops) {$max_drops=$DROP;} + if ($OTHER>$max_other) {$max_other=$OTHER;} + if ($sales>$max_sales2) {$max_sales=$sales;} + if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} + $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; + $graph_stats[$i][1]=$USERcalls[$i]; + $graph_stats[$i][2]=$A1; + $graph_stats[$i][3]=$DROP; + $graph_stats[$i][4]=$OTHER; + $graph_stats[$i][5]=$sales; + $graph_stats[$i][6]=$Cpct; $A1 = sprintf("%4s", $A1); $A2 = sprintf("%4s", $A2); @@ -606,7 +768,8 @@ while ($i < $users_to_print) $OTHER = sprintf("%4s", $OTHER); $sales = sprintf("%4s", $sales); - echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n"; + $CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n"; $i++; } @@ -651,21 +814,108 @@ $totDROP = sprintf("%5s", $totDROP); $totOTHER = sprintf("%5s", $totOTHER); $TOTsales = sprintf("%5s", $TOTsales); -echo "+--------------------------+--------+------+------+------+------+-------+\n"; -echo "| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; -echo "+--------------------------+--------+------+------+------+------+-------+\n"; - - - - - +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n"; +$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n"; +$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n"; + for ($d=0; $d"; + $SALES_graph.=" "; + $DROP_graph.=" "; + $OTHER_graph.=" "; + $SALES2_graph.=" "; + $CONVPCT_graph.=" "; + } + $CALLS_graph.="
    CLOSER STATS
    AGENTCALLS
    SALES
    DROP
    OTHER
    SALES
    CONV %
    ".$graph_stats[$d][1]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][2]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][3]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][4]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][5]."
    ".$graph_stats[$d][0]."".$graph_stats[$d][6]."%
    TOTAL:".trim($TOTcalls)."
    "; + $SALES_graph.="
    TOTAL:".trim($totA1)."
    "; + $DROP_graph.="
    TOTAL:".trim($totDROP)."
    "; + $OTHER_graph.="
    TOTAL:".trim($totOTHER)."
    "; + $SALES2_graph.="
    TOTAL:".trim($TOTsales)."
    "; + $CONVPCT_graph.="
    TOTAL:".trim($totCpct)."%
    "; + $JS_onload.="\tDrawCloserGraph('CALLS', '1');\n"; + $JS_text.="function DrawCloserGraph(graph, th_id) {\n"; + $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; + $JS_text.=" var SALES_graph=\"$SALES_graph\";\n"; + $JS_text.=" var DROP_graph=\"$DROP_graph\";\n"; + $JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n"; + $JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n"; + $JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n"; + $JS_text.="\n"; + $JS_text.=" for (var i=1; i<=6; i++) {\n"; + $JS_text.=" var cellID=\"closergraph\"+i;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n"; + $JS_text.=" }\n"; + $JS_text.=" var cellID=\"closergraph\"+th_id;\n"; + $JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n"; + $JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n"; + $JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n"; + $JS_text.="}\n"; + $GRAPH_text.=$GRAPH; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} + +if ($report_display_type=="HTML") { + $HTML_text.=$GRAPH_text; + } +else + { + $HTML_text.=$ASCII_text; + } + +if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";} + +$HTML_text.="\n"; +$HTML_text.="
    \n"; + +$HTML_text.="\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "FCSTATS_$US$FILE_TIME.csv"; + $CSV_text=$CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + $JS_onload.="}\n"; + $JS_text.=$JS_onload; + $JS_text.="\n"; + + echo $HTML_head; + echo $JS_text; + require("admin_header.php"); + echo $HTML_text; + } + +#$CSV_report=fopen("fcstats.csv", "w"); +#$CSV_head=preg_replace('/\s+,/', ',', $CSV_fronter_header.$CSV_fronter_lines.$CSV_fronter_footer.$CSV_closer_header.$CSV_closer_lines.$CSV_closer_footer); +#fwrite($CSV_report, $CSV_head); +#fclose($CSV_report); + + + + } @@ -673,8 +923,3 @@ if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} ?> - -
    - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/functions.php b/agc_2-X/trunk/LANG_www/vicidial_it/functions.php index f3a6e7b7..ea43bbd7 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/functions.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/functions.php @@ -1,14 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: # 90524-1503 - First Build +# 110708-1723 - Added HF precision option +# 111222-2124 - Added max stats bar chart function +# 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -18,11 +22,19 @@ function sec_convert($sec,$precision) if ($sec < 1) { - return "0:00"; + if ($precision == 'HF') + {return "0:00:00";} + else + {return "0:00";} } else { - if ($sec < 3600) {$precision='M';} + if ($precision == 'HF') + {$precision='H';} + else + { + if ( ($sec < 3600) and ($precision != 'S') ) {$precision='M';} + } if ($precision == 'H') { @@ -88,4 +100,92 @@ function array_group_count($array, $sort = false) return $tally_array; } + +##### bar chart using max stats data ##### +function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$metric_name,$more_link) + { + $stats_start_time = time(); + $Bstats_date[0]=date("Y-m-d"); + $Btotal_calls[0]=0; + $link_text=''; + $max_count=0; + $i=0; + $NWB = "   \"AIUTO\""; + + + ### get stats for last X days + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_flag='OPEN';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Xstats_to_print = mysql_num_rows($rslt); + if ($Xstats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Bstats_date[0] = $rowx[0]; + $Btotal_calls[0] = $rowx[1]; + if ($max_count < $Btotal_calls[0]) {$max_count = $Btotal_calls[0];} + } + $stats_date_ARRAY = explode("-",$Bstats_date[0]); + $stats_start_time = mktime(10, 10, 10, $stats_date_ARRAY[1], $stats_date_ARRAY[2], $stats_date_ARRAY[0]); + while($i <= $days_graph) + { + $i++; + $stats_start_time = ($stats_start_time - 86400); + $Bstats_date[$i] = date("Y-m-d", $stats_start_time); + $Btotal_calls[$i]=0; + $stmt="SELECT stats_date,$metric from vicidial_daily_max_stats where campaign_id='$campaign_id' and stats_date='$Bstats_date[$i]';"; + if ($metric=='total_calls_inbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} + if ($metric=='total_calls_outbound_all') + {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + $rslt=mysql_query($stmt, $link); + $Ystats_to_print = mysql_num_rows($rslt); + if ($Ystats_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $Btotal_calls[$i] = $rowx[1]; + if ($max_count < $Btotal_calls[$i]) {$max_count = $Btotal_calls[$i];} + } + } + if ($max_count < 1) + {echo "";} + else + { + if ($title=='campaign') {$out_in_type=' outbound';} + if ($title=='in-group') {$out_in_type=' inbound';} + if ($more_link > 0) {$link_text = "more summary stats...";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $max_multi = (400 / $max_count); + $i=0; + while($i < $days_graph) + { + $bar_width = intval($max_multi * $Btotal_calls[$i]); + if ($Btotal_calls[$i] < 1) {$Btotal_calls[$i] = "-none-";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
    $days_graph Day $out_in_type $metric_name for this $title   $link_text   $NWB#vicidial_campaigns-max_stats$NWE
    date $metric_name
    $Bstats_date[$i] \"\" $Btotal_calls[$i]
    \n"; + } + } ?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/group_hourly_stats.php b/agc_2-X/trunk/LANG_www/vicidial_it/group_hourly_stats.php index 98c0ac9f..5f7c9526 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/group_hourly_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - Added required user/pass to gain access to this page # 90310-2138 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0159 - Added User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -56,7 +58,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -75,10 +77,10 @@ if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); @@ -100,17 +102,26 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGuser_group = $row[1]; + + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + exit; } # $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -120,6 +131,24 @@ $browser = getenv("HTTP_USER_AGENT"); } +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } @@ -163,41 +192,41 @@ require("admin_header.php"); if ( ($group) and ($status) and ($date_with_hour) ) { -$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' $LOGadmin_viewable_groupsSQL order by full_name desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $tsrs_to_print = mysql_num_rows($rslt); $o=0; while($o < $tsrs_to_print) - { + { $row=mysql_fetch_row($rslt); $VDuser[$o] = "$row[0]"; $VDname[$o] = "$row[1]"; $o++; - } + } $o=0; while($o < $tsrs_to_print) - { - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; - } + } echo "
    \n"; @@ -213,7 +242,7 @@ echo "
    TSR ID TSR ID TOTALE $status $hour_calls $total_calls $day_calls
    TOTALE $status $hour_calls $total_calls $day_calls
    \n"; echo "

    \n"; - echo "
    Per favore inserisci il gruppo per il quale vuoi le statistiche orarie:
    \n"; - echo "\n"; - echo "gruppo: \n"; +echo "gruppo:
    \n"; - echo "esito:   (esempio: XFER)
    \n"; - echo "data e ora:   (esempio: 2004-06-25 14)
    \n"; - echo "\n"; - echo "


    \n"; +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group"; +$rslt=mysql_query($stmt, $link); +$groups_to_print = mysql_num_rows($rslt); +$o=0; +$groups_list=''; +while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "\n";} + else + {$groups_list .= "\n";} + $o++; + } +echo "$groups_list
    \n"; +echo "esito:   (esempio: XFER)
    \n"; +echo "data e ora:   (esempio: 2004-06-25 14)
    \n"; +echo "\n"; +echo "


    \n"; $ENDtime = date("U"); @@ -285,11 +315,4 @@ echo "\n\n\n


    \nTempo Esecuzione Script: $RUNtime seconds exit; - - ?> - - - - - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/horizontalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_it/horizontalbargraph.css new file mode 100644 index 00000000..ec51244b --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/horizontalbargraph.css @@ -0,0 +1,104 @@ +td.value { + background-image: url(images/gridline58.gif); + background-repeat: repeat-x; + background-position: left top; + border-left: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + padding:0; + border-bottom: none; + background-color:transparent; +} +td.graph { + padding: 4px 6px; + border-bottom:1px solid #e5e5e5; + border-left:1px solid #e5e5e5; + background-color:#fff; +} +td.value img { + vertical-align: middle; + margin: 2px 2px 2px 0; + height: 10px; +} +th.thgraph { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; +} +.grey_graph_cell { + background-color:#ddd; +} +.graph_span_cell { + background-color:#eee; + text-align: center; +} + +th.column_header { + text-align: left; + vertical-align:top; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 70%; +} +td.chart_td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 60%; + white-space:nowrap; + padding-right: 10px; +} +td.last { + border-bottom:1px solid #e5e5e5; +} +td.first { + border-top:1px solid #e5e5e5; +} +.auraltext +{ + position: absolute; + font-size: 0; + left: -1000px; +} +table.horizontalgraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + background-image:url(images/bg_fade2.png); + background-position:left top; + width: 33em; +} +caption { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:90%; + font-style:italic; +} + +.overlap_barGraph { + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: left; + margin: 1em 0; + padding: 0; + position: relative; + } + +.overlap_barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0.01em; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: right; + } + +.overlap_barGraph li.p1{ + background: #999 url(images/bar.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} +.overlap_barGraph li.p2{ + background: #666 url(images/bar_blue.png) repeat-x top right; + color: #FFF; + white-space:nowrap; + font-weight: bold; +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/lead_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_it/lead_report_export.php new file mode 100644 index 00000000..a818d603 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/lead_report_export.php @@ -0,0 +1,944 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 110624-0834 - First build, based upon calls_report_export.php +# 111104-1245 - Added user_group restrictions for selecting in-groups +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["export_fields"])) {$export_fields=$_GET["export_fields"];} + elseif (isset($_POST["export_fields"])) {$export_fields=$_POST["export_fields"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Export Leads Rapporto'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $custom_fields_enabled = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; + $group_SQL = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vi.status IN($status_SQL)"; + } + + $export_fields_SQL=''; + $EFheader=''; + if ($export_fields == 'EXTENDED') + { + $export_fields_SQL = ",entry_date,called_count,last_local_call_time,modify_date,called_since_last_reset"; + $EFheader = "\tentry_date\tcalled_count\tlast_local_call_time\tmodify_date\tcalled_since_last_reset"; + } + + + if ($DB > 0) + { + echo "
    \n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "
    \n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
    \n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "
    \n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "
    \n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "
    \n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "Esistono no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_uniqueid[$k] = $row[36]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_epoch_time[$k] = $row[38]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vi.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date desc limit 500000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "Esistono no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; + $export_uniqueid[$k] = $row[38]; + $export_epoch_time[$k] = $row[39]; + $export_duplicate_check_line[$k] = "$export_lead_id[$k]---$export_epoch_time[$k]---$k"; + $export_fieldsDATA=''; + if ($export_fields == 'EXTENDED') + {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $custom_data=''; + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + $extended_data_a=''; + $extended_data_b=''; + $extended_data_c=''; + if ($export_fields=='EXTENDED') + { + $extended_data = "\t$export_uniqueid[$i]"; + if (strlen($export_uniqueid[$i]) > 0) + { + $uniqueidTEST = $export_uniqueid[$i]; + $uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST); + $stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vle_ct = mysql_num_rows($rslt); + if ($vle_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_a = "\t$row[0]\t$row[1]"; + $export_call_id[$i] = $row[0]; + } + + $stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcarl_ct = mysql_num_rows($rslt); + if ($vcarl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]"; + } + + $stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcpdl_ct = mysql_num_rows($rslt); + if ($vcpdl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extended_data_c = "\t$row[0]"; + } + + } + if (strlen($extended_data_a)<1) + {$extended_data_a = "\t\t";} + if (strlen($extended_data_b)<1) + {$extended_data_b = "\t\t\t\t\t";} + if (strlen($extended_data_c)<1) + {$extended_data_c = "\t";} + $extended_data .= "$extended_data_a$extended_data_b$extended_data_c"; + } + + $notes_data=''; + if ($call_notes=='YES') + { + if (strlen($export_vicidial_id[$i]) > 0) + { + $stmt = "SELECT call_notes from vicidial_call_notes where vicidial_id='$export_vicidial_id[$i]' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $notes_ct = mysql_num_rows($rslt); + if ($notes_ct > 0) + { + $row=mysql_fetch_row($rslt); + $notes_data = $row[0]; + } + $notes_data = preg_replace("/\r\n/",' ',$notes_data); + $notes_data = preg_replace("/\n/",' ',$notes_data); + } + $notes_data = "\t$notes_data"; + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="MOSTRA TABELLAS LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + $RAW_EXPORT[$i] = "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$custom_data\r\n"; + $i++; + } + + if ($header_row=='YES') + { + $RFheader = ''; + $NFheader = ''; + $CFheader = ''; + $EXheader = ''; + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + if ($export_fields=='EXTENDED') + {$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";} + if ($call_notes=='YES') + {$NFheader = "\tcall_notes";} + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + + echo "call_date\tphone_number_dialed\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$CFheader\r\n"; + } + + ### sort the duplicate check in newest to oldest call order by lead_id + rsort($export_duplicate_check_line); + + ### always print the first line(newest call on highest lead_id) + $check_line_array = explode('---',$export_duplicate_check_line[0]); + $check_lead_id = $check_line_array[0]; + $check_line_number = $check_line_array[2]; + echo "$RAW_EXPORT[$check_line_number]"; + + $j=1; + while ($i > $j) + { + $current_line_array = explode('---',$export_duplicate_check_line[$j]); + $current_lead_id = $current_line_array[0]; + $current_line_number = $current_line_array[2]; + if ($current_lead_id == "$check_lead_id") + {$duplicate_lead++;} + else + { + $unique_lead++; + $check_lead_id = $current_lead_id; + echo "$RAW_EXPORT[$current_line_number]"; + } + $j++; + } + } + else + { + echo "Esistono no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; + while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "ADMINISTRATION: $report_name"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Leads Rapporto</B></FONT><BR>\n"; + echo "<FONT SIZE=2 FACE=\"Arial,Helvetica\">Questo rapporto raccoglie le informazioni di piombo per le chiamate effettuate nell'intervallo di date selezionato. Un cavo è esportato solo una volta, non importa quante chiamate sono state gestite. Lo stato attuale piombo viene utilizzato.</FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE Border=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Date:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lunedi week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Lunedi week start + </script> + <?php + + echo "<BR><BR>\n"; + + echo "<B>Header Row:</B><BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Recording Fields:</B><BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NESSUNO</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "<B>campo personalizzatos:</B><BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + + echo "<BR><BR>\n"; + + echo "<B>Per Call Notes:</B><BR>\n"; + echo "<select size=1 name=call_notes><option>YES</option><option selected>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "<B>Export Fields:</B><BR>\n"; + echo "<select size=1 name=export_fields><option selected>STANDARD</option><option>EXTENDED</option></select>\n"; + + ### bottom of first column + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campagnas:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Gruppi Inbound:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Liste:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Esiti:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Gruppi Utenti:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=20 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>   \n"; + + echo "</TD></TR><TR></TD><TD ALIGN=CENTER VALIGN=TOP COLSPAN=5>\n"; + echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/leadloader_template_display.php b/agc_2-X/trunk/LANG_www/vicidial_it/leadloader_template_display.php new file mode 100644 index 00000000..dd3de249 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/leadloader_template_display.php @@ -0,0 +1,203 @@ +<?php +# AST_admin_template_maker.php - version 2.4 +# +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 120402-2238 - First Build +# + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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"];} +$sample_template_file=$_FILES["sample_template_file"]; +$LF_orig = $_FILES['sample_template_file']['name']; +$LF_path = $_FILES['sample_template_file']['tmp_name']; +if (isset($_GET["sample_template_file_name"])) {$sample_template_file_name=$_GET["sample_template_file_name"];} + elseif (isset($_POST["sample_template_file_name"])) {$sample_template_file_name=$_POST["sample_template_file_name"];} +if (isset($_FILES["sample_template_file"])) {$sample_template_file_name=$_FILES["sample_template_file"]['name'];} +if (isset($_GET["form_action"])) {$form_action=$_GET["form_action"];} + elseif (isset($_POST["form_action"])) {$form_action=$_POST["form_action"];} +if (isset($_GET["delimiter"])) {$delimiter=$_GET["delimiter"];} + elseif (isset($_POST["delimiter"])) {$delimiter=$_POST["delimiter"];} +if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];} + elseif (isset($_POST["buffer"])) {$buffer=$_POST["buffer"];} + +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; +if ($form_action=="prime_file" && $sample_template_file_name) + { + $delim_set=0; + if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) + { + $sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); + copy($LF_path, "/tmp/$sample_template_file_name"); + $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); + $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; + passthru("$convert_command"); + $lead_file = "/tmp/$new_filename"; + if ($DB > 0) {echo "|$convert_command|";} + + if (preg_match("/\.csv$/i", $sample_template_file_name)) {$delim_name="CSV: Comma Separated Values"; $template_file_type="CSV";} + if (preg_match("/\.xls$/i", $sample_template_file_name)) {$delim_name="XLS: MS Excel 2000-XP"; $template_file_type="XLS";} + if (preg_match("/\.xlsx$/i", $sample_template_file_name)) {$delim_name="XLSX: MS Excel 2007+"; $template_file_type="XLSX";} + if (preg_match("/\.ods$/i", $sample_template_file_name)) {$delim_name="ODS: OpenOffice.org OpenDocument Spreadsheet"; $template_file_type="ODS";} + if (preg_match("/\.sxc$/i", $sample_template_file_name)) {$delim_name="SXC: OpenOffice.org First Spreadsheet"; $template_file_type="SXC";} + $delim_set=1; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + $template_file_type="TXT"; + } + $file=fopen("$lead_file", "r"); + if ($webroot_writable > 0) + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $buffer=eregi_replace("[\'\"\n]", "", $buffer); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($delim_set < 1) + { + if ($tab_count>$pipe_count) + {$delim_name="tab-delimited";} + else + {$delim_name="pipe-delimited";} + } + if ($tab_count>$pipe_count) + {$delimiter="\t";} + else + {$delimiter="|";} + echo "<script language='Javascript'>\n"; + echo "parent.document.getElementById(\"template_file_type\").value='$template_file_type';\n"; + echo "parent.document.getElementById(\"template_file_delimiter\").value='".urlencode($delimiter)."';\n"; + echo "parent.document.getElementById(\"template_file_buffer\").value='".urlencode($buffer)."';\n"; + echo "</script>"; + $field_check=explode($delimiter, $buffer); + flush(); +} else if ($form_action=="update_template") { + echo "Hi"; +} else { +# echo "<B>** $form_action</b>"; die; +$fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; +# $vicidial_listloader_fields = '|vendor_lead_code|source_id|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|rank|owner|'; + +$vl_fields_count=substr_count($vicidial_listloader_fields, "|")-1; + +##### BEGIN custom fields columns list ### +if ($custom_fields_enabled > 0) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT list_id, vendor_lead_code, source_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id limit 1"; + + } + } + } +##### END custom fields columns list ### + +##### Same code from the listloader page. Since this is a custom template, it's assumed the layout is "custom" instead of "standard" and follows the coding as such +#if (($sample_template_file) && ($LF_path)) +if ($delimiter && $buffer) + { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; +# $buffer=rtrim(fgets($file, 4096)); +# $buffer=stripslashes($buffer); +# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); +# echo "delimiter: $delimiter<BR>$buffer<BR>"; +} +echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; +$rslt=mysql_query("$fields_stmt", $link); +$custom_fields_count=mysql_num_fields($rslt)-$vl_fields_count; +for ($i=0; $i<mysql_num_fields($rslt); $i++) + { + if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} + + echo " <tr bgcolor='$bgcolor'>\r\n"; + echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; + if (mysql_field_name($rslt, $i)!="list_id") + { + echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; + echo " <option value='-1'>(none)</option>\r\n"; + + for ($j=0; $j<count($row); $j++) + { + eregi_replace("\"", "", $row[$j]); + echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; + } + + echo " </select></td>\r\n"; + } + else + { + echo " <td align=left> <font class='standard_bold'>$list_id<input type='hidden' name='".$field_prefix.$list_id."' value='$list_id'></font></td>\r\n"; + } + echo " </tr>\r\n"; + } + echo "</table>"; +} +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/line.js b/agc_2-X/trunk/LANG_www/vicidial_it/line.js new file mode 100644 index 00000000..d007fe0a --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/line.js @@ -0,0 +1,183 @@ +/* This notice must remain at all times. + +graph.js +Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com +Development support by Jexp, Inc http://www.jexp.com + +This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! + +Latest version can be downloaded from http://www.sbmkpm.com + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +line.js provides a simple mechanism to draw line graphs. It uses +wz_jsgraphics.js which is copyright of its author. + +Usage: +var g = new line_graph(); +g.add("title1",value); +g.add("title2",value2); + +g.render("canvas_name", "graph title"); + +//where canvas_name is a div defined INSIDE body tag +<body> +<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div> + + +*/ + +hD="0123456789ABCDEF"; + +function d2h(d) +{ + var h = hD.substr(d&15,1); + while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;} + return h; +} + +function h2d(h) +{ + return parseInt(h,16); +} + +function line_graph(dw) +{ + this.ct = 0; + + this.data = new Array(); + this.x_name = new Array(); + this.max = -64000; //MAX INT + + this.c_array = new Array(); + this.c_array[0] = new Array(255, 192, 95); + this.c_array[1] = new Array(80, 127, 175); + this.c_array[2] = new Array(159, 87, 112); + this.c_array[3] = new Array(111, 120, 96); + this.c_array[4] = new Array(224, 119, 96); + this.c_array[5] = new Array(80, 159, 144); + this.c_array[6] = new Array(207, 88, 95); + this.c_array[7] = new Array(64, 135, 96); + this.c_array[8] = new Array(239, 160, 95); + this.c_array[9] = new Array(144, 151, 80); + this.c_array[10] = new Array(255, 136, 80); + + this.getColor = function() + { + if(this.ct >= (this.c_array.length-1)) + this.ct = 0; + else + this.ct++; + + return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]); + } + + + this.add = function(x_name, value) + { + this.x_name.push(x_name); + this.data.push(parseInt(value,10)); + + if(value > this.max) + this.max = parseInt(value,10); + } + + this.render = function(canvas, title) + { + var jg = new jsGraphics(canvas); + + var h = 250; + var sx = 40; +// var dw = 6; + var shadow = 0; + var fnt = 8; + + var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length); + + // Draw markers + var i; + jg.setColor("black"); + for(i = 1 ; i <= 5 ; i++) + { + +// Joe J - tweak to make the y-axis intervals less nutty + if (this.max<=50) { + while (this.max%5!=0) { + this.max++; + } + } else if (this.max<=100) { + while (this.max%10!=0) { + this.max++; + } + } else if (this.max<=250) { + while (this.max%25!=0) { + this.max++; + } + } else if (this.max<=500) { + while (this.max%50!=0) { + this.max++; + } + } else if (this.max<=1000) { + while (this.max%100!=0) { + this.max++; + } + } else if (this.max<=2500) { + while (this.max%250!=0) { + this.max++; + } + } else if (this.max<=5000) { + while (this.max%500!=0) { + this.max++; + } + } else { + while (this.max%1000!=0) { + this.max++; + } + } + + + jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i))); + var ff = Math.round(this.max - (this.max / 5 * i)); + jg.drawString(ff,4,Math.round((h/5*i)-2)); + } + + // Draw the bar graph + var color = this.getColor(); + var oldx, oldy; + jg.setStroke(1); + + for(i = 0; i < this.data.length; i++) + { + var ht1 = Math.round(this.data[i]*h/this.max); + + if (this.x_name[i].match(/\+/)) + { + sx+=(2*dw); + } + + if(i >= 1) + { + jg.setColor(color); + jg.drawLine(oldx, h-oldy, sx, h-ht1); + } + + jg.setColor("red"); + jg.fillEllipse(sx-2, h-ht1-2, 5, 5); + + jg.setColor("black"); + jg.drawString(this.x_name[i], sx, h); + + oldx = sx; + oldy = ht1; + + sx = sx+dw+Math.round(dw/2)+shadow; + } + + jg.setFont("Verdana", fnt, Font.BOLD); + jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left"); + jg.paint(); + } + +} diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php index 05540718..f33dd1d8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php @@ -108,7 +108,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); # Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } @@ -143,7 +143,7 @@ if ($download_type == 'systemdnc') if ($leads_count < 1) { - echo "There are no phone numbers in list: SYSTEM INTERNAL DNC\n"; + echo "Non ci sono numeri di telefono in elenco: SYSTEM INTERNAL DNC\n"; exit; } } @@ -181,7 +181,7 @@ elseif ($download_type == 'dnc') if ($leads_count < 1) { - echo "There are no leads in Campagna DNC list: $group_id\n"; + echo "Non ci sono cavi in ​​lista Campagna DNC: $group_id\n"; exit; } } @@ -219,7 +219,7 @@ elseif ($download_type == 'fpgn') if ($leads_count < 1) { - echo "There are no leads in this filter phone gruppo: $group_id\n"; + echo "Non ci sono contatti in questo gruppo cellulare filtro: $group_id\n"; exit; } } @@ -228,7 +228,7 @@ else ##### list download validation ##### $event_code_type='LIST'; $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -247,7 +247,7 @@ else } $stmt="select count(*) from vicidial_list where list_id='$list_id';"; - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') {$stmt="select count(*) from vicidial_list where list_id > 0;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -261,7 +261,7 @@ else if ($leads_count < 1) { - echo "There are no leads in list_id: $list_id\n"; + echo "Esistono no leads in list_id: $list_id\n"; exit; } } @@ -305,7 +305,7 @@ else $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; $list_id_header=''; $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') { $list_id_header="list_id\t"; $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; @@ -343,7 +343,7 @@ while ($i < $leads_to_print) { $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') { $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; $export_list_id[$i] = $row[0]; @@ -363,7 +363,7 @@ $ch=0; if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) { $valid_custom_table=0; - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') { $stmtA = "SELECT list_id from vicidial_lists;"; $rslt=mysql_query($stmtA, $link); @@ -435,7 +435,7 @@ if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) $i=0; while ($i < $leads_to_print) { - if ($list_id=='ALL-LISTE') + if ($list_id=='ALL-LISTS') { $valid_custom_table=0; $u=0; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_it/listloaderMAIN.php index 0210fcb7..d3d59509 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/listloaderMAIN.php @@ -1,7 +1,7 @@ <?php # listloaderMAIN.php # -# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # this is the main frame page for the lead loading section. This is where you # would upload a file and have it inserted into vicidial_list @@ -10,6 +10,7 @@ # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat # 60822-1105 - fixed for nonwritable directories # 90508-0644 - Changed to PHP long tags +# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # require("dbconnect.php"); @@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); @@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; if ($LOGload_leads < 1) { echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php index 91937186..d6f79e52 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php @@ -1,7 +1,7 @@ <?php # new_listloader_superL.php # -# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -34,11 +34,12 @@ # 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec> # 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats # 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.4-37'; -$build = '100712-1416'; +$version = '2.4-38'; +$build = '120223-2148'; require("dbconnect.php"); @@ -143,7 +144,7 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_ ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -153,6 +154,7 @@ if ($qm_conf_ct > 0) $non_latin = $row[0]; $admin_web_directory = $row[1]; $custom_fields_enabled = $row[2]; + $webroot_writable = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -181,7 +183,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -213,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } @@ -409,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { $stmt_file=fopen("listloader_stmts.txt", "w"); } @@ -724,7 +726,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -740,7 +742,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; ### insert good record into vicidial_list table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -778,7 +780,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -813,7 +815,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Elaborazione in corsoCSV file... \n"; @@ -1112,7 +1114,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";} - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -1128,7 +1130,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1164,7 +1166,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; @@ -1176,7 +1178,7 @@ if ($leadfile) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; ### LOG INSERTION Admin Log Table ### - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTE', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1187,7 +1189,7 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; @@ -1198,7 +1200,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -1443,7 +1445,7 @@ if ($leadfile) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1479,7 +1481,7 @@ if ($leadfile) { if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1490,7 +1492,7 @@ if ($leadfile) { } } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; @@ -1515,7 +1517,7 @@ if ($leadfile) { } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; @@ -1526,7 +1528,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.csv"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Elaborazione in corsoCSV file... \n"; @@ -1754,7 +1756,7 @@ if ($leadfile) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1789,7 +1791,7 @@ if ($leadfile) { if ($multi_insert_counter!=0) { $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1865,7 +1867,7 @@ if ($leadfile) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; @@ -1876,7 +1878,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.txt"; } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -1924,7 +1926,7 @@ if ($leadfile) { } else if (!eregi(".csv", $leadfile_name)) { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; @@ -1947,7 +1949,7 @@ if ($leadfile) { } else { - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) { copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; @@ -1959,7 +1961,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) + if ($webroot_writable > 0) {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Elaborazione in corsoCSV file... \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php index 6be8f1f4..a4a8d34e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php @@ -1,7 +1,7 @@ <?php # non_agent_api.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -9,9 +9,16 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info','add_list',etc...) # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') +# optional callback variables for add_lead/update_lead +# - $callback - ('Y,'N','REMOVE') +# - $callback_status - ('CALLBK','CBXYZ',...) +# - $callback_datetime - ('YYYY-MM-DD+HH:MM:SS','NOW') +# - $callback_type - ('USERONLY','ANYONE') +# - $callback_user - ('6666','1001',...) +# - $callback_comments - ('Comments go here',...) # CHANGELOG: # 80724-0021 - First build of script @@ -37,10 +44,34 @@ # 100723-1333 - Added no_update option to the update_lead function # 100728-1952 - Added delete_lead option to the update_lead function # 100924-1403 - Added called_count as an update_lead option +# 101111-1536 - Added vicidial_hopper.source to vicidial_hopper inserts +# 101117-1104 - Added callback and custom field entry delete to delete_lead option +# 101206-2126 - Added recording_lookup and did_log_export functions +# 110127-2245 - Added add_user and add_phone functions +# 110303-2122 - Added information on agent-on-hook phone to real-time report popup +# 110306-1044 - Added add_list and update_list functions +# 110316-2035 - Added reset_time variable and NAMEPHONE dup search +# 110404-1356 - Added uniqueid search parameter to recording_lookup function +# 110409-0822 - Added run_time logging of API functions +# 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) +# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead +# 110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions +# 110928-2110 - Added callback options to add_lead and update_lead +# 111106-0959 - Added user_group restrictions to some functions +# 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php +# 120315-1537 - Added filter for single-quotes and backslashes on custom field data +# 120326-1317 - Added agent_stats_export function # -$version = '2.4-23'; -$build = '100924-1403'; +$version = '2.4-43'; +$build = '120326-1317'; +$api_url_log = 0; + +$startMS = microtime(); require("dbconnect.php"); @@ -159,6 +190,114 @@ if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["header"])) {$header=$_GET["header"];} + elseif (isset($_POST["header"])) {$header=$_POST["header"];} +if (isset($_GET["agent_pass"])) {$agent_pass=$_GET["agent_pass"];} + elseif (isset($_POST["agent_pass"])) {$agent_pass=$_POST["agent_pass"];} +if (isset($_GET["agent_user_level"])) {$agent_user_level=$_GET["agent_user_level"];} + elseif (isset($_POST["agent_user_level"])) {$agent_user_level=$_POST["agent_user_level"];} +if (isset($_GET["agent_full_name"])) {$agent_full_name=$_GET["agent_full_name"];} + elseif (isset($_POST["agent_full_name"])) {$agent_full_name=$_POST["agent_full_name"];} +if (isset($_GET["agent_user_group"])) {$agent_user_group=$_GET["agent_user_group"];} + elseif (isset($_POST["agent_user_group"])) {$agent_user_group=$_POST["agent_user_group"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["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["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["registration_password"])) {$registration_password=$_GET["registration_password"];} + elseif (isset($_POST["registration_password"])) {$registration_password=$_POST["registration_password"];} +if (isset($_GET["phone_full_name"])) {$phone_full_name=$_GET["phone_full_name"];} + elseif (isset($_POST["phone_full_name"])) {$phone_full_name=$_POST["phone_full_name"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["script"])) {$script=$_GET["script"];} + elseif (isset($_POST["script"])) {$script=$_POST["script"];} +if (isset($_GET["am_message"])) {$am_message=$_GET["am_message"];} + elseif (isset($_POST["am_message"])) {$am_message=$_POST["am_message"];} +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["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["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["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} + elseif (isset($_POST["delete_list"])) {$delete_list=$_POST["delete_list"];} +if (isset($_GET["delete_leads"])) {$delete_leads=$_GET["delete_leads"];} + elseif (isset($_POST["delete_leads"])) {$delete_leads=$_POST["delete_leads"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} + elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} +if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];} + elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];} +if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];} + elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];} +if (isset($_GET["delete_phone"])) {$delete_phone=$_GET["delete_phone"];} + elseif (isset($_POST["delete_phone"])) {$delete_phone=$_POST["delete_phone"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["phone_logins"])) {$phone_logins=$_GET["phone_logins"];} + elseif (isset($_POST["phone_logins"])) {$phone_logins=$_POST["phone_logins"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["delete_alias"])) {$delete_alias=$_GET["delete_alias"];} + elseif (isset($_POST["delete_alias"])) {$delete_alias=$_POST["delete_alias"];} +if (isset($_GET["callback"])) {$callback=$_GET["callback"];} + elseif (isset($_POST["callback"])) {$callback=$_POST["callback"];} +if (isset($_GET["callback_status"])) {$callback_status=$_GET["callback_status"];} + elseif (isset($_POST["callback_status"])) {$callback_status=$_POST["callback_status"];} +if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} + elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} +if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} + elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} +if (isset($_GET["callback_user"])) {$callback_user=$_GET["callback_user"];} + elseif (isset($_POST["callback_user"])) {$callback_user=$_POST["callback_user"];} +if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} + elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} +if (isset($_GET["admin_user_group"])) {$admin_user_group=$_GET["admin_user_group"];} + elseif (isset($_POST["admin_user_group"])) {$admin_user_group=$_POST["admin_user_group"];} +if (isset($_GET["datetime_start"])) {$datetime_start=$_GET["datetime_start"];} + elseif (isset($_POST["datetime_start"])) {$datetime_start=$_POST["datetime_start"];} +if (isset($_GET["datetime_end"])) {$datetime_end=$_GET["datetime_end"];} + elseif (isset($_POST["datetime_end"])) {$datetime_end=$_POST["datetime_end"];} +if (isset($_GET["time_format"])) {$time_format=$_GET["time_format"];} + elseif (isset($_POST["time_format"])) {$time_format=$_POST["time_format"];} header ("Content-type: text/html; charset=utf-8"); @@ -218,7 +357,7 @@ if ($non_latin < 1) $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = ereg_replace("\+"," ",$alt_phone); - $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = ereg_replace("\+"," ",$email); $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = ereg_replace("\+"," ",$security_phrase); @@ -233,7 +372,7 @@ if ($non_latin < 1) $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $source = ereg_replace("[^0-9a-zA-Z]","",$source); - $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $session_id = ereg_replace("[^0-9]","",$session_id); $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $stage = ereg_replace("[^a-zA-Z]","",$stage); @@ -251,6 +390,58 @@ if ($non_latin < 1) $no_update = ereg_replace("[^A-Z]","",$no_update); $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); $called_count=ereg_replace("[^0-9]","",$called_count); + $agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); + $hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); + $voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); + $agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); + $agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); + $agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); + $phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + $extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); + $dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); + $protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); + $registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); + $phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); + $local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); + $outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); + $phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); + $active=ereg_replace("[^A-Z]","",$active); + $script=ereg_replace("[^-_0-9a-zA-Z]","",$script); + $am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); + $drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); + $web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); + $reset_list=ereg_replace("[^A-Z]","",$reset_list); + $delete_list=ereg_replace("[^A-Z]","",$delete_list); + $delete_leads=ereg_replace("[^A-Z]","",$delete_leads); + $reset_time=ereg_replace("[^-_0-9]","",$reset_time); + $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); + $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); + $usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); + $usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); + $delete_phone = ereg_replace("[^A-Z]","",$delete_phone); + $alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); + $phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); + $alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); + $delete_alias = ereg_replace("[^A-Z]","",$delete_alias); + $callback = ereg_replace("[^A-Z]","",$callback); + $callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); + $callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); + $callback_type = ereg_replace("[^A-Z]","",$callback_type); + $callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); + $callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); + $admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); + $datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); + $datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); + $time_format = ereg_replace("[^A-Z]","",$time_format); } else { @@ -269,8 +460,8 @@ $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); +$ip = getenv("REMOTE_ADDR"); $MT[0]=''; -$postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; @@ -302,7 +493,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -322,11 +513,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); @@ -557,6 +748,29 @@ if ($function == 'moh_list') } else { + $stmt="SELECT user_group from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGuser_group = $row[0]; + + $stmt="SELECT allowed_campaigns,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; + if ($DB>0) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGadmin_viewable_groups = $row[1]; + + $LOGadmin_viewable_groupsSQL=''; + $whereLOGadmin_viewable_groupsSQL=''; + if ( (!eregi("--ALL--",$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')"; + } + echo "\n"; echo "<HTML><head><title>NON-AGENT API\n"; echo " + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo "$report_name: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; +#echo "\n"; + +echo "Real-Time Report                                                                               \n"; +echo "\n"; +echo "
    \n"; +echo "Scegli Opzioni di visualizzazione Relazione"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo ""; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "
    \n"; +echo "$webphone_content\n$webphone_clpos\n"; +echo "
    \n"; +echo "
    \n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "RELOAD NOW"; +if (eregi('ALL-ACTIVE',$group_string)) + {echo "       MODIFICA | \n";} +else + {echo "       MODIFICA | \n";} + +echo "RIEPILOGO \n"; + + +echo "       rinfrescare: \n\n"; + +if ($is_webphone == 'Y') + {echo "       webphone +\n\n";} +else + {echo "       \n\n";} + +if ($webphone_bufh > 10) + {echo "
    \n";} +echo "
    \n\n"; + + +if ($adastats<2) + {echo "       + VIEW MORE";} +else + {echo "       - VIEW LESS";} +if ($UGdisplay>0) + {echo "       NASCONDI GRUPPI UTENTI";} +else + {echo "       MOSTRA GRUPPI UTENTI";} +if ($SERVdisplay>0) + {echo "       NASCONDI INFO SERVER";} +else + {echo "       MOSTRA INFO SERVER";} +if ($CALLSdisplay>0) + {echo "       NASCONDI WAITING CALLS";} +else + {echo "       MOSTRA WAITING CALLS";} +if ($ALLINGROUPstats>0) + {echo "       NASCONDI IN-GROUP STATS";} +else + {echo "       MOSTRA IN-GROUP STATS";} +if ($PHONEdisplay>0) + {echo "       NASCONDI PHONES";} +else + {echo "       MOSTRA PHONES";} +if ($CUSTPHONEdisplay>0) + {echo "       NASCONDI CUSTPHONES";} +else + {echo "       MOSTRA CUSTPHONES";} + +#echo "
    "; +##### END header formatting ##### + +#echo "
    "; + +echo "\n"; + + + + + + + + +?> +
    + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/remote_dispo.php b/agc_2-X/trunk/LANG_www/vicidial_it/remote_dispo.php index a50a5fa8..f7558602 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/remote_dispo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/remote_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # this is the remote agent disposition screen for calls sent to remote agents. # This allows the remote agent to modify customer information and disposition @@ -11,6 +11,7 @@ # # 60619-1626 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # @@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/send_CID_call.php b/agc_2-X/trunk/LANG_www/vicidial_it/send_CID_call.php new file mode 100644 index 00000000..8549f6a3 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/send_CID_call.php @@ -0,0 +1,132 @@ + LICENSE: GPLv2 +# +# CHANGES +# +# 90714-1355 - First Build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$ip = getenv("REMOTE_ADDR"); + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["sender"])) {$sender=$_GET["sender"];} + elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];} +if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];} + elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];} +if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];} + elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$sender = ereg_replace("[^0-9]","",$sender); +$receiver = ereg_replace("[^0-9]","",$receiver); +$cid_number = ereg_replace("[^0-9]","",$cid_number); +$server_ip = ereg_replace("[^\.0-9]","",$server_ip); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + + +?> + + + + + +\n"; +echo "VICIDIAL: Manual CID call\n"; +echo "
    \n"; +echo "Sender:     \n"; +echo "Receiver:     \n"; +echo "CID Number:     \n"; +echo "Server:   \n"; +echo "\n"; +echo "\n"; +echo "           REPORTS \n"; +echo "

    \n\n"; + + +if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) ) + { + echo "\n\n"; + echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n"; + } + +else + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $Local_end = '@default'; + + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "Call sent from $sender to $receiver using CIDnumber: $cid_number"; + } + +?> + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/sheet2tab.pl b/agc_2-X/trunk/LANG_www/vicidial_it/sheet2tab.pl new file mode 100644 index 00000000..7abf691d --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/sheet2tab.pl @@ -0,0 +1,363 @@ +#!/usr/bin/perl +# +# sheet2tab.pl - Convert spreadsheet to tab-delimited text file version 2.4 +# +# Copyright (C) 2011 Matt Florell & Michael Cargile LICENSE: AGPLv2 +# +# Lead file conversion and scrubbing script. This is the first stage in the lead loading process. +# +# *Stage 1 - Convert file to a tab delimited format (DONE) +# Stage 2 - Prompt the user for the field mapping (TBD) +# Stage 3 - Schedule a List Load by the command line list loader (TBD) +# +# This particular script converts csv xls xlsx ods sxc files to a tab delimited file. In the +# process it scrubs out ' " ; ` \ characters which could cause problems with db insertion of +# lead data. It also replaces pipes, tabs, carrage returns, and line feeds with spaces to prevent +# stage 3 from miscounting the number of fields on a line. +# +# ARG1 = File to Convert +# ARG2 = Name of the output file +# +# This file requires the Spreadsheet::Read and Spreadsheet::XLSX perl modules from CPAN +# +# cpan> install Spreadsheet::Read +# cpan> install Spreadsheet::XLSX +# +# CHANGES +# 100706-0833 - Initial build +# 100706-1244 - Reformat and add comments +# 110927-1750 - Fixed issue with improperly CSV files locking up servers +# + +# disable when not debugging +#use strict; +#use warnings; + +use Spreadsheet::Read; +use File::Basename; + + +sub scrub_lead_field + { + my $lead_field = $_[0]; + + # remove bad characters + $lead_field =~ s/\'|\\|\"|;|\`|\224//gi; + + # replace tabs and newlines with spaces + $lead_field =~ s/\n|\r|\t|\174/ /gi; + + return $lead_field; + } + +my $infile; +my $outfile; + +my $error_log = "sheet2tab_error.txt"; + +my $csv_chuck_size = 500; + +my $crap_loop_time = 5; + +if ( $#ARGV == 1 ) + { + $infile = $ARGV[0]; + $outfile = $ARGV[1]; + } +else + { + print STDERR "Incorrect number of arguments\n"; + exit(1); + } + +open( OUTFILE , ">$outfile" ) or die $!; + +my $debug = 0; + +my $out_delim = "\t"; + +my $count = 0; + +my $colPos = 0; +my $rowPos = 0; + +my $time = time(); + +my $tempfile = "sheet2tab_temp_file_$time.csv"; + +# file types we are looking for +my @exts = qw(.csv); + +# dont screw up the actual infile variable +my $exten_file = $infile; +chomp $exten_file; + +# break the file up into its parts +my ($dir, $name, $ext) = fileparse($exten_file, @exts); + +# if we are a csv file + +if ($ext eq '.csv') + { + open( IN, $infile ) or die "can't open $infile: $!\n"; + open( TMPFILE , ">$tempfile" ) or die $!; + + my $cur_loop_time = time(); + my $old_loop_time = time(); + my $loop_time = 0; + my $loop_sleep = 0; + + my $loop_count = 0; + + # loop through the file and process it in chunks + while( ) + { + $loop_count++; + + print TMPFILE $_; + if ($debug) { print STDERR "csv line = '$_'\n"; }; + + # break + if ( $loop_count % $csv_chuck_size == 0 ) + { + + # close the temp file + close( TMPFILE ); + + # process the temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + # Something is not right if they have 0 or over 100 columns in their lead file. + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + # repopn the TMPFILE + open( TMPFILE , ">$tempfile" ) or die $!; + + + # figure out how long it took to loop + $old_loop_time = $cur_loop_time; + $cur_loop_time = time(); + + $loop_time = $cur_loop_time - $old_loop_time; + + #print STDERR "loop_count = '$loop_count' $loop_time $loop_sleep\n"; + + if ( $loop_time > $crap_loop_time ) + { + # this should not take this long to run through a loop. + # sleep for a bit to let the CPU recover. + $loop_sleep = $loop_sleep + $loop_time; + + # they have waited 60 seconds lets just kill this and get it over with + if ( $loop_sleep > 60 ) + { + close( TMPFILE ); + close( IN ); + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl aborting. Penalized them long enough for their junk leads in $infile \n\n"; + + close( ERRFILE ); + + exit; + } + + sleep($loop_sleep); + + open( ERRFILE, ">>$error_log" ); + + print ERRFILE "$cur_loop_time: Sheet2tab.pl took $loop_time to process $csv_chuck_size leads from the $infile lead file. Making them sleep $loop_sleep so we can recover.\n\n"; + + close( ERRFILE ); + + # do not penalize the next loop through because we forced them to sleep + $cur_loop_time = time(); + } + } + } + + # close the temp and In files + close( TMPFILE ); + close( IN ); + + # see if we have any left overs + my $temp_file_size = -s $tempfile; + + # if not exit + if ( $temp_file_size == 0 ) + { + # delete the TMPFILE + unlink( $tempfile ) or die $!; + exit; + } + + # other wise parse the last temp file + my $parser = ReadData ( "$tempfile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + if (( $maxCol >= 100 ) || ( $maxCol == 0 )) + { + print STDERR "ERROR: Improperly formatted lead file.\n"; + print OUTFILE "BAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\tBAD_LEAD_FILE\t\n"; + exit; + } + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + + # delete the TMPFILE + unlink( $tempfile ) or die $!; + + } +else + # not a CSV file + { + # parse the file + my $parser = ReadData ( "$infile" ); + + my $maxCol = $parser->[1]{maxcol}; + my $maxRow = $parser->[1]{maxrow}; + + + if ($debug) { print STDERR "maxCol = '$maxCol'\n"; }; + if ($debug) { print STDERR "maxRow = '$maxRow'\n"; }; + + # loop through the rows + for ( $rowPos = 1; $rowPos <= $maxRow; $rowPos++ ) + { + # loop through the cols + for ( $colPos = 1; $colPos <= $maxCol; $colPos++ ) + { + my $cell = cr2cell( $colPos, $rowPos ); + + if ($debug) { print STDERR "cell = '$cell'\n"; }; + + my $field; + + # make sure the field has a value + if ( $parser->[1]{$cell} ) + { + $field = $parser->[1]{$cell}; + } + else + { + $field = ""; + } + + if ($debug) { print STDERR "field = '$field'\n"; }; + + $field = scrub_lead_field( $field ); + + print OUTFILE $field; + + if ( $colPos < $maxCol ) + { + print OUTFILE $out_delim; + } + else + { + print OUTFILE "\n"; + } + } + } + } +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_edit.php b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_edit.php index 52e7269a..b92cec03 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_edit.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80701-1323 - functional beta version done # 90310-2109 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT"); $modify_timeclock_log = $row[1]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php index b6078623..8de55881 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,9 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1830 - Added download option +# 111104-1314 - Added user_group restrictions for selecting in-groups +# 120224-0910 - Added HTML display option with bar graphs # require("dbconnect.php"); @@ -41,6 +44,10 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} @@ -52,7 +59,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -72,21 +79,21 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "\n"; + $MAIN.="\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -100,26 +107,48 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -127,9 +156,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $LISTuser_groups[$i]='---ALL---'; @@ -143,50 +172,46 @@ while ($i < $user_groups_to_print) } ##### START HTML ##### -?> - - +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; -<style type="text/css"> -<!-- - div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} - div.scroll_list {height: 400px; width: 140px; overflow: scroll;} - div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} - div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} - .body_text {font-size: 13px; font-family: sans-serif;} - .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} - .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} - .body_small {font-size: 11px; font-family: sans-serif;} - .body_tiny {font-size: 10px; font-family: sans-serif;} - .log_text {font-size: 11px; font-family: monospace;} - .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} - .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} - .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .sb_text {font-size: 12px; font-family: sans-serif;} - .sk_text {font-size: 11px; font-family: sans-serif;} - .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} - .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} - .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} - - .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} - .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} - .data_records {font-size: 12px; font-family: sans-serif; color: black} - .data_records_fix {font-size: 12px; font-family: monospace; color: black} - .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} - ---> -</style> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<TITLE> - -<?php -echo "$report_name"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -206,7 +231,7 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); @@ -232,105 +257,102 @@ else if ($DB > 0) { - echo "<BR>\n"; - echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; - echo "<BR>\n"; + $MAIN.="<BR>\n"; + $MAIN.="$user_group_ct|$user_group_string|$user_group_SQL\n"; + $MAIN.="<BR>\n"; } -echo "<CENTER>\n"; -echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; -echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; -echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<CENTER>\n"; +$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +$MAIN.="<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Date:</B></font><BR><CENTER>\n"; -echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +$MAIN.="<font class=\"select_bold\"><B>Date:</B></font><BR><CENTER>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'query_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunedi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'query_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="</script>\n"; -echo "<BR>to<BR>\n"; -echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; +$MAIN.="<BR>to<BR>\n"; +$MAIN.="<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunedi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="</script>\n"; -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Gruppi Utenti:</B></font><BR><CENTER>\n"; -echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Gruppi Utenti:</B></font><BR><CENTER>\n"; +$MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $o=0; while ($user_groups_to_print > $o) { if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) - {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} else - {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + {$MAIN.="<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} $o++; } -echo "</SELECT>\n"; +$MAIN.="</SELECT>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; -echo "<SELECT SIZE=1 NAME=order>\n"; -echo "<option selected value=\"$order\">$order</option>\n"; -echo "<option value=\"\">--</option>\n"; -echo "<option>hours_up</option>\n"; -echo "<option>hours_down</option>\n"; -echo "<option>user_up</option>\n"; -echo "<option>user_down</option>\n"; -echo "<option>name_up</option>\n"; -echo "<option>name_down</option>\n"; -echo "<option>group_up</option>\n"; -echo "<option>group_down</option>\n"; -echo "</SELECT><BR><CENTER>\n"; - -echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "<font class=\"select_bold\"><B>Utente:</B></font><BR>\n"; -echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; - -echo "<BR><BR><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; -echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; -echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; -echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n"; - -echo "</TD></TR></TABLE>\n"; -echo "</FORM>\n\n"; - -echo "<PRE><FONT SIZE=3>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">"; +$MAIN.="Visualizzare as:<BR>"; +$MAIN.="<select name='report_display_type'>"; +if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";} +$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n"; +$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n"; +$MAIN.="<SELECT SIZE=1 NAME=order>\n"; +$MAIN.="<option selected value=\"$order\">$order</option>\n"; +$MAIN.="<option value=\"\">--</option>\n"; +$MAIN.="<option>hours_up</option>\n"; +$MAIN.="<option>hours_down</option>\n"; +$MAIN.="<option>user_up</option>\n"; +$MAIN.="<option>user_down</option>\n"; +$MAIN.="<option>name_up</option>\n"; +$MAIN.="<option>name_down</option>\n"; +$MAIN.="<option>group_up</option>\n"; +$MAIN.="<option>group_down</option>\n"; +$MAIN.="</SELECT>\n"; +$MAIN.="</font><CENTER>\n"; -echo "UtenteOrologio Report $NOW_TIME\n"; +$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="<font class=\"select_bold\"><B>Utente:</B></font><BR>\n"; +$MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; -echo "Intervallo Di Tempo: $query_date to $end_date\n\n"; -echo "---------- USER TIMECLOCK DETAILS -------------\n"; -echo "These totals do NOT include any active sessions\n</PRE>\n"; +$MAIN.="<BR><BR><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n"; +$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&INVIA=$INVIA&file_download=1\">DOWNLOAD</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2>   |   <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n"; + +$MAIN.="</TD></TR></TABLE>\n"; +$MAIN.="</FORM>\n\n"; + +$MAIN.="<PRE><FONT SIZE=3>\n"; + + +$MAIN.="UtenteOrologio Report $NOW_TIME\n"; + +$CSV_text.="\"UtenteOrologio Report - $NOW_TIME\"\n"; +$CSV_text.="\"Intervallo Di Tempo: $query_date to $end_date\"\n"; +$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n"; +$CSV_text.="\"These totals do NOT include any active sessions\"\n\n"; -echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; -echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; -echo "</TR>\n"; $order_SQL=''; if ($order == 'hours_up') {$order_SQL = "order by login";} @@ -346,78 +368,175 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} else {$user_SQL='';} $stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$rows_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $rows_to_print) - { - $dbHOURS=0; - $row=mysql_fetch_row($rslt); - $user_id[$i] = $row[0]; - $full_name[$i] = $row[1]; - $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); - $u_group[$i] = $row[3]; - if ($login_sec[$i] > 0) + +if (!$report_display_type || $report_display_type=="TEXT") + { + $MAIN.="Intervallo Di Tempo: $query_date to $end_date\n\n"; + $MAIN.="---------- USER TIMECLOCK DETAILS -------------\n"; + $MAIN.="These totals do NOT include any active sessions\n</PRE>\n"; + $MAIN.="<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; + $MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; + $MAIN.="</TR>\n"; + + $CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n"; + + $rslt=mysql_query($stmt, $link); + if ($DB) {$MAIN.="$stmt\n";} + $rows_to_print = mysql_num_rows($rslt); + $i=0; + + while ($i < $rows_to_print) { - $dbHOURS = ($login_sec[$i] / 3600); - $dbHOURS = round($dbHOURS, 2); - $dbHOURS = sprintf("%01.2f", $dbHOURS); + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + + $j=0; + while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $MAIN.="<TR $bgcolor>\n"; + $MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + $MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n"; + + $j++; + } + + + if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); } else - {$dbHOURS='0.00';} + {$TOTdbHOURS='0.00';} - $hours[$i] = $dbHOURS; - $hoursSORT[$i] = "$dbHOURS-----$i"; + $TOThours = $TOTdbHOURS; - $i++; + + + $MAIN.="<TR BGCOLOR=#E6E6E6>\n"; + $MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALI</TD>\n"; + $MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; + $MAIN.="</TR>\n"; + $CSV_text.="\"\",\"TOTALI\",\"\",\"\",\"\",\"$TOThours\"\n"; + + $MAIN.="</TABLE>\n"; } - - -$j=0; -while ($j < $rows_to_print) +else { + ######## GRAPHING ######### + $rslt=mysql_query($stmt, $link); + $high_ct=0; $i=0; + while ($row=mysql_fetch_row($rslt)) { - $hours_split = explode("-----",$hoursSORT[$j]); - $i = $hours_split[1]; + if ($row[2] > 0) + { + $dbHOURS = ($row[2] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} - if (eregi("1$|3$|5$|7$|9$", $j)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "<TR $bgcolor>\n"; - echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; - echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; - echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; - echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; - echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; - echo "</TR>\n"; - - $j++; + if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;} + $ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]"; + $ct_ary[$i][1]=$dbHOURS; + $i++; + } + if ($high_ct<1) {$high_ct*=10;} + $MAIN.="</PRE>\n"; + $MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"INVITO hangup MOTIVO STATS\" class=\"horizontalgraph\">\n"; + $MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Intervallo Di Tempo: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n"; + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n"; + $MAIN.=" </tr>\n"; + for ($i=0; $i<count($ct_ary); $i++) { + if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";} + $MAIN.=" <tr>\n"; + $MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n"; + $MAIN.=" <td class=\"chart_td value$class\"><img src=\"../vicidial/images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n"; + $MAIN.=" </tr>\n"; + } + $MAIN.=" <tr>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n"; + $MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n"; + $MAIN.=" </tr>\n"; + $MAIN.="</table>\n"; + $MAIN.="<PRE>\n"; + ########################### } -if ($TOTlogin_sec > 0) - { - $TOTdbHOURS = ($TOTlogin_sec / 3600); - $TOTdbHOURS = round($TOTdbHOURS, 0); - $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); +$MAIN.="</CENTER>\n"; +$MAIN.="</BODY></HTML>\n"; + + if ($file_download>0) { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_report_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/^\s+/', '', $CSV_text); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } else { + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; } -else - {$TOTdbHOURS='0.00';} -$TOThours = $TOTdbHOURS; - - -echo "<TR BGCOLOR=#E6E6E6>\n"; -echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALI</TD>\n"; -echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; -echo "</TR>\n"; - -echo "</TABLE>\n"; ?> -</CENTER> -</BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php index 81793af4..2ce33f21 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php @@ -1,7 +1,7 @@ <?php # timeclock_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -13,9 +13,11 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110703-1833 - Added download option +# 111104-1315 - Added user_group restrictions for selecting in-groups # -header ("Content-type: text/html; charset=utf-8"); +#header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -36,6 +38,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $report_name = 'Gruppo UtenteOrologio Status Report'; @@ -45,7 +49,7 @@ $db_source = 'M'; ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -66,7 +70,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -92,12 +96,11 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -111,29 +114,51 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGuser_group = $row[0]; -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } -$stmt="select user_group from vicidial_user_groups order by user_group;"; +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$LOGadmin_viewable_call_timesSQL=''; +$whereLOGadmin_viewable_call_timesSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); $i=0; $user_groups_to_print++; @@ -150,19 +175,17 @@ while ($i < $user_groups_to_print) if (strlen($user_group) > 0) { - $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[0]; } -?> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: -<?php -echo "$report_name"; +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +$HEADER.="<title>ADMINISTRATION: \n"; +$HEADER.="$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -182,45 +205,41 @@ $usergroups_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; ##### END Set variables to make header show properly ##### -require("admin_header.php"); +# require("admin_header.php"); -?> -<CENTER> -<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> -<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Orologio Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             -<?php -echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; -echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Utente Group</a>\n"; -?> -</TD></TR> +$MAIN.="<CENTER>\n"; +$MAIN.="<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT>\n"; +$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Orologio Status for $user_group</TD><TD ALIGN=RIGHT>            \n"; +$MAIN.="<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +$MAIN.="<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>Utente Group</a>\n"; +$MAIN.="</TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<select size=1 name=user_group>$FORMuser_groups</select>"; +$MAIN.="<input type=submit name=submit value=submit>\n"; - -<?php - -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; - -echo "<form action=$PHP_SELF method=POST>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<select size=1 name=user_group>$FORMuser_groups</select>"; -echo "<input type=submit name=submit value=submit>\n"; - -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="<br><center>\n"; if (strlen($user_group) < 1) { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; exit; } ##### grab all users in this user_group ##### -$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; -if ($DB>0) {echo "|$stmt|";} +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' $LOGadmin_viewable_groupsSQL order by full_name;"; +if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rslt); $o=0; @@ -248,7 +267,7 @@ while ($users_to_print > $o) $total_login_time = 0; ##### grab timeclock status record for this user ##### $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $stats_to_print = mysql_num_rows($rslt); if ($stats_to_print > 0) @@ -267,7 +286,7 @@ while ($users_to_print > $o) ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $logs_to_parse = mysql_num_rows($rslt); $p=0; @@ -311,11 +330,11 @@ while ($users_to_print > $o) $Tlogin_sec[$o] = $total_login_time; } - if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + if ($DB>0) {$MAIN.="|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} ##### grab vicidial_agent_log records in this user_group ##### $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $vals_to_print = mysql_num_rows($rslt); if ($vals_to_print > 0) @@ -331,23 +350,26 @@ while ($users_to_print > $o) ##### print each user that has any activity for today ##### -echo "<br>\n"; -echo "<center>\n"; +$MAIN.="<br>\n"; +$MAIN.="<center>\n"; -echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; -echo "<TR>\n"; -echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green -echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow -echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red -echo "</TR><TR>\n"; -echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green -echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow -echo "<TD>     </TD><TD align=left>   </TD>\n"; -echo "</TR></TABLE><BR>\n"; +$MAIN.="<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<TR>\n"; +$MAIN.="<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +$MAIN.="<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +$MAIN.="<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +$MAIN.="</TR><TR>\n"; +$MAIN.="<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +$MAIN.="<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +$MAIN.="<TD>     </TD><TD align=left>   </TD>\n"; +$MAIN.="</TR></TABLE><BR>\n"; -echo "<B>USER STATUS FOR Utente Gruppo: $user_group</B>\n"; -echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; +$MAIN.="<B>USER STATUS FOR Utente Gruppo: $user_group      <a href='$PHP_SELF?DB=$DB&user_group=$user_group&submit=$submit&file_download=1'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPAIGN</td></tr>\n"; + +$CSV_text.="\"USER STATUS FOR Utente Gruppo: $user_group\"\n"; +$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"STATUS\",\"IP ADDRESS\",\"TC TIME\",\"TC LOGIN\",\"VICI LAST LOG\",\"VICI CAMPAIGN\"\n"; $o=0; $s=0; @@ -358,31 +380,33 @@ while ($users_to_print > $o) if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + {$bgcolor[$o]='bgcolor="#FFFF33"'; $CSV_status="TC Logged in only";} # yellow if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#99FF33"';} # green + {$bgcolor[$o]='bgcolor="#99FF33"'; $CSV_status="TC Logged in and VICI active";} # green } else { if ($Tlogin_sec[$o] > 0) - {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + {$bgcolor[$o]='bgcolor="#CCCC00"'; $CSV_status="TC Logged out only";} # yellow if (strlen($Vevent_time[$o]) > 0) - {$bgcolor[$o]='bgcolor="#FF6666"';} # red + {$bgcolor[$o]='bgcolor="#FF6666"'; $CSV_status="VICI active only";} # red if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) - {$bgcolor[$o]='bgcolor="#66CC66"';} # green + {$bgcolor[$o]='bgcolor="#66CC66"'; $CSV_status="TC Logged out and VICI active";} # green } $s++; - echo "<tr $bgcolor[$o]>"; - echo "<td><font size=1>$s</td>"; - echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; - echo "<td><font size=2>$full_name[$o]</td>"; - echo "<td><font size=2>$Tip_address[$o]</td>"; - echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; - echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; - echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; - echo "</tr>"; + $MAIN.="<tr $bgcolor[$o]>"; + $MAIN.="<td><font size=1>$s</td>"; + $MAIN.="<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + $MAIN.="<td><font size=2>$full_name[$o]</td>"; + $MAIN.="<td><font size=2>$Tip_address[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tlogin_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Tevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vevent_time[$o]</td>"; + $MAIN.="<td align=right><font size=2>$Vcampaign[$o]</td>"; + $MAIN.="</tr>"; + + $CSV_text.="\"\",\"$s\",\"$users[$o]\",\"$full_name[$o]\",\"$CSV_status\",\"$Tip_address[$o]\",\"$Tlogin_time[$o]\",\"$Tevent_time[$o]\",\"$Vevent_time[$o]\",\"$Vcampaign[$o]\"\n"; if (strlen($Tstatus[$o])>0) {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} @@ -400,36 +424,61 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr bgcolor=white>"; -echo "<td colspan=4><font size=2>TOTALI</td>"; -echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "<td align=right><font size=2></td>"; -echo "</tr>"; -echo "</table>"; - +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=4><font size=2>TOTALI</td>"; +$MAIN.="<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="<td align=right><font size=2></td>"; +$MAIN.="</tr>"; +$MAIN.="</table>"; +$CSV_text.="\"\",\"TOTALI\",\"\",\"\",\"\",\"\",\"$total_login_hours_int:$total_login_minutes_int\"\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "timeclock_status_$US$FILE_TIME.csv"; + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + 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; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo "$HEADER"; + require("admin_header.php"); + echo "$MAIN"; + } -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; @@ -449,16 +498,16 @@ $EQday_ARY = explode('-',$end_date); $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); -echo "<br><br>\n"; +$MAIN.="<br><br>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n"; +$MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; +$MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -479,13 +528,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; } if (ereg("LOGOUT", $row[0])) { @@ -498,13 +547,13 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f $event_minutes = ($event_minutes * 60); $event_minutes_int = round($event_minutes, 0); if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[5]</td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; } $o++; } @@ -521,14 +570,14 @@ $total_login_minutes = ($total_login_minutes * 60); $total_login_minutes_int = round($total_login_minutes, 0); if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTALE </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; +$MAIN.="<tr><td align=right><font size=2> </td>"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2> </td>\n"; +$MAIN.="<td align=right><font size=2><font size=2>TOTALE </td>\n"; +$MAIN.="<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; -echo "</TABLE></center>\n"; +$MAIN.="</TABLE></center>\n"; @@ -540,20 +589,15 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; +$MAIN.="</TD></TR><TABLE>\n"; +$MAIN.="</body>\n"; +$MAIN.="</html>\n"; -?> - - -</TD></TR><TABLE> -</body> -</html> - -<?php exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_group_bulk_change.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_group_bulk_change.php index 096f68ca..6c67df87 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_group_bulk_change.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_group_bulk_change.php @@ -1,13 +1,15 @@ <?php # user_group_bulk_change.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81119-0918 - First build # 90309-1830 - Added admin_log logging # 90310-2144 - Added admin header # 90508-0644 - Changed to PHP long tags +# 120221-0025 - Added in User Group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -59,38 +61,38 @@ $ip = getenv("REMOTE_ADDR"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } - else +else { - if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname = $row[0]; - $change_agent_campaign = $row[1]; - $modify_timeclock_log = $row[2]; + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + $LOGuser_group = $row[3]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -98,13 +100,33 @@ $browser = getenv("HTTP_USER_AGENT"); { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } + exit; } } -$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$HTML_text.="|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; +$LOGadmin_viewable_call_times = $row[3]; + +$LOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + } + +$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,7 +140,6 @@ while ($i < $groups_to_print) } - ?> <html> <head> @@ -164,7 +185,7 @@ echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVET ##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### if ($stage == "one_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All Gruppo Utente $old_group Utenti changed to the $group Gruppo Utente<BR>\n"; @@ -183,7 +204,7 @@ if ($stage == "one_user_group_change") ##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### if ($stage == "all_user_group_change") { - $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7 $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); echo "All non-Admin Utenti changed to the $group Gruppo Utente<BR>\n"; @@ -266,6 +287,4 @@ echo "|$stage|$group|"; exit; - ?> - diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php index 81759c84..6b68c981 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php @@ -1,7 +1,7 @@ <?php # user_stats.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -28,9 +28,14 @@ # 100802-2347 - Added User Group Allowed Reports option validation # 100908-1205 - Added customer 3way hangup flags to user calls display # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110218-1523 - Added searches display +# 110703-1836 - Added download option +# 110718-1204 - Added skipped manual dial leads display +# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options +# 111106-1105 - Added user_group restrictions +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); @@ -41,9 +46,9 @@ $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} +if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { @@ -53,6 +58,7 @@ if ($qm_conf_ct > 0) $slave_db_server = $row[2]; $reports_use_slave_db = $row[3]; $user_territories_active = $row[4]; + $webroot_writable = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -63,7 +69,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $use_slave_server=1; $db_source = 'S'; require("dbconnect.php"); - echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + $MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n"; } $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; @@ -87,6 +93,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -104,7 +112,7 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; -if ($DB) {echo "|$stmt|\n";} +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $reports_only_user=$row[0]; @@ -122,40 +130,82 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGfullname = $row[0]; -$LOGuser_group = $row[1]; +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; +$LOGadmin_hide_lead_data = $row[2]; +$LOGadmin_hide_phone_data = $row[3]; -fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); -fclose($fp); +if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } -$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; -if ($DB) {echo "|$stmt|\n";} +$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$LOGallowed_campaigns = $row[0]; -$LOGallowed_reports = $row[1]; +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; +$LOGadmin_viewable_groups = $row[2]; + +$LOGadmin_viewable_groupsSQL=''; +$vuLOGadmin_viewable_groupsSQL=''; +$whereLOGadmin_viewable_groupsSQL=''; +if ( (!eregi("--ALL--",$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')"; + $vuLOGadmin_viewable_groupsSQL = "and vicidial_users.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; + + if (strlen($user) > 0) + { + if ($did > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_count = $row[0]; + } + + if ($allowed_count < 1) + { + echo "This user does not exist: |$PHP_AUTH_USER|$user|\n"; + exit; + } + } + } if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + echo "Non sei autorizzato a visualizzare questa relazione: |$PHP_AUTH_USER|$report_name|\n"; exit; } if ($did > 0) { - $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';"; + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; } else { - $stmt="SELECT full_name from vicidial_users where user='$user';"; + $stmt="SELECT full_name from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; @@ -163,21 +213,16 @@ else - -?> -<html> -<head> - -<script language="JavaScript" src="calendar_db.js"></script> -<link rel="stylesheet" href="calendar.css"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<?php +$HEADER.="<html>\n"; +$HEADER.="<head>\n"; +$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; +$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n"; +$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; if ($did > 0) - {echo "<title>ADMINISTRATION: DID Call Stats";} + {$HEADER.="<title>ADMINISTRATION: DID Call Stats";} else - {echo "<title>ADMINISTRATION: $report_name";} + {$HEADER.="<title>ADMINISTRATION: $report_name";} @@ -207,98 +252,93 @@ if ($did > 0) } ##### END Set variables to make header show properly ##### -require("admin_header.php"); +#require("admin_header.php"); -?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2> -<?php +$MAIN.="<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>\n"; if ($did > 0) - {echo "<B>   DID Call Stats for $user";} + {$MAIN.="<B>   DID Call Stats for $user";} else - {echo "<B>   Statistiche utente for $user";} + {$MAIN.="<B>   Statistiche utente for $user";} -?> -</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> -<?php +$MAIN.="</TD><TD ALIGN=RIGHT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>   </TD></TR>\n"; +$MAIN.="<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$download_link="$PHP_SELF?DB=$DB&did_id=$did_id&did=$did&begin_date=$begin_date&end_date=$end_date&user=$user&submit=$submit\n"; -echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; +$MAIN.="<form action=$PHP_SELF method=GET name=vicidial_report id=vicidial_report>\n"; +$MAIN.="<input type=hidden name=DB value=\"$DB\">\n"; +$MAIN.="<input type=hidden name=did_id value=\"$did_id\">\n"; +$MAIN.="<input type=hidden name=did value=\"$did\">\n"; +$MAIN.="<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; -echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; -echo "<input type=hidden name=DB value=\"$DB\">\n"; -echo "<input type=hidden name=did_id value=\"$did_id\">\n"; -echo "<input type=hidden name=did value=\"$did\">\n"; -echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'begin_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="</script>\n"; -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'begin_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunedi week start -</script> -<?php +$MAIN.=" to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; -echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; - -?> -<script language="JavaScript"> -var o_cal = new tcal ({ - // form name - 'formname': 'vicidial_report', - // input name - 'controlname': 'end_date' -}); -o_cal.a_tpl.yearscroll = false; -// o_cal.a_tpl.weekstart = 1; // Lunedi week start -</script> -<?php +$MAIN.="<script language=\"JavaScript\">\n"; +$MAIN.="var o_cal = new tcal ({\n"; +$MAIN.=" // form name\n"; +$MAIN.=" 'formname': 'vicidial_report',\n"; +$MAIN.=" // input name\n"; +$MAIN.=" 'controlname': 'end_date'\n"; +$MAIN.="});\n"; +$MAIN.="o_cal.a_tpl.yearscroll = false;\n"; +$MAIN.="// o_cal.a_tpl.weekstart = 1; // Lunedi week start\n"; +$MAIN.="</script>\n"; if (strlen($user)>1) - {echo "<input type=hidden name=user value=\"$user\">\n";} + {$MAIN.="<input type=hidden name=user value=\"$user\">\n";} else - {echo "<input type=text name=user size=12 maxlength=10>\n";} -echo "<input type=submit name=submit value=submit>\n"; + {$MAIN.="<input type=text name=user size=12 maxlength=10>\n";} +$MAIN.="<input type=submit name=submit value=submit>\n"; -echo "           $user - $full_name<BR><BR>\n"; +$MAIN.="           $user - $full_name<BR><BR>\n"; -echo "<center>\n"; +$MAIN.="<center>\n"; if ($did > 0) { - echo "<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; - echo " | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificareDID</a>\n"; + $MAIN.="<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificareDID</a>\n"; } else { - echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; - echo " | <a href=\"./user_status.php?user=$user\">Status Utente</a>\n"; - echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; - echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; + $MAIN.="<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; + $MAIN.=" | <a href=\"./user_status.php?user=$user\">Status Utente</a>\n"; + $MAIN.=" | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; + $MAIN.=" | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; } -echo "</center>\n"; +$MAIN.="</center>\n"; -echo "</B></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +$MAIN.="</B></TD></TR>\n"; +$MAIN.="<TR><TD ALIGN=LEFT COLSPAN=2>\n"; -echo "<br><center>\n"; +$MAIN.="<br><center>\n"; if ($did < 1) { ##### vicidial agent talk time and status ##### - echo "<B>AGENT TEMPO DI CHIAMATA E ESITO:</B>\n"; + $MAIN.="<B>AGENT TEMPO DI CHIAMATA E ESITO:     <a href='$download_link&file_download=1'>[DOWNLOAD]</a></B>\n"; - echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $CSV_text1.="\"AGENT TEMPO DI CHIAMATA E ESITO\"\n"; + $CSV_text1.="\"\",\"STATUS\",\"COUNT\",\"HOURS:MM:SS\"\n"; $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); @@ -356,9 +396,10 @@ if ($did < 1) $call_hours_minutes = sec_convert($call_sec[$o],'H'); - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$status[$o]</td>"; + $MAIN.="<td align=right><font size=2> $counts[$o]</td>\n"; + $MAIN.="<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"$status[$o]\",\"$counts[$o]\",\"$call_hours_minutes\"\n"; $total_calls = ($total_calls + $counts[$o]); $total_sec = ($total_sec + $call_sec[$o]); $call_seconds=0; @@ -367,21 +408,25 @@ if ($did < 1) $call_hours_minutes = sec_convert($total_sec,'H'); - echo "<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - echo "</TABLE></center>\n"; + $MAIN.="<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $CSV_text1.="\"\",\"TOTALE CHIAMATE\",\"$total_calls\",\"$call_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; ##### Login and Logout time from vicidial agent interface ##### - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>AGENT TIEMPO LOGIN/LOGOUT:</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + $MAIN.="<B>AGENT TIEMPO LOGIN/LOGOUT:     <a href='$download_link&file_download=2'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $CSV_text2.="\"AGENT TIEMPO LOGIN/LOGOUT\"\n"; + $CSV_text2.="\"\",\"EVENT\",\"DATE\",\"CAMPAIGN\",\"GROUP\",\"HOURS:MM:SS\",\"SESSION\",\"SERVER\",\"PHONE\",\"COMPUTER\"\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date;"; $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -399,15 +444,16 @@ if ($did < 1) if (ereg("LOGIN", $row[0])) { $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -419,22 +465,24 @@ if ($did < 1) $total_login_time = ($total_login_time + $event_seconds); $event_hours_minutes = sec_convert($event_seconds,'H'); - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td>\n"; - echo "<td align=right colspan=4><font size=2>  </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes</td>\n"; + $MAIN.="<td align=right colspan=4><font size=2>  </td></tr>\n"; $event_start_seconds=''; $event_stop_seconds=''; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$event_hours_minutes\"\n"; } else { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right colspan=5><font size=2>  </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right colspan=5><font size=2>  </td></tr>\n"; + $CSV_text2.="\"\",\"$row[0]\",\"$row[2]\",\"$row[3]\"\n"; } } @@ -446,13 +494,14 @@ if ($did < 1) $total_login_hours_minutes = sec_convert($total_login_time,'H'); - echo "<tr><td><font size=2>TOTALE</td>"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $MAIN.="<tr><td><font size=2>TOTALE</td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + $CSV_text2.="\"\",\"TOTAL\",\"\",\"\",\"\",\"$total_login_hours_minutes\"\n"; - echo "</TABLE></center>\n"; + $MAIN.="</TABLE></center>\n"; @@ -466,16 +515,18 @@ if ($did < 1) $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; - echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $MAIN.="<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:     <a href='$download_link&file_download=3'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + $CSV_text3.="\"TIMECLOCK TIEMPO LOGIN/LOGOUT\"\n"; + $CSV_text3.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IPADDRESS\",\"GROUP\",\"HOURS:MM:SS\"\n"; $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + if ($DB>0) {$MAIN.="|$stmt|";} $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -496,13 +547,14 @@ if ($did < 1) if (ereg("LOGIN", $row[0])) { $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> </td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\"\n"; } if (ereg("LOGOUT", $row[0])) { @@ -510,15 +562,16 @@ if ($did < 1) $total_login_time = ($total_login_time + $login_sec); $event_hours_minutes = sec_convert($login_sec,'H'); - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; + $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + $MAIN.="<td align=right><font size=2>$manager_edit</td>"; + $MAIN.="<td align=right><font size=2>$row[0]</td>"; + $MAIN.="<td align=right><font size=2> $TC_log_date</td>\n"; + $MAIN.="<td align=right><font size=2> $row[4]</td>\n"; + $MAIN.="<td align=right><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} + $MAIN.="</td></tr>\n"; + $CSV_text3.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"$event_hours_minutes\"\n"; } $o++; } @@ -526,32 +579,35 @@ if ($did < 1) { $login_sec = ($STARTtime - $row[1]); $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + if ($DB) {$MAIN.="LOGIN ONLY - $total_login_time - $login_sec";} } $total_login_hours_minutes = sec_convert($total_login_time,'H'); - if ($DB) {echo " - $total_login_time - $login_sec";} + if ($DB) {$MAIN.=" - $total_login_time - $login_sec";} - echo "<tr><td align=right><font size=2> </td>"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2> </td>\n"; - echo "<td align=right><font size=2><font size=2>TOTALE </td>\n"; - echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - - echo "</TABLE></center>\n"; + $MAIN.="<tr><td align=right><font size=2> </td>"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2> </td>\n"; + $MAIN.="<td align=right><font size=2><font size=2>TOTALE </td>\n"; + $MAIN.="<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + $CSV_text3.="\"\",\"\",\"\",\"\",\"\",\"TOTAL\",\"$total_login_hours_minutes\"\n"; + $MAIN.="</TABLE></center>\n"; ##### closer in-group selection logs ##### - echo "<br><br>\n"; + $MAIN.="<br><br>\n"; - echo "<center>\n"; + $MAIN.="<center>\n"; - echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; - echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + $MAIN.="<B>CLOSER IN-GROUP SELECTION LOGS:     <a href='$download_link&file_download=4'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + + $CSV_text4.="\"CLOSER IN-GROUP SELECTION LOGS\"\n"; + $CSV_text4.="\"\",\"#\",\"DATE/TIME\",\"CAMPAIGN\",\"BLEND\",\"GROUPS\",\"MANAGER\"\n"; $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); @@ -567,25 +623,28 @@ if ($did < 1) {$bgcolor='bgcolor="#9BB9FB"';} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[2]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[5]</td>\n"; + $CSV_text4.="\"\",\"$u\",\"$row[2]\",\"$row[1]\",\"$row[3]\",\"$row[4]\",\"$row[5] \"\n"; + $MAIN.="</tr>\n"; } - echo "</TABLE><BR><BR>\n"; + $MAIN.="</TABLE><BR><BR>\n"; ##### vicidial agent outbound calls for this time period ##### - echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $MAIN.="<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=5'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + $CSV_text5.="\"OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text5.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"GROUP\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -601,28 +660,48 @@ if ($did < 1) {$bgcolor='bgcolor="#9BB9FB"';} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; + + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[10]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[10] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[10] = preg_replace("/./",'X',$phone_temp);} + } + } + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[4]</td>"; + $MAIN.="<td align=left><font size=2> $row[7]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[8]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[14] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[15] </td></tr>\n"; + $CSV_text5.="\"\",\"$u\",\"$row[4]\",\"$row[7]\",\"$row[8]\",\"$row[10]\",\"$row[3]\",\"$row[14]\",\"$row[2]\",\"$row[1]\",\"$row[15]\"\n"; } - echo "</TABLE><BR><BR>\n"; + $MAIN.="</TABLE><BR><BR>\n"; } ##### vicidial agent inbound calls for this time period ##### -echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$MAIN.="<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=6'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; +$CSV_text6.="\"INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text6.="\"\",\"#\",\"DATE/TIME\",\"LENGTH\",\"STATUS\",\"PHONE\",\"CAMPAIGN\",\"WAIT(S)\",\"AGENT(S)\",\"LIST\",\"LEAD\",\"HANGUP REASON\"\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; if ($did > 0) @@ -660,37 +739,58 @@ while ($logs_to_print > $u) $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + if (strlen($phone_temp) > 0) + { + if ($LOGadmin_hide_phone_data == '4_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + else + {$row[3] = preg_replace("/./",'X',$phone_temp);} + } + } + $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> $row[5] </td>\n"; - echo "<td align=right><font size=2> $AGENTseconds </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; - echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $AGENTseconds </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td></tr>\n"; + $CSV_text6.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$AGENTseconds\",\"$row[6]\",\"$row[7]\",\"$row[8]\"\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALI</td>"; -echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td>\n"; -echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; -echo "<td colspan=3><font size=2>   </td></tr>\n"; -echo "</TABLE></center><BR><BR>\n"; +$MAIN.="<tr bgcolor=white>"; +$MAIN.="<td colspan=2><font size=2>TOTALI</td>"; +$MAIN.="<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +$MAIN.="<td colspan=4><font size=2>   </td>\n"; +$MAIN.="<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +$MAIN.="<td colspan=3><font size=2>   </td></tr>\n"; +$MAIN.="</TABLE></center><BR><BR>\n"; +$CSV_text6.="\"\",\"\",\"TOTALI\",\"$TOTALinSECONDS\",\"\",\"\",\"\",\"\",\"$TOTALagentSECONDS\"\n"; ##### vicidial agent activity records for this time period ##### if ($did < 1) { - echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $MAIN.="<B>ATTIVITA 'AGENTE PER QUESTO PERIODO DI TEMPO: (10000 record limit)     <a href='$download_link&file_download=7'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>questi campi sono in pochi secondi </td><td colspan=4><font size=1>   </td></tr>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + $CSV_text7.="\"ATTIVITA 'AGENTE PER QUESTO PERIODO DI TEMPO: (10000 record limit)\"\n"; + $CSV_text7.="\"\",\"#\",\"DATE/TIME\",\"PAUSE\",\"WAIT\",\"TALK\",\"DISPO\",\"DEAD\",\"CUSTOMER\",\"STATUS\",\"LEAD\",\"CAMPAIGN\",\"PAUSE CODE\"\n"; $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -742,46 +842,48 @@ if ($did < 1) $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); - echo "<tr $bgcolor>"; - echo "<td><font size=1>  </td>"; - echo "<td><font size=2>$DBcall_end</td>"; - echo "<td align=right><font size=2> $DBtotal_sec </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td>\n"; - echo "<td align=right><font size=2>   </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>  </td>"; + $MAIN.="<td><font size=2>$DBcall_end</td>"; + $MAIN.="<td align=right><font size=2> $DBtotal_sec </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td>\n"; + $MAIN.="<td align=right><font size=2>   </td></tr>\n"; } $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$event_time</td>"; + $MAIN.="<td align=right><font size=2> $pause_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $wait_sec</td>\n"; + $MAIN.="<td align=right><font size=2> $talk_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dispo_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $dead_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $customer_sec </td>\n"; + $MAIN.="<td align=right><font size=2> $status </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $campaign_id </td>\n"; + $MAIN.="<td align=right><font size=2> $pause_code </td></tr>\n"; + $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; } - echo "<tr bgcolor=white>"; - echo "<td colspan=2><font size=2>TOTALI</td>"; - echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; - echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; - echo "<td colspan=4><font size=2>   </td></tr>\n"; + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=2>TOTALI</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"TOTALI\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); @@ -790,25 +892,28 @@ if ($did < 1) $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - echo "<tr bgcolor=white>"; - echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; - echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; - echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; - echo "<td colspan=4><font size=2>   </td></tr>\n"; + $MAIN.="<tr bgcolor=white>"; + $MAIN.="<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + $MAIN.="<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + $MAIN.="<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + $MAIN.="<td colspan=4><font size=2>   </td></tr>\n"; + $CSV_text7.="\"\",\"\",\"(in HH:MM:SS)\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; - echo "</TABLE></center><BR><BR>\n"; + $MAIN.="</TABLE></center><BR><BR>\n"; } ##### vicidial recordings for this time period ##### -echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$MAIN.="<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=8'>[DOWNLOAD]</a></B>\n"; +$MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +$MAIN.="<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; +$CSV_text8.="\"RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; +$CSV_text8.="\"\",\"#\",\"LEAD\",\"DATE/TIME\",\"SECONDS\",\"RECID\",\"FILENAME\",\"LOCATION\"\n"; $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -824,6 +929,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$bgcolor='bgcolor="#9BB9FB"';} $location = $row[11]; + $CSV_location=$row[11]; if (strlen($location)>2) { @@ -837,7 +943,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon if ($rowx[0] > 0) { - $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); @@ -845,6 +951,10 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon { $location = eregi_replace($URLserver_ip, $rowx[1], $location); } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } @@ -857,27 +967,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon else {$location = $locat;} $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[8] </td>\n"; - echo "<td align=left><font size=2> $row[0] </td>\n"; - echo "<td align=center><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $location   </td>\n"; - echo "</tr>\n"; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + $MAIN.="<td align=left><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=left><font size=2> $row[0] </td>\n"; + $MAIN.="<td align=center><font size=2> $row[10] </td>\n"; + $MAIN.="<td align=right><font size=2> $location   </td>\n"; + $MAIN.="</tr>\n"; + $CSV_text8.="\"\",\"$u\",\"$row[12]\",\"$row[4]\",\"$row[8]\",\"$row[0]\",\"$row[10]\",\"$CSV_location\"\n"; } -echo "</TABLE><BR><BR>\n"; +$MAIN.="</TABLE><BR><BR>\n"; if ($did < 1) { ##### vicidial agent outbound user manual calls for this time period ##### - echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; - echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; - echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $MAIN.="<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=9'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; + $CSV_text9.="\"MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text9.="\"\",\"#\",\"DATE/TIME\",\"CALL TYPE\",\"SERVER\",\"PHONE\",\"DIALED\",\"LEAD\",\"CALLERID\",\"ALIAS\",\"PRESET\",\"C3HU\"\n"; $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -898,21 +1011,134 @@ if ($did < 1) if (strlen($row[9]) > 1) {$C3HU = "$row[9] $row[10]";} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td>\n"; - echo "<td align=right><font size=2> $row[8] </td>\n"; - echo "<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + if ($LOGadmin_hide_phone_data != '0') + { + if ($DB > 0) {echo "NASCONDIPHONEDATA|$row[10]|$LOGadmin_hide_phone_data|\n";} + $phone_temp = $row[3]; + $dialed_temp = $row[4]; + if ($LOGadmin_hide_phone_data == '4_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 4)) . substr($dialed_temp,-4,4);} + } + elseif ($LOGadmin_hide_phone_data == '3_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 3)) . substr($dialed_temp,-3,3);} + } + elseif ($LOGadmin_hide_phone_data == '2_DIGITS') + { + if (strlen($phone_temp) > 0) + {$row[3] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);} + if (strlen($dialed_temp) > 0) + {$row[4] = str_repeat("X", (strlen($dialed_temp) - 2)) . substr($dialed_temp,-2,2);} + } + else + { + if (strlen($phone_temp) > 0) + {$row[3] = preg_replace("/./",'X',$phone_temp);} + if (strlen($dialed_temp) > 0) + {$row[4] = preg_replace("/./",'X',$dialed_temp);} + } } - echo "</TABLE><BR><BR>\n"; + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=left><font size=2> $row[1]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[2]</td>\n"; + $MAIN.="<td align=left><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[6] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[7] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[8] </td>\n"; + $MAIN.="<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + $CSV_text9.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$C3HU\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### + + $MAIN.="<B>PIOMBO RICERCHE PER QUESTO PERIODO DI TEMPO: (10000 record limit)     <a href='$download_link&file_download=10'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=left NOWRAP><font size=2> TYPE   </td><td align=left NOWRAP><font size=2> RESULTS   </td><td align=left NOWRAP><font size=2> SEC   </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n"; + $CSV_text10.="\"PIOMBO RICERCHE PER QUESTO PERIODO DI TEMPO: (10000 record limit)\"\n"; + $CSV_text10.="\"\",\"#\",\"DATE/TIME\",\"TYPE\",\"RESULTS\",\"SEC\",\"QUERY\"\n"; + + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[0]</td>"; + $MAIN.="<td align=center><font size=2> $row[1] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[2] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td></tr>\n"; + $CSV_text10.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; + } + +if ($did < 1) + { + ##### vicidial agent manual dial lead preview skips for this time period ##### + + $MAIN.="<B>PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)     <a href='$download_link&file_download=11'>[DOWNLOAD]</a></B>\n"; + $MAIN.="<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + $MAIN.="<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME   </td><td align=right NOWRAP><font size=2> LEAD ID   </td><td align=right NOWRAP><font size=2> STATUS   </td><td align=right NOWRAP><font size=2> COUNT   </td><td align=right NOWRAP><font size=2> CAMPAGNA</td></tr>\n"; + $CSV_text11.="\"PREVIEW LEAD SKIPS FOR THIS TIME PERIOD: (10000 record limit)\"\n"; + $CSV_text11.="\"\",\"#\",\"DATE/TIME\",\"LEAD ID\",\"STATUS\",\"COUNT\",\"CAMPAIGN\"\n"; + + $stmt="select user,event_date,lead_id,campaign_id,previous_status,previous_called_count from vicidial_agent_skip_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $MAIN.="<tr $bgcolor>"; + $MAIN.="<td><font size=1>$u</td>"; + $MAIN.="<td><font size=2>$row[1]</td>"; + $MAIN.="<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[2]\" target=\"_blank\">$row[2]</A> </td>\n"; + $MAIN.="<td align=right><font size=2> $row[4] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[5] </td>\n"; + $MAIN.="<td align=right><font size=2> $row[3] </td></tr>\n"; + $CSV_text11.="\"\",\"$u\",\"$row[1]\",\"$row[2]\",\"$row[4]\",\"$row[5]\",\"$row[3]\"\n"; + } + $MAIN.="</TABLE><BR><BR>\n"; } @@ -920,22 +1146,50 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n\n"; +$MAIN.="\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; +$MAIN.="<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; + +$MAIN.="</TD></TR><TABLE>"; +$MAIN.="</body>"; +$MAIN.="</html>"; -?> +if ($file_download>0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "user_stats_$US$FILE_TIME.csv"; + $CSV_var="CSV_text".$file_download; + $CSV_text=preg_replace('/^\s+/', '', $$CSV_var); + $CSV_text=preg_replace('/\n\s+,/', ',', $CSV_text); + $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); + $CSV_text=preg_replace('/\" +/', '"', $CSV_text); + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + // It will be called LIST_101_20090209-121212.txt + 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(); -</TD></TR><TABLE> -</body> -</html> + echo "$CSV_text"; + + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + echo $HEADER; + require("admin_header.php"); + echo $MAIN; + exit; + } -<?php -exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php index e315f93c..afea05c0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,11 @@ # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process # 100309-0544 - Added queuemetrics_loginout option +# 101108-0032 - Added ADDMEMBER queue_log code +# 110124-1134 - Small query fix for large queue_log tables +# 110224-2350 - Small QM logout fix +# 110420-0344 - Added DEAD/PARK agent statuses +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # header ("Content-type: text/html; charset=utf-8"); @@ -65,6 +70,7 @@ $StarTtimE = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $ip = getenv("REMOTE_ADDR"); +$check_time = ($StarTtimE - 86400); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} @@ -99,7 +105,7 @@ else $modify_timeclock_log = $row[2]; if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -107,7 +113,7 @@ else { if ($webroot_writable > 0) { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; @@ -133,6 +139,7 @@ else $Aextension = $row[4]; $Astatus = $row[5]; $Acampaign = $row[7]; + $Acallerid = $row[9]; $Alast_call = $row[14]; $Acl_campaigns = $row[15]; $agent_territories = $row[27]; @@ -155,6 +162,30 @@ else $i++; } + if ($Astatus == 'INCALL') + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus = 'PARK'; + } + else + { + $stmtP="select count(*) from vicidial_auto_calls where callerid='$Acallerid';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $live_channel = $rowP[0]; + + if ($live_channel < 1) + { + $Astatus = 'DEAD'; + } + } + } } $stmt="select campaign_id from vicidial_campaigns;"; @@ -271,7 +302,7 @@ if ($stage == "log_agent_out") if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} - if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + 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';"; @@ -339,20 +370,22 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; - $queuemetrics_loginout = $row[6]; + $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_pe_phone_append = $row[8]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -367,26 +400,84 @@ if ($stage == "log_agent_out") $agents='@agents'; $agent_logged_in=''; - $time_logged_in=''; + $time_logged_in='0'; - $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 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/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); if ($qml_ct > 0) { $row=mysql_fetch_row($rsltB); - $agent_logged_in = $row[0]; - $time_logged_in = $row[1]; - $phone_logged_in = $row[2]; + $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;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; - if ($DB) {echo "<BR>$stmtB\n";} - $rsltB=mysql_query($stmtB, $linkB); + if ($queuemetrics_addmember_enabled > 0) + { + $queuemetrics_phone_environment=''; + $stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $cqpe_ct = mysql_num_rows($rslt); + if ($cqpe_ct > 0) + { + $row=mysql_fetch_row($rslt); + $queuemetrics_phone_environment = $row[0]; + } + + $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' order by time_id desc;"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $amq_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $amq_conf_ct) + { + $row=mysql_fetch_row($rslt); + $AMqueue[$i] = $row[0]; + $i++; + } + + ### add the logged-in campaign as well + $AMqueue[$i] = $VLA_campaign_id; + $i++; + $amq_conf_ct++; + + $i=0; + while ($i < $amq_conf_ct) + { + $pe_append=''; + if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) ) + { + $qm_extension = explode('/',$phone_logged_in); + $pe_append = "-$qm_extension[1]"; + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';"; + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + $i++; + } + } + + if ($queuemetrics_loginout != 'NONE') + { + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } } echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_territories.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_territories.php index 92006655..c8c7ad18 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_territories.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_territories.php @@ -40,8 +40,8 @@ if (isset($_GET["batch"])) {$batch=$_GET["batch"];} elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +74,7 @@ if ($ss_conf_ct > 0) if ($user_territories_active < 1) { - echo "ERROR: User Territories are not active on this system\n"; + echo "ERROR: Territori degli utenti non sono attivi su questo sistema\n"; exit; } @@ -84,7 +84,7 @@ if ($non_latin < 1) $DB = ereg_replace("[^0-9]","",$DB); $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); - $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $level = ereg_replace("[^\_A-Z]","",$level); $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); @@ -115,7 +115,7 @@ else { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$USER|$PASS|\n"; + echo "Utentename/Password non validi: |$USER|$PASS|\n"; exit; } } @@ -138,8 +138,8 @@ if (strlen($action) < 1) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> -<title>ADMINISTRATION: User Territories +<!-- VERSIONE: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: Utente Territori <?php @@ -154,11 +154,11 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambia Territorio Proprietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Proprietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -175,12 +175,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Proprietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; echo "</TABLE></center>\n"; exit; } @@ -194,7 +194,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i if ( (strlen($accountid)<1) or (strlen($user)<1) ) { - echo "ERROR: Account ID and User must be filled in<BR>\n"; + echo "ERROR: Account ID and Utente must be filled in<BR>\n"; } else { @@ -220,7 +220,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; $rslt=mysql_query($stmt, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Dovuto aggiungere territorio utente: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -253,8 +253,8 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i $rsltV=mysql_query($stmtB, $link); } - echo "Vtiger Territory Owner Changed: $user $territory<BR>\n"; - echo "Records Changed: $changed<BR>\n"; + echo "Vtiger Territorio Proprietario Changed: $user $territory<BR>\n"; + echo "Record modificati: $changed<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -299,13 +299,13 @@ $colspan='3'; ?> <TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> <TR BGCOLOR=#E6E6E6> -<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">List Territories</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Add Territory</a></TD> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Add User Territory</a></TD> +<TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>">Elenco Territori</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_TERRITORY">Aggiungi Territorio</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=ADD_USER_TERRITORY">Aggiungi Utente Territorio</a></TD> <? if ($enable_vtiger_integration > 0) { ?> -<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner</a></TD> +<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   <a href="<?php echo "$PHP_SELF" ?>?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territorio Owner</a></TD> <? $colspan='4'; } ?> @@ -333,7 +333,7 @@ $admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = eregi_replace('audio_store.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AIUTO\" ALIGN=TOP></A>"; $secX = date("U"); $pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; @@ -350,10 +350,10 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n"; + echo "<br>Vtiger Cambia Territorio Proprietario<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -370,7 +370,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$territories_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>New Proprietario:</td><td align=left><select size=1 name=user>\n"; $stmt="SELECT user,full_name from vicidial_users where active='Y' order by user"; $rslt=mysql_query($stmt, $link); @@ -387,12 +387,12 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Proprietario:</td><td align=left><select size=1 name=vl_owner>\n"; echo "<option SELECTED>YES</option>\n"; echo "<option>NO</option>\n"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; echo "</TABLE></center>\n"; } ### END change territory owner in the system @@ -403,7 +403,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio e degli utenti deve essere compilato in<BR>\n"; } else { @@ -418,7 +418,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; $rslt=mysql_query($stmtB, $link); - echo "NOTICE: Had to add user territory: $user $territory<BR>\n"; + echo "NOTICE: Dovuto aggiungere territorio utente: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -505,7 +505,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; $rsltV=mysql_query($stmtB, $linkV); - echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; + echo "Vtiger Territorio Proprietario Changed: $user $territory       Record modificati: $changed - $Achanged - $Cchanged - $Vchanged<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -530,7 +530,7 @@ if ($action == "ADD_USER_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add User Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Aggiungi Utente Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_USER_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Agent: </td><td align=left><select size=1 name=user>\n"; @@ -550,7 +550,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$users_list"; echo "</select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><select size=1 name=territory>\n"; $stmt="SELECT territory,territory_description from vicidial_territories order by territory"; $rslt=mysql_query($stmt, $link); @@ -567,7 +567,7 @@ if ($action == "ADD_USER_TERRITORY") echo "$territories_list"; echo "</select></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Level: </td><td align=left><select size=1 name=level><option>TOP_AGENT</option><option>STANDARD_AGENT</option><option>BOTTOM_AGENT</option></select></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add user territory page @@ -578,7 +578,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, degli utenti e di livello deve essere compilato in<BR>\n"; } else { @@ -587,7 +587,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: this territory user is already in the system<BR>\n"; + echo "ERROR: questo utente territorio è già nel sistema<BR>\n"; } else { @@ -600,7 +600,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Added: $user $territory<BR>\n"; + echo "Utente Territorio Added: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -621,7 +621,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) { - echo "ERROR: Territory, User and Level must be filled in<BR>\n"; + echo "ERROR: Territorio, degli utenti e di livello deve essere compilato in<BR>\n"; } else { @@ -630,7 +630,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: questo utente territorio non è nel sistema di<BR>\n"; } else { @@ -643,7 +643,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY") $rslt=mysql_query($stmtB, $link); } - echo "User Territory Modified: $user $territory<BR>\n"; + echo "Utente Territorio Modified: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -664,7 +664,7 @@ if ($action == "DELETE_USER_TERRITORY") { if ( (strlen($territory)<1) or (strlen($user)<1) ) { - echo "ERROR: Territory and User must be filled in<BR>\n"; + echo "ERROR: Territorio e degli utenti deve essere compilato in<BR>\n"; } else { @@ -673,14 +673,14 @@ if ($action == "DELETE_USER_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: this territory user is not in the system<BR>\n"; + echo "ERROR: questo utente territorio non è nel sistema di<BR>\n"; } else { $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; $rslt=mysql_query($stmt, $link); - echo "User Territory Deleted: $user $territory<BR>\n"; + echo "Utente Territorio Soppresso: $user $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; @@ -706,12 +706,12 @@ if ($action == "ADD_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Aggiungi Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Descrizione territorio: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n"; echo "</TABLE></center>\n"; } ### END add territory page @@ -722,7 +722,7 @@ if ($action == "PROCESS_ADD_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio e Territorio Descrizione deve essere compilato in<BR>\n"; } else { @@ -731,14 +731,14 @@ if ($action == "PROCESS_ADD_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] > 0) { - echo "ERROR: there is already a territory in the system with this name<BR>\n"; + echo "ERROR: vi è già un territorio nel sistema con questo nome<BR>\n"; } else { $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; $rslt=mysql_query($stmt, $link); - echo "Territory Added: $territory<BR>\n"; + echo "Territorio Added: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -759,7 +759,7 @@ if ($action == "DELETE_TERRITORY") { if (strlen($territory)<1) { - echo "ERROR: Territory must be filled in<BR>\n"; + echo "ERROR: Territorio deve essere compilato in<BR>\n"; } else { @@ -768,14 +768,14 @@ if ($action == "DELETE_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 0) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Questo territorio non è presente nel sistema con questo nome<BR>\n"; } else { $stmt="DELETE from vicidial_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Deleted: $territory<BR>\n"; + echo "Territorio Soppresso: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -796,7 +796,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY") { if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) { - echo "ERROR: Territory and Territory Description must be filled in<BR>\n"; + echo "ERROR: Territorio e Territorio Descrizione deve essere compilato in<BR>\n"; } else { @@ -805,14 +805,14 @@ if ($action == "PROCESS_MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); if ($row[0] < 1) { - echo "ERROR: This territory is not in the system with this name<BR>\n"; + echo "ERROR: Questo territorio non è presente nel sistema con questo nome<BR>\n"; } else { $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; $rslt=mysql_query($stmt, $link); - echo "Territory Modified: $territory<BR>\n"; + echo "Territorio Modified: $territory<BR>\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; @@ -841,12 +841,12 @@ if ($action == "MODIFY_TERRITORY") echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>Modify Territory<form action=$PHP_SELF method=POST>\n"; + echo "<br>Modifica Territorio<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=action value=PROCESS_MODIFY_TERRITORY>\n"; echo "<input type=hidden name=territory value=\"$territory\">\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; - echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Territorio: </td><td align=left><B>$rowx[0]</B></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=right>Descrizione territorio: </td><td align=left><input type=text name=territory_description size=50 maxlength=255 value=\"$rowx[1]\"></td></tr>\n"; $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; $rslt=mysql_query($stmt, $link); @@ -857,7 +857,7 @@ if ($action == "MODIFY_TERRITORY") $row=mysql_fetch_row($rslt); $user_count = $row[0]; } - echo "<tr bgcolor=#B6D3FC><td align=right>Agents: </td><td align=left><B>$user_count</B></td></tr>"; + echo "<tr bgcolor=#B6D3FC><td align=right>Agenti: </td><td align=left><B>$user_count</B></td></tr>"; $owner_count=0; $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; @@ -884,11 +884,11 @@ if ($action == "MODIFY_TERRITORY") } echo "<tr bgcolor=#B6D3FC><td align=right>Vtiger Accounts: </td><td align=left><B>$vtiger_count</B></td></tr>"; } - echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></form></td></tr>\n"; + echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></form></td></tr>\n"; echo "</TABLE></center>\n"; echo "<BR><BR>\n"; - echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Users in this Territory:</TD></TR>\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=1 WIDTH=600><TR><TD COLSPAN=5><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Utenti in this Territorio:</TD></TR>\n"; $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; $rslt=mysql_query($stmt, $link); @@ -959,7 +959,7 @@ if ($action == "MODIFY_TERRITORY") echo "<input type=submit name=submit value=submit>"; echo "</form>"; echo "</TD>"; - echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">DELETE</a></TD>"; + echo "<TD><a href=\"$PHP_SELF?action=DELETE_USER_TERRITORY&territory=$territory&user=$Tuser[$o]\">CANCELLA</a></TD>"; echo "</TR>\n"; $o++; } @@ -967,12 +967,12 @@ if ($action == "MODIFY_TERRITORY") echo "</TABLE>\n"; echo "<BR><BR><BR>\n"; - echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Delete This Territory</a>\n"; + echo "<a href=\"$PHP_SELF?action=DELETE_TERRITORY&territory=$territory\">Elimina Questo territorio</a>\n"; echo "<BR><BR>\n"; } else { - echo "ERROR: Territory not found: $territory<BR>\n"; + echo "ERROR: Territorio non trovato: $territory<BR>\n"; } } ### END modify territory page @@ -986,13 +986,13 @@ if ($action == "LIST_ALL_TERRITORIES") { echo "<TABLE><TR><TD>\n"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; - echo "<br>List All Territories:\n"; + echo "<br>Tutti i territori:\n"; echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n"; echo "<TR BGCOLOR=BLACK>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>#</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TERRITORY</B></TD>"; - echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n"; + echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIZIONE</B></TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>AGENTS</TD>\n"; echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACCOUNTS</TD>\n"; if ($enable_vtiger_integration > 0) @@ -1085,5 +1085,5 @@ if ($action == "LIST_ALL_TERRITORIES") -<BR><font size=1>User Territories     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +<BR><font size=1>Utente Territori     VERSIONE: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> </TD></TR></TABLE> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/vdremote.php b/agc_2-X/trunk/LANG_www/vicidial_it/vdremote.php index a40d7f93..2d72d6ca 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/vdremote.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/vdremote.php @@ -4,7 +4,7 @@ # make sure you have added a user to the vicidial_users MySQL table with at # least user_level 4 to access this page the first time # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -13,10 +13,11 @@ # 60619-1603 - Added variable filtering to eliminate SQL injection attack threat # 90508-0644 - Changed to PHP long tags # 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # -$version = '2.2.0'; -$build = '91129-2249'; +$version = '2.2.4-7'; +$build = '120223-2135'; require("dbconnect.php"); @@ -124,12 +125,12 @@ else $server_ip=$row[1]; if (!$number_of_lines) {$number_of_lines=$row[2];} - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); fclose($fp); echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; exit; @@ -137,7 +138,7 @@ else } else { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); fclose($fp); } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/verticalbargraph.css b/agc_2-X/trunk/LANG_www/vicidial_it/verticalbargraph.css new file mode 100644 index 00000000..1ecf1941 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/verticalbargraph.css @@ -0,0 +1,57 @@ + +.verticalBarGraph { + border-bottom: 1px solid #FFF; + height: 200px; + margin: 0; + padding: 0; + position: relative; + } + +.verticalBarGraph li { + border: 1px solid #555; + border-bottom: none; + bottom: 0; + list-style:none; + margin: 0; + padding: 0; + position: relative; + text-align: center; + width: 39px; + } + +.barGraph { + background: url(images/horizontal_grid_line_50_pixel.png) bottom left; + border-bottom: 3px solid #333; + font: 9px Helvetica, Geneva, sans-serif; + height: 200px; + margin: 1em 0; + padding: 0; + position: relative; + } + +.barGraph li { + background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right; + border: 1px solid #555; + border-bottom: none; + bottom: 0; + color: #FFF; + margin: 0; + padding: 0 0 0 0; + position: absolute; + list-style: none; + text-align: center; + width: 39px; + } + +.barGraph li.p1{ + background-color:#FFFFFF; + color: #000; +} +/* +.barGraph li.p2{ background-color:#AAAAAA } +.barGraph li.p3{ background-color:#888888 } +.barGraph li.p4{ background-color:#666666 } +*/ +.barGraph li.p2{ background-color:#B66 } +.barGraph li.p3{ background-color:#944 } +.barGraph li.p4{ background-color:#722 } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/voice_lab.php b/agc_2-X/trunk/LANG_www/vicidial_it/voice_lab.php new file mode 100644 index 00000000..2eaaf88c --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/voice_lab.php @@ -0,0 +1,312 @@ +<?php +# voice_lab.php +# +# This script is designed to broadcast a recorded message or allow a person to +# speak to all agents logged into a VICIDIAL campaign. +# +# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# +# 61220-1050 - First Build +# 70115-1246 - Added ability to define an exten to play +# 90508-0644 - Changed to PHP long tags +# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["message"])) {$message=$_GET["message"];} + elseif (isset($_POST["message"])) {$message=$_POST["message"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} + elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} +if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} + elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} +if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} + elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} +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"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$MYSQL_datetime = date("Y-m-d H:i:s"); +$FILE_datetime = date("Ymd-His_"); +$secX = $STARTtime; + +$local_DEF = 'Local/'; +$local_AMP = '@'; +$ext_context = 'demo'; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); + fclose($fp); + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + +##### get server listing for dynamic pulldown +$stmt="SELECT server_ip,server_description from servers order by server_ip"; +$rslt=mysql_query($stmt, $link); +$servers_to_print = mysql_num_rows($rslt); +$servers_list=''; + +$o=0; +while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + +##### get campaigns listing for dynamic pulldown +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; +$rslt=mysql_query($stmt, $link); +$campaigns_to_print = mysql_num_rows($rslt); +$campaigns_list=''; + +$o=0; +while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + + + +?> +<html> +<head> +<title>VICIDIAL VOICE LAB: Admin +\n"; +?> + + +
    + + 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; + + $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); + $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); + + $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $agents_to_loop = mysql_num_rows($rslt); + $agents_sessions[0]=''; + $agents_servers[0]=''; + $agents_users[0]=''; + + $o=0; + while ($agents_to_loop > $o) + { + $rowx=mysql_fetch_row($rslt); + $agents_sessions[$o] = "$rowx[0]"; + $agents_servers[$o] = "$rowx[1]"; + $agents_users[$o] = "$rowx[2]"; + $o++; + } + + $o=0; + while ($agents_to_loop > $o) + { + if ($agents_servers[$o] == "$server_ip") + {$dial_string = $session_id;} + else + {$dial_string = $remote_dialstring;} + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; + + $o++; + } + + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } +else + { + if ($PLAY_MESSAGE > 0) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) + { + echo "


    TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
    \n"; + + echo "
    or, you can enter an extension that you want played below
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Message Extension\n"; + echo "\n"; + echo "



    \n"; + + $nn='99'; + $n='9'; + + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "MESSAGE $message played at session $session_id on server $server_ip\n"; + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "



    \n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + } + else + { + echo "
    Start a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + + + echo "
    Kill a Voice Lab Session: 8600900
    \n"; + echo "\n"; + echo "\n"; + echo "Your Server: \n"; + echo "
    \n"; + echo "Campaign: "; + echo "
    \n"; + echo "\n"; + echo "



    \n"; + } + } + + +if ($KILL_VOICE_LAB > 1) + { + if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) + { + $kill_dial_string = "5555$session_id"; + $hangup_exten='8300'; + $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; + echo "|$stmt|\n

    \n"; + $rslt=mysql_query($stmt, $link); + + echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; + } + else + { + echo "ERROR!!!! Not all info entered properly\n

    \n"; + echo "|$server_ip| |$session_id| |$campaign_id|\n

    \n"; + echo "Back to main voicelab screen\n

    \n"; + } + + } + +?> + + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/welcome.php b/agc_2-X/trunk/LANG_www/vicidial_it/welcome.php index afb3a4b6..db060df8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/welcome.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/welcome.php @@ -8,7 +8,7 @@ echo "ViciDial Benvenuto\n"; echo "\n"; echo "\n"; echo "




    "; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php index 3b48ee07..81c3bc8f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -59,6 +59,9 @@ echo "   \n"; echo "\n"; +echo "
    Benvenuti
     
    "; echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php index 4fe6d387..e00e310e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php @@ -2,7 +2,7 @@ # welcome_languages.php - VICIDIAL welcome Languages page # # -# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -59,6 +59,9 @@ echo "  
    "; echo "   Swedish Agent Login"; +echo "
    "; +echo "   Danish Agent Login"; echo "
    \n"; echo "
    \n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/wz_jsgraphics.js b/agc_2-X/trunk/LANG_www/vicidial_it/wz_jsgraphics.js new file mode 100644 index 00000000..c0ed67c2 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_it/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.33 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 24. 10. 2005 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
    <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
    \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
    '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
    '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/agc_2-X/trunk/translations/br_language_admin.txt b/agc_2-X/trunk/translations/br_language_admin.txt index 0eb178f6..7e0f4d88 100644 --- a/agc_2-X/trunk/translations/br_language_admin.txt +++ b/agc_2-X/trunk/translations/br_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Ingles| @@ -951,7 +983,7 @@ BUILD|BUILD| REPORTS|RELATÓRIOS| USERS|USUÁRIOS| CAMPAIGNS| CAMPANHAS| -LISTS|LISTAS| +#LISTS|LISTAS| SCRIPTS|SCRIPTS| FILTERS|FILTROS| IN-GROUPS|GRUPOS DE ENTR.| @@ -1480,7 +1512,7 @@ QC Allowed Inbound Groups: |Grupos de Entrada para CQ:| Queue Priority -<\/B> This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode|Prioridade da Fila - Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended| Queue Priority: |Prioridade da Fila:| Drop Action: |Ação de Drop:| -Drop Transfer Group: |Grupo de Transferência de Drop:| +Drop Transfer Group|Grupo de Transferência de Drop| Drop Action -<\/B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below|Ação de Drop - Este menu permite que você escolha o que acontece com uma chamada quando esta ficou esperando mais que o tempo configurado no campo Tempo Limite de Drop. HANGUP irá simplesmente desligar a chamada, MESSAGE irá enviar a chamada para Extensão de Drop que você definiu abaixo, VOICEMAIL irá enviar a chamada para a caixa de voicemail que você definiu abaixo e IN_GROUP irá enviar a chamada para o grupo de entrada que você define abaixo| Drop Exten -<\/B> If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds|Extensão de Drop - Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop| Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Tempo Limite de Drop- O número em segundos que uma chamada deve ficar na fila de espera até ser considerada um DROP| @@ -1522,7 +1554,7 @@ code name must be between 2 and 30 characters in length|nome do código deve ter CALL HANGUP REASON STATS|ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO| After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE|Ação Fora do Expediente - A ação a ser realizada se o horário for fora do definido no horário de chamada para este grupo de entrada. HANGUP irá imediatamente desligar a chamada, MESSAGE irá tocar o arquivo no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para o extensão do campo Extensão Fora do Expediente no plano de discagem e VOICEMAIL irá enviar a chamada para a caixa de voicemail listada no campo de Voicemail Fora do Expediente, IN_GROUP irá enviar a chamada para o grupo de entrada selecionado na lista Grupo de Entrada Fora do Expediente. Padrão é MESSAGE| After Hours Transfer Group -<\/B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group|Grupo de Transferência Fora do Expediente- Se a Ação de Fora do Expediente estiver configurada para IN_GROUP, a chamada irá ser enviada para esse grupo de entrada se ela entrar neste grupo de entrada fora do horário configurado no Horário de Chamadas para este grupo de entrada| -After Hours Transfer Group: |Grupo de Transferência Fora do Exped.:| +After Hours Transfer Group|Grupo de Transferência Fora do Exped.| Total calls taken in to this In-Group:|Total de chamadas recebidas pelo Grupo:| CALL HOLD TIME BREAKDOWN IN SECONDS|TEMPO DE ESPERA POR SEGUNDOS| Date Range:|Período:| @@ -2075,8 +2107,8 @@ DOWNLOAD|DOWNLOAD| Users|Usuários| User|Usuário| Reports|Relatórios| -OUTBOUND|SAINTE| -INBOUND|ENTRANTE| +#OUTBOUND|SAINTE| +#INBOUND|ENTRANTE| Server Stats and Reports|Estatísticas do Servidor e Relatórios| Click here to see a VDAD report for this campaign|Clique aqui para ver um relatório VDAD para esta campanha| Show DIDs|Mostrar DDRs| @@ -2488,3 +2520,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|Xfer-Conf Número Override| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Todos os usuários do sistema, nem mesmo usuários registrados| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|A opção NÃO-logged-in-Agentes permite que todos os usuários do sistema a ser exibido, mesmo que eles não são registrados em curently| +Voicemail ID|ID Voicemail| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Esta é a caixa de correio de voz que as chamadas serão direcionadas para em um AGENTDIRECT em grupo no momento, se a queda no grupo tem o método da gota definida para a caixa postal eo campo Voicemail definido para AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz| +Record Call|Registro de chamada| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Esta opção permite que você defina as chamadas que vem a este fez para ser gravado. Y vai gravar a chamada inteira, Y_QUEUESTOP irá gravar a chamada até que a chamada é hungup ou entra em uma fila em grupo, N não vai gravar a chamada. O padrão é N.| +Click here to see a list of recordings and calls for this DID|Clique aqui para ver uma lista de gravações e chamadas para este DID| +Ignore List Script Override|Ignorar Override Script Lista| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Esta opção permite que você ignore a lista de ID opção Override Script para chamadas que entram esta no Grupo. Definindo-a para Y irá ignorar qualquer lista as configurações de script de identificação. O padrão é N| +External Server IP|IP do servidor externo| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Esta configuração é onde você pode colocar um IP ou o nome outra máquina que pode ser usado no lugar do server_ip quando se utiliza um webphone na interface do agente. Para que isso funcione você também deve ter a entrada de telefones configurado para usar o IP do servidor externo. O padrão é vazio| +Set As Webphone|Definir como Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|Definir esta opção como Y tentará carregar um telefone baseado na web quando o agente registra em sua tela de agente. O padrão é N.| +Use External Server IP|Use IP do servidor externo| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Se usar como um telefone web, você pode definir isso para Y para utilizar os servidores de IP externo para se registar em vez do IP do servidor. O padrão é vazio| +Default Webphone|Webphone padrão| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Se definido para 1, esta opção fará com que todos os novos telefones criados tiver definido como conjunto de Webphone padrão é 0 Y.| +Default External Server IP|Padrão IP do servidor externo| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Se definido para 1, esta opção fará com que todos os novos telefones criados têm Use IP do servidor externo definido como Y. O padrão é 0| +Webphone URL|URL Webphone| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|Esta é a URL do webphone que será usado com este sistema se ele estiver habilitado no registro de telefones que um agente está usando. O padrão é vazio| +AGENT ACTIVITY FOR THIS TIME PERIOD|Atividade do agente para esse período| +these fields are in seconds|estes campos estão em segundos| +Enable Agent Disposition Logfile|Habilitar Logfile Disposição agente| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Esta opção irá registrar em um arquivo de log de texto no servidor cada vez que uma chamada é dispositioned por um agente. O padrão é 0, desativado| +Agent Call Log View|Agente Ver registro de chamadas| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Esta opção define se o agente será capaz de ver o seu registo de chamadas para chamadas tratadas através da tela de agente ViciDial. Padrão é n para não ou desativado| +Agent Call Log View Override|Call Agent View Log Override| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Esta definição irá substituir o que o grupo de usuários usuários estabeleceu para Agente Ver registro de chamadas. DEFICIENTES usará a configuração grupo de usuários. N não vai permitir mostrar o registro de chamadas de usuários. Y vai permitir mostrar o registro de chamadas do usuário. O padrão é DISABLED| +Custom Dialplan Entry|Entrada Dialplan personalizado| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Este campo permite-lhe entrar em quaisquer elementos dialplan que você deseja para o servidor, as linhas serão adicionadas para o contexto padrão| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Este campo permite-lhe entrar em quaisquer elementos dialplan que você deseja para todos os servidores Asterisk, as linhas serão adicionadas para o contexto padrão| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Esta opção permite que você insira personalizados linhas dialplan em Menus de chamadas, servidores e configurações do sistema. O padrão é 0 para inativo| +Custom CallerID|Personalizado CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Quando definido como Y, esta opção permite que você use o campo security_phrase na tabela vicidial_list como o CallerID para enviar ao colocar para cada ligação específica. Se este campo não tem CID nele, então a Campanha CallerID definido acima será usado. Esta opção irá desativar o CallerID lista Substituir se houver um presente CID no campo security_phrase. O padrão é N| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID irá usar o CID personalizada que é definido no campo security_phrase da tabela vicidial_list para o chumbo| +Scheduled Callbacks Alert|Callbacks alerta agendadas| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Esta opção permite que a linha de status callbacks na interface do agente a ser vermelho, piscar ou piscar em vermelho quando há AGENTONLY agendada callbacks que atingiram o seu tempo de disparo e data. O padrão é NONE para a linha de status padrão| +QueueMetrics Login-Out|QueueMetrics Login-Out| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Esta opção afeta a forma como vicidial irá registrar os logins e logouts de um agente no queue_log. Padrão é padrão para usar o padrão AGENTLOGIN AGENTLOGOFF, CALLBACK usará AGENTCALLBACKLOGIN e AGENTCALLBACKLOGOFF que QM irá analisar de forma diferente| +Enable CallCard|Habilitar CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Esta configuração permite que os recursos CallCard com ViciDial para permitir chamadores de usar números de pinos e card_ids que têm um saldo de minutos e os saldos pode ter tempo de conversação do agente em chamadas de clientes para em-grupos deduzidas. O padrão é 0 para deficientes físicos| +CallCard Access|CallCard Acesso| +Agent Transfer Options|Transferência Opções do Agente| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Estas opções de permitir a desactivação de botões específicos na secção Conferência de transferência da interface do agente. O padrão é Y para sim ou habilitado| +Agent Allow Park Customer Dial Xfer|Agente Permitir Parque Xfer Dial Cliente| +Agent Allow Dial With Customer Xfer|Agente Permitir Dial Com Xfer Cliente| +Agent Allow Blind Xfer|Agente Permitir Xfer Cegos| +Agent Allow Voicemail Message Xfer|Agente Permitir Xfer mensagem de voz| +Agent Allow Dial Override Xfer|Agente Permitir Xfer Override Dial| +Agent Allow Consultative Xfer|Agente Permitir Xfer Consultivo| +Agent Fullscreen|Agente Fullscreen| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Esta opção se definido como Y irá definir a altura ea largura da tela agente ViciDial ao tamanho da janela do navegador web, sem qualquer subsídio para o Vista agentes, chamadas em modo de fila ou chamadas em vista Session. Padrão é n para não ou desativado| +Add Extension Group|Adicionar Grupo de Extensão| +New Group Extension Addition|Adição de Extensão de Novo Grupo| +Modify Extension Group|Modificar Grupo de Extensão| +Delete Extension Group|Excluir Grupo de Extensão| +Extension Groups|Grupos de Extensão| +Add Extension Group Entry|Adicionar Entrada do Grupo de Ramais| +Extension Group|Grupo de Extensão| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Este campo obrigatório é onde você entra o ID do grupo que você quer que essa extensão a ser colocada. Sem espaços ou caracteres especiais, exceto para destacar letras e números| +Extension:|Extensão:| +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Este campo obrigatório é o lugar onde você colocar a extensão dialplan que você deseja que o agente remoto chama para ser enviado para para esta entrada do grupo de extensão| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|Este campo permite-lhe classificar as entradas de extensão do grupo que compartilham o grupo de mesma extensão. O padrão é 0| +Campaigns Groups|Grupos de Campanhas| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|Neste campo você pode colocar uma lista de IDs de campanha e IDs de grupo ou de entrada que você deseja restringir o uso do grupo de extensão para. Lista deve ser separada por tubos e têm um tubo no início e no fim da cadeia| +EXTENSION GROUP ENTRY NOT ADDED|ENTRADA DO GRUPO DE EXTENSÃO NÃO ADICIONADO| +there is already an extension group entry with these values|já existe uma entrada de grupo de extensão com estes valores| +EXTENSION GROUP ENTRY ADDED|ENTRADA GROUP extensão adicionada| +MODIFY AN EXTENSION GROUP ENTRY|Modificar uma entrada GRUPO DE EXTENSÃO| +Click here to see Admin chages to this extension group entry|Clique aqui para ver chages administrador para esta entrada do grupo de extensão| +DELETE THIS EXTENSION GROUP ENTRY|Apagar este registo GRUPO DE EXTENSÃO| +Call Count Today|Contagem contas hoje| +Last Call Time|Última chamada| +Last Call ID|ID Last Call| +EXTENSION GROUP ENTRY NOT MODIFIED|ENTRADA DO GRUPO DE EXTENSÃO NÃO MODIFICADA| +EXTENSION GROUP ENTRY MODIFIED|ENTRADA DO GRUPO DE EXTENSÃO MODIFICADO| +EXTENSION GROUP ENTRY NOT DELETED|ENTRADA DO GRUPO DE EXTENSÃO não excluído| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|EXTENSÃO GRUPO DE CONFIRMAÇÃO DE INSCRIÇÃO ELIMINAÇÃO| +Click here to delete extension group entry|Clique aqui para excluir a entrada grupo de ramal| +EXTENSION GROUP ENTRY DELETION COMPLETED|EXTENSÃO EXCLUSÃO DE ENTRADA grupo completou| +EXTENSION GROUP LISTINGS|GRUPO LISTAS DE EXTENSÃO| +Extension Group|Grupo de Extensão| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Se definido para algo diferente de NONE ou vazio este irá substituir o campo Extensão Externa e usar as entradas de extensão do Grupo que têm o mesmo ID de grupo de extensão. O padrão é NONE para desativado| +Click here to see agents logged in to this inbound group|Clique aqui para ver os agentes conectados a este grupo de entrada| +Agent Choose Blended|Agente Escolha Blended| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Esta opção se definido como 1 permite ao usuário escolher se o agente tem o seu conjunto campanha para misto ou não, e se não, então a configuração padrão misturado será usado. O padrão é 1 para habilitado| +Click here to see a log of the uploads to the audio store|Clique aqui para ver um registro dos uploads para o armazenamento de áudio| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Esta opção se definido a 0 não vai colocar na entrada CALLSTATUS em queue_log quando um agente disposições chamadas. O padrão é 1 para habilitado| +QM CallStatus Override|QM CallStatus Override| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Se a integração QueueMetrics está ativado nas configurações do sistema, em seguida, essa configuração permite que o principal das configurações do sistema de definição para as entradas CallStatus queue_log. O padrão é DISABLED que irá utilizar a configuração do sistema| +Extension Append CID|Extensão Anexar CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Se activado, as chamadas feitas a partir deste campanha terá um espaço e da extensão de telefone do agente acrescentado ao final do nome CallerID para a chamada antes de ser enviado para o agente. Padrão é n para deficientes físicos| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Se activado, as chamadas entrada, desde no grupo-terá um espaço ea extensão de telefone do agente acrescentado ao final do nome CallerID para a chamada antes de ser enviado para o agente. Padrão é n para deficientes físicos| +Scheduled Callbacks Count|Callbacks agendadas Contagem| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Esta opção permite que você defina se apenas callbacks VIVOS, pelo usuário apenas retornos de chamada programadas que atingiram a sua data de disparo e de tempo, ou callbacks ALL_ACTIVE, o usuário somente callbacks que estão ativos no sistema, bem como callbacks VIVOS, deve BE3 contados int ele agente seção alerta de retorno de chamada na tela do agente. O padrão é ALL_ACTIVE| +Realtime Block User Info|Informações do usuário em tempo real Bloco| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Esta configuração se definido como 1 irá bloquear as informações do usuário e da estação que está sendo exibido no relatório em tempo real. O padrão é 0 para deficientes físicos| +Manual Dial Override|Manual de Dial Override| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|A configuração pode substituir os Usuários definição para a capacidade de discagem manual para agentes quando eles são registrados nesta campanha. NONE seguirá a definição de Usuários, ALLOW_ALL permitirá que qualquer agente registrados nesta campanha para fazer chamadas de discagem manual, DISABLE_ALL não permitirá que ninguém registrados nesta campanha para fazer chamadas de discagem manual. O padrão é NONE| +Blind Monitor Warning|Aviso Monitor de Cegos| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Esta opção, se habilitado deixará o agente sabe de várias formas opcionais, se eles estão sendo monitorados por alguém cego. DESATIVADO significa que este recurso não está ativo, o alerta só aparecerá um alerta na tela do agente, AVISO irá publicar uma nota que permanece na tela do agente, enquanto theyâ re sendo monitorado, AUDIO vai jogar o nome definido abaixo quando um agente está começando a ser monitorados e as outras opções são combibnations das opções acima. O padrão é DISABLED| +Blind Monitor Notice|Aviso Monitor de Cegos| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Esta é a mensagem que irá mostrar na tela do agente, enquanto eles estão sendo monitorados se a opção AVISO é selecionado. O padrão é| +Blind Monitor Filename|Nome do Monitor de Cegos| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Este é o arquivo de áudio que será reproduzido na sessão de agentes no início do monitoramento alguém cegá-los. Este aviso vai ser jogado para todos na sessão, incluindo o cliente se for o caso está presente. O padrão é vazio| +Uniqueid Status Display|Display de Status uniqueid| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Se ativado, quando um agente recebe uma chamada através deste em grupo eles vão ver o uniqueid da chamada adicionada à linha de status em sua interface agente. O prefixo opção irá adicionar o prefixo definido golpe para o início da uniqueid no visor. O padrão é DISABLED. Se já havia uma uniqueid definido em uma chamada inserindo este no grupo-, então a uniqueid original será exibido| +Uniqueid Status Prefix|Prefixo Estado uniqueid| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Se a opção for selecionada PREFIX acima, então este é o valor do prefixo. O padrão é vazio| +Default Codecs|Codecs padrão| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|Você pode definir uma lista delimitada por vírgula de codecs para ser definido como os codecs padrão para todos os sistemas. Opções para incluir codecs ulaw, alaw, gsm, g729, Speex, G722, G723, G726, iLBC, ... O padrão é vazio| +Allowed Codecs|Codecs admitidos| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|Você pode definir uma lista delimitada por vírgula de codecs para ser definido como os codecs padrão para este telefone. Opções para incluir codecs ulaw, alaw, gsm, g729, Speex, G722, G723, G726, iLBC, ... Alguns desses codecs podem não estar disponíveis em seu sistema, como o G729 ou G726. Se o campo estiver vazio, então os codecs padrão do sistema ou a entrada de telefone acima este será utilizado para os codecs permitidas. O padrão é vazio| +Allowed Codecs With Template|Codecs permitidos com Template| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Definir essa opção como 1 irá incluir os codecs definidos acima, mesmo se um modelo de arquivo conf é usado. O padrão é 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Se a opção de manter, seja utilizado ea chamada é enviada para um segundo agente, o prefixo uniqueid e exibida para o primeiro agente também será exibida para o segundo agente| +Custom Fields Modify|Campos Personalizados Modificar| +This option if set to 1 allows the user to modify custom list fields|Esta opção se definido como 1 permite ao usuário modificar campos personalizados da lista| +ERROR: Custom Fields are not active on this system|ERROR: campos personalizados não estiver ativo no sistema| +Lists Custom Field|Lista de campo personalizado| +Field Label|Rótulo de campo| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Este é o identificador de campo de dados para este campo. Isso precisa ser um identificador único dentro dos campos personalizados para esta lista. Não use espaços ou pontuação para este campo. max 50 caracteres, mínimo de 2 caracteres| +Field Name|Nome do Campo| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|Este é o nome do campo como irá aparecer a um agente através da sua interface. Você pode usar espaços neste campo, mas sem pontuação caracteres, máximo de 50 caracteres e mínima de 2 caracteres| +Field Description|Campo Descrição| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|A descrição do campo como ele aparecerá na interface de administração. Este é um campo opcional com um máximo de 100 caracteres| +Field Rank|Posição Campo| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|A ordem em que estes campos é exibido ao agente do menor no topo mais alto que no fundo| +Field Help|Ajuda Campo| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Campo opcional, se você preenchê-lo, o agente será capaz de ver este texto quando clicar em um link de ajuda ao lado do campo em sua interface agente| +Field Type|Tipo de Campo| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Esta opção define o tipo de campo que irá ser apresentada. TEXTO é um formulário de entrada padrão de linha única, AREA é uma caixa de texto multi-linha, SELECT é uma seleção única pull-down menu, MULTI é uma caixa de seleção múltipla, o rádio é uma lista de botões de rádio, onde somente uma opção pode ser selecionado, CHECKBOX é uma lista de caixas de seleção onde várias opções podem ser selecionadas, DATA é um dia do calendário pop-up ano, mês em que o agente pode escolher a data ea hora é uma caixa de seleção tempo. O padrão é texto. Para as opções SELECT, RÁDIO, MULTI ea caixa de seleção é necessário definir os valores de opção abaixo na caixa Opções de Campo| +Field Options|Opções de Campo| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Para o SELECT, RADIO, MULTI e tipos de campo opção, você deve definir os valores de opção nesta caixa. Você deve colocar uma lista de vírgula rótulo opção separada e texto opção aqui com cada opção de uma linha própria. O primeiro valor não deve ter espaços, e nem os valores devem ter qualquer pontuação. Por exemplo - electric_meter Meter, Elétrica| +Field Size|Tamanho do Campo| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Essa configuração vai significar coisas diferentes dependendo do que o tipo de campo é. Para campos de texto, o tamanho é o número de caracteres que irá mostrar no campo. Para os campos de área, o tamanho é a largura da caixa de texto em caracteres. Para campos MULTI, esta configuração define o número de opções para ser mostrado na lista de vários select. Para SELECT, rádio, checkbox DATA, HORA e essa configuração é ignorada| +Field Max|Campo Max| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Essa configuração vai significar coisas diferentes dependendo do que o tipo de campo é. Para obter texto, campos escondidos e READONLY, o tamanho é o número máximo de caracteres que são permitidos no campo. Para os campos da área, este campo define o número de linhas de texto visível na caixa de texto. Para MULTI, SELECT, rádio, checkbox DATA, HORA e esta definição é ignorada| +Field Cost|Custo Campo| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Este campo somente leitura diz-lhe que o custo deste campo é na tabela de campo personalizado para esta lista. Não há limite rígido para o número de campos personalizados que você pode ter em uma lista, mas o total do custo de todos os campos para a lista deve ser inferior a 65000. Isso geralmente permite que centenas de campos, mas se você especificar vários campos de texto que são centenas ou milhares de caracteres de comprimento, então você pode atingir esse limite rapidamente. Se você precisa que o texto muito em um campo, você deve escolher um tipo de zona, que são armazenados de forma diferente e não use espaço de tabela tanto| +Field Required|Campo Obrigatório| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Se definido como Y, este campo irá forçar o agente a inserção de texto ou selecione uma opção para este campo. O padrão é N| +Field Default|Padrão Campo| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Este campo opcional permite que você defina o valor a atribuir a um campo, se nada for carregado para esse campo. O padrão é NULL que desativa a função padrão| +MODIFY FIELDS|Modificar os campos| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|LISTAS LISTA com campos personalizados COUNT| +SUMMARY OF FIELDS|SÍNTESE DOS CAMPOS| +ADD A NEW CUSTOM FIELD FOR THIS LIST|Adicionar um novo campo CUSTOM para esta lista| +ERROR: Field does not exist|ERRO: Campo não existe| +ERROR: Table does not exist|ERROR: Tabela não existe| +ERROR: Field already exists for this list|ERRO: Campo já existe para esta lista| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|CLIQUE AQUI para confirmar a exclusão este campo personalizado| +THIS CUSTOM FIELD HAS BEEN DELETED|Este campo personalizado FOI DELETADO| +Records in this custom table|Registros nesta tabela personalizado| +EXAMPLE OF CUSTOM FORM|EXEMPLO DE FORMA PERSONALIZADA| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Para os tipos de campo DATA, o padrão é sempre definido como hoje, a menos que um número é colocado no caso em que a data será que hoje muitos dias mais ou menos. Para os tipos de campo de tempo, o padrão é sempre definido como a hora atual do servidor, a menos que um número é colocado no caso em que o tempo será que muitos minutos mais ou menos tempo atual| +MODIFY EXISTING FIELDS|Modificar campos existentes| +Field Name Position|Posição Nome do Campo| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|Se definido como LEFT, este nome de campo aparecerá à esquerda do campo, se definido como TOP o nome do campo vai ocupar toda a linha e aparecem acima do campo. Padrão é da Esquerda| +Option Position|Posição opção| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Para os tipos de campos checkbox e radio apenas, se definido como HORIZONTAL as opções aparecerão na mesma linha, possivelmente envolvendo a linha abaixo se há muitas opções. Se definido para VERTICAL haverá apenas uma opção por linha. O padrão é HORIZONTAL| +Hold Time Option Minimum|Segure mínimo opção de tempo| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Se a opção Tempo de espera ativado, este é o número mínimo de segundos que a chamada deve ser de espera antes de ser apresentado com a opção de tempo de espera. A opção de tempo de retenção será imediatamente apresentado neste momento, se o tempo de espera estimado é maior do que o valor de tempo de espera Opção Segundos. O padrão é 0 segundos| +ADDING COPIED CARRIER|ADICIONANDO CARRIER COPIADO| +ADD COPIED CARRIER|ADD CARRIER COPIADO| +Source Carrier|Transportadora Fonte| +COPIED CARRIER ADDED|CARRIER COPIADO ADICIONADO| +Copy A Carrier|Copiar Um transportador| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Campo OrderIf mais de um campo tem a mesma pontuação, eles serão colocados na mesma linha e eles serão colocados em ordem por este valor menor para o maior, da esquerda para a direita| +Copy Fields to Another List|Copiar Campos para outra lista| +List ID to Copy Fields to|Lista de ID para copiar campos para| +List ID to Copy Fields From|Listar ID para copiar campos de| +Copy Option|Opção Copiar| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Ao copiar definições de campo de uma lista para outra, você tem algumas opções para como funciona o processo de cópia. APPEND será adicionar os campos que não estão presentes na lista de destino, se houver correspondência rótulos de campo aqueles vontade permaneceram intocados, não existem dados de campo personalizado serão apagados ou modificados por esta opção. UPDATE atualiza os campos comuns field_label na lista de destinos para as definições de campo a partir da lista de origem. dados de campo personalizadas podem ser modificados ou perdidos usando esta opção. REPLACE irá remover todos os campos existentes personalizados na lista de destino e substituí-los com os campos personalizados a partir da lista de origem, todos os dados de campo personalizado serão apagados através desta opção| +ERROR: Source list has no custom fields|ERRO: Lista de Fonte não tem campos personalizados| +SUCCESS: Custom Field Added|SUCESSO: Campo personalizado Adicionado| +SUCCESS: Custom Field Modified|SUCESSO: Campo personalizado Modificado| +SUCCESS: Custom Field Deleted|SUCESSO: Campo personalizado Excluídos| +Copy List Custom Fields|Copiar campos personalizados da lista| +ERROR: You cannot copy fields to the same list|ERRO: Você não pode copiar os campos para a mesma lista| +DISPLAY will display only and not allow for modification by the agent|VISOR irá exibir somente e não permitir a modificação introduzida pelo agente| +Hold Time Option Callmenu|Segure Callmenu opção de tempo| +Hold Time Option Press Filename|Hold Time Filename Pressione Option| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Se a opção Hold Time está definido para CALL_MENU, este é o menu de chamada que a chamada será enviado para que o tempo de espera estimado ultrapassa os Segundos opção Tempo de Espera| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado, se o tempo de espera estimado ultrapassa os Segundos Opção Hold Time para dar ao cliente a opção de pressionar 1 em seu telefone para executar o Hold Time selecionado Pressione Option. É muito importante que este ficheiro de áudio é de 10 segundos ou menos, ou não haverá problemas. O padrão é a-ser-chamado-back| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Se uma das opções de PRESS_ é selecionado, ele vai jogar o Filename Imprensa definido abaixo e dar ao cliente a opção de pressionar 1 no seu telemóvel para deixar a fila e executar a opção selecionada| +Hold Time Option After Press Filename|Segure Option Time After Filename Imprensa| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Se a opção Tempo de espera é definida como uma das opções PRESS_ ou CALLERID_CALLBACK, este é o prompt de nome de arquivo que é jogado depois que o cliente tem pressionado 1 ou a chamada foi adicionado à lista de chamada de retorno| +Inbound Queue No Dial|Fila de entrada no Disque| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Este recurso se definido como ENABLED permite evitar saída discagem automática desta campanha se existem chamadas de entrada na fila de espera que fazem parte dos grupos permitidos entrada definidos nesta campanha. Definindo-a para ALL_SERVERS vai mudar o algoritmo para calcular todas as chamadas de entrada como as chamadas ativas neste servidor, mesmo se eles estiverem em outro servidor que irá reduzir a chance de colocar desnecessários chamadas de saída se você tiver chamadas que entram em outro servidor. O padrão é DISABLED| +After Hours Filename Override|After Hours Override Filename| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|Estes campos permitem substituir a mensagem Horas depois para os grupos de entrada, se for configurado para algo. O padrão é vazio| +On Hold Prompt No Block|On Hold Prompt No Bloco| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada em espera, onde o aviso é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o On Hold mensagem Filename Prompt está jogando a um cliente que não pode ser enviada a um agente. O padrão é N| +On Hold Prompt Seconds|On Hold Segundos Prompt| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Este campo precisa ser definido como o número de segundos que o Filename On Hold Prompt joga. O padrão é 10| +Hold Time Option Press No Block|Segure Pressione Option No Time Bloco| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada onde o espera Tempo Pressione Opção Filename prompt é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o Tempo de espera Opção mensagem Filename Imprensa está jogando a um cliente que não pode ser enviada a um agente. O padrão é N| +Hold Time Option Press Filename Seconds|Hold Time Opção Segundos Nome do ficheiro Imprensa| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Este campo precisa ser definido como o número de segundos que o tempo de espera Filename Pressione Option joga. O padrão é 10| +CallCard Generate New Numbers|CallCard Gerar Novos números| +Call Menu In-Group Settings|Chamada do menu Configurações em grupo| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Se a rota é definida como ingroup então há muitas opções que você pode definir para definir como a chamada é enviada para a fila. Em-Group é o grupo de entrada que você deseja que o convite para ir. Método Handle é o jeito que você quer que a chamada seja tratada| +Click here to see a list of the available handle methods|Clique aqui para ver uma lista dos métodos disponíveis punho| +VID Enter Filename|VID Enter Filename| +VID ID Number Filename|VID Filename Número de Identificação| +VID Confirm Filename|VID Confirmar Nome| +VID Digits|Dígitos VID| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Método de pesquisa define como a fila vai encontrar o próximo agente, recomendo deixar em LB. ID lista é a lista que o novo eletrodo é inserido, também se o método não é um método de pesquisa eo chumbo não é encontrado. ID da campanha é a campanha para procurar listas através se um dos métodos de RC é usado. Código de telefone é a entrada do campo phone_code para o chumbo que é inserido com. VID Enter Filename é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado de pedir ao cliente a entrar no seu ID. VID Filename número de identificação é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado após cliente entra em seu ID, algo como você digitou. VID Filename Confirmar é usado se o método é definido como um dos métodos VIDPROMPT, é o prompt de áudio tocado para confirmar sua identidade, algo como PRESS 1 para confirmar e entrar novamente 2. Dígitos VID é usado se o método é definido como um dos métodos VIDPROMPT, se ele é definido como um número é o número de dígitos que devem ser inseridos pelo cliente, quando solicitado pelo seu ID, se definido como vazio ou X, em seguida, o cliente terá que pressionar a libra ou de hash para terminar a sua entrada de sua ID| +Admin Web Directory|Diretório do Web Admin| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Este é o diretório que o seu conteúdo web administation, como admin.php, está dentro padrão é vicidial. Para descobrir o seu diretório web Admin, é tudo que está entre o nome do domínio eo admin.php na URL nesta página, sem as barras de início e término| +TTS Voice|Voz| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|Isto é, onde poderá definir a voz a ser usado na geração de TTS. O padrão é Allison-8kHz| +Default Field Labels|Os rótulos de campos padrão| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Esses 19 campos permitem que você defina o nome que aparecerá na interface do agente ViciDial, bem como a página principal modificação administrativa. O padrão é vazio, que usará os padrões codificados na interface do agente| +Label Title|Título Etiqueta| +Label First Name|Nome primeira etiqueta| +Label Middle Initial|Médio rótulo inicial| +Label Last Name|Nome última etiqueta| +Label Address1|Etiqueta Address1| +Label Address2|Etiqueta Endereço2| +Label Address3|Etiqueta Endereço3| +Label City|Cidade Etiqueta| +Label State|Estado Etiqueta| +Label Province|Província Etiqueta| +Label Postal Code|Código Postal Etiqueta| +Label Vendor Lead Code|Etiqueta de código de chumbo Vendedor| +Label Gender|Sexo rótulo| +Label Phone Number|Telefone Etiqueta| +Label Phone Code|Telefone Código de etiqueta| +Label Alt Phone|Telefone Alt Etiqueta| +Label Security Phrase|Frase Label Security| +Label Email|E-mail rótulo| +Label Comments|Comentários Etiqueta| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|Nós não recomendamos a configuração chamadas de entrada para uma prioridade maior do que as chamadas de saída de campanha porque as pessoas que fazem escala em que esperar e pessoas a serem chamadas de esperar de alguém para estar lá no telefone| +Formerly called Conf File Secret|Anteriormente chamado Segredo arquivo conf| +Registration Password|Registo Senha| +Login Password|Login Senha| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|A senha usada para o usuário do telefone para acessar as aplicações baseadas na web do cliente. IMPORTANTE, esta é a senha apenas para o agente de login do telefone interface web, para mudar o sip.conf ou senha iax.conf, ou secreta, para este dispositivo de telefone que você precisa para modificar a senha de inscrição no próximo campo| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|SCRIPT também irá exibir apenas, mas você é capaz de usar variáveis ​​de script como no recurso de Scripts. Campos script também irá apenas exibir o conteúdo em Opções, e não o nome do campo como o tipo de exibição faz| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|Você também pode incluir os campos padrão ViciDial em uma configuração de campo personalizado, e você vai vê-los em vermelho na lista. Estes campos não será adicionado à tabela de costume lista banco de dados, o agente de interface, em vez disso referência à tabela vicidial_list directamente. As etiquetas que você pode usar para incluir os fieds padrão são| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Se os campos personalizados da lista estão habilitados em seu sistema, formulário será aberto no separador FORMULÁRIO na conexão de uma chamada para um agente| +Enable Custom List Fields|Habilitar campos personalizados da lista| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Esta configuração permite que o costume lista de recursos que permite que os campos para os campos de dados personalizados a ser definido na interface web de administração em uma base per-lista e, então, os campos disponíveis em uma guia FORM para o agente na interface web do agente. O padrão é 0 para deficientes físicos| +CUSTOM FIELDS FOR THIS LEAD|Campos personalizados para ESTE LEAD| +Slave Database Server|Database Server Escravo| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Se você tem um banco de dados MySQL escravo em seguida, digite o endereço IP local para o servidor aqui. Esta opção é atualmente usada apenas nos relatórios selecionados na próxima opção e não tem nada a ver com a configuração automática MySQL replicação mestre-escravo. O padrão é vazio para deficientes físicos| +Reports to use Slave DB|Relatórios para usar DB Escravo| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Esta opção permite que você selecione os relatórios que você deseja ter usar o banco de dados MySQL escravo, tal como definido na opção acima em vez do banco de dados mestre que o seu sistema ao vivo ViciDial está sendo executado. Você deve configurar a replicação escravo MySQL antes que você pode ativar esta opção. O padrão é vazio para deficientes físicos| +Custom fields defined for this list|Os campos personalizados definidos para esta lista| +Go to the list modification page for this list|Vá para a página modificação lista para esta lista| +Estimated Hold Time Option|Opção Tempo estimado de espera| +Hold Time Second Option|Segure Option Segundo Tempo| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Mesmo que o primeiro campo Opção Tempo de espera acima, exceto este irá verificar para o cliente pressionando a tecla 2. O padrão é NONE. Se nenhuma opção de tempo de espera primeiro é selecionada a opção não será oferecido| +Hold Time Third Option|Segure Option terceira vez| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Mesmo que o primeiro campo Opção Tempo de espera acima, exceto este irá verificar para o cliente pressionando a tecla 3. O padrão é NONE. Se nenhuma opção Second Time espera for selecionado, então esta opção não serão oferecidos| +Wait Time Option|Aguarde Opção Tempo| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Isto permite-lhe oferecer aos clientes opções para deixar a fila se o tempo de espera é sobre a quantidade de segundos especificados abaixo. O padrão é NONE. Se uma das opções de PRESS_ é selecionado, ele vai jogar o Filename Imprensa definido abaixo e dar ao cliente a opção de pressionar 1 em seu telefone para sair da fila e executar a opção selecionada. A opção PRESS_STAY enviará o cliente de volta para a fila sem perder seu lugar na fila| +Wait Time Second Option|Aguarde Opção Segundo Tempo| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Mesmo que o primeiro campo Opção Wait Time acima, exceto este irá verificar para o cliente pressionando a tecla 2. O padrão é NONE. Se nenhuma opção de tempo de espera é primeiro selecionado, então esta opção não serão oferecidos| +Wait Time Third Option|Aguarde Opção terceira vez| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Mesmo que o primeiro campo Opção Wait Time acima, exceto este irá verificar para o cliente pressionando a tecla 3. O padrão é NONE. Se nenhuma opção Second Time Wait for selecionado, então esta opção não serão oferecidos| +Wait Time Option Seconds|Aguarde alguns segundos opção de tempo| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Se a opção Tempo de espera é definida como qualquer coisa, mas NENHUM, este é o número de segundos que o cliente está esperando na fila que irá acionar as opções de tempo de espera. O padrão é 120 segundos| +Wait Time Option Extension|Aguarde Opção Extensão Tempo| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Se a opção Tempo de espera é definido como PRESS_EXTEN, esta é a extensão dialplan que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção| +Wait Time Option Callmenu|Espere Callmenu opção de tempo| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Se a opção Tempo de espera é definido como PRESS_CALLMENU, este é o menu de chamada que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção| +Wait Time Option Voicemail|Espere Voicemail opção de tempo| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Se a opção Tempo de espera é definido como PRESS_VMAIL, esta é a caixa de correio de voz que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção. Em um AGENTDIRECT em grupo, definindo-o para AGENTVMAIL irá selecionar o ID do usuário para usar correio de voz| +Wait Time Option Transfer In-Group|Espere Transferência Tempo Opção em grupo| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Se a opção Tempo de espera é definido como PRESS_INGROUP, este é o grupo de entrada que a chamada será enviado para o cliente, se pressiona a tecla opção quando apresentados com a opção| +Wait Time Option Press Filename|Tempo de espera Filename Pressione Option| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado, se o tempo de espera do cliente exceder os Aguarde alguns segundos opção de tempo para dar ao cliente a opção de pressionar 1, 2 ou 3 em seu telefone para executar os selecionados Wait Imprensa opções de tempo. É muito importante que você inclua opções no arquivo de áudio para todas as suas opções selecionadas Tempo de espera, e que o tamanho do arquivo de áudio em segundos está devidamente definido no campo Nome do arquivo Segundos abaixo ou haverá problemas. O padrão é a-ser-chamado-back| +Wait Time Option Press No Block|Espere Pressione Option No Time Bloco| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Definir esta opção como Y permitirá chamadas na fila atrás de uma chamada onde o Tempo de Espera Pressione Opção Filename prompt é jogar para ir a um agente se torna disponível, enquanto a mensagem está jogando. Enquanto o Tempo de Espera Opção mensagem Filename Imprensa está jogando a um cliente que não pode ser enviada a um agente. O padrão é N| +Wait Time Option Press Filename Seconds|Aguarde tempo de opção Segundos Nome do ficheiro Imprensa| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Este campo precisa ser definido como o número de segundos que o Wait Time Filename Pressione Option joga. O padrão é 10| +Wait Time Option After Press Filename|Aguarde Opção Time After Filename Imprensa| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Se a opção Tempo de espera é definida como uma das opções PRESS_, este é o prompt de nome de arquivo que é jogado depois que o cliente tem pressionado 1, 2 ou 3| +Wait Time Option Callback List ID|Tempo de espera Opção ID Lista de chamada de retorno| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Se a opção Tempo de espera é definido como PRESS_CID_CALLBACK, este é o ID da chamada Lista é adicionado como uma nova pista, se o cliente pressiona a tecla opção quando apresentados com a opção| +Wait Hold Option Priority|Espere Segure Prioridade Opção| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Se ambas as opções Retenção estimado vez e aguarde opções de tempo são ativos, esta configuração irá definir se um, outro ou ambos os recursos são ativos. Por exemplo, se a opção de tempo estimado de espera é definida como 360, a opção Tempo de espera é definida para 120 eo cliente tem estado à espera de 120 segundos e ainda há 400 segundos estimados tempo de espera, então eles são ambos ativos ao mesmo tempo e esta definição será verificada para ver quais opções serão oferecidas. O padrão é esperar apenas| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|As opções bloqueadas são usados ​​para bloquear o valor para o botão Quick Transfer mesmo que o agente usa os recursos de conferência de transferência durante uma chamada antes de usar o botão Quick Transfer| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|HANGUP irá desligar a chamada quando o cronômetro é disparado, CALLMENU enviará a chamada para o menu de chamada especificado no campo Destino Temporizador Ação, EXTENSÃO enviará a chamada para o ramal que está especificado no campo Destino Temporizador Ação, IN_GROUP enviará a chamada para o No Grupo-especificado no campo Destino Temporizador Ação| +Timer Action Destination|Destino Ação temporizador| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Este campo é onde você especificar a chamada do menu de extensão, ou em grupo que você deseja a chamada enviada se o tempo de ação é definido como EXTENSÃO CALLMENU, ou IN_GROUP. O padrão é vazio| +You must enter field options when adding a|Você deve digitar opções de campo ao adicionar um| +You must enter field options when updating a|Você deve digitar opções de campo ao atualizar um| +Allowed Reports|Relatórios admitidos| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Se um usuário neste grupo é definido como nível de usuário 7 ou superior, então este recurso pode ser usado para restringir os relatórios que os usuários possam visualizar. O padrão é ALL. Se você quiser selecionar mais de um relatório, em seguida, pressione a tecla Ctrl no teclado enquanto seleciona os relatórios| +You are not allowed to view this report|Você não tem permissão para ver este relatório| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - incluem listas de inativos na pesquisa para o número| +Add-Delete DNC Number|Adicione-Delete Número DNC| +Add DNC Number|Adicionar número de DNC| +Copy Custom Fields|Copiar campos personalizados| +Add Filter Phone Group|Adicionar Grupo de telefone Filtro| +New Filter Phone Group|Grupo Telefone novo filtro| +Modify Filter Phone Group|Modificar Grupo Telefone Filtro| +Delete Phone Filter Group|Excluir Grupo Telefone Filtro| +Filter Phone Groups|Filtro de Grupos de telefone| +Filter Phone Group ID|ID Group Filter Telefone| +Filter Phone Group Name|Nome do grupo Filtro Telefone| +Filter Phone Group Description|Descrição Group Filter Telefone| +PHONE FILTER GROUP NOT ADDED|GRUPO DE FILTRO TELEFONE NÃO ADICIONADO| +there is already a PHONE FILTER GROUP in the system with this ID|já existe um Grupo Telefone FILTER no sistema com este ID| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|Telefone ID Group Filter deve ter entre 2 e 20 caracteres e não contêm| +PHONE FILTER GROUP ADDED|GRUPO DE TELEFONE filtro adicionado| +Add Filter Phone Group|Adicionar Grupo de telefone Filtro| +Add-Delete FPG Number|Adicione-Delete Número FPG| +Add FPG Number|Adicionar número FPG| +FILTER PHONE GROUP NOT MODIFIED|GRUPO DE FILTRO TELEFONE NÃO MODIFICADA| +FILTER PHONE GROUP MODIFIED|GRUPO DE TELEFONE filtro Modificado| +FILTER PHONE GROUP NOT DELETED|GRUPO DE FILTRO TELEFONE NÃO DELETED| +Click here to delete FILTER PHONE GROUP|Clique aqui para apagar GROUP TELEFONE FILTER| +FILTER PHONE GROUP DELETION CONFIRMATION|FILTRO TELEFONE CONFIRMAÇÃO EXCLUSÃO DO GRUPO| +FILTER PHONE GROUP DELETION COMPLETED|EXCLUSÃO DO GRUPO FILTRO TELEFONE COMPLETO| +Click here to see Admin chages to this filter phone group|Clique aqui para ver chages administrador para este grupo de telefone filtro| +DELETE THIS FILTER PHONE GROUP|Excluir este grupo TELEFONE FILTER| +FILTER PHONE GROUP LISTINGS|LISTAS DE GRUPO DE FILTRO TELEFONE| +Filter Phone Group Numbers|Números do Grupo Filtro de telefone| +This phone number is not in the Filter Phone Group List|Este número de telefone não está na lista de filtros Telefone Grupo| +This phone number is already in the Filter Phone Group List|Este número de telefone já está na lista de filtros Telefone Grupo| +FILTER PHONE GROUP NUMBER NOT DELETED|NÚMERO DO GRUPO FILTRO TELEFONE NÃO DELETED| +FILTER PHONE GROUP NUMBER DELETED|NÚMERO DO GRUPO FILTRO TELEFONE DELETED| +FILTER PHONE GROUP NUMBER NOT ADDED|NÚMERO DO GRUPO FILTRO TELEFONE NÃO ADICIONADO| +FILTER PHONE GROUP NUMBER ADDED|NÚMERO DO GRUPO FILTRO TELEFONE ADICIONADO| +Numbers in this Filter Phone Group|Números deste grupo Telefone Filtro| +There are no phone numbers in list|Não há números de telefone na lista| +There are no leads in Campaign DNC list|Não há derivações em DNC lista Campanha| +There are no leads in this filter phone group|Não existem ligações neste grupo de telefone filtro| +Click here to download the numbers in this filter phone group|Clique aqui para baixar os números neste grupo telefone filtro| +Filter Inbound Number|Número de entrada do filtro| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Esta opção, se habilitada permite filtrar as chamadas que entram neste DID e enviá-los para uma ação alternativa se corresponderem a um número de telefone que está no grupo de telefone filtro ou uma resposta URL se você tiver configurado um. O padrão é DISABLED. GRUPO irá pesquisar em um grupo de Telefone Filter. URL irá enviar uma URL e irá corresponder a 1, se é enviado de volta| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Se o campo Número de filtro de entrada é definida como grupo, então este é o ID do Grupo Telefone filtro que terão seus números pesquisados ​​à procura de um jogo para o número de identificação do autor da chamada| +Filter URL|Filtro de URL| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Se o campo Número de filtro de entrada é definida como URL, então este é o endereço web de um script que irá procurar um sistema remoto e retornar um 1 por um jogo e um 0 para nenhuma correspondência. Apenas duas variáveis ​​estão disponíveis no endereço se você usar o prefixo VAR como com endereços webform em campanhas, - A - phone_number - B - e - A - did_pattern - B - pode ser usado na URL para indicar o identificador de chamadas do chamador e do DID que o cliente chamado em| +Filter Action|Ação do Filtro| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Se Número de entrada do filtro é ativado e uma correspondência for encontrada, então esta é a ação que deve ser tomado. Este é o mesmo que a rota que você selecionar para um DID, e as configurações abaixo funcionar exatamente como eles fazem para um encaminhamento padrão| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|Este é o ID do Grupo Telefone filtro que é o recipiente para um grupo de números de telefone que você pode ter procurado automaticamente através quando receber uma chamada em um arquivo. DID e enviar para uma rota alternativa, se houver uma correspondência Este campo deve ser entre 2 e 20 caracteres e não têm pontuação, exceto para sublinhado| +Filter Phone Group Description|Descrição Group Filter Telefone| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Esta é a descrição do Grupo de telefone de filtro, é puramente para fins de notação apenas e não é um campo necessário| +Clean CID Number|Limpe Número CID| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|Este campo permite que você especifique um número de dígitos para restringir o número de identificação de entrada chamador, colocando um R na frente do número de dígitos, por exemplo, para restringir o direito de 10 dígitos que gostariam de entrar no R10. Você também pode usar esse recurso para remover apenas um dígito ou dígitos colocando um L na frente dos dígitos específicos que você deseja remover, por exemplo, para remover a 1 como o primeiro dígito que você entraria em L1. O padrão é vazio. Se mais de uma regra é especificada certifique-se de separá-los com um espaço e do R será executado antes do L| +must be an existing vicidial user|deve ser um usuário existente vicidial| +you must use a valid user as the user_start for remote agents|você deve usar um usuário válido como o user_start para agentes remotos| +your number of lines overlaps with another remote agent|seu número de sobreposições de linhas com um outro agente remoto| +Webphone URL Override|Substituir URL Webphone| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Esta configuração permite que você defina uma URL webphone alternativa apenas para os membros de um grupo de usuários. O padrão é vazio| +Calculate Estimated Hold Seconds|Calcule Segundos Retenção estimado| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Isso define o número de segundos na fila que o cliente irá esperar antes de o tempo de espera estimado será calculado e, opcionalmente, jogado. Mínima é de 3 segundos, mesmo se definida inferior a 3. O padrão é 0| +Campaign Preset Added|Predefinição Campanha Adicionado| +Campaign Presets|Presets de campanha| +Modify Campaign Preset|Modificar Predefinição Campanha| +Campaign Preset Removed|Predefinição Campanha Removido| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Se o cenário de campanha para pré-está definido como Habilitado, então você tem a capacidade de definir Transferência-Conferência presets que estarão disponíveis para o agente que lhes permite 3-way chamar esses presets ou transferir chamadas cegos a estes números predefinidos. Essas predefinições também tem a opção de ocultar o número associado a cada preset do agente| +PRESET NOT ADDED|PRESET NÃO ADICIONADO| +there is already an entry for this campaign with this preset|já existe uma entrada para esta campanha com esta predefinição| +PRESET NOT MODIFIED|PRESET NÃO MODIFICADA| +>Presets<|> Presets <| +Hide Transfer Number to Dial|Esconder número de transferência para discar| +Enable Transfer Presets|Habilitar Presets de transferência| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Esta opção permitirá que os Presets Sub menu a aparecer no topo da página Modificação da campanha, e você também terá a capacidade para especificar números de discagem pré-selecionadas para Agentes de utilizar no quadro de transferência de Conferência de o agente de interface. O padrão é DISABLED| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Esta opção irá esconder o número a ser discado campo no quadro de transferência de Conferência de o agente de interface. O padrão é DISABLED| +PRESETS FOR THIS CAMPAIGN|PRESETS para esta campanha| +ADD NEW PRESET|ADD NEW PRESET| +Hide Number|Ocultar número| +Preset Name|Nome da predefinição| +Preset Number|Número pré-definido| +Preset DTMF|Predefinição DTMF| +CAMPAIGN PRESET LISTINGS|LISTAS DE CAMPANHA PRESET| +CAMPAIGN PRESET NOT DELETED|PRESET CAMPANHA NÃO DELETED| +Show Presets Stats|Mostrar Estatísticas Presets| +AGENT DIAL PRESETS NAMES|PRESETS AGENTE NOMES DE MARCAÇÃO| +Manual Dial Prefix|Prefixo de discagem manual| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Este campo opcional permite que você defina o prefixo de discagem para ser usado somente quando fazer chamadas de discagem manual do agente de interface, como usar o recurso de discagem manual, ou Disque o próximo número, quando no método de discagem manual, manual ou marcação de números alt, ou programado pelo usuário apenas callbacks. O padrão é vazio para deficientes físicos, que utilizam o prefixo de discagem definido no campo acima. Esta opção não interfere com a opção 3way Dial Prefix| +Here is a list of reserved phrases that cannot be used as menu IDs|Aqui é uma lista de frases reservados que não pode ser usado como um menu de IDs| +Call Menu ID cannot use reserved words|Identificação de chamada Menu não pode usar palavras reservadas| +Webphone System Key Override|Sistema Webphone Tecla Anulação| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Esta configuração permite que você defina uma chave do sistema alternativo webphone apenas para os membros de um grupo de usuários. O padrão é vazio| +Webphone Dialpad Override|Webphone Dialpad Override| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Esta configuração permite ativar ou desativar o teclado na webphone apenas para os membros de um grupo de usuários. O padrão é DISABLED. TOGGLE permitirá ao usuário visualizar e ocultar o teclado, clicando em um link| +Webphone Dialpad|Webphone Dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Esta configuração permite ativar ou desativar o teclado para este webphone. O padrão é Y para habilitado. TOGGLE permitirá ao usuário visualizar e ocultar o teclado, clicando em um link. Este recurso não está disponível em todas as versões webphone| +Webphone System Key|Webphone chave do sistema| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Se o seu sistema ou o fornecedor de exigir, este é o lugar onde a chave do sistema para o webphone deve ser inserido dentro padrão é vazia| + Strength| Força| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Uma palavra-passe registo forte deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Um segredo arquivo forte conf deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Uma palavra-passe utilizador forte deve ser de pelo menos 8 caracteres de comprimento e têm minúsculas e letras maiúsculas, bem como, pelo menos, um número| +Force Change Password|Forçar alteração de senha| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Se esta opção estiver definida para Y, então o usuário será solicitado a alterar sua senha na próxima vez que efetuar login na página de administração. O padrão é N| +First Login Trigger|Gatilho primeiro Login| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Esta configuração permite a configuração inicial da tela do servidor para ser mostrado para o administrador quando pela primeira vez entrar no sistema| +Default Phone Registration Password|Senha padrão de Registro Telefone| +This is the default registration password used when new phones are added to the system. Default is test|Esta é a senha registo padrão usado quando novos celulares são adicionados ao sistema. O padrão é teste| +Default Phone Login Password|Padrão Login Senha Telefone| +This is the default phone web login password used when new phones are added to the system. Default is test|Este é o padrão de telefone senha de acesso web utilizado quando os telefones novos são adicionados ao sistema. O padrão é teste| +Default Server Password|Senha do Servidor Padrão| +This is the default server password used when new servers are added to the system. Default is test|Esta é a senha do servidor padrão usado quando novos servidores são adicionados ao sistema. O padrão é teste| +CHANGE PASSWORD|MUDAR SENHA| +INITIAL INSTALL WELCOME|Instalação inicial BEM-VINDO| +COPYRIGHT TRADEMARK LICENSE|COPYRIGHT LICENÇA MARCA| +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|Você é obrigado a alterar sua senha antes que você possa continuar a Administração. Uma senha forte tem tanto letras minúsculas e maiúsculas, assim como pelo menos um número. Sua senha deve ter de 2 a 20 caracteres e não pode conter quaisquer caracteres que não são letras ou números| +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|Certifique-se que esta senha é algo que você pode lembrar, porque assim que você fizer essa alteração, você será solicitado a digitar a nova senha para login em Administração| +Password has not been changed, please try again|A senha não foi alterada, por favor tente novamente| +New Password|Nova Senha| +Password has been updated, you may now continue|A senha foi atualizada, você pode agora continuar| +Passwords have been updated, you may now continue on into Administration|Senhas foram atualizadas, agora você pode continuar em Administração| +You may want to start by reading the ViciDial Manager Manual available at|Você pode querer começar por ler o Manual Gestor ViciDial disponível em| +there is a free version available|existe uma versão gratuita disponível| +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|Certifique-se que esta senha é algo que você pode lembrar, porque assim que você completar esta tela de configuração inicial, você será solicitado a digitar a nova senha novamente para voltar a entrar para a Administração| +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|Os próximos três senhas padrão são definidas na seção Configurações do Sistema, e você pode alterá-los depois de defini-los aqui. É uma idéia boa para fazer essas senhas tão forte que ninguém pode invadir suas contas de telefone e telefonemas lugar sem você saber. A senha de registro padrão usado quando os telefones novos são adicionados ao sistema como o SIP ou IAX senha do telefone VOIP. O padrão de telefone senha de acesso web utilizado quando os telefones novos são adicionados ao sistema, como a senha do telefone que um agente iria usar na interface do Agente ViciDial. A senha do servidor padrão usado quando os novos servidores são adicionados ao sistema para os servidores para comunicar uns com os outros| +Passwords have been updated, you may now continue on into Administration|Senhas foram atualizadas, agora você pode continuar em Administração| +You may want to start by reading the ViciDial Manager Manual available at|Você pode querer começar por ler o Manual Gestor ViciDial disponível em| +there is a free version available|existe uma versão gratuita disponível| +Welcome to ViciDial|Bem-vindo ao ViciDial| +initial setup screen|tela de configuração inicial| +copyright, trademark and license page|página direitos autorais, marcas e licenças| +The ViciDial Call Center Suite is maintained by the|O ViciDial Call Center Suite é mantido pelo| +is a registered trademark of the|é uma marca registrada do| +Here is our|Aqui é o nosso| +trademark use policy|política de uso de marca| +The ViciDial Call Center Suite is released under the|O ViciDial Call Center Suite é lançado sob a| +open source license|licença de código aberto| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|O ViciDial Call Center Suite está disponível para download, e para o uso, livre de custos. Você pode baixar o fácil de instalar| +ViciBox CD ISO version|ViciBox CD ISO versão| +or only the|ou apenas o| +source code|código-fonte| +Continue on to the Initial Setup|Continue até a configuração inicial| +Customer 3-Way Hangup Logging|Cliente 3-Way Logging Hangup| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Se esta opção estiver habilitada a user_call_log irá registrar quando um cliente hangup até se desligar durante uma chamada 3-way. Além disso, este pode permitir para o cliente 3-forma acção hangup se um é defineed abaixo. O padrão é ativado| +Customer 3-Way Hangup Seconds|Cliente 3-Way Segundos hangup| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Se o registro do cliente 3-way é ativada, esta opção permite que você defina o número de segundos após o desligamento do cliente é detectado antes que ele está realmente conectado eo cliente opcional ação hangup de 3 vias é executado. O padrão é 5 segundos| +Customer 3-Way Hangup Action|Cliente 3-Way Ação Hangup| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Se o registro do cliente 3-way é ativada, esta opção permite-lhe ter a tela de agente automaticamente pendurar-se sobre a chamada e ir para a tela DISPO se esta opção estiver definida para DISPO. O padrão é NONE| +Inbound Report by DID|Relatório de entrada por DID| +Lists Campaign Status Stats|Listas de Status Estatísticas da campanha| +Add Lead URL|Adicionar Chumbo URL| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Este endereço de URL teia não é visto pelo agente, mas é chamado cada vez que um chumbo é adicionado ao sistema através do processo de entrada. O padrão é em branco. Você deve começar esta URL com VAR se você quiser usar variáveis ​​e, é claro - A - e - B - em torno da variável real na URL onde você quer usá-lo. Aqui está a lista de variáveis ​​que estão disponíveis para esta função| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Este utilitário permite que você envie arquivos de áudio para o servidor web de modo que eles podem ser distribuídos para todos os servidores ViciDial em um cluster multi-servidor. Uma nota importante, apenas dois tipos de arquivos de áudio irá funcionar,. Wav que são PCM Mono 16bit e 8k. Arquivos GSM que são 8k 8bit. Por favor verifique se seus arquivos estão devidamente formatado antes de enviá-las aqui| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Recomendamos fortemente que carregar apenas 16bit Mono 8k arquivos de áudio PCM WAV| +Park Music-on-Hold|Park Music-on-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|Isto é onde você pode definir o contexto de música em espera para esta campanha. Certifique-se de selecionar uma música válido no contexto espera a partir da lista de seleção e que o contexto que você selecionou tem arquivos válidos na mesma. O padrão é padrão| +Park Call IVR|Estacionamento de chamadas IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Esta opção vai permitir que um agente para estacionar uma chamada com um botão separado CHAMADA IVR PARK em sua interface agente se este está habilitado ou ENABLED_PARK_ONLY. A opção ENABLED_PARK_ONLY vai permitir ao agente para enviar a chamada para estacionar, mas não clique para recuperar a chamada como a opção Enabled. A opção ENABLED_BUTTON_HIDDEN permite que a função através da API só. O padrão é DISABLED| +Park Call IVR AGI|Estacionamento de chamadas IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Se o Parque campo IVR chamada não está desativado, então este campo é usado como a seqüência de aplicação AGI que o cliente seja enviado. Esta é uma configuração que deve ser definido pelo administrador, se possível| +Manual Preview Dial|Dial visualização manual| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|Isso permite que o agente em modo de discagem manual para ver as informações de chumbo, quando clicar em Discar Número seguida antes que eles ativamente discar o telefonema. Há um link opcional para Ignorar a ligação e passar para a próxima, se selecionado. O padrão é PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Estima Segure Filename tempo mínimo| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Se o tempo de retenção estimado é activo e é calculado para ser igual ou inferior ao mínimo de 15 segundos, então este ficheiro irá ser jogado em vez de o anúncio padrão. O padrão é vazio para inativos| +Estimated Hold Time Minimum Prompt No Block|Mínimo Tempo estimado de espera Não Avisar Bloco| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Se Tempo de espera estimado é ativo eo estimado de espera Tempo campo Nome do arquivo mínimo acima é preenchido, então esta opção para permitir que as chamadas em fila atrás de uma chamada em que o prompt está jogando para ir a um agente se torna disponível quando a mensagem é jogar . Enquanto o tempo está a desempenhar a um cliente que não podem ser enviados para um agente. O padrão é N| +Estimated Hold Time Minimum Prompt Seconds|Estimado Hold Time Segundos mínimos Prompt| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Este campo precisa ser definido como o número de segundos que o estimado de espera Filename tempo mínimo prompt de joga. O padrão é 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|Este campo permite que você personalize o nome da gravação quando a gravação da campanha é OnDemand ou ALLCALLS. As variáveis ​​são permitidos| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|O padrão é FULLDATE_AGENT e ficaria assim 20051020-103108_6666. Outro exemplo é CAMPAIGN_TINYDATE_CUSTPHONE que ficaria assim| +Real-Time Agent Time Stats|Tempo Real Tempo Estatísticas do Agente| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|Configurando isso para nada, mas desativado permitirá a recolha de estatísticas em tempo agente para hoje para esta campanha, que são visíveis através do relatório em tempo real. As chamadas são a média chama manipulados por agente, ESPERA é o tempo médio de espera, agente CUST é o tempo médio de conversação do cliente, ACW é a média do tempo de trabalho Depois de chamada, PAUSE é o tempo de pausa média. O padrão é DISABLED| +Add A Dial Status to Call|Adicionar um status de marcação para chamadas| +Admin Modify Auto-Refresh|Administrador Modificar Auto-Refresh| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|Este é o intervalo de atualização em segundos das telas de modificação neste interface de administração. Configurando isso para 0 irá desativá-lo, configurá-lo abaixo de 5, na sua maioria fazem as telas modificam inutilizável porque irá atualizar rápido demais para mudar de campo. Esta opção é útil em situações em que mais de um gerente é controlar configurações em uma campanha ativa ou em grupo, para que as configurações são atualizadas com freqüência. O padrão é 0| +Admin No-Cache|Administrador No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|Definindo-a para um irá definir todas as páginas de administração para o navegador web no-cache, por isso cada tela tem que ser recarregado cada vez que é visto, mesmo se clicar de volta no navegador. O padrão é 0 para deficientes físicos| +Generate Cross-Server Phone Extensions|Gerar extensões entre servidores telefone| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Esta opção se definido como 1 irá gerar entradas dialplan para qualquer telefone em um sistema multi-servidor. O padrão é 0 para inativo| +QueueMetrics Addmember Enabled|QueueMetrics AddMember Habilitado| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Esta opção se definido como 1 irá gerar ADDMEMBER2 e entradas REMOVEMEMBER em queue_log. O padrão é 0 para deficientes físicos| +Minimum Hopper Level|Nível Hopper mínimo| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Este é o número mínimo de leva o script VDhopper tenta manter na tabela vicidial_hopper para esta campanha. Se executar o script VDhopper cada minuto, fazem deste um pouco maior que o número de leva você passar em um minuto| +Automatic Hopper Level|Nível Hopper automática| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Definindo-a para Y permitirá Vicidial para ajustar automaticamente o funil baseado fora as configurações que você tem em sua campanha. A fórmula que utiliza para fazer isto é| +Automatic Hopper Multiplier|Multiplicador Hopper automática| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|Esta é multiplicador para o Auto Hopper. Definir este menos de 1 fará com que o algoritmo de Hopper Auto para carregar leva menos do que normalmente. Definir este maior do que 1 fará com que o algoritmo de Hopper Auto para carregar mais ligações do que normalmente. O padrão é 1| +Auto Trim Hopper|Auto Trim Hopper| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Definindo-a para Y permitirá Vicidial para remover automaticamente excesso leva do funil. O padrão é Y| +Manual Dial API|Manual de Dial API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Esta opção permite que você defina a API do agente para fazer qualquer chamada um a um, hora, ou a capacidade de fila chamadas de discagem manual e tê-los discar automaticamente uma vez que o agente entra em pausa ou está disponível para atender a sua chamada próxima com o opção de desativar a discagem automática dessas chamadas, QUEUE, ou QUEUE_AND_AUTOCALL que é a mesma fila, mas sem a opção de desativar a discagem automática das chamadas. Se um agente tem mais do que uma chamada na fila para eles vai ver a conta de quantas chamadas de discagem manual estão na fila logo abaixo do botão de pausa, ou Disque botão próximo número. Sugerimos que se QUEUE é usado que você envie ações API usando o preview = YES opção para que você não está repetidamente discagem de chamadas para o agente sem aviso prévio. Além disso, se estiver usando QUEUE e fortemente usando chamadas de discagem manual em um método não MANUAL marcação, recomendamos definir o Pause Agente Após Cada opção chamada para Y. O padrão é PADRÃO| +Manual Call Time Check|Call Time manual Confira| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Se esta opção estiver ativada, ele irá verificar todas as chamadas de discagem manual para se certificar que estão dentro das configurações de chamada de tempo definido para a campanha. O padrão é DISABLED| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Se você quiser mudar isso leva a um retorno programado, primeiro mude a disposição para CBHOLD, em seguida, submeter-se e você será capaz de definir a data de retorno e tempo| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Override Web Form - Este é o endereço personalizado que clicar no botão Web Form em VICIDIAL irá levá-lo para as chamadas que entram em nesta lista| +Agent Screen Login|Entrar Tela agente| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|O login utilizado para o usuário do telefone para acessar os aplicativos do cliente, como a tela de agente ViciDial| +Phone Extension|Extensão de telefone| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Este campo é onde você coloca o nome de telefones como ele aparece para o Asterisk não incluindo o protocolo ou barra no início. Por exemplo: para o telefone SIP SIP/test101 a extensão do telefone seria test101. Além disso, para IAX2 telefones: IAX2/IAXphone1 @ IAXphone1 seria IAXphone1. Para Zap e Dahdi channelbank anexado ou FXS telefones certifique-se de colocar o número do canal completo sem o prefixo: Zap/25-1 seria 25-1. Outra nota, certifique-se de definir o campo de protocolo abaixo corretamente para o seu tipo de telefone| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|STATUS dentro das listas ativo para esta CAMPANHA| +SHOW LEAD STATUSES IN THIS CAMPAIGN|MOSTRAR STATUS DE CHUMBO Nesta campanha| +RELOAD NOW|RELOAD AGORA| +refresh|refrescar| +You can also set a label to ---HIDE--- to hide both the label and the field|Você também pode definir um rótulo para esconder --- --- para esconder tanto o rótulo eo campo| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Para somente de entrada, você também pode definir o tempo de chamada de parada maior do que 2400 se quiser que o tempo de chamada para ir além da meia-noite. Então, se você quiser que o seu tempo de chamada para executar a partir de 6 da manhã até as 2 da manhã do dia seguinte, você colocaria 0600 como o horário de início e 2600 como o tempo de paragem| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF será o padrão para não mostrar o teclado na primeira carga, mas permitirá que o usuário para mostrar o teclado, clicando no link dialpad| +Add Multi-Server Phones Form|Adicionar Multi-Form Server Celular| +Phones Bulk Insert|Telefones de inserção em massa| +List Order Randomize|Ordem Randomize Lista| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Esta opção permite que você embaralhar a ordem dos leads no funil de carga dentro dos resultados definidos pelos critérios estabelecidos acima. Por exemplo, a ordem de lista será preservada, mas os resultados serão randomizados dentro que a triagem. Definir esta opção como Y vai ativar esse recurso. Padrão é n para deficientes físicos. Note que, se você tem um grande número de leva esta opção pode diminuir a velocidade do script de carregamento funil| +NONE will not log any logins and logouts within queue_log|NONE não registra nenhum logins e logouts dentro queue_log| +QueueMetrics Dispo Pause Code|QueueMetrics Código Pause Dispo| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Esta opção, se preenchida, permite que você defina se um código de pausa dispo é celebrado queue_log quando um agente está em estado dispo. O padrão é vazio para deficientes físicos| +List Order Secondary|Ordem lista secundária| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Esta opção permite que você selecione a ordem de classificação segundo os leads no funil de carga após a Ordem de lista e dentro dos resultados definidos pelos critérios estabelecidos acima. Por exemplo, a ordem de lista irá ser utilizado para o primeiro tipo de os fios, mas os resultados serão classificados uma segunda vez no que ordenação através do mesmo conjunto da Ordem primeira lista. Por exemplo, se você tiver Ordem Lista definido para contagem decrescente e você só tem ligações que foram tentadas 1 e 2 vezes, então se você tem o conjunto Ordem lista secundária para LEAD_ASCEND todas as tentativas 1 ligações serão classificados por mais antigas pistas primeira e será colocada no funil de que maneira. O padrão é LEAD_ASCEND. Note que, se você tem um grande número de ligações usando uma das opções CALLTIME pode diminuir a velocidade do script de carregamento funil| +My Callbacks Checkbox Default|Meu padrão Checkbox Callbacks| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Esta opção permite-lhe pré-definir a opção de chamada de retorno na tela My callback agente programado. CHECKED irá verificar a caixa de seleção automaticamente para cada chamada. O padrão é UNCHECKED| +Call Notes Per Call|Chame Notes por chamada| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|Definir esta opção como ENABLED vai permitir que agentes para entrar em notas para cada chamada lidar com eles na interface do agente. O campo de entrada de notas irá aparecer abaixo do campo Observações na interface do agente. Além disso, se o Grupo User Agent tem permissão para ver registros de chamadas, em seguida, o agente será capaz de ver as notas de chamada passado para a liderança a qualquer momento. O padrão é DISABLED| +If List Order Randomize is enabled, this option will be ignored|Se Ordem Lista Randomize é ativada, esta opção será ignorada| +ERROR: Lead not added, please go back and look at what you entered|ERROR: Chumbo não adicionou, por favor, vá para trás e olhar para o que você entrou| +Lead has been added|O chumbo foi adicionado| +Add A New Lead|Adicionar uma nova pista| +Agent Lead Search Override|Agente Override Pesquisa chumbo| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Esta definição irá substituir o que a campanha criou para pesquisa de chumbo agente. NOT_ACTIVE usará o cenário de campanha. ENABLED permitirá a pesquisa de chumbo e deficientes não permitirá a pesquisa de chumbo. O padrão é NOT_ACTIVE| +Agent Lead Search|Pesquisa de chumbo agente| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|Definir esta opção como ENABLED permitirá que agentes para procurar pistas e visualizar informações de chumbo durante uma pausa na interface do agente. Além disso, se o Grupo User Agent tem permissão para ver registros de chamadas, em seguida, o agente será capaz de ver as notas de chamada passado por qualquer dica que eles estão vendo informações sobre. O padrão é DISABLED| +Agent Lead Search Method|Agente Método de Pesquisa de chumbo| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Se a pesquisa de chumbo Agente está habilitado, essa configuração define onde o agente será permitido a procurar por pistas. O sistema irá procurar todo o sistema, CAMPAIGNLISTS irá procurar dentro de todas as listas de ativos dentro da campanha, CAMPLISTS_ALL irá procurar dentro de todas as listas de ativos e inativos dentro da campanha, LISTA irá procurar somente dentro do ID manual Dial lista, conforme definida na campanha . O padrão é CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|LEAD procura por este período de tempo| +Routing Extension|Roteamento de Extensão| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|Este campo permite uma extensão de encaminhamento personalizado de saída. Isto permite-lhe usar métodos de manipulação de chamada diferentes, dependendo de como você quer rotear chamadas através de sua campanha de saída. Extensão VDAD Anteriormente chamado de Campanha| +same as|mesma| +Will send the call only to an agent on the same server as the call is placed on|Vou enviar o convite apenas a um agente no mesmo servidor como a chamada é colocada em| +Used for press-1, broadcast and survey campaigns|Usado para campanhas de imprensa-1 de radiodifusão e vistoria| +Will try to first send the call to an agent on the local server, then it will look on other servers|Vai tentar primeiro enviar a chamada para um agente no servidor local, então ele vai procurar em outros servidores| +DEFAULT - Will send the call to the next available agent no matter what server they are on|PADRÃO - Vou enviar a chamada para o próximo agente disponível não importa o que eles estão no servidor| +Used for Answering Machine Detection after that, same behavior as|Utilizada para Detecção de Máquina Respondendo depois disso, mesmo comportamento| +Used for Answering Machine Detection after that same behavior as|Utilizada para Detecção de Máquina Respondendo depois que o mesmo comportamento como| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Usado para campanhas de imprensa-1 de radiodifusão, e pesquisa com Cepstral Text-to-speech| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Utilizada para Detecção de Máquina Respondendo em seguida, pressione-1 de radiodifusão e vistoria campanhas com Cepstral Text-to-speech| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Uma dessas opções com USER_ na frente só vai procurar dentro de leads que têm o campo proprietário correspondente ao ID do usuário do agente, as opções com GROUP_ na frente só vai procurar dentro de leads que têm o campo proprietário correspondente ao grupo de usuários que o usuário é um membro, as opções com TERRITORY_ na frente só vai procurar dentro de leads que têm o campo proprietário combinando os territórios que o agente tem selecionados| +QM Phone Environment|QM Ambiente Telefone| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Se a integração QueueMetrics está ativado nas configurações do sistema, em seguida, essa configuração permite a inserção de dados este valor no campo dados4 do queue_log para registros de atividade do agente. O padrão é vazio para deficientes físicos| +Active Twin Server IP|IP Active Server Gêmea| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Alguns sistemas vicidial exigem a criação de servidores vicidial em pares. Esta configuração é onde você pode colocar o IP do servidor de um outro servidor vicidial que este servidor está geminada com. O padrão é vazio para deficientes físicos| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|NOTAS: Para ring_all, os agentes que estão usando telefones que têm Em habilitado agente Gancho terá seu anel de telefones e o primeiro a responder vai receber a chamada e as informações na tela do agente. Desde ring_all ignora tempo agente espera e classificação e vai chamar todos os agentes que está disponível para a fila, nós não recomendamos usar este método para as filas grandes. Ao utilizar ring_all, agentes conectados com telefones que têm o Agente Gancho Em desativado terá que usar as chamadas em painel de fila e clique no link CHAMADA TOMAR PARA receber chamadas em fila. A quantidade de tempo que o telefone vai tocar para os agentes ring_all está definido para a configuração de tempo no gancho do anel ou o menor tempo de anel dos telefones que serão chamados. Nós não recomendamos o uso ring_all em filas de chamadas em grande volume, ou filas com muitos agentes. O método ring_all se destina a ser usado com apenas alguns agentes e sobre o volume de chamadas em baixo-grupos| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Esta opção só é usada para os agentes que são registrados com telefones que têm a função de agente no gancho habilitado. Este é o número de segundos que cada tentativa de chamada para o agente tocará para até que o sistema irá aguardar um segundo e começar a tocar os telefones agente disponível novamente. Este campo pode ser substituído se os telefones de agentes são definidos para um menor tempo de anel que pode ser necessário para evitar chamadas sejam enviados um correio de voz telefones. O padrão é 15| +On-Hook Agent|Em Hook-agente| +On-Hook Ring Time|No gancho-Time Anel| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Esta opção só é usada para chamadas de entrada que vão a este agente remoto. Este recurso irá chamar o agente remoto e não enviar o cliente para o agente remoto até que a linha é atendida. Padrão é n para deficientes físicos| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Esta opção só é usada quando o campo agente no gancho acima é definido como Y e, em seguida, apenas para chamadas de entrada próximos a este agente remoto. Este é o número de segundos que cada tentativa de chamada irá tocar para tentar obter uma resposta. É recomendável que você defina isso para alguns segundos menos do que leva para uma chamada para ser enviado para a caixa postal. O padrão é 15| +On-Hook Agent Login|Em Hook-Agent Login| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Esta opção só é usada para chamadas de entrada que vão a um agente conectado com este telefone. Este recurso irá chamar o agente e não vai mandar o cliente para a sessão de agentes até a linha é atendida. Padrão é n para deficientes físicos| +This is a Phone On-Hook Agent|Este é um telefone no gancho agente| +Maximum Ring Time|Tempo máximo anel| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|As opções de adiar irá parar de piscar e ou exibição no vermelho quando você verificar os retornos de chamada, até que o número de retornos de chamada mudanças| +Auto Pause Pre-Call Work|Auto Pausa trabalho de pré-Call| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Em auto dial-modo, esta definição se habilitado irá definir o agente para uma pausa automaticamente quando os cliques do agente em qualquer das seguintes funções que os obriga a ser pausado-Manual Dial, Dial pesquisa rápida e chumbo, Call Log View, Callbacks Verifique, Digite o Código Pause. Padrão é n para inativos| +Auto Resume Pre-Call Work|Auto Resume Pré-Call Work| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Em auto dial-modo, esta definição se habilitado irá definir o agente ativo automaticamente quando o agente clica para fora, ou cancela, em qualquer das seguintes funções que os obriga a ser interrompida Dial-Manual, Discagem rápida, Pesquisa chumbo, Call Entrar View, Callbacks Verifique, insira o código de pausa. Padrão é n para inativos| +Auto Pause Pre-Call Code|Auto Pausa Código Pré-Call| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Se o Auto Pause função trabalho de pré-Call acima é ativo, e Códigos Pause agente está ativo, essa configuração será o código de pausa que é usado quando o agente está em pausa para essas atividades. O padrão é PRECAL| +This campaign is not set to Auto-Alt-Dial|Esta campanha não está definido para Auto-Alt-Dial| +Multi-Alt-Settings|Multi-Alt-Definições| +Reload Dialplan On Servers|Atualizar Dialplan Em Servidores| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Esta opção permite que você force uma recarga do dialplan em todos os servidores Asterisk no cluster. Se você fez alterações na entrada personalizada Dialplan acima, você deve definir esta a 1 e se submeter a ter essas alterações entrem em vigor nos servidores| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Usando MULTI_LEAD permite que você use um cabo separado para cada número de uma conta de cliente que compartilham vendor_lead_code comum, eo tipo de número de telefone para cada um é definido com uma etiqueta no campo Proprietário. Esta opção irá desativar algumas opções na tela Modificar campanha e mostrar um link para o Multi-Alt página de configurações que permite que você defina os tipos de telefone cujo número, definidas pelo rótulo de cada ligação, será marcado e em que ordem. Isto irá criar um filtro especial de chumbo e vai alterar o campo de classificação de todas as ligações no interior das listas definidas para esta campanha, a fim de chamá-los na ordem que você especificou| +Manual Dial CID|Marcação Manual CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Este define se um agente fazer chamadas discagem manual terá as configurações de campanha callerID usado, ou seus agentes as configurações do telefone callerID usado. O padrão é CAMPANHA| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Se a opção Usar campanha personalizado CID está ativado ou a lista Campanha configuração Override CID é usada, esta configuração será ignorada| +Phone Post Time Difference Alert|Telefone Mensagem de Alerta Diferença de tempo| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Este recurso manual-dial-somente, se ativada, irá mostrar um alerta se o fuso horário para o código postal de chumbo, ou código postal, é diferente do fuso horário do código de área do número de telefone para a liderança. A opção OUTSIDE_CALLTIME_ONLY só irá mostrar a indicação se as duas zonas de tempo são diferentes e uma das zonas de tempo está fora do tempo de permanência seleccionado para a campanha. OUTSIDE_CALLTIME_PHONE só verificar o fuso horário do número de telefone do chumbo e alertar se estiver fora do tempo de chamada local. OUTSIDE_CALLTIME_POSTAL só verificar o fuso horário do código postal do chumbo e alertar se estiver fora do tempo de chamada local. OUTSIDE_CALLTIME_BOTH irá verificar o código postal e número de telefone para estar dentro do tempo de chamada local, mesmo se eles estão no mesmo fuso horário. Esses alertas irá mostrar na informação do registo de chamadas, informações callbacks lista, informações de resultados de pesquisa, quando uma ligação é marcado e quando uma ligação é visualizado. O padrão é DISABLED| +Custom 3-Way Button Transfer|Personalizado Transferência Botão 3-Way| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Esta opção irá adicionar um botão personalizado Transferência para a tela do agente abaixo do botão de transferência de Conf, que permitirá um clique de três vias chamadas usando o pré-selecionada ou campo. As opções PRESET_ irá efetuar chamadas usando o valor definido predefinido. As opções field_ irá efetuar chamadas usando o número no campo selecionado a partir do chumbo. DEFICIENTES não vai mostrar o botão na tela do agente. As opções PARK_ irá estacionar o cliente antes de discar. O padrão é DISABLED| +Auto Dial Level Threshold|Auto Threshold Nível Dial| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Essa configuração só funciona com um ADAPT ou RATIO Método de marcação, e deve ser definido para algo diferente de Desativado eo número de agentes de configuração deve estar acima de 0. Este recurso permite que você defina um número mínimo de agentes que o algoritmo preditivo vai trabalhar. Se o número de agentes é inferior ao número que você definiu, então o nível de ligação vai a 1,0 até mais agentes login ou ir para o estado selecionado. LOGGED de IN_AGENTS contará todos os agentes registrados na campanha, NÃO PAUSED_AGENTS só vai contar com agentes que estão à espera ou falar, e WAITING_AGENTS só contam os agentes que estão à espera de uma chamada. O padrão é DISABLED| +Available Only Tally Threshold|Threshold Tally disponível somente| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Essa configuração só funciona com um ADAPT ou RATIO Método de marcação, Tally disponível apenas deve ser definido como N, essa configuração deve ser definido para algo diferente de Desativado eo número de agentes de configuração deve estar acima de 0. Este recurso permite que você defina o número de agentes abaixo do qual Tally disponível apenas será habilitado. Se o número de agentes é inferior ao número que você definiu, então a configuração Tally disponível apenas com ir para Y temporariamente até que os agentes mais fazer login ou ir para o estado selecionado. LOGGED de IN_AGENTS contará todos os agentes registrados na campanha, NÃO PAUSED_AGENTS só vai contar com agentes que estão à espera ou falar, e WAITING_AGENTS só contam os agentes que estão à espera de uma chamada. O padrão é DISABLED| +Time Zone Setting|Definição de Fuso Horário| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Esta opção permite que você defina o método de manter a pesquisa de fuso horário atual para as ligações dentro desta lista. Este processo só é feito à noite para que todas as alterações feitas não serão imediatos. COUNTRY_AND_AREA_CODE é o padrão, e vai usar o código do país eo código de área do número de telefone para determinar o fuso horário do chumbo. Postal_code irá utilizar o código postal se disponível para determinar o fuso horário do chumbo. NANPA_PREFIX funciona apenas nos EUA e vai usar o código de área eo prefixo do número de telefone para determinar o fuso horário do chumbo, mas isso não é ativado por padrão no sistema, por isso, tenha certeza de ter os dados prefixo NANPA carregados seu sistema antes de selecionar esta opção. OWNER_TIME_ZONE_CODE usará o abbraviation zona padrão de tempo carregado no campo do proprietário do chumbo para determinar o fuso horário, nos EUA são exemplos AST, EST, CST, MST, PDT, AKST, HST. Este recurso deve ser ativado pelo administrador do sistema para entrar em vigor| +Dial Level Difference Target|Disque-alvo diferença de nível| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Este campo é utilizado para definir se você deseja atingir com um número específico de agentes à espera de chamadas ou chamadas de espera para os agentes. Por exemplo, se você sempre gostaria de ter em média um agente livre para receber chamadas imediatamente você deve definir como -1, se você gostaria de ter sempre como alvo uma chamada em espera à espera de um agente, você deve definir esta a 1. O padrão é 0. Este campo não é usado pelo MANUAL ou métodos de marcação INBOUND_MAN| +Admin Utilities|Utilitários de administração| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|página utilitários escondidos - Se você não sabe o que esses utilitários fazer, provavelmente você não deve usá-los| +Welcome Languages Page|Página Idiomas Bem-vindo| +Campaign Debug Page|Página Debug Campanha| +Bulk Phone Insert Page|Página de inserção em massa Telefone| +Send a Call With Custom CID Page|Enviar uma Chamada Com CID Página Personalizada| +Speech Voice Lab Page|Discurso Página Lab Voz| +Safe Harbor Audio|Áudio Safe Harbor| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Este é o arquivo de áudio prompt que é jogado, se a ação de soltar for definido como AUDIO. O padrão é o zumbido| +Safe Harbor Call Menu|Menu de chamada Safe Harbor| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|Este é o menu de chamada que uma chamada é enviada para se a ação de soltar for definido como CALLMENU| +Log Key Press|Pressione a tecla Entrar| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Esta opção, se habilitado irá registrar a imprensa DTMF chave pelo chamador neste menu Chamadas. O padrão é 0 para deficientes físicos| +No DTMF Logging|Nenhum registro DTMF| +DTMF Logging Enabled|DTMF Log Habilitado| +Webphone Auto-Answer|Webphone Auto-Resposta| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Esta configuração permite que o telefone web para ser configurado para atender automaticamente as chamadas que chegam por defini-la como Y, ou ter o toque de chamadas por defini-la como padrão é N. Y| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU irá enviar o cliente para o menu de chamada definido na lista de seleção abaixo| +Survey Call Menu|Menu de chamada pesquisa| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Se o método é definida como CALLMENU, este é o menu de chamada que o cliente é enviado para se optar por| +Scheduled Callbacks Days Limit|Programado Callbacks Limite Dias| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Esta opção permite que você reduza o agente callbacks programadas do calendário para um número selecionável de dias a partir de hoje, o calendário do mês completa 12 ainda será exibido, mas apenas o número de dias será selecionável. O padrão é 0 para ilimitado| +Dial Level Difference Target Method|Disque nível do método alvo Diferença| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Esta opção permite definir se o disco de nível fixação de metas diferença é aplicada apenas para o cálculo do nível de discagem ou também para a marcação real em cada servidor de discagem. Se você estiver executando uma campanha pequena, com agentes logados em vários servidores que você pode querer usar a opção ADAPT_CALC_ONLY, porque a opção CALLS_PLACED pode resultar em menos chamadas que estão sendo colocadas de deisred. Esta opção só está activo se Dial-alvo diferença de nível é definido como algo diferente de 0. O padrão é ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Se você quiser usar campos personalizados em um endereço de formulário web, você precisa adicionar| +as part of your URL|como parte de sua URL| +Disable Dispo Screen|Desativar Tela Dispo| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Esta opção permite que você desabilite a tela disposição na interface do agente. O Desabilitar campo Status Dispo abaixo devem ser preenchidos para que essa opção funcione. O padrão é| +Disable Dispo Status|Desativar Status Dispo| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Se a opção Desativar Tela Dispo está definido para DISPO_DISABLED, então este campo deve ser preenchido polegadas Você pode usar qualquer disposição que você deseja para este campo, desde que ele é de 1 a 6 caracteres de comprimento com apenas letras e números| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Esta configuração se definido como 1 irá permitir que um gerente para acessar a chamada exportação e relatórios de chumbo na tela RELATÓRIOS. O padrão é 0. Para a exportação Chama e Leads relatórios, a ordem dos campos a seguir é usado para as exportações| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Este relatório extrai informações da ligação para números discados no período selecionado. A liderança só é exportada uma vez, não importa quantas chamadas foram manipulados. O estado actual liderança é usado.| +Export Leads Report|Exportação lidera Relatório| +Screen Labels|Etiquetas Tela| +Add A Screen Label|Adicione um rótulo Tela| +ADD NEW SCREEN LABEL|ADD NEW LABEL TELA| +ADDING NEW SCREEN LABEL|ADICIONANDO LABEL TELA NOVA| +MODIFY SCREEN LABEL|MODIFICAR LABEL TELA| +DELETE SCREEN LABEL|Suprimir a etiqueta TELA| +SCREEN LABELS LIST|Lista de rótulos TELA| +Screen Label ID|Label ID tela| +Screen Label Name|Nome do Rótulo tela| +SCREEN LABEL NOT ADDED|LABEL TELA NÃO ADICIONADO| +there is already a label in the system with this ID|já existe uma etiqueta no sistema com este ID| +SCREEN LABEL ADDED|LABEL TELA ADICIONADO| +SCREEN LABEL NOT DELETED|LABEL TELA NÃO DELETED| +SCREEN LABEL DELETION CONFIRMATION|TELA CONFIRMAÇÃO EXCLUSÃO LABEL| +Click here to delete screen label|Clique aqui para apagar rótulo tela| +SCREEN LABEL DELETION COMPLETED|EXCLUSÃO LABEL TELA CONCLUÍDO| +DELETE THIS SCREEN LABEL|DELETE THIS LABEL TELA| +Click here to see Admin changes to this screen label|Clique aqui para ver as mudanças de administrador para essa etiqueta tela| +Hide Label in Call Logs|Ocultar Label em registros de chamadas| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Se um rótulo é definida como --- OCULTAR --- então os registros de chamadas de agentes, se habilitado na campanha, ainda vai mostrar o campo e os dados a menos que esta opção é definida para Y. O padrão é N| +SCREEN LABEL NOT MODIFIED|LABEL TELA NÃO MODIFICADA| +SCREEN LABEL MODIFIED|LABEL TELA MODIFICADO| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Este campo precisa ser pelo menos 2 caracteres de comprimento e um máximo de 20 caracteres de comprimento, sem espaços ou caracteres especiais. Esta é a identificação que irá ser utilizado para identificar o rótulo tela ao longo do sistema| +This is the descriptive name of the screen label entry|Este é o nome descritivo da entrada rótulo tela| +Agent Screen Labels|Tela Etiquetas Agente| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|Você pode selecionar um conjunto de etiquetas de agente de tela para usar com esta opção. O padrão é - configurações de sistema - para os rótulos padrão| +Status Display Fields|Mostrar campos de status| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|Você pode selecionar quais variáveis ​​para as chamadas serão exibidos na linha de status da tela do agente. CALLID irá exibir a 20 caracteres ID chamada única, LEADID irá exibir a ID principal do sistema, ListId irá exibir o ID lista. O padrão é CALLID| +CAMPAIGNS USING THIS SCREEN LABEL|Campanhas que usam Esta etiqueta TELA| +QueueMetrics Phone Environment Phone Append|QueueMetrics Telefone Ambiente Telefone Anexar| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Esta opção, se ativada, irá acrescentar o login telefone agente para o registro dados4 na tabela de log fila se a campanha de campo Ambiente Telefone é preenchida. O padrão é 0 para deficientes físicos| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|HIDDEN não vai mostrar o agente de campo, mas vai permitir que o campo ter dados importados para ele e exportado a partir dele, assim como tê-lo disponível para a aba script e endereço de forma web. READONLY irá exibir o valor dos dados no campo, mas não irá permitir que o agente para alterar os dados| +Enable Campaign Test Calls|Habilitar chamadas de teste da campanha| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Esta configuração permite que a capacidade de introduzir um código de telefone e número de telefone em campos na parte inferior da tela Detalhes da campanha e colocar uma chamada telefónica para o número como se fosse uma vantagem de ser auto-marcado no sistema. O número de telefone será armazenado como uma nova pista no manual lista de identificação de discagem lista. A campanha deve estar ativo para que este recurso seja ativado, e recomenda-se que as listas atribuídas à campanha todos ser definido como inativo. O prefixo de discagem, tempo limite de ligação e todos os recursos de discagem outros produtos, exceto para DNC e opções de compra de tempo, vai afetar a discagem do número de teste. O telefonema vai ser colocado no servidor selecionado como o servidor de correio de voz nas configurações do sistema. O padrão é 0 para deficientes físicos| +Test calling disabled|Teste chamando desativada| +PLACE TEST CALL|Chamada de teste LOCAL| +Test Outbound Call|Teste de chamadas de saída| +Agents Calls Reset|Agentes Chama Redefinir| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Esta configuração define se a agentes com sessão iniciada e registros telefonemas ativos devem ser zerados no final timeclock do dia. O padrão é 1 para habilitado| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|O campo 5 personalizado pode ser usado como um campo para definir um número dialplan para enviar uma chamada para a partir de um AGENTDIRECT em grupo, se o usuário não estiver disponível, você só precisa colocar AGENTEXT no campo da mensagem ou extensão no AGENTDIRECT em grupo eo sistema irá procurar o campo de cinco personalizada e enviar a chamada para esse número dialplan| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Para AGENTDIRECT em grupos de, se o usuário não estiver disponível, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Para AGENTDIRECT em-grupos, você pode colocar AGENTEXT neste campo eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|Você também pode colocar AGENTEXT neste campo, se ele é definido como extensão eo sistema irá procurar o usuário cinco campo personalizado e enviar a chamada para esse número dialplan| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|encomendas por a última vez que um agente foi enviado uma chamada de entrada. Resultados em agentes que recebem aproximadamente o mesmo número de chamadas global| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|encomendas por a última vez que um agente terminar uma chamada de entrada. AKA agente espera mais longa recebe primeira chamada| +Servers|Servidores| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Esta é uma lista dos endereços IP do servidor de servidores existentes no sistema que você quer as entradas de telefone a ser povoada toda. Estes devem ser endereços IP válidos, eles devem ser ativos no sistema e você deve colocar um por linha na caixa de entrada de texto área| +Phones|Celular| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Esta é uma lista das extensões de telefone que deseja ser criados em todos os servidores listados acima. As extensões de telefone deve ser apenas letras e números, sem caracteres especiais e você deve colocar um por linha na caixa de área de texto| +Registration Password|Registo Senha| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|Esta é a senha registo que irá ser utilizado para todos os telefones que são criados. Para o protocolo SIP e IAX2 você deve usar uma senha complexa, por razões Secutiry| +Login Password|Login Senha| +This is the agent screen login password that will be used for all of the phones that are created|Este é o agente de senha de logon tela que irá ser utilizado para todos os telefones que são criados| +Create Alias Entries|Criar entradas de alias| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Definir esta opção como YES irá criar um telefones entrada de alias para cada uma das extensões listadas acima, que irá ligar todas as entradas de mesma extensão em cada servidor em conjunto permitindo telefone balanceamento de carga de login para trabalhar na interface do agente| +Alias Suffix|Sufixo Alias| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|Este é o sufixo que será adicionado à extensão para formar o telefone ID alias. Por exemplo, se a extensão é CC100 eo sufixo alias é x, então o apelido de telefone ID usado para isso seria cc100x| +Client Protocol|Protocolo de Cliente| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Este é o protocolo de telefone que irá ser utilizado para todos os telefones criadas quando submetido. SIP e IAX2 são protocolos de VOIP que vão criar as entradas do arquivo conf para permitir que essas phoens a registar nos servidores| +Local GMT|GMT Local| +This is the time zone that all of the phones will be created with|Esta é a zona de tempo que todos os telefones será criado com| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB é semelhante ao HIDDEN exceto o tipo de armazenamento de dados no banco de dados é um tipo BLOB, adequada para dados binários ou de dados que precisa ser protegido| +Default Local GMT|Local padrão GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Esta configuração define o que será usado por padrão quando novos telefones e servidores são adicionadas usando essa interface web de administração. Padrão é de -5| +Default Voicemail Zone|Zona Voicemail padrão| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Esta configuração define o fuso será usado por padrão quando novos telefones e caixas de correio de voz são criados. A lista de zonas disponíveis é diretamente retirado do arquivo voicemail.conf. O padrão é oriental| +Voicemail Zone|Zona Voicemail| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Esta configuração permite que você defina a zona que esta caixa de correio de voz será definido para quando o tempo é registrado para uma mensagem. O padrão é definido nas configurações do sistema| +Voicemail Options|Opções de correio de voz| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Esta configuração opcional lhe permite definir as configurações de correio de voz adicionais. É recomendável que você deixe este campo em branco se você não sabe o que está fazendo| +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|As próximas duas configurações também são definidos na seção Configurações do Sistema, e você pode alterá-los depois de defini-los aqui. Você deve definir o local padrão para o fuso horário GMT que seus agentes querem estar dentro A zona de Voicemail é a lista de fusos horários de correio de voz que as mensagens de correio de voz será o tempo registrado com quando novas mensagens são deixadas| +ERROR: You cannot use reserved words for field labels|ERRO: Você não pode usar palavras reservadas para rótulos de campo| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|A opção DISPO_SELECT_DISABLED não irá desativar a tela dispo completamente, mas vai exibir a tela dispo sem quaisquer disposições, esta opção só deve ser usado se você quiser forçar os agentes a usar o software de CRM que vai enviar o status para o sistema através da API| +No Agent Call URL|No URL chamada Agent| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Este endereço de URL da web não é visto pelo agente, mas se ela é preenchida é chamada cada vez que uma chamada que não é tratado por um agente é desligou ou transferidos. Usa as mesmas variáveis ​​que os campos de formulários da Web e scripts. dispo pode ser usado para recuperar o definido pelo sistema de disposição para a chamada. Esta URL não pode ser um caminho relativo. O padrão é em branco| +On-Hook CID|Em Hook-CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Esta opção só é usada para os agentes que são registrados com telefones que têm a função de agente no gancho habilitado. Este é o identificador de chamadas que aparecerá em seus telefones agente quando as chamadas são de toque. GENERIC é um tipo genérico RINGAGENT00000000001 da notificação. Ingroup vai mostrar apenas o grupo na chamada veio. CUSTOMER_PHONE irá mostrar apenas o número de telefone do cliente. CUSTOMER_PHONE_RINGAGENT irá mostrar RINGAGENT_3125551212 com o RINGAGENT como parte do CID com o número de telefone do cliente. CUSTOMER_PHONE_INGROUP irá mostrar os primeiros 10 caracteres do grupo em seguida o número do telefone do cliente| +Please wait for the whole page to load before submitting the form|Por favor, espere a página inteira para carregar antes de enviar o formulário| +In-Group Calldate|In-Grupo Calldate| +This is the last date and time that a call was directed to this inbound group|Esta é a última data e hora em que uma chamada foi direcionada para esse grupo de entrada| +No-Answer Log|Sem resposta-Log| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Esta opção irá registrar as chamadas auto-discagem que não foram respondidas para uma tabela separada. O padrão é N| +Alt-Log DB Server|Alt Log-DB Server| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|Este é o servidor de banco de dados alternativo log. Isto é opcional, e permite que alguns logs para serem gravados em um banco de dados separado. O padrão é vazio| +Alt-Log Tables|Alt-Log Tabelas| +These are the tables that are available for logging on the alternate log database server. Default is blank|Estas são as tabelas que estão disponíveis para fazer logon no servidor alternativo log de banco de dados. O padrão é em branco| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Este é o texto atual a campo de dados de fala que é enviado para Cepstral para a criação do arquivo de áudio para ser jogado para o cliente. você pode usar Speech Synthesis Markup Language-SSML, neste campo, por exemplo| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|para uma pausa de 1 segundo. Você também pode usar diversas variáveis, tais como nome, sobrenome e título como variáveis ​​ViciDial exatamente como você faz em um Script: - A - first_name - B -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Se você tiver estáticos arquivos de áudio que você deseja usar com base no valor de um dos campos que você pode usar as também com C e D etiquetas. Os nomes dos arquivos devem estar em letras minúsculas e devem ser 8k 16bit arquivos PCM WAV. O nome do campo deve ser o mesmo, mas sem o wav. No nome do arquivo. Por exemplo - C ---- A - Endereço3 - B ---- D - em primeiro lugar encontrar o valor para Endereço3, então seria tentar encontrar um arquivo de áudio que correspondem ao valor de colocá-lo no prompt| +Here is a list of the available variables|Aqui está uma lista das variáveis ​​disponíveis| +DID Agent Log|DID Log agente| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Esta opção irá registrar a entrada DID chamadas junto com um no grupo e de usuário de identificação, se aplicável, uma tabela separada. O padrão é N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|TIMEOUT irá permitir que você defina o que acontece com a chamada quando ele expira sem entrada a partir da chamada. INVALID irá permitir que você defina o que acontece quando o chamador entra uma opção inválida. INVALID_2ND e 3 º só pode estar ativo se inválido não for usado, ele vai esperar até a entrada segundo ou terceiro inválido pelo chamador antes de executar a opção| +Survey Recording|Gravação de pesquisa| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Se ativado, isto irá iniciar a gravação quando a chamada é atendida. Apenas recomendado se o método não está definido para transferir a um agente. Padrão é n para deficientes físicos| +Campaign Areacode CID|CódigoDeÁrea Campanha CID| +AREACODE CIDS FOR THIS CAMPAIGN|CIDS CódigoDeÁrea para esta campanha| +ADD NEW AREACODE CID|ADD CódigoDeÁrea NOVA CID| +AREACODE|CódigoDeÁrea| +SUBMIT CHANGES|Enviar alterações| +AREACODE CID NOT ADDED|CódigoDeÁrea NÃO CID ADICIONADO| +there is already an entry for this campaign with this CID|já existe uma entrada para esta campanha com este CID| +AREACODE CID ADDED|CódigoDeÁrea CID ADICIONADO| +AREACODE CID NOT DELETED|CódigoDeÁrea CID não excluído| +this entry does not exist|esta entrada não existir| +AREACODE CID DELETED|CódigoDeÁrea CID DELETED| +AREACODE CID MODIFIED|CódigoDeÁrea CID MODIFICADO| +Campaign Areacode CID Modify|Modificar Campanha CódigoDeÁrea CID| +CAMPAIGN AREACODE CID LISTINGS|CAMPANHA LISTAS CódigoDeÁrea CID| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Quando ajustado para CódigoDeÁrea você tem a possibilidade de ir para o submenu AC-CID e definir callerids múltiplas a serem utilizados por areacode| +Enable Campaign Areacode CID|Habilitar CódigoDeÁrea Campanha CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Esta configuração permite que a capacidade de definir números específicos de saída callerid para ser usado por campanha. O padrão é 1 para habilitado| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Se a configuração do sistema para CódigoDeÁrea CIDs é habilitado eo cenário de campanha para uso personalizado CallerID é definido como código de área, então você tem a capacidade de definir CIDs CódigoDeÁrea que serão usados ​​quando chamado de saída para ligações nesta campanha específica. Você pode adicionar múltiplas callerIDs por areacode e você pode ativar e desativar cada um deles de tempo real. Se mais do que um callerID é activo para um código de área específica, então o sistema irá usar o callerid que tem sido utilizado o menor número de vezes que hoje em dia. Se não callerIDs são ativos para a areacode então o CallerID campanha ou uma lista de substituição CallerID será usado| +PLLB Grouping|Agrupamento PLLB| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Telefone Entrar Agrupamento de balanceamento de carga, só é permitido se houver vários agentes e servidores de aliases de telefone estão presentes no sistema. Se definido como ONE_SERVER_ONLY vai obrigar todos os agentes para essa campanha para entrar no mesmo servidor. Se definido como CASCATA ele vai agrupar logado agentes no mesmo servidor até PLLB Limitar número Agrupamento de agentes são atingidos, então o próximo agente entrará para o próximo servidor com o menor número de agentes. Se definido como Desativado o padrão de comportamento Telefone Aliases de cada agente encontrar o servidor com o menor número de não-remotos agentes conectados em que será utilizado. O padrão é DISABLED| +PLLB Grouping Limit|PLLB Limite Agrupamento| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Telefone Entrar Carga Limite Agrupamento de balanceamento. Se Agrupamento PLLB está definido para CASCATA essa configuração irá determinar o número de agentes aceitável em cada servidor para esta campanha. O padrão é 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Telefone Entrar Carga Limite Agrupamento de balanceamento. Se Agrupamento PLLB está definido para CASCATA no nível da campanha, em seguida, essa configuração vai determinar o número de agentes aceitável em cada servidor em todas as campanhas. O padrão é 100| +Modify DID RA Extension Overrides|Modificar DID RA Extensão Substitui| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|NAO OVERRIDE ramal remoto agente adicionado| +there is already an entry for this DID with this RA EXTENSION|já existe uma entrada para esta DID com esta extensão RA| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|DID OVERRIDE ramal remoto agente adicionado| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|EXTENSÃO QUE AGENTE REMOTO OVERRIDE não excluído| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|EXTENSÃO QUE AGENTE REMOTO OVERRIDE MODIFICADO| +MODIFY THIS DID|MODIFICAR ESTE DID| +Enable Remote Agent Extension Overrides|Ativar substituições extensão remota do Agente| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Esta configuração permite DIDs ter substituições de extensão para agente remoto encaminhado chama através de in-grupos. O padrão é 0 para deficientes físicos| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|Substituições AGENTE REMOTO extensão para esse DID| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|Remote Agent Substituir LISTAS DE EXTENSÃO| +DID Remote Agent Extension Overrides|DID substituições extensão remota do Agente| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Esta seção permite que você ative DIDs ter substituições de extensão para agente remoto encaminhado chama através de in-grupos. O Início do usuário deve ser um usuário válido Iniciar Remote Agent ou se você quer a extensão Substituir entrada de trabalhar para todas as chamadas, então você pode usar --- todos --- no campo Iniciar do usuário. Se houver várias entradas para o mesmo usuário e DID Iniciar, em seguida, as entradas de ativos será usado em um método round robin| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|VER QUE AGENTE substituições REMOTO extensão para esse DID| +THERE ARE|HÁ| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID substituições AGENTE ramal remoto para este agente REMOTO| +Action Transfer CID|Transferência de Ação CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Usado para soltar, após o expediente e nenhum agente-fila não-ações. Este é o número de identificação do chamador que a chamada usa antes de ser transferido para extensões, mensagens, correio de voz ou menus de atendimento. Você pode usar CLIENTE neste campo a ser usado o número de telefone do cliente, ou Campanha para usar a primeira campanha permitiu número identificador de chamadas. O padrão é CLIENTE| +After Hours Call Menu|After Hours chamada do menu| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Se After Hours Ação é definida como CALLMENU, a chamada será enviada para este menu de chamada se ele entra no exterior no grupo do regime de tempo de chamada definido para o grupo em-| +Drop Call Menu|Largar menu de chamada| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Se a Ação Gota é definida como CALLMENU, a chamada será enviada para este menu chamada se atingir Segundos chamada gota| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|Personalizado DID Campos - Estes cinco campos podem ser usados ​​para diversos fins, principalmente relativas à programação personalizada e relatórios| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|Se definido como Y_WITH_AMD mesmo atendedor chamadas mensagens detectados serão registrados| +Log Field|Entrar Campo| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Se a opção Registrar Pressione a tecla estiver ativada, essa configuração opcional pode permitir que a resposta a ser armazenado neste campo lista| +Default is NONE for disabled|O padrão é NONE para deficientes físicos| +Call Count Limit|Contagem contas Limite| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Isso impõe um limite no número de tentativas de chamadas para os terminais marcados nesta campanha. A liderança pode ultrapassar esse limite se ligeiramente reciclagem de chumbo ou Auto-Alt-discagem está ativado. O padrão é 0 para sem limite| +Call Count Target|Contagem contas Alvo| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Esta opção só é usada para fins de relatório e não tem efeito em ligações discadas. O padrão é 3| +Enable Expanded List Stats|Habilitar Estatísticas lista extensa| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Esta configuração permite que duas colunas adicionais a serem exibidos em mais da lista de tabelas de estado de degradação sobre a modificação lista de páginas e de modificação de campanha. A penetração é definido como a percentagem de ligações que são iguais ou superiores ao limite de contagem campanha de chamadas e ou o estado é marcado como concluído. O padrão é 1 para habilitado| +Report Option|Opção Relatório| +This option allows this specific shift to show up in selected reports that support this option|Esta opção permite que essa mudança específica para aparecer nos relatórios selecionados que suportam esta opção| +There are|Existem| +completed leads in those lists|ligações concluídas nessas listas| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|A opção VIEW_PRESET simplesmente abrir o quadro de transferência e do quadro pré-| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|CONTACTOS é uma opção apenas se contact_information está habilitado em seu sistema, que é um recurso personalizado| +Preset Contact Search|Contato Busca predefinido| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Se o usuário estiver conectado em uma campanha que tem Presets de transferência definida como CONTACTOS, essa configuração pode desativar contato procurando por este único usuário. O padrão é NOT_ACTIVE que vão usar o que o cenário de campanha é| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|A opção VIEW_CONTACTS irá abrir uma janela de busca de contatos, isto só irá funcionar se Presets Enable está configurada para CONTACTOS| +Contacts Enabled|Contactos Habilitado| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Esta configuração permite que os contatos sub-seção de administração que permite que um gerente para adicionar modificar ou excluir contatos no sistema que podem ser usados ​​como parte de uma transferência personalizado em uma campanha onde um agente pode procurar contactos por Nome Sobrenome ou escritório número e, em seguida, selecione um dos muitos números associados a esse contato. Este recurso é freqüentemente utilizado pelos operadores ou em funções de telefonistas, onde o usuário teria de transferir uma chamada para um telefone não-agente. O padrão é 0 para deficientes físicos| +CONTACTS LIST|LISTA DE CONTATOS| +Add A Contact|Adicionar um contato| +ADD NEW CONTACT|Adicionar novo contato| +ADDING NEW CONTACT|ADICIONAR CONTATO NOVO| +MODIFY CONTACT|MODIFICAR CONTATO| +CONTACT NOT ADDED|CONTATO NÃO ADICIONADO| +there is already a contact in the system with this name and number|já existe um contato no sistema com este nome e número| +CONTACT ADDED|Contato adicionado| +DELETE THIS CONTACT|Excluir este contato| +Click here to see Admin changes to this contact|Clique aqui para ver as mudanças de administração para este contato| +DELETE CONTACT|Excluir contato| +CONTACT NOT DELETED|CONTATO não excluído| +CONTACT DELETION CONFIRMATION|CONTATO CONFIRMAÇÃO ELIMINAÇÃO| +Office Number|Número de escritório| +Cell Number|O número de células| +Other Number|Outro número| +CONTACT NOT MODIFIED|CONTATO NÃO MODIFICADA| +Scheduled Callbacks Hours Block|Programado Callbacks Bloco Horas| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Esta opção permite que você restringir um callback USERONLY agendado seja exibido na lista de chamada de retorno agente até X horas depois de ter sido definido. O padrão é 0 para nenhum bloco| +Scheduled Callbacks Calltime Block|Callbacks agendadas Bloco Calltime| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Esta opção, se habilitado irá impedir o retorno agendado na lista de chamada de retorno do agente de que está sendo chamado se estiver fora do calltime prevista para a campanha. O padrão é DISABLED| +Modify Same User Level|Modificar o nível mesmo usuário| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Esta definição aplica-se apenas ao nível 9 usuários. Se ativado ele permite que o usuário 9 nível para modificar as suas próprias definições, bem como outras de nível 9 usuários. O padrão é 1 para habilitado| +Admin Hide Lead Data|Administrador Ocultar dados levam| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Esta definição aplica-se apenas ao nível 7, 8 e 9 usuários. Se ativado ele substitui os dados dos clientes de chumbo nos muitos relatórios e telas do sistema com Xs. O padrão é 0 para deficientes físicos| +Admin Hide Phone Data|Administrador Ocultar dados do telefone| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Esta definição aplica-se apenas ao nível 7, 8 e 9 usuários. Se ativado ele substitui os números de telefone dos clientes nos diversos relatórios e telas do sistema com Xs. As configurações dígitos irão mostrar apenas os dígitos últimos X do número de telefone. O padrão é 0 para deficientes físicos| +Allowed User Groups|Admitidos Grupos de Usuários| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Esta é uma lista selecionável de Grupos de Usuários em que os membros deste grupo de usuário pode visualizar e possivelmente editar. Grupos de usuários podem restringir o acesso a quase todos os aspectos do sistema, a partir de um DID de entrada para caixas de correio de voz para telefones. A - ALL - opção permite que os usuários neste grupo para ver e efetuar login em qualquer registro no sistema se suas permissões de usuário permitem que| +Allowed Call Times|Admitidos Tempos de Ligação| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Esta é uma lista selecionável de Times de chamada para que os membros deste grupo de usuários pode usar em campanhas, em grupos de chamada e menus. A - ALL - opção permite que os usuários neste grupo a usar todos os tempos de chamada no sistema| +All call times in the system|Todos os tempos de chamada do sistema| +You are not allowed to edit your own user group|Você não tem permissão para editar o seu próprio grupo de usuários| +You are not allowed to edit your own user|Você não tem permissão para editar seu próprio usuário| +Admin User Group|Grupo de Usuários do Administrador| +All Admin User Groups|Todos os Grupos de Usuários de Admin| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|Este é o grupo de usuário administrativo para esta campanha, o que permite a visualização de administrador esta campanha, bem como as listas atribuídos a essa campanha para ser restringido por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador com permissões de usuário de campanha do grupo para ver esta campanha| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|Este é o grupo de usuário administrativo para esse grupo de entrada, o que permite a visualização de administrador isso no grupo restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador para visualizar esta em grupo| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|Este é o grupo de usuário administrativo para este fez, isso permite a visualização de administração deste ter restringido por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário administrador para visualizar este fez| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|Este é o grupo de usuário administrativo para esse registro, o que permite a visualização de administrador deste recoird restrito por grupo de usuários. O padrão é - ALL - que permite a qualquer usuário admin para ver este registro| +User Start for this remote agent does not exist|Iniciar usuário para este agente remoto não existe| +ADMIN GROUP|GRUPO ADMIN| +Max Calls Method|Max chama o método| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Esta opção pode permitir que o máximo recurso de chamadas simultâneas para esta no grupo. Se definido como TOTAL, então o número total de chamadas que estão sendo manipulados pelos agentes e em fila neste em grupo não será permitido exceder a Max Chama Contar o número de linhas como definido abaixo. Se definido como IN_QUEUE, então se o número de chamadas em fila de espera para os agentes não será permitido exceder a Max Chama Conte, não importa quantas chamadas são com agentes para isso no grupo. O padrão é DISABLED| +Max Calls Count|Max chama Conte| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Esta opção deve ser definida maior que 0 se você quiser usar o recurso do método Max Chama. O padrão é 0| +Max Calls Action|Max chama Ação| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|Esta é a ação a ser tomada se o Max chama o método é habilitado eo número de chamadas exceder o que está definido acima, na Max Chama Conte configuração. As chamadas superiores a esse montante será enviado para tanto o GOTA ação, a ação ou a ação AfterHours NO_AGENT_NO_QUEUE e será registrado como um estado MAXCAL com uma razão hangup MAXCALLS. O padrão é NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Se um método é usado com CIDLOOKUP ALT, ele irá procurar o campo alt_phone para o número de telefone, se nenhuma correspondência for encontrada para o número de telefone principal. Se um método é usado com CIDLOOKUP ADDR3, ele irá procurar o campo Endereço3 para o número de telefone, se nenhuma correspondência for encontrada para o número de telefone principal e, opcionalmente, o campo alt_phone| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Outro campo nesta secção é grau, o que permite a campaign_grade_random próximo agente Chamada definindo a ser usado. Esta configuração grau irá aumentar ou diminuir a probabilidade de que o agente vai receber a chamada| +gives a higher probability of getting a call to the higher graded agents|dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados| +gives a higher probability of getting a call to the higher graded agents by in-group|dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados por em grupo| +gives a higher probability of getting a call to the higher graded agents by campaign|dá uma maior probabilidade de obter uma chamada para os agentes de maior classificados por campanha| +Day call count for this in-group|Contagem de dias chamado para esse grupo em| +Day call count for this campaign|Dia contagem chamada para esta campanha| +SUMMARY STATS|STATS RESUMO| +Daily Maximum Stats|Máxima diária Stats| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Estas são as estatísticas que são geradas pelo sistema a cada dia durante todo o dia até que o relógio de ponto final do dia, como é definido nas configurações do sistema. Estes números são gerados a partir dos registos dentro do sistema para permitir a exibição muito mais rápido. As estatísticas estão incluídos são - Total de chamadas, Agentes máximo, máximo de chamadas de entrada, Máximo chamadas de saída| +Add or Remove In-Group Selected For Active Users in This User Group|Adicionar ou Remover No Grupo-selecionado para usuários ativos no Este Grupo de Usuários| +Maximum System Stats Reports|Máxima do sistema Relatórios Estatísticas| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Estas estatísticas são totais que são armazenados em cache ao longo de cada dia em tempo real através de processos de back-end. Para chamadas de entrada, as chamadas totais por in-grupo são calculadas para cada chamada que entra no processo que calcula. Para a contagem de todo o sistema, os totais são gerados a partir de entradas de registro, bem como outros totais em grupo e da campanha. Esses totais podem não somar devido às configurações que você tem em seu sistema, bem como quando a chamada é desligada| +Hopper VLC Dup Check|Hopper VLC Dup Confira| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Definindo-a para Y irá resultar em todas as pistas que está sendo inserido dentro do depósito que está sendo verificado por vendor_lead_code para se certificar de que não há duplicar leva inseridos com o vendor_lead_code mesmo. Isto é muito útil quando o Auto-Alt-Discagem com MULTI_LEAD. O padrão é N| +Inventory Report|Relatório de Inventário| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Se o relatório de inventário está habilitado em seu sistema, esta opção irá determinar se esta lista é incluída no relatório ou não. O padrão é Y para sim| +Report Rank|Relatório Ranking| +This option allows you to rank shifts in selected reports that support this option|Esta opção permite que você classifique as mudanças nos relatórios selecionados que suportam esta opção| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|Você também pode usar um IGNORENOSCROLL variável especial para forçar as barras de rolagem na guia script mesmo se você estiver usando um iframe dentro dela| +Carrier Log Report|Relatório Log transportadora| +ADMINISTRATION: Campaign Multi-Alt-Leads|ADMINISTRAÇÃO: campanha multi-Alt-Leads| +Multi-Lead Auto Alt Dialing Settings Form|Multi-chumbo Auto definições de marcação Alt Formulário| +List Custom Fields|Listar Campos Personalizados| +Select custom template|Selecione modelo personalizado| +template builder|construtor modelo| +Load from Lead File|Carregar de arquivo de chumbo| +Listloader Custom Template Maker|Listloader Criador modelo personalizado| +Custom template to use|Template personalizado para usar| +Create a new template|Criar um novo modelo| +Delete an existing template|Excluir um modelo existente| +Sample file fitting template|Exemplo de arquivo de modelo de montagem| +needed for field assignation||necessário para a atribuição de campo| +Select template to delete|Selecione modelo para excluir| +DELETE TEMPLATE|Apagar Modelo| +New template form|Novo modelo de formulário| +Template ID|ID do modelo| +Template Name|Nome do Modelo| +Template Description|Descrição template| +List ID template will load into|Modelo ID lista será carregado no| +Assign columns to file fields|Atribuir colunas para campos de arquivo| +selecting a different list will reset columns|selecionar uma lista diferente irá repor colunas| +Standard Field|padrão do campo| +Custom Field|campo Personalizado| +Select a list ID from the drop down menu above to show columns|Selecione um ID de lista do menu drop-down acima para mostrar colunas| +SUBMIT TEMPLATE|Enviar modelo| +Click here to see Admin changes to this campaign|Clique aqui para ver as mudanças de administrador para esta campanha| +Click here to see Admin changes to this record|Clique aqui para ver as mudanças de administrador para este registro| +Click here to see Admin changes to this list|Clique aqui para ver as mudanças de administração a esta lista| +Click here to see Admin changes to this script|Clique aqui para ver as mudanças de administração para este script| +Click here to see Admin changes to this filter|Clique aqui para ver as mudanças de administrador para este filtro| +Click here to see Admin changes to this In-Group|Clique aqui para ver as mudanças de administração para esta No Grupo In| +Click here to see Admin changes to this DID|Clique aqui para ver as mudanças de administrador para este DID| +Click here to see Admin changes to this filter phone group|Clique aqui para ver as mudanças de administração para este grupo de telefone filtro| +Click here to see Admin changes to this user group|Clique aqui para ver as mudanças de administração a este grupo de usuários| +Click here to see Admin changes to this remote agent|Clique aqui para ver as mudanças de administração a este agente remoto| +Click here to see Admin changes|Clique aqui para ver as mudanças de administrador| +CAMPAIGNS USING THIS SCRIPT|CAMPANHAS usando este script| +IN-GROUPS USING THIS SCRIPT|EM GRUPOS usando este script| +LIST OVERRIDES USING THIS SCRIPT|Substituições lista usando este script| +ADMIN REPORT OPTIONS|ADMIN Opções de relatório| + Inbound | Entrada | +Audio File|arquivo de áudio| +USING THIS IN-GROUP|USAR ESTE GRUPO IN| +Handle Method|lidar com Método| +Search Method|Método de Pesquisa| +USING THIS CALL MENU|Usando este menu CHAMADA| +DELETE THIS CALL MENU|DELETE THIS MENU CHAMADA| +Click here to see Admin changes to this CALL MENU|Clique aqui para ver as mudanças de administrador para este menu de chamada| diff --git a/agc_2-X/trunk/translations/de_language_admin.txt b/agc_2-X/trunk/translations/de_language_admin.txt index d6db3ecd..50626c9b 100644 --- a/agc_2-X/trunk/translations/de_language_admin.txt +++ b/agc_2-X/trunk/translations/de_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Englisch| @@ -940,7 +972,7 @@ BUILD|BAU| REPORTS|REPORTS| USERS|BENUTZER| CAMPAIGNS| KAMPAGNEN| -LISTS|LISTEN| +#LISTS|LISTEN| SCRIPTS|INDEXE| FILTERS|FILTER| IN-GROUPS|IN-GROUPS| @@ -2065,8 +2097,8 @@ DOWNLOAD|DOWNLOAD| Users|Benutzer| User|User| Reports|Berichte| -OUTBOUND|OUTBOUND| -INBOUND|INBOUND| +#OUTBOUND|OUTBOUND| +#INBOUND|INBOUND| Server Stats and Reports|Server-Statistiken und Berichte| Click here to see a VDAD report for this campaign|Klicken Sie hier, um ein VDAD Bericht für diese Kampagne| Show DIDs|Show DIDS| @@ -2475,3 +2507,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|Xfer-Conf-Nr Override| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Diese fünf Felder ermöglichen Sie den Transfer Conference Anzahl Presets zu überschreiben, wenn das Blei aus dieser Liste. Der Standardwert ist leer| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Diese vier Felder können Sie zwei Arten von Transfer zum Konferenz-und DTMF-Presets. Wenn der Anruf oder die Kampagne geladen wird, wird das Skript vicidial.php zwei Tasten auf der Transfer-Konferenz Rahmen und auto show-bevölkern die Zahl-to-Dial und die Sende-DTMF-Felder, wenn gedrückt. Wenn Sie zulassen möchten Beratenden Transfers, ein Fronter, eine engere, haben die Agenten verwenden Sie die Checkbox BERATENDE, die nicht für Dritte nicht funktioniert-ViciDial beratende Anrufe. Für die nur noch der Agent auf die DFÜ mit Kunden-Taste. Dann kann der Agent nur LEAVE-3way-CALL und weiter zu ihrem nächsten Anruf. Wenn Sie möchten, Blind Transfer von Kunden zu einem VICIDIAL AGI-Skript für die Anmeldung oder einer IVR, dann setzen Sie AXFER der Zahl-to-Dial-Bereich zu ermöglichen. Sie können auch eine benutzerdefinierte Erweiterung nach dem AXFER, zum Beispiel, wenn Sie einen Anruf an einen besonderen IVR Sie auf eine Verlängerung 83900 gesetzt würden Sie AXFER83900 der Zahl in Verkehr gebracht werden-to-Dial-Feld| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Alle Benutzer im System, auch nicht angemeldete Benutzer| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|Die NICHT-logged-in-Agenten Option können alle Benutzer im System angezeigt werden soll, auch wenn sie nicht eingeloggt sind in curently| +Voicemail ID|Voicemail-ID| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Dies ist die Voicemail-Box, die Anrufe in einer in-group AGENTDIRECT wird am Tropfen Zeit gerichtet, wenn die in-group hat die Drop-Methode gesetzt, um Sprachnachrichten und Voicemail-Feld auf AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen| +Record Call|Anruf aufzeichnen| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Diese Option ermöglicht es Ihnen, die Anrufe kommen in diese DID aufgezeichnet werden eingestellt. Y wird die gesamte Anruf aufzeichnen, wird Y_QUEUESTOP das Gespräch mitschneiden, bis der Anruf ist hungup oder tritt in eine Warteschlange in-group, N nimmt nicht auf den Anruf. Die Standardeinstellung ist N.| +Click here to see a list of recordings and calls for this DID|Klicken Sie hier, um zu sehen, eine Liste der Aufnahmen und fordert, dass dies DID| +Ignore List Script Override|Ignorieren-Liste Script Override| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Diese Option ermöglicht es Ihnen, die Liste ID Script Override-Option für Anrufe kommen in dieser In-Group zu ignorieren. Wenn Sie dieses auf Y ignoriert dann sämtliche Listen-ID Script-Einstellungen. Standard ist N| +External Server IP|Externe Server IP| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Diese Einstellung ist, wo Sie eine Server-IP oder andere Maschine Namen, der an Stelle des server_ip verwendet werden können, wenn ein webphone im Agent-Interface stellen können. Damit dies funktioniert, müssen Sie auch die Telefone Eintrag auf den externen Server IP zu verwenden. Standard ist leer| +Set As Webphone|Set As Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|Wenn diese Option auf Y wird versuchen, ein Web-basiertes Handy zu laden, wenn der Agent loggt sich in ihren Agenten-Bildschirm. Die Standardeinstellung ist N.| +Use External Server IP|Mit externen Server IP| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Bei Verwendung als Web-Telefon, können Sie dies auf Y gesetzt, um die Server zu verwenden, um externe IP statt des Server-IP registrieren. Standard ist leer| +Default Webphone|Standard Webphone| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Wenn auf 1 gesetzt, diese Option wird alle neuen Handys erstellt wurden als Webphone Satz zu Y. Standardwert ist 0| +Default External Server IP|Externe Server-IP-Standard| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Wenn auf 1 gesetzt, diese Option wird alle neuen Telefone erstellt haben Mit externen Server IP auf Y gesetzt Standard ist 0| +Webphone URL|Webphone URL| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|Dies ist die URL des webphone, die mit diesem System verwendet werden soll, wenn es in der Rekord-Telefone aktiviert ist, dass ein Agent verwendet. Standard ist leer| +AGENT ACTIVITY FOR THIS TIME PERIOD|Agentenaktivität Für diesen Zeitraum| +these fields are in seconds|Diese Felder werden in Sekunden| +Enable Agent Disposition Logfile|Aktivieren Agenten Disposition Logfile| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Diese Option wird in einer Textdatei auf dem Webserver Logfiles protokollieren jedes Mal, wenn ein Anruf von einem Agenten dispositioned wird. Standard ist 0, deaktiviert| +Agent Call Log View|Agent-Call Log anzeigen| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Diese Option legt fest, ob der Agent in der Lage, ihre Anrufliste für Anrufe über das sich jeder leisten Agent Bildschirm behandelt sehen. Standard ist für keine N-oder ausgeschaltet| +Agent Call Log View Override|Agent-Call Log anzeigen Override| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Diese Einstellung hat Vorrang vor was auch immer der Benutzer User Group hat für Agent Call Log Ansicht eingestellt. Deaktiviert wird, verwenden Sie die Benutzergruppe Einstellung. N wird nicht zulassen, welche die Benutzer Anrufliste. Y ermöglicht, welche die Benutzer Anrufliste. Der Standardwert ist DISABLED| +Custom Dialplan Entry|Benutzerdefinierte Dialplan Eintrag| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Dieses Feld ermöglicht es Ihnen, in allen Dialplan Elemente, die Sie für den Server eingeben, werden die Zeilen in die Standard-Kontext hinzugefügt werden| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Dieses Feld ermöglicht es Ihnen, in allen Dialplan Elemente, die Sie für all die Asterisk-Servern eingeben, werden die Zeilen in die Standard-Kontext hinzugefügt werden| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Diese Option ermöglicht es Ihnen, benutzerdefinierte Dialplan Linien in Anruf-Menüs,-Server und System-Einstellungen eingeben. Standard ist 0 für inaktive| +Custom CallerID|Benutzerdefinierte CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Wenn auf Y gesetzt, ermöglicht Ihnen diese Option, um die security_phrase Feld in der Tabelle vicidial_list verwenden als die CallerID zu senden, bei der Platzierung für jeden spezifischen Blei. Wenn dieses Feld hat keine CID es dann in die Kampagne CallerID umrissen sind, sollen stattdessen verwendet werden. Diese Option deaktiviert die Liste CallerID überschreiben, wenn es eine CID in der security_phrase Feld. Standard ist N| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID wird die Custom CID, die im Bereich der security_phrase vicidial_list Tabelle definiert ist für die Leitung verwendet| +Scheduled Callbacks Alert|Geplante Rückrufe Alarm| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Diese Option ermöglicht die Rückrufe Statuszeile im Agent-Interface, rot zu sein, blinken oder blinkt rot, wenn es sich AGENTONLY Rückrufe, die ihre Zeit und das Datum Trigger getroffen haben soll. Der Standardwert ist NONE für Standard-Status-Zeile| +QueueMetrics Login-Out|QueueMetrics Login-Out| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Diese Option wirkt sich, wie sich jeder leisten wird die An-und Abmeldungen von einem Agenten in der queue_log anmelden. Voreingestellt ist standard auf Standard AGENTLOGIN AGENTLOGOFF verwenden, wird Rückruf nutzen AGENTCALLBACKLOGIN und AGENTCALLBACKLOGOFF dass QM wird anders parsen| +Enable CallCard|Aktivieren CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Diese Einstellung aktiviert die CallCard Features mit sich jeder leisten, damit für Anrufer Pin-Nummern und card_ids, die ein Gleichgewicht von Minuten und die Salden können Agenten Gesprächszeit auf Kundenanrufe in-Gruppen abgezogen haben haben zu verwenden. Standard ist 0 für Behinderte| +CallCard Access|CallCard Zugang| +Agent Transfer Options|Agent-Transfer-Optionen| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Mit diesen Optionen können für die Sperrung von bestimmten Tasten in der Transfer Conference Abschnitt des Agent-Schnittstelle. Die Standardeinstellung ist J für Ja oder aktiviert| +Agent Allow Park Customer Dial Xfer|Agenten erlauben Park Kunden Dial Xfer| +Agent Allow Dial With Customer Xfer|Agenten ermöglichen Zifferblatt mit Kunden Xfer| +Agent Allow Blind Xfer|Agenten die blinde Xfer| +Agent Allow Voicemail Message Xfer|Agenten ermöglichen Voicemail-Nachricht Xfer| +Agent Allow Dial Override Xfer|Erlauben Sie Dial-Agent-Override Xfer| +Agent Allow Consultative Xfer|Agenten ermöglichen Beratenden Xfer| +Agent Fullscreen|Agent-Vollbild| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Diese Option wenn der Wert auf Y wird die Höhe und Breite der sich jeder leisten Agent Bildschirm, um die Größe des Browser-Fenster ohne Berücksichtigung des Agenten anzeigen gesetzt ist, ruft in Queue-Ansicht oder Anrufe in Session-Ansicht. Standard ist für keine N-oder ausgeschaltet| +Add Extension Group|Erweiterung hinzufügen Gruppe| +New Group Extension Addition|Neue Gruppe Erweiterung Zusatz| +Modify Extension Group|Ändern Verlängerung Gruppe| +Delete Extension Group|Löschen Verlängerung Gruppe| +Extension Groups|Erweiterung Gruppen| +Add Extension Group Entry|Erweiterung hinzufügen Gruppeneintrag| +Extension Group|Erweiterungs-Gruppe| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Dieses erforderliche Feld ist, wo Sie die Gruppen-ID, die Sie wollen, dass diese Erweiterung in Kraft gesetzt werden. Keine Leerzeichen oder Sonderzeichen außer Unterstrich Buchstaben und Zahlen| +Extension:|Extension:| +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Dieses Feld ist erforderlich, wo Sie die Dialplan-Erweiterung stellen, dass Sie wollen, dass der Remote-Agent ruft an, um für diese Nebenstelle Gruppe Eintrag gesendet werden| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|In diesem Feld können Sie die Einträge, die Verlängerung Gruppe die gleiche Ausdehnung Gruppe teilen Rang. Standard ist 0| +Campaigns Groups|Kampagnen Gruppen| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|In diesem Feld können Sie legte eine Liste von Kampagnen-IDs und Gruppen-IDs oder Inbound, dass Sie die Nutzung der Erweiterung für die Gruppe zu beschränken. Liste werden getrennt durch Rohrleitungen und eine Leitung am Anfang und Ende des Strings| +EXTENSION GROUP ENTRY NOT ADDED|Nebenstellengruppe Eintrag nicht hinzugefügt| +there is already an extension group entry with these values|Existiert bereits ein Eintrag Verlängerung Gruppe mit diesen Werten| +EXTENSION GROUP ENTRY ADDED|Nebenstellengruppe Eintrag hinzugefügt| +MODIFY AN EXTENSION GROUP ENTRY|Ändern eines EXTENSION Gruppeneintrag| +Click here to see Admin chages to this extension group entry|Klicken Sie hier um Admin chages zu dieser Erweiterung finden Sie unter group-Eintrag| +DELETE THIS EXTENSION GROUP ENTRY|DELETE THIS ENTRY Nebenstellengruppe| +Call Count Today|Anzahl der Anrufe Heute| +Last Call Time|Last Call Time| +Last Call ID|Last Call ID| +EXTENSION GROUP ENTRY NOT MODIFIED|Nebenstellengruppe Eintrag nicht MODIFIZIERTE| +EXTENSION GROUP ENTRY MODIFIED|Nebenstellengruppe Eintrag dahingehend angepasst| +EXTENSION GROUP ENTRY NOT DELETED|Nebenstellengruppe Eintrag nicht gelöscht| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|VERLÄNGERUNG Gruppeneintrag Löschbestätigung| +Click here to delete extension group entry|Klicken Sie hier, um die Verlängerung Gruppe Eintrag löschen| +EXTENSION GROUP ENTRY DELETION COMPLETED|Nebenstellengruppe Eintragslöschnachricht ABGESCHLOSSEN| +EXTENSION GROUP LISTINGS|VERLÄNGERUNG Group Einträge| +Extension Group|Erweiterungs-Gruppe| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Wenn etwas anderes als NONE oder leer dies wird die externe Feld Erweiterung außer Kraft setzen und nutzen den Extension-Gruppe Einträge, die die gleiche Ausdehnung Gruppen-ID eingestellt haben. Der Standardwert ist NONE deaktiviert| +Click here to see agents logged in to this inbound group|Klicken Sie hier, um die angemeldeten Agenten in dieser Gruppe sehen Inbound| +Agent Choose Blended|Wählen Sie Blended-Agent| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Diese Option, wenn dieser Wert auf 1 kann der Anwender wählen, ob der Agent hat ihre Kampagne zu Blended-Set oder nicht, und wenn nicht, dann wird die Standard-Einstellung wird gemischt verwendet werden. Standard ist 1 für aktivierte| +Click here to see a log of the uploads to the audio store|Klicken Sie hier um ein Protokoll der Uploads auf den Audio-Speicher zu sehen| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Diese Option, wenn der Wert auf 0 wird nicht in der CALLSTATUS die Einreise in queue_log, wenn ein Agent einen Anruf Dispositionen. Standard ist 1 für aktivierte| +QM CallStatus Override|QM CallStatus Override| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Wenn QueueMetrics Integration in den Systemeinstellungen aktiviert ist, wird diese Einstellung erlauben das vorrangige der System-Einstellungen die Einstellung für CallStatus queue_log Einträge. Der Standardwert ist DISABLED, welche den System-Einstellung verwenden| +Extension Append CID|Erweiterung anhängen CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Wenn diese Option aktiviert, werden die Anrufe von dieser Kampagne platziert haben einen Raum und die Durchwahl des Agenten an das Ende des CallerID Name für den Anruf, bevor es an den Agenten gesendet wird. Standard ist für behinderte N| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Wenn aktiviert, kommen die Anrufe in ins In-Gruppe wird eine Raum und die Durchwahl des Mittels an das Ende des CallerID Namen für den Anruf, bevor es an den Agenten gesendet wird. Standard ist für behinderte N| +Scheduled Callbacks Count|Geplante Rückrufe Count| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Mit dieser Option können Sie festlegen, ob nur LIVE-Rückrufe, benutzerfreundliche nur geplante Rückrufe, die ihre Trigger Datum und Uhrzeit, oder ALL_ACTIVE Rückrufe getroffen haben, benutzerfreundliche nur Rückrufe, die aktiv sind in der Anlage sowie LIVE-Rückrufe sollten be3 int zählte er Agent-Callback-Benachrichtigung Abschnitt über die Agenten-Bildschirm. Die Standardeinstellung ist ALL_ACTIVE| +Realtime Block User Info|Realtime Block User Info| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Diese Einstellung, wenn es auf 1 gesetzt werden Benutzer und Informationen vor dem Bahnhof in der Real-time-Bericht angezeigt zu blockieren. Standard ist 0 für Behinderte| +Manual Dial Override|Manuelle Wahl Override| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|Die Einstellung kann der Benutzer überschreiben die Einstellung für die manuelle Einwahl Möglichkeit für Agenten, wenn sie in dieser Kampagne werden protokolliert. NONE wird die Benutzer-Einstellung folgen, ALLOW_ALL wird jedes Mittel in dieser Kampagne auf manuelle Einwahl Anrufe getätigt werden protokolliert zulassen, wird DISABLE_ALL niemandem erlauben, in diese Kampagne angemeldet, um manuelle Einwahl von Anrufen. Der Standardwert ist NONE| +Blind Monitor Warning|Blinden-Monitor Warnung| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Diese Option aktiviert wird, wenn wir das Mittel in verschiedene optionale Möglichkeiten wissen, ob sie blind zu sein von jemandem überwacht werden. DISABLED bedeutet diese Funktion nicht aktiv ist, wird nur eingeblendet ALERT eine Warnung auf dem Bildschirm Agent, NOTICE wird eine Notiz, die sich bleibt auf dem Agent-Bildschirm, solange Theyâ Re überwachten veröffentlichen, wird der Ton spielen Sie den Dateinamen unten definiert, wenn ein Agent beginnt, überwacht werden und die anderen Optionen sind combibnations der oben genannten Optionen. Der Standardwert ist DISABLED| +Blind Monitor Notice|Blinden-Monitor und Datenschutz| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Das ist die Botschaft, die auf dem Bildschirm zeigen Agent wird, während sie überwacht wird, wenn die Bekanntmachung Option ausgewählt ist. Die Standardeinstellung ist| +Blind Monitor Filename|Blinden-Monitor Dateiname| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Dies ist der Audio-Datei, in der Agenten-Session zu Beginn der Überwachung jemand blinde ihnen zu spielen. Diese Aufforderung wird für jeden in der Sitzung mit dem Kunden, wenn eine vorhanden ist, gespielt werden. Standard ist leer| +Uniqueid Status Display|UniqueId Statusanzeige| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Wenn aktiviert, wenn ein Agent einen Anruf erhält durch diese In-Group werden sie sehen den uniqueid des Anrufs hinzugefügt, um die Status-Zeile in ihrer Agent-Interface. Die Option Präfix wird das Präfix definiert Schlag auf den Beginn des uniqueid in der Anzeige. Der Standardwert ist DISABLED. Wenn es bereits eine UniqueId auf einen Anruf Betreten dieser in-Gruppe definiert, wird die ursprüngliche uniqueid wird angezeigt| +Uniqueid Status Prefix|UniqueId Status-Prefix| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Wenn PREFIX Option ausgewählt wird dann oben das ist der Wert dieses Präfix. Standard ist leer| +Default Codecs|Standard-Codecs| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|Sie können eine durch Kommas getrennte Liste von Codecs als die Standard-Codecs für alle Systeme festgelegt werden. Optionen für Codecs beinhalten ulaw, alaw, GSM, G729, Speex, G722, G723, G726, ilbc, ... Standard ist leer| +Allowed Codecs|Erlaubt Codecs| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|Sie können eine durch Kommas getrennte Liste von Codecs als die Standard-Codecs für dieses Telefon eingestellt werden. Optionen für Codecs beinhalten ulaw, alaw, GSM, G729, Speex, G722, G723, G726, ilbc, ... Einige dieser Codecs ist möglicherweise nicht auf Ihrem System zur Verfügung, wie G729 oder G726. Wenn das Feld leer ist, dann werden die System-Standard-Codecs oder das Telefon über diesem Eintrag wird man für den zulässigen Codecs verwendet werden. Standard ist leer| +Allowed Codecs With Template|Erlaubt Codecs mit Schablone| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Wenn diese Option auf 1 umfassen auch die Codecs oben definiert, wenn eine conf-Datei Vorlage verwendet wird. Standard ist 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Wenn die Option preserve verwendet wird und der Anruf wird zu einem zweiten Agenten, der uniqueid gesendet und Präfix zu dem ersten Agenten angezeigt wird auch an den zweiten Agenten angezeigt werden| +Custom Fields Modify|Benutzerdefinierte Felder bearbeiten| +This option if set to 1 allows the user to modify custom list fields|Diese Option, wenn auf 1 gesetzt, kann der Anwender benutzerdefinierte Liste Felder ändern| +ERROR: Custom Fields are not active on this system|FEHLER: Custom Fields sind auf diesem System nicht aktiv| +Lists Custom Field|Listet Custom Field| +Field Label|Feldbezeichnung| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Dies ist die Datenbank-Feld-ID für dieses Feld. Dies muss eine eindeutige Kennung innerhalb der benutzerdefinierten Felder für diese Liste sein. Verwenden Sie keine Leer-oder Satzzeichen für dieses Feld. max 50 Zeichen, mindestens 2 Zeichen| +Field Name|Feldname| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|Dies ist der Name des Feldes, wie es wird ein Mittel über die Schnittstelle angezeigt. Sie können die Räume in diesem Bereich, aber keine Satzzeichen, maximal 50 Zeichen und mindestens 2 Zeichen| +Field Description|Feld Beschreibung| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|Die Beschreibung dieses Feldes, wie es wird in der Administrationsoberfläche angezeigt. Dies ist ein optionales Feld mit einem Maximum von 100 Zeichen| +Field Rank|Feld Rang| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|Die Reihenfolge, in der diese Felder an den Agenten von der niedrigsten bis zur höchsten auf der Oberseite an der Unterseite wird angezeigt| +Field Help|Feldhilfe| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Optionales Feld, wenn Sie es ausfüllen, wird der Agent in der Lage sein, diesen Text sehen, wenn sie klicken Sie auf einen Hilfe-Link neben dem Feld in ihren Agenten-Interface| +Field Type|Feldtyp| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Diese Option definiert den Typ des Feldes, der angezeigt wird. TEXT ist eine Standard-Single-Line-Anmeldeformular, Bereich A mehrzeiligen Textfeld ist, wählen Sie eine Single-Auswahl im Pulldown-Menü ist, MULTI ein Multiple-Select-Box ist, ist Radio eine Liste von Radio-Buttons, wo kann nur eine Option ausgewählt werden, CheckBox eine Liste von Checkboxen, in denen mehrere Optionen ausgewählt werden können, ist ein DATE Jahr Monat Tag calendar popup wo der Agent kann wählen das Datum und die Zeit ist eine Zeit Auswahlbox. Die Standardeinstellung ist Text. Für die SELECT-, Multi, und Checkboxes Optionen müssen Sie die Option Werte unterhalb definieren im Bereich Feld Optionen| +Field Options|Feldoptionen| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Für die SELECT-, Multi, und Checkboxes Feldtypen, müssen Sie die Option Werte in diesem Feld zu definieren. Sie müssen eine Liste von durch Komma getrennt Option Beschriftung und Option Text hier setzen mit jeder Option ein in einer eigenen Zeile. Der erste Wert sollte keine Leerzeichen enthält, und es werden keine Werte sollten keine Satzzeichen haben. Zum Beispiel - electric_meter, Stromzähler| +Field Size|Feldgröße| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Diese Einstellung wird verschiedene Dinge bedeuten je nachdem, was das Feld Typ ist. Für Textfelder, die Größe ist die Anzahl der Zeichen, die auf dem Gebiet zeigen wird. Für AREA Felder, die Größe ist die Breite des Textfelds in Zeichen. Für MULTI Felder, legt diese Einstellung die Anzahl der Optionen, um im Multi Select-Liste angezeigt werden. Für SELECT, wird Radio, Checkbox, DATE und TIME diese Einstellung ignoriert| +Field Max|Feld-Max| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Diese Einstellung wird verschiedene Dinge bedeuten je nachdem, was das Feld Typ ist. Für TEXT, kein versteckter und readonly-Feldern, die Größe ist die maximale Anzahl der Zeichen, die in dem Gebiet zulässig sind. Für AREA Felder definiert dieses Feld die Anzahl der Zeilen des Textes sichtbar in das Textfeld ein. Für MULTI, SELECT, Radio, Checkbox, DATE und TIME wird diese Einstellung ignoriert| +Field Cost|Feld Kostenstelle| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Diese Nur-Lese-Feld Ihnen sagt, was die Kosten für dieses Feld in der Tabelle benutzerdefiniertes Feld ist für diese Liste. Es gibt keine feste Grenze für die Anzahl der benutzerdefinierten Felder, die Sie in einer Liste haben kann, aber die Summe der Kosten aller Felder für die Liste muss unter 65000. Diese Regel erlaubt es seit Hunderten von Feldern, aber wenn Sie mehrere Textfelder, die hunderte oder tausende von Zeichen lang sind dann können Sie angeben, diese Grenze schnell getroffen. Wenn Sie so viel Text in einem Feld benötigen, sollten Sie wählen Sie einen Bereich geben, die anders gelagert und verwenden Sie nicht so viel Tabellenbereich| +Field Required|Feld erforderlich| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Wenn auf Y gesetzt, wird dieses Feld zwingen, den Agenten, um Text einzugeben oder wählen Sie eine Option für dieses Feld. Standard ist N| +Field Default|Feld-Standard| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Dieses optionale Feld können Sie festlegen, welchen Wert Sie auf ein Feld zuweisen, wenn nichts in dieses Feld geladen wird. Der Standardwert ist NULL, die die Standard-Funktion deaktiviert| +MODIFY FIELDS|Ändern von Feldern| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|LISTE DIASHOW mit benutzerdefinierten Feldern COUNT| +SUMMARY OF FIELDS|ZUSAMMENFASSUNG DER FELDER| +ADD A NEW CUSTOM FIELD FOR THIS LIST|ADD ein neues benutzerdefiniertes Feld für diese Liste| +ERROR: Field does not exist|ERROR: Feld existiert nicht| +ERROR: Table does not exist|FEHLER: Tabelle ist nicht vorhanden| +ERROR: Field already exists for this list|FEHLER: existiert bereits für diese Liste| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|KLICKEN SIE HIER, um das Löschen dieses Feld CONFIRM| +THIS CUSTOM FIELD HAS BEEN DELETED|R dieses Feld wurde gelöscht| +Records in this custom table|Einträge in dieser Tabelle benutzerdefinierte| +EXAMPLE OF CUSTOM FORM|Beispiel einer eigenen FORM| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Für DATE-Feld-Typen, wird der Standard immer auf heute gestellt, es sei denn eine Zahl im In diesem Fall wird das Datum, dass viele Tage plus oder minus heute gestellt wird. Für ZEIT Feldtypen, wird der Standard immer auf dem aktuellen Server Uhrzeit einzustellen, wenn eine Zahl im in diesem Fall die Zeit wird genommen wird, dass viele Minuten plus oder minus aktuelle Zeit| +MODIFY EXISTING FIELDS|Ändern von vorhandenen FIELDS| +Field Name Position|Feldname Position| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|Wenn auf links eingestellt, wird dieses Feld Name auf der linken Seite des Feldes erscheinen, wenn auf den Namen des Feldes TOP dauert bis die gesamte Zeile erscheinen und über dem Feld. Standard ist LEFT| +Option Position|Option Position| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Für Checkbox und Radio Feldtypen nur, wenn auf Horizontal festgelegt die Optionen auf der gleichen Linie möglicherweise Wickeln auf die Zeile unter, wenn es viele Optionen stehen scheinen. Wenn auf Vertical festgelegt wird es nur eine Option pro Zeile sein. Die Standardeinstellung ist HORIZONTAL| +Hold Time Option Minimum|Hold Time Option in einer Mindestharmonisierung| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Wenn Hold Time Option aktiviert, ist dies die minimale Anzahl von Sekunden der Anruf warten muss, bevor es mit der Haltezeit Option vorgestellt werden. Die Haltezeit Option wird sofort zu diesem Zeitpunkt vorgelegt werden, wenn der geschätzte Haltezeit ist größer als die Haltezeit Option Sekunden-Wert. Standardwert ist 0 Sekunden| +ADDING COPIED CARRIER|HINZUFÜGEN KOPIERT CARRIER| +ADD COPIED CARRIER|ADD KOPIERT CARRIER| +Source Carrier|Quelle Carrier-| +COPIED CARRIER ADDED|KOPIERT Träger zugesetzt| +Copy A Carrier|Kopieren Sie ein Carrier-| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Feld OrderIf mehr als einem Feld hat denselben Rang, werden sie auf der gleichen Zeile platziert werden und sie werden, um durch diesen Wert vom niedrigsten zum höchsten platziert werden, von links nach rechts| +Copy Fields to Another List|Kopieren Sie Felder in eine andere Liste| +List ID to Copy Fields to|Listen-ID, um Felder zu kopieren| +List ID to Copy Fields From|Listen-ID, um Felder aus kopieren| +Copy Option|Option Kopieren| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Beim Kopieren von Felddefinitionen aus einer Liste in eine andere, haben Sie einige Optionen für den Kopiervorgang zu Werke. APPEND werden die Felder, die nicht vorhanden sind, in der Zielliste hinzufügen, wenn es passende Feldbeschriftungen jene Wille blieb unberührt, werden keine benutzerdefinierten Feld Daten gelöscht oder verändert werden mit dieser Option. UPDATE werden die gemeinsamen field_label Feldern in der Zielliste zu den Feld-Definitionen von der Quelle Liste zu aktualisieren. benutzerdefiniertes Feld Daten können verändert werden oder verloren gehen mit dieser Option. REPLACE werden alle vorhandenen benutzerdefinierten Felder in der Ziel-Liste zu entfernen und ersetzen sie durch den benutzerdefinierten Feldern aus der Quelle-Liste, werden alle Daten gelöscht benutzerdefiniertes Feld mit dieser Option werden| +ERROR: Source list has no custom fields|Fehler: Quelle-Liste hat keine benutzerdefinierten Felder| +SUCCESS: Custom Field Added|ERFOLG: Custom Field Hinzugefügt| +SUCCESS: Custom Field Modified|ERFOLG: Custom Field Geändert| +SUCCESS: Custom Field Deleted|ERFOLG: Custom Field Deleted| +Copy List Custom Fields|Kopieren Liste Custom Fields| +ERROR: You cannot copy fields to the same list|Fehler: Sie können nicht kopiert werden Felder in die gleiche Liste| +DISPLAY will display only and not allow for modification by the agent|DISPLAY wird nur nicht angezeigt, und ermöglichen eine Änderung durch den Agenten| +Hold Time Option Callmenu|Hold Time Option Callmenu| +Hold Time Option Press Filename|Hold Time Option Drücken Dateiname| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Wenn Hold Time Option zum CALL_MENU gesetzt wird, ist dies das Menü Anruf, dass der Aufruf gesendet werden, wenn der geschätzte Haltezeit übersteigt die Haltezeit Option Sekunden| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Wenn Hold Time Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die gespielt wird, wenn der geschätzte Haltezeit übersteigt die Haltezeit Option Sekunden, um den Kunden die Möglichkeit, ein auf ihrem Handy drücken, um das ausgewählte Hold Time laufen Drücken Sie Option. Es ist sehr wichtig, dass diese Audio-Datei 10 Sekunden oder weniger ist oder wird es Probleme geben. Standard ist zu-sein-als-back| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Wenn einer der PRESS_ Optionen gewählt wird, wird es spielen die Presse Dateiname unten definiert und geben dem Kunden die Möglichkeit, ein auf ihrem Handy drücken, um die Warteschlange zu verlassen, und führen Sie die gewählte Option| +Hold Time Option After Press Filename|Hold Time Option Nach dem Drücken Dateiname| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Wenn Hold Time Option auf eine der Optionen oder PRESS_ CALLERID_CALLBACK gesetzt wird, ist dies der Dateiname Eingabeaufforderung, die spielten, nachdem der Kunde 1 gedrückt wurde oder wird der Anruf an die Callback-Liste hinzugefügt| +Inbound Queue No Dial|Eingangswarteschlange No Dial| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Diese Funktion, wenn auf ENABLED einstellen können Sie ausgehende automatische Einwahl dieser Kampagne zu verhindern, wenn es irgendwelche eingehende Anrufe in der Warteschlange, die Teil der zulässigen eingehenden in dieser Kampagne festgelegt sind. Wenn Sie dieses auf ALL_SERVERS ändert den Algorithmus, um alle eingehenden Anrufe als aktive Anrufe auf diesem Server zu berechnen, auch wenn sie auf einem anderen Server, die die Chance auf unnötigen ausgehenden Anrufen reduziert werden, wenn Sie Anrufe kommen in auf einem anderen Server haben sollen. Der Standardwert ist DISABLED| +After Hours Filename Override|After Hours Dateiname Override| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|In diesen Feldern können Sie die After Hours Nachricht für eingehende Gruppen außer Kraft setzen, wenn es um etwas eingestellt wird. Standard ist leer| +On Hold Prompt No Block|Hold On Prompt keine Block| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf in die Warteschleife, wo die Eingabeaufforderung zu spielen, um an einen Agenten gehen, wenn man zur Verfügung steht, während die Nachricht abgespielt wird. Während die On Hold Prompt Filename Nachricht an einen Kunden spielt sie können nicht an einen Agenten geschickt werden. Standard ist N| +On Hold Prompt Seconds|Hold On Prompt Sekunden| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Dieses Feld muss auf die Anzahl der Sekunden, die das On Hold Prompt Dateiname spielt für eingestellt werden. Standard ist 10| +Hold Time Option Press No Block|Hold Time Option Presse keine Block| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf, wo die Hold Time Option Dateiname Presse prompt zu spielen, um an einen Agenten zu gehen, wenn einer verfügbar wird, während die Nachricht abgespielt wird. Während die Hold Time Option Drücken Filename Nachricht an einen Kunden spielt sie können nicht an einen Agenten geschickt werden. Standard ist N| +Hold Time Option Press Filename Seconds|Hold Time Option Drücken Dateiname Sekunden| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Dieses Feld muss auf die Anzahl der Sekunden, die Hold Time Option Dateiname spielt für Presse eingestellt werden. Standard ist 10| +CallCard Generate New Numbers|CallCard Generate New Numbers| +Call Menu In-Group Settings|Rufen Sie Menü In-Group-Einstellungen| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Wenn die Fahrtroute eingestellt ist, um Eigengruppe dann gibt es viele Optionen, die Sie setzen, um festzulegen, wie der Aufruf wird in die Warteschlange gesendet werden können. In-Group ist die Inbound-Gruppe, die Sie den Anruf an gehen wollen. Handle-Methode ist, wie Sie wollen den Anruf zu handhabenden| +Click here to see a list of the available handle methods|Klicken Sie hier, um eine Liste der verfügbaren Methoden siehe Griff| +VID Enter Filename|VID Geben Sie Dateiname| +VID ID Number Filename|VID-ID-Nummer Dateiname| +VID Confirm Filename|VID bestätigen Dateiname| +VID Digits|VID Digits| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Suchmethode definiert, wie die Warteschlange wird beim nächsten Agenten zu finden, empfehlen lassen Sie dieses auf LB. ID-Liste ist die Liste, dass die neue Führung in eingesetzt wird, auch wenn die Methode nicht um eine Lookup-Methode und das Blei wird nicht gefunden. Kampagnen-ID ist die Kampagne, um Listen durch, wenn eine der RC-Verfahren verwendet wird, zu suchen. Telefon Code ist die phone_code Feld Eintrag für die Führung, die mit eingefügt wird. VID eingeben, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird Dateiname verwendet wird, ist es die Audio-Aufforderung gespielt, um den Kunden zu bitten, ihre ID eingeben. VID-ID-Nummer Dateiname verwendet wird, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, ist es die Audio-Aufforderung spielte nach Kunde gibt seine ID, so etwas wie Sie eingegeben haben. VID bestätigen Dateiname verwendet wird, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, ist es die Audio-Aufforderung gespielt, um ihre Identifikation zu bestätigen, so etwas wie PRESS 1 bestätigen und 2, um erneut einzugeben. VID Digits wird verwendet, wenn die Methode zu einem der VIDPROMPT Methoden gesetzt wird, wenn es zu einer Reihe ist es die Anzahl der Stellen, die vom Kunden eingegeben werden, wenn für ihre ID aufgefordert werden müssen, wenn sie leer oder X dann das gesetzt wird Kunde muss Nummernzeichen drücken auf ihre Aufnahme ihrer ID beenden| +Admin Web Directory|Admin Web Directory| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Dies ist das Verzeichnis, dass Ihr administation Web-Inhalte, wie admin.php, sind in. Die Standardeinstellung ist sich jeder leisten. Um herauszufinden, Ihre Admin-Web-Verzeichnis, es ist alles, was zwischen dem Domainnamen und der admin.php in der URL auf dieser Seite ist, ohne Anfang und am Ende Schrägstriche| +TTS Voice|TTS-Stimme| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|Hier können Sie die Stimme definieren, die in der TTS-Erzeugung verwendet werden. Die Standardeinstellung ist Allison-8kHz| +Default Field Labels|Standard Feldbezeichner| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Diese 19 Felder können Sie den Namen gesetzt, wie es in der sich jeder leisten Agent-Interface sowie die administrative Führung modify Seite erscheint. Der Standardwert ist leer, was wird die hartcodierte Standardwerte im Agent-Interface verwenden| +Label Title|Label-Titel| +Label First Name|Label-Vorname| +Label Middle Initial|Label Middle Initial| +Label Last Name|Label-Nachname| +Label Address1|Label-Adresse1| +Label Address2|Label-Address2| +Label Address3|Label-Address3| +Label City|Label-Stadt| +Label State|Kennzeichnungsschild| +Label Province|Label-Provinz| +Label Postal Code|Label-PLZ| +Label Vendor Lead Code|Label-Hersteller Blei-Code| +Label Gender|Label-Geschlecht| +Label Phone Number|Label-Telefonnummer| +Label Phone Code|Label-Telefon Code| +Label Alt Phone|Label-Alt-Phone| +Label Security Phrase|Label Security Phrase| +Label Email|Label-E-Mail| +Label Comments|Label-Kommentare| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|Wir empfehlen nicht, die Einstellung eingehende Anrufe an eine höhere Priorität als die Outbound Kampagnen, weil die Leute rufen in zu warten, erwarten, und die Menschen aufgerufen erwarten, für jemanden da zu sein auf dem Handy| +Formerly called Conf File Secret|Früher nannte conf-Datei Geheimnis| +Registration Password|Anmeldung Passwort| +Login Password|Login Passwort| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|Das Passwort für den Benutzer verwendet werden, um telefonisch zu den Web-basierten Client-Anwendungen anmelden. Wichtig ist, ist dies das Passwort nur für den Agenten, Web-Interface Telefon anmelden, um die sip.conf oder iax.conf Kennwort ein, oder geheim zu ändern, für dieses Telefon Gerät, das Sie, um die Registrierung Passwort in das nächste Feld zu ändern müssen| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|Skript wird auch nur anzeigen, aber Sie können Skript-Variablen genau wie im Skripte Funktion nutzen zu können. SCRIPT Felder werden nur angezeigt, auch die Inhalte in den Optionen, und nicht der Feldname wie die Anzeige Typ tut| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|Sie können auch die Standardeinstellungen sich jeder leisten Felder in einem benutzerdefinierten Feld Setup, und Sie werden sehen, wie sie in Rot in der Liste. Diese Felder werden nicht auf die benutzerdefinierte Liste Datenbank-Tabelle hinzugefügt werden, das Agenten-Interface wird stattdessen Verweis auf die Tabelle direkt vicidial_list. Die Etiketten, die Sie verwenden, um die Standardeinstellungen fieds zählen können, sind| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Wenn benutzerdefinierte Liste Felder auf Ihrem System aktiviert sind, bilden die Registerkarte Formular bei der Verbindung eines Anrufs öffnen, um einen Agenten| +Enable Custom List Fields|Aktivieren Sie Benutzerdefinierte Liste Felder| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Diese Einstellung ermöglicht die benutzerdefinierte Liste Felder Feature, das für benutzerdefinierte Datenfelder in der Webschnittstelle auf einer Pro-Liste auf Basis definiert werden und dann müssen die Felder in einer Form vor Registerkarte, um den Agenten in der Agenten-Web-Interface ermöglicht. Standard ist 0 für Behinderte| +CUSTOM FIELDS FOR THIS LEAD|CUSTOM Felder für diesen LEAD| +Slave Database Server|Slave Database Server| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Wenn Sie eine MySQL-Slave-Datenbank-Server haben, dann geben Sie die lokale IP-Adresse für diesen Server hier. Diese Option ist derzeit nur durch die ausgewählten Berichte in der nächsten Option genutzt und hat nichts mit der automatischen Konfiguration von MySQL Master-Slave-Replikation zu tun. Standard ist leer für Behinderte| +Reports to use Slave DB|Berichte auf Slave DB verwenden| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Mit dieser Option können Sie die Berichte, die Sie haben den MySQL-Slave-Datenbank zu verwenden, wie in der oben genannten Option anstelle der Master-Datenbank, die sich jeder leisten Ihre Live-System ausgeführt wird definiert auszuwählen. Sie müssen die die MySQL-Slave-Replikation, bevor Sie diese Option aktivieren können. Standard ist leer für Behinderte| +Custom fields defined for this list|Benutzerdefinierte Felder für diese Liste definiert| +Go to the list modification page for this list|Zur Änderung der Liste Seite für diese Liste| +Estimated Hold Time Option|Geschätzte Hold Time Option| +Hold Time Second Option|Hold Time Zweite Option| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Gleiche wie die erste Option Hold Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 2 zu prüfen. Standardwert ist NONE. Wenn kein erster Hold Time Option gewählt dann ist diese Option nicht angeboten werden| +Hold Time Third Option|Hold Time Third Option| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Gleiche wie die erste Option Hold Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 3 zu überprüfen. Standardwert ist NONE. Wenn kein Sekunden Haltezeit Option gewählt dann ist diese Option nicht angeboten werden| +Wait Time Option|Wait Time Option| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Dies ermöglicht Ihnen, den Kunden Möglichkeiten, um die Warteschlange zu verlassen, wenn ihre Wartezeit ist über die Anzahl der Sekunden unten angegeben. Standardwert ist NONE. Wenn einer der PRESS_ Optionen gewählt wird, wird es spielen die Presse Dateiname unten definiert und geben dem Kunden die Möglichkeit, ein auf ihrem Handy drücken, um die Warteschlange zu verlassen, und führen Sie die gewählte Option. Die PRESS_STAY Option wird den Kunden zurück in die Warteschlange zu senden, ohne dabei ihren Platz in der Linie| +Wait Time Second Option|Wartezeit Zweite Option| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Gleiche wie die erste Option Wait Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 2 zu prüfen. Standardwert ist NONE. Wenn keine Wartezeit erste Option gewählt dann ist diese Option nicht angeboten werden| +Wait Time Third Option|Wartezeit Third Option| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Gleiche wie die erste Option Wait Time Feld oben, außer diesem einen wird für den Kunden Drücken der Taste 3 zu überprüfen. Standardwert ist NONE. Wenn keine zweite Wartezeit Option ausgewählt wird dann diese Option nicht angeboten werden| +Wait Time Option Seconds|Wait Time Option Sekunden| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Wenn Wartezeit Option, um alles andere als NONE gesetzt ist, ist dies die Anzahl der Sekunden, dass der Kunde in der Warteschleife gewartet, dass die Wartezeit Optionen auslösen wird. Standardwert ist 120 Sekunden| +Wait Time Option Extension|Wait Time Option Erweiterung| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Wenn Wartezeit Option auf PRESS_EXTEN, ist dies der Dialplan-Erweiterung, dass der Aufruf gesendet werden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt| +Wait Time Option Callmenu|Wait Time Option Callmenu| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Wenn Wartezeit Option zum PRESS_CALLMENU gesetzt wird, ist dies das Menü Anruf, dass der Aufruf gesendet werden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt| +Wait Time Option Voicemail|Wait Time Option Voicemail| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Wenn Wartezeit Option auf PRESS_VMAIL, ist dies der Voicemail-Box, dass der Aufruf, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt wird gesendet. In einem in-group AGENTDIRECT hat die Einstellung dieses AGENTVMAIL wählt der Benutzer Voicemail-ID zu benutzen| +Wait Time Option Transfer In-Group|Wait Time Option Transfer-In-Group| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Wenn Wartezeit Option zum PRESS_INGROUP gesetzt wird, ist dies die Gruppe, dass der eingehende Anruf wird weiterverbunden, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt| +Wait Time Option Press Filename|Wait Time Option Drücken Dateiname| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Wenn Wartezeit Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die gespielt wird, wenn der Kunde Wartezeit überschreitet die Wartezeit Option Seconds to geben dem Kunden die Option auf 1, 2 oder 3 auf ihrem Handy drücken, um laufen die ausgewählten Wartezeit Drücken Sie Optionen. Es ist sehr wichtig, dass Sie Optionen in der Audiodatei für alle Ihre ausgewählten Wait Time-Optionen, und dass die Audiodatei in Sekunden Länge ist richtig in das Feld Dateiname Sekunden unten definiert oder wird es Probleme geben sind. Standard ist zu-sein-als-back| +Wait Time Option Press No Block|Wait Time Option Presse keine Block| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Wenn diese Option auf Y ermöglicht Anrufe in der Schlange hinter einem Anruf, wo die Wartezeit Option Dateiname Presse prompt zu spielen, um an einen Agenten zu gehen, wenn einer verfügbar wird, während die Nachricht abgespielt wird. Während die Wartezeit Option Drücken Dateiname Nachricht an einen Kunden spielt sie nicht an einen Agenten gesendet werden. Standard ist N| +Wait Time Option Press Filename Seconds|Wait Time Option Drücken Dateiname Sekunden| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Dieses Feld muss auf die Anzahl der Sekunden, die Wartezeit Option Dateiname spielt für Presse eingestellt werden. Standard ist 10| +Wait Time Option After Press Filename|Wait Time Option Nach dem Drücken Dateiname| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Wenn Wartezeit Option zu einem der PRESS_ Optionen eingestellt ist, ist dies der Dateiname Eingabeaufforderung, die spielten, nachdem der Kunde 1, 2 oder 3 gedrückt hat, wird| +Wait Time Option Callback List ID|Wait Time Option Rückruf-Liste-ID| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Wenn Wartezeit Option zum PRESS_CID_CALLBACK gesetzt wird, ist dies die ID-Liste der Aufruf wird als neuer Lead hinzugefügt, wenn der Kunde die Option-Taste drückt, wenn mit der Option vorgestellt| +Wait Hold Option Priority|Warten Halten Sie die Wahltaste Priorität| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Wenn beide Optionen Geschätzte Hold Time und Wartezeit Optionen aktiv sind, wird diese Einstellung festlegen, ob eine, das andere oder beide dieser Funktionen aktiv sind. Zum Beispiel, wenn der geschätzte Hold Time Option auf 360 gesetzt ist, die Wartezeit Option auf 120 gesetzt und der Kunde hat für 120 Sekunden gewartet und es gibt noch schätzungsweise 400 Sekunden Haltezeit, dann sind sie beide zur gleichen Zeit aktiv sein und diese Einstellung wird überprüft, um zu sehen, welche Möglichkeiten angeboten werden soll. Standard ist nur WAIT| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|Die LOCKED Optionen werden verwendet, um den Wert auf die Schnelle Transfer-Taste sperren, auch wenn der Agent verwendet die Übertragung Konferenz-Funktionen während eines Gesprächs vor der Verwendung des Quick-Transfer-Taste| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|HANGUP hängen bleiben wird das Gespräch, wenn der Timer ausgelöst wird, wird CALLMENU den Anruf an den Anruf-Timer-Menü im Feld Ziel angegeben Aktion zu senden, EXTENSION, wird der Anruf an die Erweiterung, die in der Timer-Aktion Feld Ziel angegeben wird, zu senden, wird IN_GROUP senden der Aufruf an die In-Group in den Timer-Aktion Feld Ziel angegeben| +Timer Action Destination|Timer-Aktion Reiseziel| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Dieses Feld ist, wo Sie das Call-Menü, Erweiterung oder In-Group angeben, dass Sie den Anruf an, wenn die Zeit Aktion zu CALLMENU, Erweiterung oder IN_GROUP eingestellt werden soll. Standard ist leer| +You must enter field options when adding a|Sie müssen Feldoptionen beim Hinzufügen eines| +You must enter field options when updating a|Sie müssen Feldoptionen beim Update ein| +Allowed Reports|Erlaubt Reports| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Wenn ein Benutzer in dieser Gruppe auf Benutzer-Ebene 7 oder höher festgelegt ist, dann ist dieses Feature kann verwendet werden, um die Berichte, dass die Benutzer sehen können eingeschränkt werden. Der Standardwert ist ALL. Wenn Sie mehr als einen Bericht auswählen möchten und drücken Sie die Strg-Taste auf Ihrer Tastatur, wenn Sie die Berichte auswählen| +You are not allowed to view this report|Sie sind nicht berechtigt, diesen Bericht zu sehen| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - wird inaktiv Listen bei der Suche nach der Zahl enthalten| +Add-Delete DNC Number|Add-DNC-Nummer löschen| +Add DNC Number|Fügen Sie DNC-Nummer| +Copy Custom Fields|Kopieren Sie benutzerdefinierte Felder| +Add Filter Phone Group|Filter hinzufügen Phone Group| +New Filter Phone Group|Neuer Filter Phone Group| +Modify Filter Phone Group|Ändern Filter Phone Group| +Delete Phone Filter Group|Löschen Phone Filter Gruppe| +Filter Phone Groups|Filter Phone Gruppen| +Filter Phone Group ID|Filter Phone Group ID| +Filter Phone Group Name|Filter Phone Group Name| +Filter Phone Group Description|Filter Phone Group Beschreibung| +PHONE FILTER GROUP NOT ADDED|PHONE Filter Gruppe NICHT HINZUGEFÜGT| +there is already a PHONE FILTER GROUP in the system with this ID|es besteht bereits eine PHONE Filter Gruppe in das System mit dieser ID| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|Telefon-Filter-Gruppen-ID muss zwischen 2 und 20 Zeichen lang sein und darf keine| +PHONE FILTER GROUP ADDED|PHONE Filter Gruppe ADDED| +Add Filter Phone Group|Filter hinzufügen Phone Group| +Add-Delete FPG Number|Add-Löschen FPG-Nummer| +Add FPG Number|Fügen Sie FPG Anzahl| +FILTER PHONE GROUP NOT MODIFIED|FILTER Phone Group NICHT VERÄNDERT| +FILTER PHONE GROUP MODIFIED|FILTER Phone Group MODIFIZIERTE| +FILTER PHONE GROUP NOT DELETED|FILTER PHONE Gruppe nicht gelöscht| +Click here to delete FILTER PHONE GROUP|Klicken Sie hier, um FILTER Phone Group löschen| +FILTER PHONE GROUP DELETION CONFIRMATION|FILTER Phone Group Löschbestätigung| +FILTER PHONE GROUP DELETION COMPLETED|FILTER Phone Group LÖSCHUNG ABGESCHLOSSEN| +Click here to see Admin chages to this filter phone group|Klicken Sie hier um Admin chages zu diesem Filter Phone Group sehen| +DELETE THIS FILTER PHONE GROUP|DELETE THIS FILTER Phone Group| +FILTER PHONE GROUP LISTINGS|FILTER PHONE Group Einträge| +Filter Phone Group Numbers|Filter Phone Group Numbers| +This phone number is not in the Filter Phone Group List|Diese Rufnummer ist nicht im Filter-Phone Group List| +This phone number is already in the Filter Phone Group List|Diese Rufnummer ist bereits in der Filter-Phone Group List| +FILTER PHONE GROUP NUMBER NOT DELETED|FILTER Phone Group ZAHL NICHT GELÖSCHT| +FILTER PHONE GROUP NUMBER DELETED|FILTER Phone Group Nummer gelöscht| +FILTER PHONE GROUP NUMBER NOT ADDED|FILTER Phone Group ZAHL NICHT HINZUGEFÜGT| +FILTER PHONE GROUP NUMBER ADDED|FILTER Phone Group Zahl hinzugefügt| +Numbers in this Filter Phone Group|Die Zahlen in diesem Filter Phone Group| +There are no phone numbers in list|Es gibt keine Rufnummern in der Liste| +There are no leads in Campaign DNC list|Es gibt keine Leitungen in der Kampagne DNC Liste| +There are no leads in this filter phone group|Es gibt keine Leitungen in diesem Filter Phone Group| +Click here to download the numbers in this filter phone group|Klicken Sie hier, um die Zahlen in diesem Filter Phone Group downloaden| +Filter Inbound Number|Filter Inbound-Nummer| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Diese Option, falls aktiviert können Sie Anrufe kommen in diese DID und schicken sie auf eine alternative Handlung, wenn sie eine Telefonnummer, die im Filter Phone Group oder einer URL-Antwort ist, wenn man ein so konfiguriert haben, passen zu filtern. Der Standardwert ist DISABLED. Gruppe wird in einem Filter-Phone-Gruppe zu finden. URL senden Sie eine URL und treffen zu, wenn eine 1 zurück gesendet wird| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Wenn der Filter Inbound Feld Nummer GRUPPE gesetzt ist, dann ist dies die ID des Filter-Phone Group, die haben ihre Zahlen gesucht auf der Suche nach einer Übereinstimmung mit dem Anrufer-ID-Nummer des eingehenden Anrufs wird| +Filter URL|URL-Filter| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Wenn der Filter Inbound-Nummer Feld URL gesetzt ist, dann ist dies die Web-Adresse von einem Skript, das eine Remote-System zu suchen und zurück wird eine 1 für ein Spiel und eine 0 für kein Spiel. Nur zwei Variablen sind in der Adresse zur Verfügung, wenn Sie die VAR-Präfix wie mit Webformular-Adressen in Kampagnen zu nutzen, - A - phone_number - B - und - A - did_pattern - B - können in der URL verwendet werden auf die Anrufer-ID des Anrufers und zeigt die DID, dass der Kunde in aufgerufen| +Filter Action|Filteraktion| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Wenn Filter Inbound-Nummer wird aktiviert und eine Übereinstimmung gefunden wird, dann ist dies die Aktion, die zu nehmen ist. Dies ist die gleiche wie die Route, die Sie wählen für eine DID, und die folgenden Einstellungen funktionieren genau wie sie es tun für eine Standard-Routing| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|Dies ist die ID des Filter-Phone Group, die die Container für eine Gruppe von Telefonnummern, die Sie automatisch durchsucht haben, wenn ein Anruf in ein DID und senden Sie eine alternative Route, wenn es eine Übereinstimmung gibt. Dieses Feld sollte zwischen 2 und 20 Zeichen lang sein und haben keine Satzzeichen außer Unterstrich| +Filter Phone Group Description|Filter Phone Group Beschreibung| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Dies ist die Beschreibung des Filters Phone Group, ist es rein für die Notation Zwecken und ist nicht ein erforderliches Feld| +Clean CID Number|Reinigen Sie CID-Nummer| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|In diesem Feld können Sie eine Anzahl von Ziffern angeben, um den eingehenden Anrufer-ID-Nummer zu beschränken, indem sie ein R vor der Anzahl der Stellen, zum Beispiel um an die richtigen Stellen Sie in 10 R10 geben würde, zu beschränken. Sie können diese Funktion auch verwenden, um nur eine führende Ziffer oder Ziffern, indem sie ein L vor den spezifischen Ziffern, die Sie entfernen möchten, zum Beispiel, um eine 1 als erste Ziffer Sie in L1 geben würde entfernen zu entfernen. Standard ist leer. Wenn mehr als eine Regel angegeben wird sicherstellen, dass Sie trennen Sie diese mit einem Leerzeichen und dem R wird vor der Ausführung L| +must be an existing vicidial user|muss ein vorhandener Benutzer sich jeder leisten sein| +you must use a valid user as the user_start for remote agents|Sie müssen einen gültigen als user_start für Remote-Agenten verwenden| +your number of lines overlaps with another remote agent|Ihre Anzahl der Zeilen Überschneidungen mit anderen Remote-Agent| +Webphone URL Override|Webphone URL Override| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Diese Einstellung ermöglicht es Ihnen, eine alternative URL webphone nur für die Mitglieder einer Benutzergruppe festzulegen. Standard ist leer| +Calculate Estimated Hold Seconds|Berechnen Sie Geschätzte Hold-Sekunden| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Dies definiert die Anzahl der Sekunden in der Warteschlange, die der Kunde wartet vor der voraussichtlichen Hold Time wird berechnet und optional gespielt. Minimum beträgt 3 Sekunden, auch wenn weniger als 3 gesetzt. Standard ist 0| +Campaign Preset Added|Kampagne Preset hinzugefügt| +Campaign Presets|Kampagne Presets| +Modify Campaign Preset|Ändern Kampagne Preset| +Campaign Preset Removed|Kampagne Preset entfernt| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Wenn die Kampagne Einstellung für Presets auf Aktiviert eingestellt ist, dann haben die Fähigkeit, Transfer-Presets, die Konferenz zur Verfügung stehen, um dem Agenten wird es ihnen ermöglicht, 3-Wege nennen diese Presets oder blind Anrufe an diese vorgegebenen Zahlen zu definieren. Diese Voreinstellungen haben auch eine Option, um die Zahl mit jedem Preset aus dem Agenten verbunden zu verbergen| +PRESET NOT ADDED|PRESET NICHT HINZUGEFÜGT| +there is already an entry for this campaign with this preset|Existiert bereits ein Eintrag für diese Kampagne mit dieser voreingestellten| +PRESET NOT MODIFIED|PRESET NICHT VERÄNDERT| +>Presets<|> Voreinstellungen <| +Hide Transfer Number to Dial|Übertragung ausblenden Zu wählende Nummer| +Enable Transfer Presets|Aktivieren Transfer-Presets| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Diese Option ermöglicht es den Presets Untermenü, an der Spitze der Kampagne Modifikation Seite erscheinen, und auch Sie werden die Fähigkeit zur Preset-Rufnummern für Agents, um in der Transfer-Konferenz Rahmen des Agent-Interface verwenden, genau angeben. Der Standardwert ist DISABLED| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Diese Option blendet die Nummer Feld in der Transfer-Konferenz Rahmen des Agent-Interfaces Dial. Der Standardwert ist DISABLED| +PRESETS FOR THIS CAMPAIGN|PRESETS Für diese Kampagne| +ADD NEW PRESET|ADD NEW PRESET| +Hide Number|Rufnummer unterdrücken| +Preset Name|Preset Name| +Preset Number|Preset-Nummer| +Preset DTMF|Preset DTMF| +CAMPAIGN PRESET LISTINGS|KAMPAGNE PRESET DIASHOW| +CAMPAIGN PRESET NOT DELETED|KAMPAGNE PRESET NICHT GELÖSCHT| +Show Presets Stats|Zeige Presets Stats| +AGENT DIAL PRESETS NAMES|AGENT DIAL PRESETS NAMEN| +Manual Dial Prefix|Manuelle Vorwahl| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Dieses optionale Feld können Sie die Vorwahl nur verwendet werden, bei der Platzierung manuelle Einwahl Anrufe aus dem Agenten-Interface, wie zum Beispiel mit dem Manual Dial Feature-Set, oder Wählen Sie die nächste Nummer, wenn in der MANUAL Zifferblatt Methode oder manuelle alt Nummernwahl, oder geplant vom Benutzer nur Rückrufe. Standard ist leer für Behinderte, die die Vorwahl im Feld oben definiert nutzen werden. Diese Option funktioniert nicht mit dem 3-fach Vorwahl Option stören| +Here is a list of reserved phrases that cannot be used as menu IDs|Hier ist eine Liste der reservierten Sätze, die nicht als Menü-IDs verwendet werden kann| +Call Menu ID cannot use reserved words|Rufen Sie Menü-ID kann nicht verwendet werden reservierte Wörter| +Webphone System Key Override|Webphone System Key Override| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Diese Einstellung ermöglicht es Ihnen, einen alternativen webphone System Key nur für die Mitglieder einer Benutzergruppe festzulegen. Standard ist leer| +Webphone Dialpad Override|Webphone Dialpad Override| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Diese Einstellung können Sie aktivieren oder deaktivieren Sie das Tastenfeld auf der webphone nur für die Mitglieder einer Benutzergruppe. Der Standardwert ist DISABLED. ROCKER kann der Benutzer zum Anzeigen und Ausblenden der Wähltasten durch Anklicken eines Links| +Webphone Dialpad|Webphone Dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Diese Einstellung können Sie aktivieren oder deaktivieren Sie das Tastenfeld für diese webphone. Standard ist für Y aktiviert. ROCKER kann der Benutzer zum Anzeigen und Ausblenden der Wähltasten durch Anklicken eines Links. Diese Funktion ist nicht bei allen Versionen zur Verfügung webphone| +Webphone System Key|Webphone System Key| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Wenn Ihr System oder Anbieter erfordert es, das ist, wo das System für den Key eingegeben webphone sollte in. Standard ist leer werden| + Strength| Stärke| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Eine starke Registrierung Passwort sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Eine starke conf-Datei Geheimnis sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Ein starker Benutzer-Passwort sollte mindestens 8 Zeichen lang sein und müssen in Kleinbuchstaben und Großbuchstaben sowie mindestens eine Zahl| +Force Change Password|Zwingen Sie Passwort ändern| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Wenn diese Option gesetzt, um dann Y der Benutzer aufgefordert, ihr Passwort ändern sie das nächste Mal in der Verwaltung Webseite anzumelden. Standard ist N| +First Login Trigger|Erster Login-Trigger| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Mit dieser Einstellung kann für die Erstkonfiguration des Servers Bildschirm, um dem Administrator angezeigt werden, wenn sie in das System zuerst anmelden| +Default Phone Registration Password|Standard-Telefon-Anmeldung Passwort| +This is the default registration password used when new phones are added to the system. Default is test|Dies ist die Standard-Registrierung Passwort verwendet werden, wenn neue Handys auf dem System hinzugefügt werden. Die Standardeinstellung ist Test| +Default Phone Login Password|Standard-Telefon Login Passwort| +This is the default phone web login password used when new phones are added to the system. Default is test|Dies ist die Standard Web-Telefon Login Passwort verwendet werden, wenn neue Handys auf dem System hinzugefügt werden. Die Standardeinstellung ist Test| +Default Server Password|Standard-Server-Kennwort| +This is the default server password used when new servers are added to the system. Default is test|Dies ist die Standard-Server-Passwort verwendet werden, wenn neue Server mit dem System hinzugefügt werden. Die Standardeinstellung ist Test| +CHANGE PASSWORD|PASSWORT ÄNDERN| +INITIAL INSTALL WELCOME|Erstinstallation WILLKOMMEN| +COPYRIGHT TRADEMARK LICENSE|Urheberrechtshinweis Markenlizenz| +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|Sie sind verpflichtet, Ihr Passwort zu ändern, bevor Sie fortfahren können, um auf Administration. Ein sicheres Kennwort verfügt sowohl Klein-und Großbuchstaben sowie mindestens eine Zahl enthalten. Ihr Passwort muss 2-20 Zeichen lang sein und darf keine Zeichen, die keine Buchstaben oder Zahlen| +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|Seien Sie sicher, dass dieses Passwort etwas, dass Sie mich erinnern kann ist, denn sobald Sie diese Änderung vorgenommen werden Sie aufgefordert, Ihr neues Passwort eingeben, um sich wieder anmelden, um Verwaltung werden| +Password has not been changed, please try again|Das Passwort wurde nicht geändert, bitte versuchen Sie es erneut| +New Password|Neues Passwort| +Password has been updated, you may now continue|Kennwort aktualisiert wurde, können Sie jetzt auch| +Passwords have been updated, you may now continue on into Administration|Passwörter aktualisiert worden sind, können Sie nun auf in Verwaltung weiter| +You may want to start by reading the ViciDial Manager Manual available at|Vielleicht möchten Sie starten durch das Lesen der sich jeder leisten Manager Handbuch finden Sie unter| +there is a free version available|gibt es eine kostenlose Version verfügbar| +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|Seien Sie sicher, dass dieses Passwort etwas, dass Sie mich erinnern kann ist, denn sobald man diese anfängliche Setup-Bildschirm füllen Sie aufgefordert, Ihr neues Passwort erneut eingeben, um in wieder einloggen, um Verwaltung werden| +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|Die nächsten drei Standard-Passwörter werden im Abschnitt Systemeinstellungen definiert, und Sie können sie ändern, nachdem Sie sie hier definieren. Es ist eine gute Idee, um diese Passwörter so stark, dass niemand in Ihr Telefon Konten und Ort telefonieren ohne Ihr Wissen zu hacken. Die Standard-Registrierung Passwort verwendet werden, wenn neue Handys mit dem System wie dem SIP-oder IAX-VOIP-Telefon, Passwort hinzugefügt werden. Die Standard-Telefon Web-Login-Passwort verwendet werden, wenn neue Handys mit dem System hinzugefügt werden, wie das Telefon vergessen, dass ein Agent würde in der sich jeder leisten Agent-Schnittstelle zu verwenden. Der Standard-Server-Passwort verwendet werden, wenn neue Server mit dem System hinzugefügt werden für Server, um miteinander zu kommunizieren| +Passwords have been updated, you may now continue on into Administration|Passwörter aktualisiert worden sind, können Sie nun auf in Verwaltung weiter| +You may want to start by reading the ViciDial Manager Manual available at|Vielleicht möchten Sie starten durch das Lesen der sich jeder leisten Manager Handbuch finden Sie unter| +there is a free version available|gibt es eine kostenlose Version verfügbar| +Welcome to ViciDial|Willkommen bei jeder leisten| +initial setup screen|anfängliche Setup-Bildschirm| +copyright, trademark and license page|Urheber-, Marken-und Lizenz-Seite| +The ViciDial Call Center Suite is maintained by the|Das sich jeder leisten Call Center-Suite wird von beibehalten| +is a registered trademark of the|ist ein eingetragenes Warenzeichen der| +Here is our|Hier ist unsere| +trademark use policy|Marke Use Policy| +The ViciDial Call Center Suite is released under the|Das sich jeder leisten Call Center Suite ist durch die das freigesetzte| +open source license|Open-Source-Lizenz| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|Das sich jeder leisten Call Center Suite-Software steht zum Download und zur Nutzung zur Verfügung, kostenlos. Sie können die einfach zu installieren| +ViciBox CD ISO version|ViciBox CD-ISO-Version| +or only the|oder nur die| +source code|Source-Code| +Continue on to the Initial Setup|Weiter geht es nach der Ersteinrichtung| +Customer 3-Way Hangup Logging|Kunde 3-Wege-Hangup Logging| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Wenn diese Option aktiviert die user_call_log wird protokolliert, wenn ein Kunde Hangup-up, wenn sie während einer 3-Wege-Anruf zu hängen. Außerdem kann dieser für den Kunden erlauben 3-Wege-Hangup Aktion, wenn man unten defineed wird. Standardeinstellung lautet AKTIVIERT| +Customer 3-Way Hangup Seconds|Kunde 3-Wege-Hangup Sekunden| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Wenn der Kunde 3-Wege-Protokollierung aktiviert ist, können Sie mit dieser Option die Anzahl der Sekunden definieren, nachdem der Kunde hangup erkannt wird, bevor es tatsächlich angemeldet ist und der Kunde optional 3-Wege-Hangup-Aktion ausgeführt wird. Die Standardeinstellung ist 5 Sekunden| +Customer 3-Way Hangup Action|Kunde 3-Wege-Hangup Aktion| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Wenn der Kunde 3-Wege-Protokollierung aktiviert ist, können Sie mit dieser Option haben die Agenten-Bildschirm automatisch auflegen auf den Anruf und rufen Sie die DISPO Bildschirm, wenn diese Option, um DISPO eingestellt ist. Der Standardwert ist NONE| +Inbound Report by DID|Inbound-Bericht von DID| +Lists Campaign Status Stats|Listen Kampagnenstatus Stats| +Add Lead URL|Fügen Sie führen zur URL| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Diese Web-URL-Adresse wird nicht durch den Agenten gesehen, aber es wird immer dann aufgerufen, eine Leitung mit dem System über den eingehenden zugegeben wird. Standardeinstellung ist leer. Sie müssen diese URL mit VAR beginnen, wenn Sie Variablen verwenden möchten, und natürlich - A - und - B - rund um die eigentliche Variable in der URL, wo Sie sie benutzen wollen. Hier ist die Liste der Variablen, die verfügbar sind für diese Funktion| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Dieses Dienstprogramm ermöglicht es Ihnen, Audio-Dateien auf den Webserver hochladen, so dass sie auf alle sich jeder leisten Servern in einer Multi-Server-Cluster verteilt werden können. Ein wichtiger Hinweis, werden nur zwei Audio-Datei-Typen zu arbeiten,. Wav-Dateien, die PCM-Mono 16bit und 8k sind. GSM-Dateien, die 8bit 8k sind. Bitte überprüfen Sie, ob Ihre Dateien ordnungsgemäß vor dem Hochladen hier formatiert| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Wir empfehlen DRINGEND Upload nur 16bit Mono 8k PCM WAV-Audiodateien| +Park Music-on-Hold|Park Music-on-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|Hier können Sie die Wartemusik Kontext für diese Kampagne definieren können. Wählen Sie unbedingt eine gültige Wartemusik Kontext von der Select-Liste und dass der Kontext, den Sie ausgewählt haben, hat gültige Dateien in sich. Die Standardeinstellung ist Standard| +Park Call IVR|Anruf parken IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Diese Option ermöglicht ein Agent einen Anruf mit einem separaten IVR-PARK Taste CALL auf ihren Agenten-Interface parken, wenn diese Option aktiviert ist oder ENABLED_PARK_ONLY. Die ENABLED_PARK_ONLY Option ermöglicht es dem Agenten, um den Anruf zu parken, aber nicht senden klicken, um das Gespräch wie die Option Aktiviert abzurufen. Die ENABLED_BUTTON_HIDDEN Option ermöglicht die Funktion nur über die API. Der Standardwert ist DISABLED| +Park Call IVR AGI|Anruf parken IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Wenn der Anruf parken IVR-Bereich nicht deaktiviert ist, dann wird dieses Feld als String AGI Anwendung, dass der Kunde gesendet wird verwendet. Dies ist eine Einstellung, die vom Administrator festgelegt werden sollte, wenn möglich| +Manual Preview Dial|Manuelle Vorschau Dial| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|Dadurch kann der Agent im manuellen Modus Zifferblatt, die Führung zu Informationen sehen, wenn sie nächstes klicken Sie auf DFÜ-Nummer wählen, bevor sie aktiv den Anruf. Es ist ein optionaler Link, um das Blei überspringen und zum nächsten, wenn ausgewählt. Die Standardeinstellung ist PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Geschätzte Mindest-Haltezeit Dateiname| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Wenn der geschätzte Hold Time ist aktiv und es wird berechnet, um am oder unter dem Minimum von 15 Sekunden sein, dann ist dies prompt Datei wird anstelle des Standard-Ankündigung abgespielt. Standardwert ist Empty für inaktive| +Estimated Hold Time Minimum Prompt No Block|Geschätzte Mindest-Haltezeit Prompt keine Block| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Wenn Geschätzte Hold Time aktiv ist und die geschätzte Hold Time Minimum Feld Dateiname oben ist ausgefüllt, dann ist diese Option für Anrufe in der Schlange hinter einem Anruf, wo die Eingabeaufforderung zu spielen, um an einen Agenten gehen, wenn man zur Verfügung stehen wird, während die Nachricht abgespielt wird erlauben . Während die Eingabeaufforderung an einen Kunden spielt sie nicht an einen Agenten gesendet werden. Standard ist N| +Estimated Hold Time Minimum Prompt Seconds|Geschätzte Mindest-Haltezeit Prompt Sekunden| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Dieses Feld muss auf die Anzahl der Sekunden, dass die geschätzte Hold Time Minimum Dateiname Eingabeaufforderung für spielt eingestellt werden. Standard ist 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|In diesem Feld können Sie den Namen der Aufnahme anpassen, wenn Campaign Aufnahme ist ONDEMAND oder ALLCALLS. Die Variablen sind erlaubt| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|Der Standardwert ist FULLDATE_AGENT und würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE das so aussehen würde| +Real-Time Agent Time Stats|Echtzeit-Agent Zeitstatistik| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|Wenn Sie dieses auf alles andere als BEHINDERTE ermöglicht das Sammeln von Agent Zeit Stats for heute für diese Kampagne, die sichtbar sind durch den Echtzeit-Bericht. Ferngespräche sind die durchschnittlichen ruft behandelt pro Agent, ist WAIT die durchschnittliche Wartezeit Agent, CUST der durchschnittliche Kunde Sprechzeit ist, der Durchschnitt liegt bei ACW Anrufnachbearbeitung Zeit, ist die durchschnittliche PAUSE Pausenzeit. Der Standardwert ist DISABLED| +Add A Dial Status to Call|Fügen Sie eine DFÜ-Status-to-Call| +Admin Modify Auto-Refresh|Admin Ändern Auto-Refresh| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|Dies ist das Aktualisierungsintervall in Sekunden der modify-Bildschirme in diesem Admin-Interface. Sie diesen Wert auf 0 deaktiviert es, indem ich sie unter 5 wird meistens machen die Steuerwerte Bildschirme unbrauchbar, weil sie zu schnell wird aktualisiert, um Felder zu ändern. Diese Option ist nützlich in Situationen, in denen mehr als ein Manager Controlling Einstellungen basiert auf einer aktiven Kampagne oder in-group, damit die Einstellungen häufig aktualisiert werden. Standard ist 0| +Admin No-Cache|Admin No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|Wenn Sie diesen Wert auf 1 wird alle Admin-Seiten auf Web-Browser no-cache gesetzt, so dass jeder Bildschirm muss jedes Mal neu geladen wird es angesehen werden, auch wenn Sie wieder auf den Browser. Standard ist 0 für Behinderte| +Generate Cross-Server Phone Extensions|Generieren Sie Cross-Server-Phone Extensions| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Diese Option, wenn auf 1 gesetzt wird Dialplan Einträge für jedes Telefon auf eine Multi-Server-System zu generieren. Standard ist 0 für inaktive| +QueueMetrics Addmember Enabled|QueueMetrics AddMember Aktiviert| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Diese Option, wenn auf 1 gesetzt wird und ADDMEMBER2 removeMember Einträge in queue_log generieren. Standard ist 0 für Behinderte| +Minimum Hopper Level|Minimale Stufe Hopper| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Dies ist die minimale Anzahl der führt die VDhopper Skript versucht, in der Tabelle vicidial_hopper für diese Kampagne zu halten. Wenn Laufen VDhopper Skript jede Minute, machen diese etwas größer als die Zahl der führt Sie durch in einer Minute gehen| +Automatic Hopper Level|Automatische Hopper Stufe| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Wenn Sie dieses auf Y wird es sich jeder leisten kann damit automatisch den Trichter aus den Einstellungen haben Sie in Ihrer Kampagne basiert. Die Formel sie verwendet, um dies zu tun ist| +Automatic Hopper Multiplier|Automatische Hopper Multiplier| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|Dies ist Multiplikator für die Auto-Hopper. Wenn Sie diese weniger als 1 bewirkt, dass der Auto-Hopper-Algorithmus, um weniger Leitungen als normalerweise zu laden. Wenn Sie diesen Wert größer als 1 bewirkt, dass der Auto-Hopper-Algorithmus, um mehr Leads als es normalerweise tun würde zu laden. Standard ist 1| +Auto Trim Hopper|Auto Trim Hopper| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Wenn Sie dieses auf Y wird es sich jeder leisten, um automatisch entfernen überschüssige Leads aus dem Trichter. Der Standardwert ist Y| +Manual Dial API|Manuelle Wahl API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Diese Option ermöglicht es Ihnen, die Agent-API gesetzt, um entweder ein Anruf zu einem Zeitpunkt, STANDARD, oder die Fähigkeit, Schlange stehen manuelle Einwahl Anrufe zu tätigen und haben sie automatisch zu wählen, sobald der Agent geht auf Pause oder ist verfügbar, um ihre nächsten Aufruf der Rücknahme Option, um die automatische Wahl der Anrufe, Warteschlange oder QUEUE_AND_AUTOCALL die die gleiche wie Warteschlange, aber ohne die Möglichkeit, die automatische Anwahl dieser Anrufe zu deaktivieren ist deaktiviert. Wenn ein Agent hat mehr als einen Aufruf für sie in der Warteschlange werden sie die zählen, wie viele manuelle Einwahl Anrufe in der Warteschlange direkt unterhalb der Pause-Taste zu sehen, oder wählen Sie Nächste Nummer drücken. Wir schlagen vor, dass, wenn Warteschlange verwendet wird, dass Sie API-Aktionen mit der Vorschaufunktion = YES Option, damit Sie nicht wiederholt werden Tätigen von Anrufen für den Agenten ohne vorherige Ankündigung zu senden. Auch, wenn mit Queue und stark durch manuelle Einwahl Anrufe in einer nicht MANUAL Zifferblatt Methode, würden wir empfehlen, die Agent-Pause nach jedem Call-Option auf Y Voreingestellt ist standard| +Manual Call Time Check|Manuell überprüfen Sie Anrufdauer| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Wenn diese Option aktiviert ist, wird es prüfen alle Anrufe auf manuelle Einwahl sicherzustellen, dass sie innerhalb der Zeit während des Bereitschaftsdienstes Einstellungen für die Kampagne eingestellt. Der Standardwert ist DISABLED| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Wenn Sie dieses Kabel an einem geplanten Rückruf ändern möchten, ändern Sie zunächst die Disposition zum CBHOLD, dann unterbreiten und Sie in der Lage, um den Rückruf von Datum und Uhrzeit| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Web Form Override - Das ist die benutzerdefinierte Adresse, dass beim Klicken auf dem Webformular-Button in jeder leisten bringt Sie zur Seite für Anrufe, die in dieser Liste kommen| +Agent Screen Login|Agent-Bildschirm Anmelden| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|Die Anmeldung für den Benutzer verwendet werden, um telefonisch zu den Client-Anwendungen anmelden, wie die sich jeder leisten Agent Bildschirm| +Phone Extension|Durchwahl| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Dieses Feld ist, wo Sie die Telefone Namen setzen, wie es zu Asterisk nicht einschließlich des Protokolls oder Schrägstrich am Anfang erscheint. Zum Beispiel: für das SIP-Telefon SIP/test101 die Telefon-Durchwahl würde test101 sein. Auch für IAX2 phones: IAX2/IAXphone1 @ IAXphone1 würde IAXphone1 sein. Für Zap und Dahdi angehängten channelbank oder FXS-Telefone stellen Sie sicher stellen das gesamte Kanal-Nummer ohne das Präfix: Zap/25-1 würde 25-1 sein. Noch ein Hinweis, sicherstellen, dass Sie das Protokoll mit folgendem richtig für Ihre Art des Telefons| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|Status innerhalb der aktiven Listen Für diese Kampagne| +SHOW LEAD STATUSES IN THIS CAMPAIGN|SHOW LEAD Zustände in dieser Kampagne| +RELOAD NOW|Jetzt Nachladen| +refresh|erfrischen| +You can also set a label to ---HIDE--- to hide both the label and the field|Sie können auch einen Aufkleber auf --- --- HIDE, um sowohl das Etikett und das Feld zu verstecken| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Für nur eingehend, können Sie auch den Anschlag Anrufzeit höher als 2400, wenn Sie die Forderung der Zeit, über Mitternacht gehen wollen. Also, wenn Sie möchten Ihren Anruf Zeit von 6 Uhr morgens bis 2 Uhr am nächsten Tag, würden Sie 0600 als Startzeit und 2600 gelegt, als der Stoppzeit| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF ausfällt, um nicht das Tastenfeld beim ersten Laden, sondern ermöglicht es dem Benutzer, die Wähltasten, indem Sie zeigen, auf dem Tastenfeld Link| +Add Multi-Server Phones Form|In Multi-Server-Handys Formular| +Phones Bulk Insert|Handys Masseneinfügungstask| +List Order Randomize|Liste Auftrag Randomize| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Diese Option ermöglicht es Ihnen, die Reihenfolge der Leitungen in den Trichter Last innerhalb der Ergebnisse von den obengenannten Kriterien definiert randomisieren. Zum Beispiel wird die Reihenfolge der Liste erhalten bleiben, aber die Ergebnisse werden innerhalb dieser Sortierung randomisiert. Wenn diese Option auf Y wird diese Funktion aktivieren. Standard ist für behinderte N. Hinweis, wenn Sie eine große Zahl von Kaufinteressenten haben diese Option kann verlangsamen die Geschwindigkeit des Trichters Laden Skript| +NONE will not log any logins and logouts within queue_log|NONE wird protokolliert keine An-und Abmeldungen innerhalb queue_log| +QueueMetrics Dispo Pause Code|QueueMetrics Dispo Pausecode| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Diese Option, wenn besiedelt, können Sie definieren, ob ein Dispo Pause Code in queue_log, wenn ein Agent ist in Dispo-Status eingetragen wird. Standard ist leer für Behinderte| +List Order Secondary|Liste Auftrag Sekundäre| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Diese Option ermöglicht es Ihnen, die zweite Sortierreihenfolge der Hauptrollen in dem Trichter nach dem Last-Liste Reihenfolge und innerhalb der Ergebnisse von den obengenannten Kriterien definiert auszuwählen. Zum Beispiel wird die Reihenfolge der Liste für die erste Art der Leitungen verwendet werden, aber die Ergebnisse werden zum zweiten Mal innerhalb dieser Sortierung über den gleichen Satz von der ersten Liste sortiert werden. Zum Beispiel, wenn Sie Auftrag Liste gesetzt zu COUNT DOWN-und haben Sie nur Leitungen, die 1 und 2 mal versucht haben, dann, wenn Sie die Reihenfolge der Liste sekundäre Gruppe zu allen Versuch 1 führt LEAD_ASCEND haben wird von den ältesten Leitungen sortiert werden erste und wird in den Trichter so gesetzt werden. Standard ist LEAD_ASCEND. Bedenken Sie, dass wenn Sie eine große Anzahl von Leitungen mit einer der Optionen CALLTIME verlangsamen die Geschwindigkeit des Trichters Laden Skript| +My Callbacks Checkbox Default|Meine Rückrufe Checkbox Standard| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Diese Option ermöglicht es Ihnen, Voreinstellung der Eig.Rückruf Checkbox auf der Callback-Agent geplant Bildschirm. Überprüft wird das Kontrollkästchen automatisch, ob für jeden Anruf. Die Standardeinstellung ist UNCHECKED| +Call Notes Per Call|Rufen Sie Noten pro Anruf| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|Wenn Sie diese Option auf Enabled ermöglicht es Agenten in Notes für jeden Anruf sie im Agent-Interface handhaben eingeben. Die Noten Eingabefeld unter dem Feld Bemerkungen im Agent-Interface erscheinen. Auch, wenn der Agent User Group ist berechtigt, Anzeigen von Anruflisten dann der Agent in der Lage, Vergangenheit Anrufanmerkungen für eine Führung jederzeit einsehen. Der Standardwert ist DISABLED| +If List Order Randomize is enabled, this option will be ignored|Wenn Liste Auftrag Randomize aktiviert ist, wird diese Option ignoriert| +ERROR: Lead not added, please go back and look at what you entered|FEHLER: nicht hinzugefügt Blei, bitte gehen Sie zurück und schauen, was Sie gemacht haben| +Lead has been added|Blei wurde hinzugefügt| +Add A New Lead|Fügen Sie einen neuen Lead| +Agent Lead Search Override|Agent-Lead-Suche Override| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Diese Einstellung hat Vorrang, was die Kampagne für Agent Lead-Suche eingestellt. NOT_ACTIVE verwenden die Kampagne Einstellung. ENABLED ermöglicht Blei Suche und DEAKTIVIERT werden nicht zulassen, Blei Suche. Die Standardeinstellung ist NOT_ACTIVE| +Agent Lead Search|Agent-Lead-Suche| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|Wenn diese Option auf ENABLED ermöglicht Agenten für Leads durchsuchen und Artikel lesen Blei Informationen während der Pause im Agent-Interface. Auch, wenn der Agent User Group ist berechtigt, Anzeigen von Anruflisten dann der Agent in der Lage, Vergangenheit Anrufanmerkungen für jeden Lead dass die dort verfügbaren Informationen zu sehen. Der Standardwert ist DISABLED| +Agent Lead Search Method|Agent-Lead-Suchmethode| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Wenn Agent Lead-Suche aktiviert ist, legt diese Einstellung in der der Agent erlaubt sein wird, für Leads zu suchen. SYSTEM wird das gesamte System zu suchen, wird im Inneren CAMPAIGNLISTS alle aktiven Listen innerhalb der Kampagne zu suchen, wird im Inneren CAMPLISTS_ALL alle aktiven und inaktiven Listen innerhalb der Kampagne suchen, listet nur suchen im Manual Dial-ID-Liste, wie in der Kampagne definiert . Die Standardeinstellung ist CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|LEAD Abfragen Für diesen Zeitraum| +Routing Extension|Routing-Erweiterung| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|In diesem Feld können für eine benutzerdefinierte Outbound-Routing-Erweiterung. Dies ermöglicht Ihnen, verschiedene Methoden Anrufbearbeitung je nachdem, wie Sie Anrufe über Ihren Outbound-Kampagnen nutzen. Früher nannte Kampagne VDAD Erweiterung| +same as|wie| +Will send the call only to an agent on the same server as the call is placed on|Wird der Anruf nur an einen Agenten auf dem gleichen Server zu senden, als der Anruf in Verkehr gebracht wird| +Used for press-1, broadcast and survey campaigns|Wird für Presse-1-, Broadcast-und Umfrage-Kampagnen| +Will try to first send the call to an agent on the local server, then it will look on other servers|Werden versuchen, senden Sie zunächst den Anruf an einen Agenten auf dem lokalen Server, dann wird es auf anderen Servern suchen| +DEFAULT - Will send the call to the next available agent no matter what server they are on|DEFAULT - wird der Anruf zur nächsten freien Agenten zu senden, egal welchem ​​Server sie sind auf| +Used for Answering Machine Detection after that, same behavior as|Wird für Anrufbeantworter-Erkennung nach, dass das gleiche Verhalten wie| +Used for Answering Machine Detection after that same behavior as|Wird für Anrufbeantworter-Erkennung nach dieser gleiche Verhalten wie| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Wird für Presse-1-, Broadcast-und Umfrage-Kampagnen mit Cepstral Text-to-Speech| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Wird für Anrufbeantworter-Erkennung und drücken Sie dann-1-, Broadcast-und Umfrage-Kampagnen mit Cepstral Text-to-Speech| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Eine dieser Optionen mit USER_ vor werden nur innerhalb von Leads, die das Feld Besitzer Anpassung der Benutzer-ID des Agenten suchen haben, werden die Optionen mit GROUP_ vor nur innerhalb von Leads, die das Feld Besitzer Anpassung der Benutzer-Gruppe ist, dass der Benutzer zu suchen, Mitglied, mit den Optionen TERRITORY_ vor werden nur innerhalb von Leads, die das Feld Besitzer passend zu den Gebieten, die der Agent ausgewählt haben, suchen| +QM Phone Environment|QM-Telefon Umwelt| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Wenn QueueMetrics Integration in den Systemeinstellungen aktiviert ist, wird diese Einstellung erlauben das Einfügen von Daten dieser Wert im Feld der data4 queue_log für Agententätigkeit Datensätze. Standard ist leer für Behinderte| +Active Twin Server IP|Aktive Twin-Server-IP| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Einige jeder leisten Systeme erfordern die Einrichtung jeder leisten Servern in Paaren. Diese Einstellung ist, wo man die Server-IP von einem anderen Server sich jeder leisten, dass dieser Server mit Partnerstadt stellen können. Standard ist leer für Behinderte| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|HINWEISE: Für ring_all, die Agenten, die mit Handys, die über Hook-Agent aktiviert haben, werden ihre Telefone klingeln und der erste, der auf die Forderung und die Informationen auf dem Bildschirm Agenten erhalten haben. Seit ring_all ignoriert Agent Wartezeit und das Ranking und wird alle Mittel, die für die Warteschlange ist anzurufen, empfehlen wir nicht mit dieser Methode für große Warteschlangen. Bei der Verwendung von ring_all werden Agenten mit Telefonen, die das Aufgelegt-Agent deaktiviert angemeldet haben müssen, um die Anrufe in Warteschlange Panel verwenden und klicken Sie auf den Link zum Gespräch annehmen Anrufe in der Warteschlange zu nehmen. Die Zeit, die Agenten-Telefon für ring_all klingelt an die On-Hakenring Zeiteinstellung oder der kürzesten Zeit Ring der Telefone, die aufgerufen wird eingestellt. Wir empfehlen nicht die Verwendung ring_all auf hohem Anrufvolumen Warteschlangen oder Warteschlangen mit vielen Agenten. Die ring_all Methode soll mit nur wenigen Mitteln und auf niedrigem Gesprächsaufkommen in-Gruppen verwendet werden| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Diese Option wird nur für Agenten, die in Handys, die mit den Agenten-On-Hook-Funktion aktiviert haben, werden protokolliert verwendet. Dies ist die Anzahl der Sekunden, dass jeder Anrufversuch an den Agent wird für das System wird bis 1 Sekunde warten und klingeln die Telefone verfügbaren Agenten erneut ertönen. Dieses Feld kann überschrieben werden, wenn die Agenten-Telefone zu einem unteren Ring der Zeit, die notwendig sein, um Anrufe von Telefonen gesendet werden ein Voicemail verhindern kann eingestellt werden. Die Standardeinstellung ist 15| +On-Hook Agent|Auf-Hook-Agent| +On-Hook Ring Time|On-Hakenring Zeit| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Diese Option ist nur für eingehende Anrufe gehen auf diese Remote-Agent verwendet. Diese Funktion ruft die Remote-Agenten und wird nicht sendet dem Kunden an den Remote-Agent, bis die Leitung beantwortet wird. Standard ist für behinderte N| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Diese Option wird nur verwendet, wenn der On-Hook-Agent-Feld oben auf Y gesetzt und dann auch nur für eingehende Anrufe kommen auf diese Remote-Agent. Dies ist die Anzahl der Sekunden, dass jeder Anrufversuch wird, klingeln, um zu versuchen, eine Antwort zu bekommen. Es wird empfohlen, dass Sie diese Einstellung auf ein paar Sekunden weniger, als es für einen Aufruf an die Voicemail gesendet werden braucht. Die Standardeinstellung ist 15| +On-Hook Agent Login|On-Haken Agent Login| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Diese Option ist nur für eingehende Anrufe gehen an einen Agenten angemeldet mit diesem Telefon verwendet. Diese Funktion ruft den Agenten und wird nicht sendet dem Kunden an den Agenten Sitzung, bis die Leitung beantwortet wird. Standard ist für behinderte N| +This is a Phone On-Hook Agent|Dies ist ein Hörer aufgelegt Agenten| +Maximum Ring Time|Maximale Ring Time| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|Die DEFER Optionen auf zu blinken und die Anzeige-oder rot auf, wenn Sie die Rückrufe zu überprüfen, bis die Anzahl der Rückrufe Änderungen| +Auto Pause Pre-Call Work|Auto Pause Pre-Call Work| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Im Auto-Dial-Modus, wenn diese Einstellung aktiviert wird gesetzt, um den Agenten automatisch angehalten, wenn der Agent klickt auf eine der folgenden Funktionen, die ihnen inne-Manual Dial, Fast Dial, Lead Suche, Call Log View benötigt, überprüfen Sie Rückrufe, Geben Sie Pause Code. Standard ist für inaktive N| +Auto Resume Pre-Call Work|Auto-Resume-Pre-Call Work| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Im Auto-Dial-Modus, wenn diese Einstellung aktiviert ist wird der Agent an aktiven automatisch eingestellt, wenn der Agent klickt, die aus oder Stempeln, auf eine der folgenden Funktionen, die ihnen inne-Manual Dial, Fast Dial, Lead Suche sein muss, Call Melden Sie sehen, Rückrufe, Enter Pause Code. Standard ist für inaktive N| +Auto Pause Pre-Call Code|Auto Pause Pre-Call-Vorwahl| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Wenn das Auto Pause Pre-Call Work-Funktion über aktiv ist, und Agent Pause Codes aktiv ist, wird diese Einstellung die Pause-Code, der verwendet wird, wenn der Agent für diese Aktivitäten angehalten wird. Die Standardeinstellung ist PRECAL| +This campaign is not set to Auto-Alt-Dial|Diese Kampagne ist nicht auf Auto-Alt-Zifferblatt| +Multi-Alt-Settings|Multi-Alt-Einstellungen| +Reload Dialplan On Servers|Auf Servern neu laden Dialplan| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Diese Option ermöglicht es Ihnen, ein erneutes Laden der Dialplan auf allen Asterisk-Server im Cluster zu zwingen. Wenn Sie Änderungen in den Custom Dialplan Eintrag oben gemachten Sie dies auf 1 gesetzt und reichen sollte, um diese Änderungen in Kraft treten müssen auf den Servern| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Mit MULTI_LEAD erlaubt Ihnen, eine separate Leitung für jede Nummer auf einem Kundenkonto, dass alle eine gemeinsame vendor_lead_code verwenden, und die Art der Rufnummer jeweils mit einem Etikett im Feld Besitzer definiert. Diese Option wird deaktiviert einige Optionen auf dem Bildschirm ändern Kampagne und zeigen einen Link zu dem Multi-Alt-Einstellungen Seite, die Sie an, welche Telefonnummer Typen, definiert durch die Beschriftung der einzelnen Blei festlegen können, wird gewählt und in welcher Reihenfolge. Dies wird eine spezielle Blei-Filter und wird das Feld Rang aller Leads innerhalb der Listen gesetzt, um diese Kampagne zu ändern, um sie in der von Ihnen angegebenen Reihenfolge nennen| +Manual Dial CID|Manuelle Wahl CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Dieser legt fest, ob ein Agent macht manuelle Einwahl Anrufe haben die Kampagne callerID Einstellungen verwendet, oder ihrer Bevollmächtigten Telefon callerID Einstellungen verwendet. Die Standardeinstellung ist KAMPAGNE| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Wenn die Use Custom CID Kampagne Option aktiviert ist oder die Liste Kampagne CID Override Einstellung wird verwendet, wird diese Einstellung ignoriert werden| +Phone Post Time Difference Alert|Telefon Post Time Difference-Alert| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Dieses Handbuch-Einwahl nur Funktion, falls aktiviert, wird eine Warnung anzeigen, wenn die Zeitzone für die Führung Postleitzahl oder eine Postleitzahl ein, unterscheidet sich von der Zeitzone von der Vorwahl der Rufnummer für die Führung. Die OUTSIDE_CALLTIME_ONLY Option wird nur die Warnung, wenn die beiden Zeitzonen unterschiedlich sind und eine der Zeitzonen liegt außerhalb des Bereitschaftsdienstes für die Kampagne ausgewählt. OUTSIDE_CALLTIME_PHONE prüfen lediglich die Zeitzone der Telefonnummer des Blei-und alarmieren, wenn es außerhalb des lokalen Zeit während des Bereitschaftsdienstes ist. OUTSIDE_CALLTIME_POSTAL prüfen lediglich die Zeitzone der Postleitzahl des Blei-und alarmieren, wenn es außerhalb des lokalen Zeit während des Bereitschaftsdienstes ist. OUTSIDE_CALLTIME_BOTH wird die Postleitzahl und die Telefonnummer für Sein im Ortsgespräch Zeit zu überprüfen, auch wenn sie in der gleichen Zeitzone befinden. Diese Warnungen werden in der Anrufliste Info, Rückrufe List-Info, Suchergebnisse Info, wenn eine Leitung gewählt wird und wenn ein Interessent eine Vorschau zu zeigen. Der Standardwert ist DISABLED| +Custom 3-Way Button Transfer|Custom 3-Wege-Taste Transfer-| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Diese Option wird eine benutzerdefinierte Schaltfläche Übertragung an den Agenten-Bildschirm unterhalb der Transfer-Conf-Taste, die es einem Klick Drei-Wege-Anrufe über das ausgewählte Preset oder ein Feld hinzufügen. Die PRESET_ Optionen findet Anrufe mit der Preset-Wert definiert. Die field_groupj Optionen findet Anrufe mit der Nummer in das ausgewählte Feld aus der Führung. BEHINDERTE nicht zeigen Sie die Taste auf dem Agenten-Bildschirm. Die PARK_ Optionen wird den Kunden vor dem Wählen zu parken. Der Standardwert ist DISABLED| +Auto Dial Level Threshold|Auto Dial Schwellwert| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Diese Einstellung funktioniert nur mit einem ADAPT oder RATIO Wählmethode, und es muss auf etwas anderes als BEHINDERTE und die Anzahl der Agenten Einstellung muss über 0 eingestellt werden. Diese Funktion erlaubt Ihnen, eine Mindestanzahl Agenten eingestellt, dass prädiktive Algorithmus wird bei der Arbeit. Wenn die Anzahl der Agenten unterschreitet die Nummer, die Sie eingestellt haben, dann wird die DFÜ-Ebene wird auf 1,0 gehen, bis mehr Agenten melden Sie sich an oder gehen in den ausgewählten Zustand. Angemeldete IN_AGENTS wird alle Mittel in die Kampagne angemeldet zu zählen, wird NON-PAUSED_AGENTS zählen nur Agenten, die darauf warten oder sich unterhalten, und WAITING_AGENTS wird nur zählen, dass Agenten auf einen Anruf warten. Der Standardwert ist DISABLED| +Available Only Tally Threshold|Erhältlich Nur Tally Threshold| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Diese Einstellung funktioniert nur mit einem ADAPT oder RATIO Wählmethode, erhältlich nur Tally auf N gesetzt werden muss, muss diese Einstellung auf etwas anderes als DISABLED gesetzt werden und die Anzahl der Agenten Einstellung muss über 0 sein. Diese Funktion ermöglicht es Ihnen, die Anzahl der Agenten, unterhalb derer Erhältlich Nur Tally aktiviert sein wird eingestellt. Wenn die Anzahl der Agenten unterschreitet die Nummer, die Sie eingestellt haben, dann ist die Verfügbar Nur Tally Einstellung mit zu gehen, um vorübergehend y bis mehreren Mitteln, sich anzumelden oder gehen in den ausgewählten Zustand. Angemeldete IN_AGENTS wird alle Mittel in die Kampagne angemeldet zu zählen, wird NON-PAUSED_AGENTS zählen nur Agenten, die darauf warten oder sich unterhalten, und WAITING_AGENTS wird nur zählen, dass Agenten auf einen Anruf warten. Der Standardwert ist DISABLED| +Time Zone Setting|Zeitzonen-Einstellung| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Diese Option ermöglicht es Ihnen, die Methode der Aufrechterhaltung der aktuellen Zeitzone Nachschlag für die Leitungen innerhalb dieser Liste gesetzt. Dieser Prozess wird nur in der Nacht geschehen ist werden die Änderungen nicht in der unmittelbaren. COUNTRY_AND_AREA_CODE ist die Standardeinstellung und wird die Landes-und Ortsvorwahl der Telefonnummer verwenden, um die Zeitzone des Bleis bestimmen. POSTAL_CODE verwenden die Postleitzahl falls vorhanden die Zeitzone des Bleis zu bestimmen. NANPA_PREFIX funktioniert nur in den USA und wird die Vorwahl und die Vorwahl der Telefonnummer verwenden, um die Zeitzone des Bleis bestimmen, aber dies ist nicht standardmäßig im System aktiviert, so dass Sie sicher, Sie haben die NANPA Präfix Daten verladen Ihr System, bevor Sie diese Option auswählen. OWNER_TIME_ZONE_CODE wird die Standard-Zeitzone abbraviation in das Feld Besitzer des Blei beladen benutzen, um die Zeitzone zu bestimmen, in den USA Beispiele sind AST, EST, CST, MST, PST, AKST, HST. Dieses Leistungsmerkmal muss von Ihrem Systemadministrator aktiviert werden, um in Kraft treten| +Dial Level Difference Target|Wählen Level Difference Ziel| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Dieses Feld wird festgelegt, ob Sie gezielt mit einer bestimmten Anzahl von Agenten warten auf Anrufe oder Anrufe in der Warteschlange für die Agenten wollen. Zum Beispiel, wenn Sie möchte immer im Durchschnitt ein Agent frei zu nehmen haben, ruft sofort würden Sie diese auf -1 gesetzt, wenn Sie möchten, zu zielen immer mit einem Anruf zu halten für einen Agenten warten Sie dies auf 1 gesetzt würde. Standard ist 0. Dieses Feld wird nicht durch das Handbuch oder INBOUND_MAN Einwahl verwendeten Methoden| +Admin Utilities|Admin-Dienstprogramme| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|versteckte Dienstprogramme Seite - wenn Sie nicht wissen, was diese Programme tun, sollten Sie wahrscheinlich nicht verwenden| +Welcome Languages Page|Willkommen Sprachen Seite| +Campaign Debug Page|Kampagne Debug Seite| +Bulk Phone Insert Page|Bulk-Phone Seite einfügen| +Send a Call With Custom CID Page|Senden Sie eine Telefonkonferenz mit Custom CID Seite| +Speech Voice Lab Page|Rede-Stimme Lab Seite| +Safe Harbor Audio|Safe-Harbor-Audio| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Dies ist der Audio-Datei, die prompt gespielt, wenn die Drop-Aktion zu AUDIO eingestellt ist. Die Standardeinstellung ist Buzz| +Safe Harbor Call Menu|Safe-Harbor-Call Menu| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|Dies ist der Anruf-Menü, dass ein Aufruf gesendet, wenn die Drop-Aktion ist auf CALLMENU| +Log Key Press|LOG-Taste drücken| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Diese Option wird aktiviert, wenn die DTMF-Taste drücken durch den Anrufer in dieser Aufforderung Menü anmelden. Standard ist 0 für Behinderte| +No DTMF Logging|Keine DTMF-Logging| +DTMF Logging Enabled|DTMF-Protokollierung aktiviert| +Webphone Auto-Answer|Webphone Auto-Antwort| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Mit dieser Einstellung kann die Web-Telefon eingerichtet werden, dass Anrufe automatisch, die kommen, indem es auf Y, oder um Anrufe Ring indem Sie sie auf N. Standard haben, ist Y| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU wird den Kunden mit dem Call-Menü in der Auswahlliste unten definiert schicken| +Survey Call Menu|Umfrage Call Menu| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Wenn die Methode zu CALLMENU gesetzt wird, ist dies das Menü Anruf, dass der Kunde wird gesendet, wenn sie opt-in| +Scheduled Callbacks Days Limit|Geplante Rückrufe Tage zu begrenzen| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Diese Option ermöglicht Ihnen, den Agenten zu reduzieren geplant Rückrufe Kalender, um eine wählbare Anzahl von Tagen ab heute, die volle 12-monatigen Kalender wird immer noch angezeigt, aber nur die festgelegte Anzahl von Tagen wird auswählbar sein. Standard ist 0 für unbegrenzt| +Dial Level Difference Target Method|Wählen Level Difference Zielmethode| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Mit dieser Option können Sie festlegen, ob die Einwahl Pegeldifferenz Zielsetzung nur auf die Berechnung des Zifferblattes Ebene oder auch auf die tatsächliche Wahl auf jeder Einwahl-Server angewendet wird. Wenn Sie mit einer kleinen Kampagne mit angemeldeten Agenten in auf vielen Servern Sie die ADAPT_CALC_ONLY Option verwenden können, weil die CALLS_PLACED Option in weniger Anrufe werden als Moeglichkeiten nach platziert führen kann. Diese Option ist nur aktiv, wenn Dial Level Difference Ziel auf etwas anderes als 0 gesetzt ist. Die Standardeinstellung ist ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Wenn Sie benutzerdefinierte Felder in einem Web-Formular-Adresse verwenden möchten, müssen Sie hinzufügen| +as part of your URL|als Teil der URL| +Disable Dispo Screen|Deaktivieren Sie Dispo-Screen| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Diese Option ermöglicht es Ihnen, die Disposition Bildschirm im Agent-Interface zu deaktivieren. Das Deaktivieren der Dispo-Status Feld darunter muss für diese Option funktioniert gefüllt werden. Die Standardeinstellung ist| +Disable Dispo Status|Deaktivieren Sie Dispo-Status| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Wenn der Dispo-Screen-Option deaktivieren, um DISPO_DISABLED gesetzt ist, dann muss dieses Feld ausgefüllt Du jede Verfügung, die Sie für dieses Feld verwenden können, solange sie von 1 bis 6 Zeichen lang mit nur Buchstaben und Zahlen ist zu| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Diese Einstellung, wenn es auf 1 gesetzt wird es ein Manager, um den Export Call-und Blei-Berichte über den Bildschirm Berichte zugreifen. Standard ist 0. Für den Export Calls und Leads Reports wurde die folgende Reihenfolge der Felder für den Export verwendet| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Dieser Bericht zieht Blei Informationen für Anrufe in den ausgewählten Zeitraum gewählt. Ein Lead ist nur einmal, egal wie viele Anrufe bearbeitet wurden exportiert. Die Stromzuführung Status verwendet wird.| +Export Leads Report|Export Leads Bericht| +Screen Labels|Screen-Labels| +Add A Screen Label|Fügen Sie einen Screen Etiketten| +ADD NEW SCREEN LABEL|ADD NEW SCREEN LABEL| +ADDING NEW SCREEN LABEL|HINZUFÜGEN VON NEUEN SCREEN LABEL| +MODIFY SCREEN LABEL|MODIFY SCREEN LABEL| +DELETE SCREEN LABEL|DELETE SCREEN LABEL| +SCREEN LABELS LIST|SCREEN Label Liste| +Screen Label ID|Screen-Label-ID| +Screen Label Name|Screen-Label Name| +SCREEN LABEL NOT ADDED|SCREEN Label nicht ADDED| +there is already a label in the system with this ID|Es ist bereits ein Etikett in dem System mit dieser ID| +SCREEN LABEL ADDED|SCREEN Etikett hinzugefügt| +SCREEN LABEL NOT DELETED|SCREEN LABEL NICHT GELÖSCHT| +SCREEN LABEL DELETION CONFIRMATION|SCREEN LABEL Löschbestätigung| +Click here to delete screen label|Klicken Sie hier, um Bildschirm-Label löschen| +SCREEN LABEL DELETION COMPLETED|SCREEN LABEL LÖSCHUNG ABGESCHLOSSEN| +DELETE THIS SCREEN LABEL|DELETE THIS SCREEN LABEL| +Click here to see Admin changes to this screen label|Klicken Sie hier um Admin Änderungen in diesem Fenster sehen Etikett| +Hide Label in Call Logs|Beschriftung ausblenden in Anrufprotokolle| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Wird ein Etikett zu setzen --- HIDE --- dann sind die Agenten Anruflisten, wenn über die Kampagne aktiviert ist, werden immer noch das Feld und Daten, wenn diese Option gesetzt, um Standard-Y ist N| +SCREEN LABEL NOT MODIFIED|SCREEN LABEL NICHT VERÄNDERT| +SCREEN LABEL MODIFIED|SCREEN LABEL MODIFIZIERTE| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Dieses Feld muss mindestens 2 Zeichen lang sein und nicht länger als 20 Zeichen lang sein, keine Leerzeichen oder Sonderzeichen enthalten. Dies ist die ID, die verwendet werden, um den Bildschirm Label im gesamten System identifiziert wird| +This is the descriptive name of the screen label entry|Dies ist der beschreibende Name des Bildschirms Etikett Eintrag| +Agent Screen Labels|Agent-Bildschirm Labels| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|Sie können eine Reihe von Agenten-Bildschirm Etiketten mit dieser Option zu nutzen. Standard ist - SYSTEM-EINSTELLUNGEN - für die Standard-Etiketten| +Status Display Fields|Status Display-Felder| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|Sie können auswählen, welche Variablen für Anrufe in der Statuszeile des Agenten-Bildschirm wird angezeigt. CALLID wird die 20-stelligen eindeutigen Anruf-ID anzuzeigen, LEADID wird das System Blei-ID anzuzeigen, wird die Liste ListId ID. Die Standardeinstellung ist CALLID| +CAMPAIGNS USING THIS SCREEN LABEL|Kampagnen mit diesem Schirm zu LABEL| +QueueMetrics Phone Environment Phone Append|QueueMetrics Telefon Umwelt Telefon anhängen| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Diese Option, falls aktiviert, wird der Agent anhängen Telefon anmelden, um die data4 Rekord in der Warteschlange Log-Tabelle, wenn die Kampagne Telefon Umwelt-Feld gefüllt wird. Standard ist 0 für Behinderte| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|Verborgenes, das nicht die Agenten das Feld, sondern ermöglicht dem Feld, um Daten in diese importiert und exportiert sie, ebenso wie haben sie für das Skript verfügbare Register und Web-Formular-Adresse. READONLY stellt den Wert der Daten in dem Feld, aber nicht zulassen, dass das Mittel, um die Daten zu ändern| +Enable Campaign Test Calls|Aktivieren Campaign Test-Anrufe| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Diese Einstellung ermöglicht die Fähigkeit, ein Telefon und die Telefonnummer in die Felder eingeben am unteren Ende der Kampagne Detailbild und legen Sie einen Anruf an diese Nummer als wäre es eine Führung in das System auto-gewählt wurden. Die Rufnummer wird als eine neue Führung in der Liste manuelle Einwahl-ID-Liste gespeichert werden. Die Kampagne muss aktiv sein, damit diese Funktion aktiviert werden, und es wird empfohlen, dass die Listen zugeordnet der Kampagne alle auf inaktiv gesetzt werden. Die Vorwahl, Dial-Timeout und alle anderen Wahlverfahren verwandten Funktionen, mit Ausnahme von DNC und Call-Optionen eingeben, wird Auswirkungen auf die Wahl der Prüfnummer. Der Anruf wird auf dem Server als dem Voicemail-Server in den Systemeinstellungen ausgewählt platziert werden. Standard ist 0 für Behinderte| +Test calling disabled|Test-Aufruf deaktiviert| +PLACE TEST CALL|ORT TESTANRUF| +Test Outbound Call|Testen Sie Outbound Call| +Agents Calls Reset|Agents Calls zurücksetzen| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Diese Einstellung legt fest, ob die angemeldeten Agenten und aktive Anrufe Aufzeichnungen zurückgesetzt werden an der Zeitschaltuhr am Ende des Tages sind. Standard ist 1 für aktivierte| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|Die Custom 5-Feld als Feld genutzt werden kann, um einen Dialplan Zahl definieren, um einen Anruf zu senden aus einer in-group AGENTDIRECT, wenn der Benutzer nicht verfügbar ist, brauchen Sie nur AGENTEXT in der Nachricht oder Erweiterungskörper setzen in der AGENTDIRECT in-group und das System sucht diesen Brauch fünf Feld und schickt den Anruf an diesem Dialplan Zahl| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Für in-Gruppen AGENTDIRECT, wenn der Benutzer nicht verfügbar ist, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Für in-Gruppen AGENTDIRECT, können Sie AGENTEXT in diesem Bereich setzen und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|Sie können auch AGENTEXT in diesem Bereich, wenn es um Infusionsleitung ist und das System wird nach dem Benutzernamen fünf benutzerdefinierte Feld und schicken Sie den Anruf an dieses Dialplan Zahl| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|Aufträge von der letzten Zeit wurde ein Agent einen eingehenden Anruf gesendet. Ergebnisse in Agenten erhalten etwa die gleiche Anzahl der Anrufe insgesamt| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|Bestellungen durch das letzte Mal ein Agent beendet einen eingehenden Anruf. AKA-Agent wartet am längsten erhält ersten nennen| +Servers|Server| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Dies ist eine Liste der Server IP-Adressen der bestehenden Server in das System, dass Sie das Telefon Einträge über besiedelt werden soll. Diese müssen gültige IP-Adressen sein, müssen sie in dem System aktiv ist, und Sie müssen eine pro Zeile in diesem Textfeld Eingabefeld setzen| +Phones|Handys| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Dies ist eine Liste mit den Telefon-Erweiterungen, die Sie auf allen Servern oben aufgeführten erstellt werden. Die Telefon-Erweiterungen sollten nur Buchstaben und Zahlen sein, ohne Sonderzeichen und Sie müssen eine pro Zeile in diesem Textfeld Feld setzen| +Registration Password|Anmeldung Passwort| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|Dies ist die Registrierung Passwort, das für alle Handys, die erstellt werden verwendet werden soll. Für SIP und IAX2-Protokoll sollten Sie ein komplexes Passwort verwenden Gründe für gesichert durch| +Login Password|Login Passwort| +This is the agent screen login password that will be used for all of the phones that are created|Dies ist der Agent Bildschirm Login-Passwort, das für alle Handys, die erstellt werden verwendet werden soll| +Create Alias Entries|Alias ​​erzeugen Einträge| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Wenn diese Option auf YES wird eine Alias-Eintrag Telefone für jede der oben genannten Erweiterungen, die alle von der gleichen Erweiterung Einträge auf jedem Server zusammen zu binden erlaubt Telefon anmelden, um Load Balancing im Agent-Interface arbeiten aufgelistet erstellen| +Alias Suffix|Alias-Suffix| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|Dies ist der Suffix, das die Erweiterung hinzugefügt wird, um das Telefon Alias-ID zu bilden. Zum Beispiel, wenn die Erweiterung CC100 und die Alias-Suffix x, dann das Telefon Alias-ID verwendet für das wäre cc100x| +Client Protocol|Client Protocol| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Dies ist die Telefonnummer Protokoll, das für alle Telefone erstellt, wenn versandt verwendet wird. SIP und IAX2 sind VoIP-Protokolle, die conf-Datei Einträge zu erstellen wird, damit diese phoens auf den Servern registrieren| +Local GMT|Lokale GMT| +This is the time zone that all of the phones will be created with|Dies ist die Zeitzone, dass alle Telefone erstellt werden wird mit| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB ähnelt HIDDEN außer der Datenspeicherung auf dem Datenbank-Typ ist ein Typ BLOB, geeignet für binäre Daten oder Daten, die gesichert werden muss| +Default Local GMT|Standard Local GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Diese Einstellung legt fest, was standardmäßig verwendet werden, wenn neue Telefone und Server hinzugefügt werden, mit dieser Admin Web-Interface. Die Standardeinstellung ist -5| +Default Voicemail Zone|Standard-Voicemail-Zone| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Diese Einstellung definiert, in welcher Zone wird standardmäßig verwendet werden, wenn neue Telefone und Voicemail-Boxen erstellt werden. Die Liste der verfügbaren Zonen wird direkt aus dem voicemail.conf Datei entnommen. Die Standardeinstellung ist Ost| +Voicemail Zone|Voicemail-Zone| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Diese Einstellung können Sie die Zone, dass diese Voicemail-Box wird an eingestellt werden, wenn die Zeit für eine Meldung protokolliert wird eingestellt. Standard wird in den Systemeinstellungen festgelegt| +Voicemail Options|Voicemail-Optionen| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Diese optionale Einstellung ermöglicht es Ihnen, zusätzliche Voicemail-Einstellungen zu definieren. Es wird empfohlen, dass Sie dieses Feld leer lassen, wenn Sie wissen was Sie tun| +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|Die nächsten beiden Einstellungen sind auch im Abschnitt Systemeinstellungen definiert, und Sie können sie ändern, nachdem Sie sie hier definieren. Sie sollten die Standard-Lokale Zeitzone GMT auf die, dass Ihre Agenten wollen in. sein Die Voicemail-Zone ist die Auflistung der Voicemail-Zeitzonen, dass Voicemail-Nachrichten werden mit der Zeit, wenn neue Nachrichten bleiben eingeloggt sein| +ERROR: You cannot use reserved words for field labels|FEHLER: Sie können keine reservierten Wörter für Feldbezeichnungen| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|Die DISPO_SELECT_DISABLED Option wird nicht deaktivieren Sie die Dispo-Bildschirm vollständig, sondern wird das Dispo-Bildschirm ohne jegliche Verfügungen anzeigen zu lassen, sollte diese Option nur verwenden, wenn Sie zu zwingen, Ihren Agenten zu Ihrem CRM-Software, die den Status an das System sendet über die API nutzen möchten werden| +No Agent Call URL|Kein Anruf-Agent URL| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Diese Web-URL-Adresse wird nicht durch den Agenten zu sehen, aber wenn es gefüllt wird aufgerufen, wenn ein Ruf, der nicht von einem Agenten gehandhabt wird nach oben oder aufgehängt übertragen. Verwendet die gleichen Variablen wie die Web-Formular und Scripts verwenden. dispo kann verwendet werden, um die vom System vorgegebene Disposition für den Anruf abzurufen. Diese URL kann kein relativer Pfad sein. Standardeinstellung ist leer| +On-Hook CID|On-Haken CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Diese Option wird nur für Agenten, die in Handys, die mit den Agenten-On-Hook-Funktion aktiviert haben, werden protokolliert verwendet. Dies ist die Anrufer-ID zeigen sich nicht auf ihren Agenten Handys, wenn die Anrufe klingeln. GENERIC ist eine generische RINGAGENT00000000001 Art der Benachrichtigung. Eigengruppe wird zeigen, nur die in-group der Anruf kam. CUSTOMER_PHONE zeigt nur den Kunden Telefonnummer. CUSTOMER_PHONE_RINGAGENT wird RINGAGENT_3125551212 mit dem RINGAGENT als Teil des CID mit dem Kunden Rufnummer zu erhalten. CUSTOMER_PHONE_INGROUP zeigt die ersten 10 Zeichen des In-Group durch den Kunden Telefonnummer gefolgt| +Please wait for the whole page to load before submitting the form|Bitte warten Sie für die gesamte Seite zu laden, bevor Sie das Formular| +In-Group Calldate|In-Group Calldate| +This is the last date and time that a call was directed to this inbound group|Dies ist das letzte Datum und die Zeit, dass ein Anruf auf diese Gruppe gerichtet war Inbound| +No-Answer Log|Keine Antwort Anmelden| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Diese Option wird protokolliert die Wählautomatik Anrufe, die nicht auf einer separaten Tabelle beantwortet werden. Standard ist N| +Alt-Log DB Server|Alt-Log DB Server| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|Dies ist der alternative Log-Datenbank-Server. Dies ist optional und ermöglicht einige Protokolle auf einer separaten Datenbank geschrieben werden. Standard ist leer| +Alt-Log Tables|Alt-Log-Tabellen| +These are the tables that are available for logging on the alternate log database server. Default is blank|Dies sind die Tabellen, die für die Protokollierung auf dem alternativen Protokoll-Datenbank-Server sind. Standardeinstellung ist leer| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Dies ist der eigentliche Text To Speech Datenfeld, das geschickt, um für die Erstellung der Audio-Datei an den Kunden gespielt werden Cepstral wird. Sie verwenden können, Speech Synthesis Markup Language-SSML-in diesem Bereich, zum Beispiel| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|für eine 1 Sekunde Pause. Sie können auch mehrere Variablen wie Vorname, Nachname und Titel wie sich jeder leisten Variablen wie nur Sie tun, in einem Script: - A - vorname - B -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Wenn Sie statische Audiodateien, die Sie verwenden möchten, auf den Wert eines der Felder, die Sie für diese ebenfalls verwenden können mit C-und D-Tags basieren. Die Dateinamen müssen kleingeschrieben sein und sie müssen 8k 16bit PCM WAV-Dateien sein. Der Name des Feldes muss die gleiche, aber ohne die. Wav im Dateinamen sein. Zum Beispiel - C ---- A - Address3 - B ---- D - zuerst finden würde, den Wert für Address3, dann würde es versuchen, eine Audio-Datei passenden Wert, dass es in den Prompt legte finden| +Here is a list of the available variables|Hier ist eine Liste der verfügbaren Variablen| +DID Agent Log|DID-Agent-Protokoll| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Diese Option wird protokolliert die eingehenden Anrufe DID zusammen mit einer Gruppe in-und Benutzer-ID, falls zutreffend, in eine separate Tabelle. Standard ist N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|TIMEOUT können Sie festlegen, was mit dem Anruf, wenn es mal aus, ohne Eingaben des Anrufers. INVALID können Sie festlegen, was passiert, wenn der Anrufer eine ungültige Option. INVALID_2ND und 3. kann nur dann aktiv, wenn ungültige nicht verwendet wird, wird es erst in der zweiten oder dritten ungültigen Eintrag durch den Anrufer warten, bevor es die Option ausführt| +Survey Recording|Umfrage Recording| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Wenn aktiviert, wird diese Aufnahme starten, wenn der Anruf beantwortet wird. Nur empfohlen, wenn das Verfahren nicht eingestellt ist, um an einen Agenten zu übertragen. Standard ist für behinderte N| +Campaign Areacode CID|Kampagne Vorwahl CID| +AREACODE CIDS FOR THIS CAMPAIGN|AREACODE CIDS Für diese Kampagne| +ADD NEW AREACODE CID|ADD NEW AREACODE CID| +AREACODE|AREACODE| +SUBMIT CHANGES|Änderungen senden| +AREACODE CID NOT ADDED|CID NICHT ADDED AREACODE| +there is already an entry for this campaign with this CID|Existiert bereits ein Eintrag für diese Kampagne mit diesem CID| +AREACODE CID ADDED|AREACODE CID ADDED| +AREACODE CID NOT DELETED|AREACODE CID NICHT GELÖSCHT| +this entry does not exist|Dieser Eintrag existiert nicht| +AREACODE CID DELETED|AREACODE CID DELETED| +AREACODE CID MODIFIED|AREACODE CID MODIFIZIERTE| +Campaign Areacode CID Modify|Kampagne Vorwahl CID ändern| +CAMPAIGN AREACODE CID LISTINGS|KAMPAGNE AREACODE CID DIASHOW| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Bei Einstellung auf AREACODE Sie haben die Fähigkeit, in die AC-CID Untermenü zu gehen und zu definieren, um mehrere callerids pro Ortsvorwahl verwendet werden| +Enable Campaign Areacode CID|Aktivieren Kampagne Vorwahl CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Diese Einstellung ermöglicht es die Möglichkeit, bestimmte abgehende CallerID Zahlen, die pro Kampagne verwendet werden soll. Standard ist 1 für aktivierte| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Wenn die Einstellung SYSTEM bei Vorwahl CIDs aktiviert ist und die Kampagne für die Einstellung Use Custom CallerID soll AREACODE dann haben Sie die Möglichkeit, Vorwahl CIDs, die verwendet werden, wenn ausgehende Anrufe, um Leads in diesem speziellen Kampagne zu definieren. Sie können mehrere callerIDs pro Ortsvorwahl und Sie können aktivieren und deaktivieren jeweils in Echtzeit. Wenn mehr als ein callerID ist für eine bestimmte Ortsvorwahl aktiv dann wird das System mit der CallerID, die die geringste Anzahl von Zeiten heute verwendet wurde. Wenn keine callerIDs für die Vorwahl der Region aktiv sind, dann ist die Kampagne CallerID oder Override-Liste CallerID verwendet werden| +PLLB Grouping|PLLB Gruppierung| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Telefon Einloggen Load Balancing Gruppierung, nur zulässig, wenn es mehrere Agent-Server sind und Telefon-Aliase sind auf dem System vorhanden. Bei der Einstellung ONE_SERVER_ONLY wird es erzwingen, dass alle Agenten für diese Kampagne, um auf den gleichen Server einloggen. Wenn in Cascading es in Agenten auf dem gleichen Server werden protokolliert Gruppe bis PLLB Gruppierung Anzahl der Agenten-Limit erreicht gesetzt sind, dann ist der nächste Agent wird an den nächsten Server mit der geringsten Anzahl von Agenten anmelden. Wenn der Maßstab Telefon Aliases Verhalten jedes Agenten Finden der Server mit der geringsten Anzahl von Nicht-Remote-Agenten hinein protokolliert Deaktiviert, um genutzt werden. Der Standardwert ist DISABLED| +PLLB Grouping Limit|PLLB Limit-Gruppierung| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Telefon Einloggen Load Balancing Verbund Limit. Wenn PLLB Gruppierung zu CASCADING eingestellt ist, dann wird diese Einstellung bestimmt die Anzahl der Agenten akzeptabel in jedem Server für diese Kampagne. Standard ist 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Telefon Einloggen Load Balancing Verbund Limit. Wenn PLLB Gruppierung in Cascading auf der Kampagnen-Ebene eingestellt ist, dann wird diese Einstellung bestimmt die Anzahl der Agenten akzeptabel auf jedem Server in allen Kampagnen. Der Standardwert ist 100| +Modify DID RA Extension Overrides|Ändern DID RA Erweiterung Überschreibt| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|DID Remote Agent EXTENSION OVERRIDE NICHT HINZUGEFÜGT| +there is already an entry for this DID with this RA EXTENSION|Existiert bereits ein Eintrag für diese DID mit diesem RA EXTENSION| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|DID Remote Agent EXTENSION OVERRIDE ADDED| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|DID Remote Agent EXTENSION OVERRIDE NICHT GELÖSCHT| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|DID Remote Agent EXTENSION OVERRIDE MODIFIZIERTE| +MODIFY THIS DID|Ändern dieser DID| +Enable Remote Agent Extension Overrides|Aktivieren Sie Remote Agent Erweiterung Overrides| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Diese Einstellung ermöglicht DIDs auf Verlängerung Überschreibungen für Remote-Agenten geroutet haben ruft durch in-Gruppen. Standard ist 0 für Behinderte| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|Remote Agent EXTENSION Überschreibungen für diesen DID| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|Remote Agent EXTENSION OVERRIDE DIASHOW| +DID Remote Agent Extension Overrides|DID Remote Agent Erweiterung Overrides| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Dieser Abschnitt erlaubt Ihnen, zu ermöglichen DIDs Erweiterung Überschreibungen für Remote-Agenten geroutet haben ruft durch in-Gruppen. Der Nutzer muss eine gültige Start-Remote-Agent User Anfang sein, oder wenn Sie die Erweiterung Überschreiben Eintrag für alle Anrufe zu arbeiten wollen, dann können Sie --- Alle --- in der User Feld Start. Wenn es mehrere Einträge für denselben DID und Benutzer starten dann die aktiven Einträge in einem Round-Robin-Verfahren verwendet werden| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|Sahen Remote Agent EXTENSION Überschreibungen für diesen DID| +THERE ARE|ES GIBT| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID Remote Agent EXTENSION Überschreibungen für diesen Remote Agent| +Action Transfer CID|Aktion Transfer-CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Wird für Tropfen, Afterhours und No-Agent-no-Warteschlange Aktionen. Dies ist die Anrufer-ID-Nummer, dass der Anruf, bevor es zu Erweiterungen, Nachrichten, Voicemail-oder Call-Menüs übertragen wird, verwendet. Sie können Kunden in diesem Bereich nutzen, um dem Kunden die Telefonnummer oder Kampagne zu verwenden, um die erste Kampagne erlaubte Anrufer-ID-Nummer zu verwenden. Die Standardeinstellung ist KUNDEN| +After Hours Call Menu|After Hours Call Menu| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Wenn After Hours Aktion zu CALLMENU gesetzt ist, wird der Anruf an diesem Call Menu geschickt werden, wenn sie die in-group außerhalb des Bereitschaftsdienstes Schema für die in-group definiert betritt| +Drop Call Menu|Drop-Call Menu| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Wenn Drop-Aktion zu CALLMENU gesetzt ist, wird der Anruf mit dieser Aufforderung Menü geschickt werden, wenn sie auf Anruf beenden Sekunden erreicht| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|Benutzerdefinierte Felder DID - Diese fünf Felder können für verschiedene Zwecke verwendet werden, vor allem in Bezug auf kundenspezifische Programmierung und Berichte| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|Wenn gesetzt, um auch Anrufbeantworter Y_WITH_AMD erkannt Nachricht Anrufe werden aufgezeichnet| +Log Field|Protokollfeld| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Wenn die LOG-Taste drücken Option aktiviert ist, kann diese optionale Einstellung ermöglicht die Reaktion auf auch in dieser Liste Feld gespeichert werden| +Default is NONE for disabled|Der Standardwert ist NONE für Behinderte| +Call Count Limit|Anzahl der Anrufe-Limit| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Dies erzwingt eine Grenze für die Anzahl der Anrufversuche für die Leitungen in dieser Kampagne gewählt. Ein Lead kann sich über diese Grenze gehen, wenn etwas Blei-Recycling oder Auto-Alt-Dialing aktiviert ist. Standard ist 0 für kein Limit| +Call Count Target|Anzahl der Anrufe Ziel| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Diese Option wird nur für Zwecke der Berichterstattung verwendet werden und hat keinen Einfluss auf den Leitungen gewählt. Standard ist 3| +Enable Expanded List Stats|Aktivieren Sie Erweiterte Liste Stats| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Diese Einstellung ermöglicht es zwei weitere Säulen, auf die meisten der Liste Status Zusammenbruch Tabellen auf der Liste Modifizierung und Änderung Kampagne Seiten angezeigt werden. Penetration ist als der Prozentsatz von Leitungen, die bei oder oberhalb der Kampagne Anruf Count Limit sind und oder der Status wird als abgeschlossen gekennzeichnet definiert. Standard ist 1 für aktivierte| +Report Option|Bericht Option| +This option allows this specific shift to show up in selected reports that support this option|Diese Option ermöglicht diese spezielle Schicht zu zeigen, bis in ausgewählte Berichte, die diese Option unterstützen| +There are|Es gibt| +completed leads in those lists|abgeschlossen führt in diesen Listen| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|Die VIEW_PRESET Option öffnen Sie einfach die Übertragung Rahmen und die voreingestellte Frame| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|Kontakte ist ein Option nur, wenn contact_information auf Ihrem System aktiviert ist, das ist eine benutzerdefinierte Funktion| +Preset Contact Search|Preset Kontakt Suche| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Wenn der Benutzer in eine Kampagne, die Transfer-Presets eingestellt hat KONTAKTE angemeldet ist, dann kann diese Einstellung deaktivieren Kontakt Suche nur für diesen Benutzer. Standard ist die NOT_ACTIVE verwenden, was auch immer die Kampagne Einstellung wird| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|Die VIEW_CONTACTS Option wird eine Suche Kontakte-Fenster zu öffnen, wird dies nur funktionieren, wenn Presets zu aktivieren KONTAKTE eingestellt ist| +Contacts Enabled|Kontakte aktiviert| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Diese Einstellung aktiviert die Kontakte Abs. Admin in die ein Manager zu ändern oder zu löschen Kontakte im System, die als Teil einer benutzerdefinierten Transfer in einer Kampagne, wo ein Agent für Kontakte nach Vorname Nachname oder Büro suchen können verwendet werden kann hinzufügen können Nummer und wählen Sie dann eine der vielen Zahlen mit diesem Kontakt zugeordnet. Diese Funktion wird oft von den Betreibern oder im Schaltschrank, wo Funktionen muss der Benutzer einen Anruf an einen Nicht-Agent Telefon übertragen würden verwendet. Standard ist 0 für Behinderte| +CONTACTS LIST|Liste KONTAKTE| +Add A Contact|Hinzufügen eines Kontakts| +ADD NEW CONTACT|Neuen Kontakt hinzufügen| +ADDING NEW CONTACT|HINZUFÜGEN VON NEUEN KONTAKT| +MODIFY CONTACT|KONTAKT ZU ÄNDERN| +CONTACT NOT ADDED|NICHT hinzugefügten Kontakt| +there is already a contact in the system with this name and number|Ist bereits ein Kontakt in das System mit diesem Namen und die Nummer| +CONTACT ADDED|Kontakt hinzugefügt| +DELETE THIS CONTACT|Diesen Kontakt löschen| +Click here to see Admin changes to this contact|Klicken Sie hier um Admin Änderungen an diesem Kontakt sehen| +DELETE CONTACT|Kontakt löschen| +CONTACT NOT DELETED|KONTAKT NICHT GELÖSCHT| +CONTACT DELETION CONFIRMATION|KONTAKT Löschbestätigung| +Office Number|Office Number| +Cell Number|Handy-Nummer| +Other Number|Andere Anzahl| +CONTACT NOT MODIFIED|NICHT VERÄNDERT KONTAKT| +Scheduled Callbacks Hours Block|Geplante Rückrufe Stunden-Block| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Diese Option ermöglicht es Ihnen, eine USERONLY geplanten Rückruf von auf dem Agent Rückrufliste bis X Stunden angezeigt, nachdem diese festgelegt wurde zu beschränken. Standard ist 0 für kein Block| +Scheduled Callbacks Calltime Block|Geplante Rückrufe Calltime-Block| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Diese Option aktiviert, wenn das geplante Rückruf in der Agenten-Callback-Liste aus, die gewählt zu verhindern, wenn es außerhalb des planmäßigen calltime für die Kampagne ist. Der Standardwert ist DISABLED| +Modify Same User Level|Ändern Gleiche User Level| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Diese Einstellung gilt nur bis 9 Benutzern zu nivellieren. Wenn diese Option aktiviert es ermöglicht der Stufe 9 Benutzer, ihre eigenen Einstellungen sowie andere Ebene 9 Benutzer ändern. Standard ist 1 für aktivierte| +Admin Hide Lead Data|Admin ausblenden Lead-Daten| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Diese Einstellung gilt nur bis Level 7, 8 und 9 Benutzer. Wenn diese Option aktiviert es ersetzt oder des Konsumenten führt Daten in den vielen Berichten und Bildschirmen im System mit Xs. Standard ist 0 für Behinderte| +Admin Hide Phone Data|Admin ausblenden Phone Data| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Diese Einstellung gilt nur bis Level 7, 8 und 9 Benutzer. Wenn diese Option aktiviert es ersetzt die Kunden Rufnummern in den vielen Berichten und Bildschirmen im System mit Xs. Die DIGITS Einstellungen zeigt nur die letzten Ziffern der X Telefonnummer. Standard ist 0 für Behinderte| +Allowed User Groups|Erlaubte User Groups| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Dies ist eine Liste der wählbaren Benutzergruppen, denen die Mitglieder dieser Benutzergruppe ansehen und ggf. bearbeiten. User Groups können den Zugriff auf nahezu alle Aspekte des Systems, vom Wareneingang bis DIDs Telefone an die Voicemail-Boxen. Die - ALLE - Option erlaubt den Benutzern in dieser Gruppe zu sehen und melden Sie sich an, um jeden Datensatz auf dem System, wenn ihre Benutzerberechtigungen für sie erlauben| +Allowed Call Times|Anruf erlaubt Zeiten| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Dies ist eine Liste der wählbaren Zeiten anrufen, an die Mitglieder dieser Benutzergruppe in Kampagnen verwenden können, in Gruppen-und Call-Menüs. Die - ALLE - Option erlaubt den Benutzern in dieser Gruppe, um alle Call-Zeiten im System verwenden| +All call times in the system|Alle Call-Zeiten im System| +You are not allowed to edit your own user group|Sie sind nicht berechtigt, eigene Benutzergruppe bearbeiten| +You are not allowed to edit your own user|Sie sind nicht berechtigt, eigene Benutzer bearbeiten| +Admin User Group|Admin User Group| +All Admin User Groups|Alle Admin User Groups| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|Dies ist der Benutzer mit Administratorrechten für diese Kampagne, ermöglicht diese Admin Betrachten dieser Kampagne sowie den Listen zugewiesen zu dieser Kampagne, um nach Benutzergruppen eingeschränkt werden. Standard ist - ALLE -, die jeder Benutzer admin mit Benutzergruppe Kampagne Rechte, um diese Kampagne sehen können| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|Dies ist die administrative Gruppe für das Inbound-Gruppe, ermöglicht diese Admin Betrachten dieser in-group von Benutzergruppe beschränkt. Standard ist - ALLE -, die jeder Benutzer admin, dies in-group sehen können| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|Dies ist die administrative Gruppe für das hat, ermöglicht diese Betrachtung von Admin dies durch Nutzergruppe hat beschränkt. Standard ist - ALLE -, die jeder Benutzer admin an, um dieses tat erlaubt| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|Dies ist die administrative Gruppe für das Rekord, ermöglicht diese Admin Betrachten dieser recoird durch Benutzergruppe zur Verfügung. Standard ist - ALLE -, die jeder Benutzer admin, um diesen Datensatz anzeigen können| +User Start for this remote agent does not exist|Benutzer-Start für diese Remote-Agent existiert nicht| +ADMIN GROUP|ADMIN-Gruppe| +Max Calls Method|Max ruft die Methode| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Diese Option kann damit die maximale gleichzeitige Anrufe für diese Funktion in-group. Bei der Einstellung TOTAL, dann ist die Gesamtzahl der Anrufe von Agenten in der Warteschlange und in dieser in-group gehandhabt wird nicht gestattet, das Max-Calls Graf Anzahl der Zeilen wie unten definiert überschreiten werden. Wenn zu IN_QUEUE gesetzt ist, dann, wenn die Anzahl der Anrufe in der Warteschlange für die Agenten nicht erlaubt wird, den Max überschreiten werden Calls Graf, egal wie viele Anrufe sind mit Agenten für diese in-group. Der Standardwert ist DISABLED| +Max Calls Count|Max ruft Graf| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Diese Option muss gesetzt höher als 0 sein, wenn Sie mit der MAX-Funktion ruft die Methode wollen. Standard ist 0| +Max Calls Action|Max ruft Aktion| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|Dies ist der zu treffenden Maßnahme, wenn der Max ruft die Methode aktiviert ist und die Anzahl der Anrufe übersteigt, was oben in der Max-Calls gesetzt Count-Einstellung sein. Die Anrufe über diesen Betrag wird entweder mit dem Drop-Aktion, die Afterhours Aktion oder der NO_AGENT_NO_QUEUE Aktion geschickt werden und werden als MAXCAL Status mit einem MaxCalls hangup Grund angemeldet sein. Die Standardeinstellung ist NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Wenn eine Methode mit CIDLOOKUP ALT verwendet wird, wird es die alt_phone Feld für die Telefonnummer zu suchen, wenn keine Übereinstimmung für die Haupt-Telefonnummer zu finden sind. Wenn eine Methode mit CIDLOOKUP ADDR3 verwendet wird, wird es die Address3 Feld für die Telefonnummer zu suchen, wenn keine Übereinstimmung für die Haupt-Telefonnummer und optional den alt_phone Bereich zu finden sind| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Ein weiterer Bereich, in diesem Abschnitt ist GRADE, das es ermöglicht, den nächsten Agenten campaign_grade_random Rufen Einstellung verwendet werden. Diese Sorte Einstellung erhöht oder verringert sich die Wahrscheinlichkeit, dass der Agent den Anruf erhalten| +gives a higher probability of getting a call to the higher graded agents|ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten| +gives a higher probability of getting a call to the higher graded agents by in-group|ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten durch in-group| +gives a higher probability of getting a call to the higher graded agents by campaign|ergibt eine höhere Wahrscheinlichkeit, einen Aufruf an die höherwertige Agenten von Kampagne| +Day call count for this in-group|Day Anruf Zählung für diese in-group| +Day call count for this campaign|Day Anruf Zählung für diese Kampagne| +SUMMARY STATS|Zusammenfassung | Statistik| +Daily Maximum Stats|Tägliches Maximum Stats| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Das sind Statistiken, die vom System generiert werden, jeden Tag den ganzen Tag, bis die Zeitschaltuhr am Ende des Tages, als es in den Systemeinstellungen eingestellt ist. Diese Zahlen sind aus den Protokollen innerhalb des Systems erzeugt werden, um für viel schneller Anzeige zu ermöglichen. Die Statistiken enthalten sind - Summe der Anrufe, Maximale Bevollmächtigte, Maximale eingehende Anrufe, ausgehende Anrufe Maximale| +Add or Remove In-Group Selected For Active Users in This User Group|Hinzufügen oder Entfernen von In-Group Für aktive Benutzer in diesem User Group gewählte| +Maximum System Stats Reports|Maximale Systemspannung Statistik Reports| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Diese Statistiken werden zwischengespeichert Summen, die jeden Tag überall in Echtzeit durch Back-End-Prozesse gespeichert werden. Bei eingehenden Anrufen werden die gesamten Anrufe pro in-group für jeden Anruf, den Prozess, der berechnet betritt berechnet. Für das gesamte System zählt, werden die Summen von Log-Einträgen sowie andere in-group-und Kampagnen-Summen erzeugt. Diese Summen können nicht addieren sich aufgrund der Einstellungen, die Sie in Ihrem System haben, sowie, wenn der Anruf aufgelegt| +Hopper VLC Dup Check|Hopper VLC Dup Prüfen| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Wenn Sie dieses auf Y wird in jedem führen, dass in den Trichter durch vendor_lead_code überprüft, um sicherzustellen, gibt es kein Duplikat eingefügt führen Leitungen mit der gleichen vendor_lead_code eingefügt. Dies ist besonders nützlich, wenn Auto-Alt-Dialing mit MULTI_LEAD. Standard ist N| +Inventory Report|Inventory Report| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Wenn das Inventory Report auf Ihrem System aktiviert ist, wird diese Option entscheiden, ob diese Liste in den Bericht aufgenommen wird oder nicht. Die Standardeinstellung ist J für Ja| +Report Rank|Melde Rang| +This option allows you to rank shifts in selected reports that support this option|Diese Option ermöglicht es Ihnen, Verschiebungen in ausgewählte Berichte, die diese Option unterstützen Rang| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|Sie können auch eine spezielle Variable IGNORENOSCROLL zu Bildlaufleisten auf der Registerkarte Skript zwingen, selbst wenn Sie mit einem iFrame sind darin| +Carrier Log Report|Carrier-Log Report| +ADMINISTRATION: Campaign Multi-Alt-Leads|VERWALTUNG: Kampagne Multi-Alt-Leads| +Multi-Lead Auto Alt Dialing Settings Form|Multi-Kanal-Auto-Dialing-Einstellungen Alt Formular| +List Custom Fields|Liste Custom Fields| +Select custom template|Wählen Sie benutzerdefinierte Vorlage| +template builder|Template Builder| +Load from Lead File|Laden von Lead-Datei| +Listloader Custom Template Maker|Listloader Custom Template Maker| +Custom template to use|Individuelle Vorlage zu verwenden| +Create a new template|Erstellen Sie eine neue Vorlage| +Delete an existing template|Löschen Sie eine vorhandene Vorlage| +Sample file fitting template|Beispiel-Datei passende Vorlage| +needed for field assignation||notwendig für das Feld Zuordnung| +Select template to delete|Wählen Sie Vorlage löschen| +DELETE TEMPLATE|Vorlage löschen| +New template form|Neue Vorlage Form| +Template ID|Template-ID| +Template Name|Template Name| +Template Description|Template Description| +List ID template will load into|Liste ID Vorlage wird in Laden| +Assign columns to file fields|Spalten zuordnen zu Datei-Felder| +selecting a different list will reset columns|Auswahl einer anderen Liste wird zurückgesetzt Spalten| +Standard Field|Standard-Feld| +Custom Field|Custom Field| +Select a list ID from the drop down menu above to show columns|Wählen Sie eine Liste ID aus dem Dropdown-Menü oben, um Spalten zeigen| +SUBMIT TEMPLATE|SUBMIT TEMPLATE| +Click here to see Admin changes to this campaign|Klicken Sie hier um Admin Änderungen an dieser Kampagne zu sehen| +Click here to see Admin changes to this record|Klicken Sie hier um Admin Änderungen an diesem Datensatz zu sehen| +Click here to see Admin changes to this list|Klicken Sie hier um Admin Änderungen an dieser Liste sehen| +Click here to see Admin changes to this script|Klicken Sie hier um Admin Änderungen an diesem Skript siehe| +Click here to see Admin changes to this filter|Klicken Sie hier um Admin Änderungen an diesem Filter sehen| +Click here to see Admin changes to this In-Group|Klicken Sie hier um Admin Änderungen an diesem In-Group sehen| +Click here to see Admin changes to this DID|Klicken Sie hier um Admin Änderungen an diese Aktion durchgeführt hat| +Click here to see Admin changes to this filter phone group|Klicken Sie hier um Admin Änderungen an diesem Filter Phone Group sehen| +Click here to see Admin changes to this user group|Klicken Sie hier um Admin Änderungen an dieser Nutzergruppe sehen| +Click here to see Admin changes to this remote agent|Klicken Sie hier, um Änderungen an diesem Admin Remote-Agent zu sehen| +Click here to see Admin changes|Klicken Sie hier, um die Änderungen zu sehen Admin| +CAMPAIGNS USING THIS SCRIPT|KAMPAGNEN mit diesem Skript| +IN-GROUPS USING THIS SCRIPT|In-Gruppen mit diesem Skript| +LIST OVERRIDES USING THIS SCRIPT|LISTE Überschreibt mit diesem Skript| +ADMIN REPORT OPTIONS|Admin zu melden OPTIONS| + Inbound | Inbound | +Audio File|Audio-Datei| +USING THIS IN-GROUP|Mit diesem in-GROUP| +Handle Method|Handle-Methode| +Search Method|Suchmethode| +USING THIS CALL MENU|Mit dieser Funktion MENU| +DELETE THIS CALL MENU|DELETE THIS CALL MENU| +Click here to see Admin changes to this CALL MENU|Klicken Sie hier um Admin Änderungen an dieser CALL MENU sehen| diff --git a/agc_2-X/trunk/translations/el_language_admin.txt b/agc_2-X/trunk/translations/el_language_admin.txt index 4fdb98ce..d74d8460 100644 --- a/agc_2-X/trunk/translations/el_language_admin.txt +++ b/agc_2-X/trunk/translations/el_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Αγγλικά| @@ -951,7 +983,7 @@ BUILD|ΔΗΜΙΟΥΡΓΙΑ| REPORTS|ΑΝΑΦΟΡΕΣ| USERS|ΧΡΗΣΤΕΣ| CAMPAIGNS| ΕΚΣΤΡΑΤΕΙΕΣ| -LISTS|ΛΙΣΤΕΣ| +#LISTS|ΛΙΣΤΕΣ| SCRIPTS|ΒΟΗΘΟΙ| FILTERS|ΦΙΛΤΡΑ| IN-GROUPS|ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ| @@ -2077,8 +2109,8 @@ DOWNLOAD|ΛΗΨΗ| Users|Χρήστες| User|Χρήστης| Reports|Εκθέσεις| -OUTBOUND|ΕΞΕΡΧΟΜΕΝΟ| -INBOUND|Εισερχόμενα| +#OUTBOUND|ΕΞΕΡΧΟΜΕΝΟ| +#INBOUND|Εισερχόμενα| Server Stats and Reports|Στατιστικά Server και Εκθέσεις| Click here to see a VDAD report for this campaign|Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια| Show DIDs|Δείτε DIDs| @@ -2487,3 +2519,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|Xfer-Conf Αριθμός Παράκαμψη| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Αυτά τα πέντε πεδία επιτρέπουν για να παρακάμψετε τις προεπιλογές αριθμό Μεταφορά Διάσκεψη όταν το αποτέλεσμα είναι από αυτή τη λίστα. Προεπιλογή είναι κενό| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Αυτές οι τέσσερις τομείς που επιτρέπουν σε σας για να έχει δύο σύνολα μεταφοράς Διάσκεψης και DTMF προεπιλογές. Όταν η κλήση ή καμπάνια είναι φορτωμένο, το σενάριο vicidial.php θα δείτε δύο κουμπιά για τη μεταφορά-πλαίσιο διάσκεψης και αυτόματη συμπλήρωση του αριθμού-να-κλήσης και την αποστολή-DTMF πεδία όταν πιέζεται. Αν θέλετε να επιτρέπεται η Συμβουλευτική Μεταφορές, ένα fronter σε μια στενότερη, έχουν το πρακτορείο χρήση του ΣΥΜΒΟΥΛΕΥΤΙΚΗ κουτάκι, το οποίο δεν λειτουργεί για το τρίτο κόμμα μη-ViciDial συμβουλευτικό κλήσεις. Για όσους έχουν απλά ένα κλικ πράκτορας της κλήσης Με κουμπί πελατών. Στη συνέχεια, ο αντιπρόσωπος μπορεί απλώς ΑΔΕΙΕΣ-3way-CALL και να προχωρήσουμε στην επόμενη κλήση τους. Αν θέλετε να επιτρέπεται Τυφλών μεταφορές των πελατών σε ένα χειρόγραφο VICIDIAL AGI για υλοτομία ή ένα IVR, τότε AXFER θέση στον αριθμό-να-dial πεδίο. Μπορείτε επίσης να καθορίσετε μια επέκταση έθιμο μετά την AXFER, για παράδειγμα, αν θέλετε να κάνετε μια κλήση σε μια ειδική IVR που έχετε θέσει για την επέκταση 83900 που θα τεθεί AXFER83900 στον αριθμό-να-πεδίο dial| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Όλοι οι χρήστες στο σύστημα, ακόμη και όχι κατα:γράφω-στους χρήστες| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|Η επιλογή όχι-κατα:γράφω--ΠΡΑΚΤΟΡΩΝ επιτρέπει σε όλους τους χρήστες στο σύστημα για να επιδειχθεί, ακόμα κι αν δεν είναι κατα:γράφω-curently| +Voicemail ID|Ταυτότητα φωνητικού ταχυδρομείου| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Αυτό είναι το κιβώτιο φωνητικού ταχυδρομείου που καλεί θα κατευθυνθεί σε μια -ομάδα AGENTDIRECT στο χρόνο πτώσης εάν η -ομάδα θέτει τη μέθοδο πτώσης καθορισμένη το ΦΩΝΗΤΙΚΌ ΤΑΧΥΔΡΟΜΕΊΟ και τον τομέα φωνητικού ταχυδρομείου AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Σε μια -ομάδα AGENTDIRECT, που θέτει αυτό σε AGENTVMAIL θα επιλέξει την ταυτότητα φωνητικού ταχυδρομείου χρηστών στη χρήση| +Record Call|Κλήση αρχείων| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Αυτή η επιλογή επιτρέπει ότι για να θέσετε τις κλήσεις που μπαίνουν σε αυτό ΚΑΝΑΤΕ για να καταγραφείτε. Το Υ θα καταγράψει την ολόκληρη κλήση, Y_QUEUESTOP θα καταγράψει την κλήση έως ότου είναι η κλήση hungup ή εισάγει μια σειρά αναμονής -ομάδας, το Ν δεν θα καταγράψει την κλήση. Η προεπιλογή είναι Ν. | +Click here to see a list of recordings and calls for this DID|Χτυπήστε εδώ για να δείτε έναν κατάλογο καταγραφών και οι κλήσεις για αυτό ΕΚΑΝΑΝ| +Ignore List Script Override|Αγνοήστε τη συμπληρωματική προμήθεια χειρογράφων καταλόγων| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Αυτή η επιλογή επιτρέπει σε σας για να αγνοήσει την επιλογή συμπληρωματικής προμήθειας χειρογράφων ταυτότητας καταλόγων για τις κλήσεις που μπαίνουν σε αυτήν την -ομάδα. Η ρύθμιση αυτού στο Υ θα αγνοήσει οποιεσδήποτε τοποθετήσεις χειρογράφων καταλόγων ταυτότητα. Η προεπιλογή είναι Ν| +External Server IP|Εξωτερικός κεντρικός υπολογιστής IP| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε έναν κεντρικό υπολογιστή IP ή άλλο όνομα μηχανών που μπορούν να χρησιμοποιηθούν αντί του server_ip κατά το χρησιμοποίηση ενός webphone στη διεπαφή πρακτόρων. Για αυτό για να εργαστεί πρέπει επίσης να τεθείτε ως στόχος την τηλεφωνική είσοδο να χρησιμοποιήσετε τον εξωτερικό κεντρικό υπολογιστή IP. Η προεπιλογή είναι κενή| +Set As Webphone|Σύνολο ως Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|Ο καθορισμός αυτής της επιλογής στο Υ θα προσπαθήσει να φορτώσει ένα βασισμένο στο WEB τηλέφωνο όταν τα κούτσουρα πρακτόρων στην οθόνη πρακτόρων τους. Η προεπιλογή είναι Ν. | +Use External Server IP|Εξωτερικός κεντρικός υπολογιστής IP χρήσης| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Εάν χρησιμοποιώντας ως τηλέφωνο Ιστού, μπορείτε να θέσετε αυτό στο Υ για να χρησιμοποιήσετε τους κεντρικούς υπολογιστές εξωτερική IP για να καταχωρήσετε αντί του κεντρικού υπολογιστή IP. Η προεπιλογή είναι κενή| +Default Webphone|Προεπιλογή Webphone| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Εάν θέστε 1, αυτή η επιλογή θα καταστήσει όλα τα νέα τηλέφωνα δημιουργημένα να έχει θέσει δεδομένου ότι καθορισμένο Webphone Υ. Default είναι 0| +Default External Server IP|Εξωτερικός κεντρικός υπολογιστής IP προεπιλογής| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Εάν θέστε 1, αυτή η επιλογή θα καταστήσει όλα τα νέα τηλέφωνα δημιουργημένα να έχει τη χρήση που ο εξωτερικός κεντρικός υπολογιστής IP καθορισμένος Υ. Default είναι 0| +Webphone URL|Webphone URL| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|Αυτό είναι το URL του webphone που θα χρησιμοποιηθεί με αυτό το σύστημα εάν επιτρέπεται στο τηλεφωνικό αρχείο που ένας πράκτορας χρησιμοποιεί. Η προεπιλογή είναι κενή| +AGENT ACTIVITY FOR THIS TIME PERIOD|ΔΡΑΣΤΗΡΙΟΤΗΤΑ ΠΡΑΚΤΟΡΩΝ ΓΙΑ ΤΗΝ ΠΕΡΙΟΔΟ ΑΥΤΗΣ ΤΗΣ ΠΕΡΙΌΔΟΥ| +these fields are in seconds|αυτοί οι τομείς είναι στα δευτερόλεπτα| +Enable Agent Disposition Logfile|Επιτρέψτε το αρχείο ημερολογίου διάθεσης πρακτόρων| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Αυτή η επιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στο webserver κάθε φορά που είναι μια κλήση από έναν πράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες| +Agent Call Log View|Άποψη κούτσουρων κλήσης πρακτόρων| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Αυτή η επιλογή καθορίζει εάν ο πράκτορας θα είναι σε θέση να δει το κούτσουρο κλήσης τους για τις κλήσεις που αντιμετωπίζονται μέσω της οθόνης πρακτόρων ViciDial. Η προεπιλογή είναι Ν για το αριθ. ή τα άτομα με ειδικές ανάγκες| +Agent Call Log View Override|Συμπληρωματική προμήθεια άποψης κούτσουρων κλήσης πρακτόρων| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Αυτή η ρύθμιση θα αγνοήσει οποιου δήποτε η ομάδα χρηστών χρηστών έχει θέσει για την άποψη κούτσουρων κλήσης πρακτόρων. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΆΓΚΕΣ θα χρησιμοποιήσουν τη ρύθμιση ομάδας χρηστών. Το Ν δεν θα επιτρέψει κούτσουρο κλήσης χρηστών. Το Υ θα επιτρέψει κούτσουρο κλήσης χρηστών. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ| +Custom Dialplan Entry|Είσοδος Dialplan συνήθειας| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Αυτός ο τομέας επιτρέπει σε σας για να εισαγάγει σε οποιαδήποτε dialplan στοιχεία που θέλετε για τον κεντρικό υπολογιστή, οι γραμμές θα προστεθούν στο πλαίσιο προεπιλογής| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Αυτός ο τομέας επιτρέπει σε σας για να εισαγάγει σε οποιαδήποτε dialplan στοιχεία που θέλετε για όλους τους κεντρικούς υπολογιστές αστερίσκων, οι γραμμές θα προστεθούν στο πλαίσιο προεπιλογής| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Αυτή η επιλογή επιτρέπει σε σας για να εισαγάγει τις dialplan γραμμές συνήθειας στις επιλογές πρόσκλησης, τους κεντρικούς υπολογιστές και τις τοποθετήσεις συστημάτων. Η προεπιλογή είναι 0 για ανενεργό| +Custom CallerID|Συνήθεια CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Όταν θέστε το Υ, αυτή η το επιλογή επιτρέπει σε σας για να χρησιμοποιήσει τον τομέα security_phrase στον πίνακα vicidial_list ως CallerID για να στείλει κατά τοποθέτηση για κάθε συγκεκριμένο μόλυβδο. Εάν αυτός ο τομέας να μην έχε κανένα CID σε το έπειτα η εκστρατεία CallerID που καθορίζεται ανωτέρω θα χρησιμοποιηθεί αντ' αυτού. Αυτή η επιλογή θα θέσει εκτός λειτουργίας τη συμπληρωματική προμήθεια CallerID καταλόγων εάν υπάρχει ένα CID παρόν στον τομέα security_phrase. Η προεπιλογή είναι Ν| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID θα χρησιμοποιήσει τη συνήθεια CID που καθορίζεται στον τομέα security_phrase του πίνακα vicidial_list για το μόλυβδο| +Scheduled Callbacks Alert|Σχέδισσα επιφυλακή επανακλήσεων| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Αυτή η επιλογή επιτρέπει στη γραμμή θέσης επανακλήσεων στη διεπαφή πρακτόρων για να είναι κόκκινη, αναβοσβήνει ή αναβοσβήνει το κόκκινο όταν υπάρχουν σχεδιασμένες AGENTONLY επανακλήσεις που έχουν χτυπήσει το χρόνο και την ημερομηνία ώθησής τους. Η προεπιλογή δεν είναι ΚΑΜΙΑ για την τυποποιημένη γραμμή θέσης| +QueueMetrics Login-Out|QueueMetrics σύνδεση-έξω| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Αυτή η επιλογή έχει επιπτώσεις σπόσο vicidial θα καταγράψει τα logins και τις αποσυνδέσεις ενός πράκτορα στο queue_log. Η προεπιλογή είναι ΤΥΠΟΠΟΙΗΜΕΝΗ για να χρησιμοποιήσει τυποποιημένο AGENTLOGIN AGENTLOGOFF, η ΕΠΑΝΆΚΛΗΣΗ θα χρησιμοποιήσει AGENTCALLBACKLOGIN και AGENTCALLBACKLOGOFF που QM θα αναλύσει διαφορετικά| +Enable CallCard|Επιτρέψτε CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Αυτή η ρύθμιση επιτρέπει στα χαρακτηριστικά γνωρίσματα CallCard με ViciDial για να επιτρέψει τους επισκέπτες να χρησιμοποιήσει τους αριθμούς καρφιτσών και card_ids που έχουν μια ισορροπία των πρακτικών και εκείνων των ισορροπιών μπορεί να έχει το χρόνο συζήτησης πρακτόρων στις κλήσεις πελατών στις -ομάδες που αφαιρούνται. Η προεπιλογή είναι 0 για τα άτομα με ειδικές ανάγκες| +CallCard Access|Πρόσβαση CallCard| +Agent Transfer Options|Επιλογές μεταφοράς πρακτόρων| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Αυτές οι επιλογές επιτρέπουν να θέσουν εκτός λειτουργίας των συγκεκριμένων κουμπιών στο τμήμα διασκέψεων μεταφοράς της διεπαφής πρακτόρων. Η προεπιλογή είναι Υ για ναι ή επιτρεμμένος| +Agent Allow Park Customer Dial Xfer|Ο πράκτορας επιτρέπει τον πίνακα Xfer πελατών πάρκων| +Agent Allow Dial With Customer Xfer|Ο πράκτορας επιτρέπει τον πίνακα με τον πελάτη Xfer| +Agent Allow Blind Xfer|Ο πράκτορας επιτρέπει τυφλό Xfer| +Agent Allow Voicemail Message Xfer|Ο πράκτορας επιτρέπει το μήνυμα Xfer φωνητικού ταχυδρομείου| +Agent Allow Dial Override Xfer|Ο πράκτορας επιτρέπει τη συμπληρωματική προμήθεια Xfer πινάκων| +Agent Allow Consultative Xfer|Ο πράκτορας επιτρέπει συμβουλευτικό Xfer| +Agent Fullscreen|Πράκτορας Fullscreen| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Αυτή η επιλογή εάν θέστε το Υ θα θέσει το ύψος και το πλάτος της οθόνης πρακτόρων ViciDial στο μέγεθος του παραθύρου μηχανών αναζήτησης Ιστού χωρίς οποιοδήποτε επίδομα για την άποψη πρακτόρων, τις κλήσεις κατά την άποψη σειρών αναμονής ή κλήσεις κατά την άποψη συνόδου. Η προεπιλογή είναι Ν για το αριθ. ή τα άτομα με ειδικές ανάγκες| +Add Extension Group|Προσθέστε την ομάδα επέκτασης| +New Group Extension Addition|Νέα προσθήκη επέκτασης ομάδας| +Modify Extension Group|Τροποποιήστε την ομάδα επέκτασης| +Delete Extension Group|Διαγράψτε την ομάδα επέκτασης| +Extension Groups|Ομάδες επέκτασης| +Add Extension Group Entry|Προσθέστε το λήμμα ομάδας επέκτασης| +Extension Group|Ομάδα επέκτασης| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Αυτός ο απαραίτητος τομέας είναι όπου εισάγετε την ταυτότητα ομάδας ότι θέλετε αυτήν την επέκταση για να τεθείτε. Κανένας διάστημα ή πρόσθετος χαρακτήρας εκτός από τα γράμματα και τους αριθμούς κάτω παυλών| +Extension:|Επέκταση: | +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Αυτός ο απαραίτητος τομέας είναι όπου βάζετε τη dialplan επέκταση ότι θέλετε τις μακρινές κλήσεις πρακτόρων για να σταλείτε για αυτήν την είσοδο ομάδας επέκτασης| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|Αυτός ο τομέας επιτρέπει σε σας για να ταξινομήσει τις καταχωρήσεις ομάδας επέκτασης που μοιράζονται την ίδια ομάδα επέκτασης. Η προεπιλογή είναι 0| +Campaigns Groups|Ομάδες εκστρατειών| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|Σε αυτόν τον τομέα μπορείτε να βάλετε έναν κατάλογο εκστρατείας IDs και ή η εισερχόμενη ομάδα IDs που θέλετε να περιορίσετε τη χρήση του καταλόγου ομάδας ξέν. επέκτασης πρέπει να είναι χωριστή από τους σωλήνες και να έχει έναν σωλήνα στην αρχή και στο τέλος της σειράς| +EXTENSION GROUP ENTRY NOT ADDED|ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΡΟΣΤΙΘΕΜΕΝΗ| +there is already an extension group entry with these values|υπάρχει ήδη μια είσοδος ομάδας επέκτασης με αυτές τις τιμές| +EXTENSION GROUP ENTRY ADDED|ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΡΟΣΤΙΘΕΜΕΝΗ| +MODIFY AN EXTENSION GROUP ENTRY|ΤΡΟΠΟΠΟΙΗΣΤΕ ΜΙΑ ΕΙΣΟΔΟ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ| +Click here to see Admin chages to this extension group entry|Χτυπήστε εδώ για να δείτε τα chages Admin σε αυτήν την είσοδο ομάδας επέκτασης| +DELETE THIS EXTENSION GROUP ENTRY|ΔΙΑΓΡΑΨΤΕ ΑΥΤΟ ΤΟ ΛΗΜΜΑ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ| +Call Count Today|Καλέστε την αρίθμηση σήμερα| +Last Call Time|Τελευταίος χρόνος κλήσης| +Last Call ID|Τελευταία ταυτότητα κλήσης| +EXTENSION GROUP ENTRY NOT MODIFIED|ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ| +EXTENSION GROUP ENTRY MODIFIED|ΕΙΣΟΔΟΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ| +EXTENSION GROUP ENTRY NOT DELETED|ΛΗΜΜΑ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΕΙΣΟΔΩΝ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ| +Click here to delete extension group entry|Χτυπήστε εδώ για να διαγράψετε το λήμμα ομάδας επέκτασης| +EXTENSION GROUP ENTRY DELETION COMPLETED|ΔΙΑΓΡΑΦΗ ΕΙΣΟΔΩΝ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ ΠΟΥ ΟΛΟΚΛΗΡΩΝΕΤΑΙ| +EXTENSION GROUP LISTINGS|ΛΙΣΤΕΣ ΟΜΑΔΑΣ ΕΠΕΚΤΑΣΗΣ| +Extension Group|Ομάδα επέκτασης| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Εάν θέστε κάτι εκτός από ΚΑΝΕΝΑΝ ή κενός αυτό θα αγνοήσει τον εξωτερικό τομέα επέκτασης και θα χρησιμοποιήσει τις καταχωρήσεις ομάδας επέκτασης που δεν έχουν την ίδια προεπιλογή ταυτότητας ομάδας επέκτασης είναι ΚΑΜΊΑ για απενεργοποιημένος| +Click here to see agents logged in to this inbound group|Χτυπήστε εδώ για να δείτε τους πράκτορες που συνδέονται σε αυτήν την εισερχόμενη ομάδα| +Agent Choose Blended|Ο πράκτορας επιλέγει συνδυασμένος| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Αυτή η επιλογή εάν θέστε 1 επιτρέπει στο χρήστη για να επιλέξει εάν ο πράκτορας θέτει την εκστρατεία τους συνδυασμένη ή όχι, και εάν όχι έπειτα η συνδυασμένη προεπιλογή ρύθμιση θα χρησιμοποιηθεί. Η προεπιλογή είναι 1 για επιτρεμμένος| +Click here to see a log of the uploads to the audio store|Χτυπήστε εδώ για να δείτε ένα κούτσουρο φορτώνει στο ακουστικό κατάστημα| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Αυτή η επιλογή εάν θέστε 0 δεν θα υποβάλει την είσοδο CALLSTATUS στο queue_log όταν διαθέσεις πρακτόρων μια κλήση. Η προεπιλογή είναι 1 για επιτρεμμένος| +QM CallStatus Override|Συμπληρωματική προμήθεια QM CallStatus| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Εάν η ολοκλήρωση QueueMetrics επιτρέπεται στις τοποθετήσεις συστημάτων έπειτα αυτήν την ρύθμιση επιτρέψτε την αγνόηση των τοποθετήσεων συστημάτων θέτοντας για queue_log τις καταχωρήσεις CallStatus. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ που θα χρησιμοποιήσει τη ρύθμιση συστημάτων| +Extension Append CID|Η επέκταση επισυνάπτει CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Εάν επιτρέπονται, οι κλήσεις που τοποθετούνται από αυτήν την εκστρατεία θα έχουν ένα διάστημα και την τηλεφωνική επέκταση του πράκτορα που επισυνάπτεται στο τέλος του ονόματος CallerID για την κλήση προτού να σταλεί στον πράκτορα. Η προεπιλογή είναι Ν για τα άτομα με ειδικές ανάγκες| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Εάν επιτρέπονται, οι κλήσεις που προέρχονται μέσα από αυτήν την -ομάδα θα έχουν ένα διάστημα και την τηλεφωνική επέκταση του πράκτορα που επισυνάπτεται στο τέλος του ονόματος CallerID για την κλήση προτού να σταλεί στον πράκτορα. Η προεπιλογή είναι Ν για τα άτομα με ειδικές ανάγκες| +Scheduled Callbacks Count|Σχέδισσα αρίθμηση επανακλήσεων| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Αυτή η επιλογή επιτρέπει σε σας για να θέσει εάν μόνο ΖΩΝΤΑΝΕΣ επανακλήσεις, χρήστης-μόνο οι σχεδιασμένες επανακλήσεις που έχουν χτυπήσει την ημερομηνία και το χρόνο ώθησής τους, ή επανακλήσεις ALL_ACTIVE, χρήστης-μόνο επανακλήσεις που είναι ενεργές στο σύστημα καθώς επίσης και τις ΖΩΝΤΑΝΈΣ επανακλήσεις, πρέπει be3 μέτρησαν το INT αυτός άγρυπνο τμήμα επανάκλησης πρακτόρων οθόνης πρακτόρων. Η προεπιλογή είναι ALL_ACTIVE| +Realtime Block User Info|Σε πραγματικό χρόνο πληροφορίες χρηστών φραγμών| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Αυτή η ρύθμιση εάν θέστε 1 θα εμποδίσει τις πληροφορίες χρηστών και σταθμών από την επίδειξη στη σε πραγματικό χρόνο έκθεση. Η προεπιλογή είναι 0 για τα άτομα με ειδικές ανάγκες| +Manual Dial Override|Χειρωνακτική συμπληρωματική προμήθεια πινάκων| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|Η ρύθμιση μπορεί να αγνοήσει τους χρήστες που θέτουν για τη χειρωνακτική δυνατότητα πινάκων για τους πράκτορες όταν καταγράφονται σε αυτήν την εκστρατεία. ΚΑΝΕΝΑΣ δεν θα ακολουθήσει τη ρύθμιση χρηστών, ALLOW_ALL θα επιτρέψει σε οποιοδήποτε πράκτορα που συνδέεται με αυτήν την εκστρατεία για να τοποθετήσει τις χειρωνακτικές κλήσεις πινάκων, DISABLE_ALL δεν θα επιτρέψει σε καθένα που συνδέεται με αυτήν την εκστρατεία για να τοποθετήσει τις χειρωνακτικές κλήσεις πινάκων. Η προεπιλογή δεν είναι ΚΑΜΙΑ| +Blind Monitor Warning|Τυφλή προειδοποίηση οργάνων ελέγχου| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Αυτή η επιλογή εάν επιτρέπεται θα ενημερώσει τον πράκτορα με τους διάφορους προαιρετικούς τρόπους εάν είναι τυφλοί που ελέγχονται από κάποιο. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΆΓΚΕΣ σημαίνουν ότι αυτό το χαρακτηριστικό γνώρισμα δεν είναι ενεργό, η ΕΠΙΦΥΛΑΚΗ θα σκάσει μόνο μια επιφυλακή επάνω στην οθόνη πρακτόρων, η ΕΙΔΟΠΟΙΗΣΗ θα ταχυδρομήσει μια σημείωση που μένει επάνω στην οθόνη πρακτόρων εφ' όσον θα παίξει το theya σχετικά με τον έλεγχο, ΗΧΟΣ το όνομα αρχείου που καθορίζεται κατωτέρω όταν αρχίζει να ελέγχεται ένας πράκτορας και οι άλλες επιλογές είναι combibnations των ανωτέρω επιλογών. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ| +Blind Monitor Notice|Τυφλή ειδοποίηση οργάνων ελέγχου| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Αυτό είναι το μήνυμα που θα παρουσιάσει στην οθόνη πρακτόρων ενώ ελέγχονται εάν η επιλογή ΕΙΔΟΠΟΙΗΣΗΣ επιλέγεται. Η προεπιλογή είναι| +Blind Monitor Filename|Τυφλό όνομα αρχείου οργάνων ελέγχου| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Αυτό είναι το ακουστικό αρχείο που θα παίξει στη σύνοδο πρακτόρων στην έναρξη κάποιου τυφλού που ελέγχει τους. Αυτή η υπαγόρευση θα παιχτεί για την καθεμία στη σύνοδο συμπεριλαμβανομένου του πελάτη εάν οποιοσδήποτε είναι παρών. Η προεπιλογή είναι κενή| +Uniqueid Status Display|Επίδειξη θέσης Uniqueid| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Εάν επιτρέπονται, όταν λαμβάνει ένας πράκτορας μια πρόσκληση μέσω αυτής της -ομάδας θα δουν το uniqueid της πρόσκλησης που προστίθεται στη γραμμή θέσης στη διεπαφή πρακτόρων τους. Η επιλογή ΠΡΟΘΕΜΑΤΟΣ θα προσθέσει το καθορισμένο πρόθεμα χτύπημα στην αρχή του uniqueid στην επίδειξη. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ. Εάν υπήρξε ήδη ένα Uniqueid που καθορίστηκε σε μια κλήση που εισάγει αυτήν την -ομάδα, κατόπιν το αρχικό uniqueid θα επιδειχθεί| +Uniqueid Status Prefix|Πρόθεμα θέσης Uniqueid| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Εάν η επιλογή ΠΡΟΘΕΜΑΤΟΣ επιλέγεται ανωτέρω έπειτα αυτό είναι η αξία εκείνου του προθέματος. Η προεπιλογή είναι κενή| +Default Codecs|Προεπιλογή Codecs| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|Μπορείτε να καθορίσετε έναν οριοθετημένο κόμμα κατάλογο codecs που τίθενται ως προεπιλογή codecs για όλα τα συστήματα. Οι επιλογές για τα codecs περιλαμβάνουν ulaw, alaw, GSM, g729, speex, g722, g723, g726, ilbc,… η προεπιλογή είναι κενή| +Allowed Codecs|Codecs| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|Μπορείτε να καθορίσετε έναν οριοθετημένο κόμμα κατάλογο codecs που τίθενται ως προεπιλογή codecs για αυτό το τηλέφωνο. Οι επιλογές για τα codecs περιλαμβάνουν ulaw, alaw, GSM, g729, speex, g722, g723, g726, ilbc,… Μερικά από αυτά τα codecs να μην είναι διαθέσιμα στο σύστημά σας, όπως g729 ή g726. Εάν ο τομέας είναι κενός, κατόπιν η προεπιλογή συστημάτων codecs ή η τηλεφωνική είσοδος επάνω από αυτήν θα χρησιμοποιηθεί για τα επιτρεπόμενα codecs. Η προεπιλογή είναι κενή| +Allowed Codecs With Template|Codecs με το πρότυπο| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Ο καθορισμός αυτής της επιλογής σε 1 θα περιλάβει τα codecs που καθορίζονται ανωτέρω ακόμα κι αν ένα πρότυπο αρχείων conf χρησιμοποιείται. Η προεπιλογή είναι 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Εάν η επιλογή ΚΟΝΣΕΡΒΩΝ χρησιμοποιείται και η κλήση στέλνεται σε έναν δεύτερο πράκτορα, το uniqueid και το πρόθεμα που επιδεικνύονται στον πρώτο πράκτορα θα επιδειχθούν επίσης στο δεύτερο πράκτορα| +Custom Fields Modify|Οι τομείς συνήθειας τροποποιούν| +This option if set to 1 allows the user to modify custom list fields|Αυτή η επιλογή εάν θέστε 1 επιτρέπει στο χρήστη για να τροποποιήσει τους τομείς καταλόγων συνήθειας| +ERROR: Custom Fields are not active on this system|ΛΑΘΟΣ: Οι τομείς συνήθειας δεν είναι ενεργοί σε αυτό το σύστημα| +Lists Custom Field|Τομέας συνήθειας καταλόγων| +Field Label|Ετικέτα τομέων| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Αυτό είναι το προσδιοριστικό τομέων βάσεων δεδομένων για αυτόν τον τομέα. Αυτό πρέπει να είναι ένα μοναδικό προσδιοριστικό μέσα στους τομείς συνήθειας για αυτόν τον κατάλογο. Μην χρησιμοποιήστε οποιαδήποτε διαστήματα ή στίξη για αυτόν τον τομέα. ανώτατοι 50 χαρακτήρες, ελάχιστο 2 χαρακτήρων| +Field Name|Όνομα τομέων| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|Αυτό είναι το όνομα του τομέα δεδομένου ότι θα εμφανιστεί σε έναν πράκτορα μέσω της διεπαφής τους. Μπορείτε να χρησιμοποιήσετε το διάστημα σε αυτόν τον τομέα, αλλά κανέναν χαρακτήρα στίξης, το μέγιστο 50 χαρακτήρων και το ελάχιστο 2 χαρακτήρων| +Field Description|Περιγραφή τομέων| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|Η περιγραφή αυτού του τομέα δεδομένου ότι θα εμφανιστεί στη διεπαφή διοίκησης. Αυτό είναι ένας προαιρετικός τομέας με ένα μέγιστο 100 χαρακτήρων| +Field Rank|Τάξη τομέων| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|Η διαταγή στην οποία αυτοί οι τομείς επιδεικνύονται στον πράκτορα από χαμηλότερο στην κορυφή σε υψηλότερο στο κατώτατο σημείο| +Field Help|Βοήθεια τομέων| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Ο προαιρετικός τομέας, εάν το συμπληρώσετε, ο πράκτορας θα είναι σε θέση να δει αυτό το κείμενο όταν χτυπούν σε μια σύνδεση βοήθειας δίπλα στον τομέα στη διεπαφή πρακτόρων τους| +Field Type|Τύπος τομέων| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Αυτή η επιλογή καθορίζει τον τύπο τομέα που θα επιδειχθεί. Το ΚΕΙΜΕΝΟ είναι μια τυποποιημένη μονής γραμμής αίτηση συμμετοχής, η ΠΕΡΙΟΧΗ είναι ένα πολλαπλών γραμμών παράθυρο κειμένου, ΕΠΙΛΕΚΤΕΣ είναι pull-down ενιαίος-επιλογής επιλογές, ΠΟΛΥ είναι ένα πολλαπλάσιος-επίλεκτο παράθυρο, το ΡΑΔΙΟΦΩΝΟ είναι ένας κατάλογος ραδιο κουμπιών όπου μόνο μια επιλογή μπορεί να επιλεχτεί, το ΤΕΤΡΑΓΩΝΙΔΙΟ είναι ένας κατάλογος τετραγωνιδίων όπου οι πολλαπλάσιες επιλογές μπορούν να επιλεχτούν, η ΗΜΕΡΟΜΗΝΙΑ είναι ένα ημερολόγιο ημέρας μήνα έτους υπερεμφανιζόμενο όπου ο πράκτορας μπορεί να επιλέξει την ημερομηνία και ο ΧΡΟΝΟΣ είναι ένα παράθυρο χρονικής επιλογής. Η προεπιλογή είναι ΚΕΙΜΕΝΟ. Για τις ΕΠΙΛΕΚΤΕΣ, ΠΟΛΥ, ΡΑΔΙΟ και επιλογές ΤΕΤΡΑΓΩΝΙΔΙΟΥ πρέπει να καθορίσετε τις τιμές επιλογής κατωτέρω στο κιβώτιο επιλογών τομέων| +Field Options|Επιλογές τομέων| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Για τους τύπους ΕΠΙΛΕΚΤΩΝ, ΠΟΛΥ, ΡΑΔΙΟ και τομέων ΤΕΤΡΑΓΩΝΙΔΙΟΥ, πρέπει να καθορίσετε τις τιμές επιλογής σε αυτό το παράθυρο. Πρέπει να βάλετε έναν κατάλογο χωρισμένων κόμμα ετικέτας επιλογής και κειμένου επιλογής εδώ με κάθε επιλογή ένα η γραμμή της. Η πρώτη αξία δεν πρέπει να έχει κανένα διάστημα σε το, και καμία τιμή δεν πρέπει να έχει οποιαδήποτε στίξη. Παραδείγματος χάριν - electric_meter, ηλεκτρικός μετρητής| +Field Size|Μέγεθος τομέων| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Αυτή η ρύθμιση θα σημάνει τα διαφορετικά πράγματα ανάλογα με αυτό που ο τύπος τομέων είναι. Για τους τομείς ΚΕΙΜΕΝΩΝ, το μέγεθος είναι ο αριθμός χαρακτήρων που θα παρουσιάσει στον τομέα. Για τους τομείς ΠΕΡΙΟΧΗΣ, το μέγεθος είναι το πλάτος του παραθύρου κειμένου στους χαρακτήρες. Για τους ΠΟΛΥ τομείς, αυτή η ρύθμιση καθορίζει τον αριθμό επιλογών που παρουσιάζονται στον πολυ επίλεκτο κατάλογο. Για το ΕΠΙΛΕΚΤΟΥΣ, ΡΑΔΙΟ, ΤΕΤΡΑΓΩΝΙΔΙΟ, την ΗΜΕΡΟΜΗΝΙΑ και το ΧΡΟΝΟ αυτή η ρύθμιση αγνοείται| +Field Max|Τομέας ανώτατος| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Αυτή η ρύθμιση θα σημάνει τα διαφορετικά πράγματα ανάλογα με αυτό που ο τύπος τομέων είναι. Για τους ΚΡΥΜΜΕΝΟ και ΜΟΝΟ ΑΝΆΓΝΩΣΗΣ τομείς ΚΕΙΜΕΝΩΝ, το μέγεθος είναι ο μέγιστος αριθμός χαρακτήρων που επιτρέπονται στον τομέα. Για τους τομείς ΠΕΡΙΟΧΗΣ, αυτός ο τομέας καθορίζει τον αριθμό σειρών του κειμένου ορατών στο παράθυρο κειμένου. Για ΠΟΛΥ, ΕΠΙΛΕΚΤΟΣ, ΡΑΔΙΟ, το ΤΕΤΡΑΓΩΝΙΔΙΟ, την ΗΜΕΡΟΜΗΝΙΑ και το ΧΡΟΝΟ αυτή η ρύθμιση αγνοείται| +Field Cost|Κόστος τομέων| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Αυτό διάβασε ότι μόνο ο τομέας σας λέει τι το κόστος αυτού του τομέα είναι στον πίνακα τομέων συνήθειας για αυτόν τον κατάλογο. Δεν υπάρχει κανένα σκληρό όριο για τον αριθμό τομέων συνήθειας που μπορείτε να έχετε σε έναν κατάλογο, αλλά το σύνολο του κόστους όλων των τομέων για τον κατάλογο πρέπει να είναι κάτω από 65000. Αυτό επιτρέπει χαρακτηριστικά τις εκατοντάδες των τομέων, αλλά εάν διευκρινίζετε διάφοροι τομείς ΚΕΙΜΕΝΩΝ που είναι εκατοντάδες ή χιλιάδες χαρακτήρες στο μήκος έπειτα εσείς μπορούν να χτυπήσουν αυτό το όριο γρήγορα. Εάν χρειάζεστε ότι πολύ κείμενο σε έναν τομέα που πρέπει να επιλέξετε έναν τύπο ΠΕΡΙΟΧΗΣ, τα οποία αποθηκεύονται διαφορετικά και δεν χρησιμοποιούν τόσο επιτραπέζιο διάστημα| +Field Required|Τομέας που απαιτείται| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Εάν θέστε το Υ, αυτός ο τομέας θα αναγκάσει τον πράκτορα για να εισαγάγει το κείμενο ή να επιλέξει μια επιλογή για αυτόν τον τομέα. Η προεπιλογή είναι Ν| +Field Default|Προεπιλογή τομέων| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Αυτός ο προαιρετικός τομέας σας αφήνει να καθορίσετε ποια αξία για να ορίσει σε έναν τομέα εάν τίποτα δεν φορτώνεται σε εκείνο τον τομέα. Η προεπιλογή είναι ΜΗΔΕΝΙΚΗ που θέτει εκτός λειτουργίας τη λειτουργία προεπιλογής| +MODIFY FIELDS|ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΟΥΣ ΤΟΜΕΙΣ| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|ΑΠΑΡΙΘΜΗΣΤΕ ΤΙΣ ΛΙΣΤΕΣ ΜΕ ΤΗΝ ΑΡΙΘΜΗΣΗ ΤΟΜΕΩΝ ΣΥΝΗΘΕΙΑΣ| +SUMMARY OF FIELDS|ΠΕΡΙΛΗΨΗ ΤΩΝ ΤΟΜΕΩΝ| +ADD A NEW CUSTOM FIELD FOR THIS LIST|ΠΡΟΣΘΕΣΤΕ ΈΝΑΝ ΝΕΟ ΤΟΜΕΑ ΣΥΝΗΘΕΙΑΣ ΓΙΑ ΑΥΤΟΝ ΤΟΝ ΚΑΤΑΛΟΓΟ| +ERROR: Field does not exist|ΛΑΘΟΣ: Ο τομέας δεν υπάρχει| +ERROR: Table does not exist|ΛΑΘΟΣ: Ο πίνακας δεν υπάρχει| +ERROR: Field already exists for this list|ΛΑΘΟΣ: Ο τομέας υπάρχει ήδη για αυτόν τον κατάλογο| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|ΧΤΥΠΗΣΤΕ ΕΔΩ ΓΙΑ ΝΑ ΕΠΙΒΕΒΑΙΩΣΕΤΕ ΤΗ ΔΙΑΓΡΑΦΗ ΑΥΤΟΥ ΤΟΥ ΤΟΜΕΑ ΣΥΝΗΘΕΙΑΣ| +THIS CUSTOM FIELD HAS BEEN DELETED|ΑΥΤΟΣ Ο ΤΟΜΕΑΣ ΣΥΝΗΘΕΙΑΣ ΕΧΕΙ ΔΙΑΓΡΑΦΕΊ| +Records in this custom table|Αρχεία σε αυτόν τον πίνακα συνήθειας| +EXAMPLE OF CUSTOM FORM|ΠΑΡΑΔΕΙΓΜΑ ΤΗΣ ΜΟΡΦΗΣ ΣΥΝΗΘΕΙΑΣ| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Για τους τύπους τομέων ΗΜΕΡΟΜΗΝΙΑΣ, η προεπιλογή είναι έθεσε πάντα σήμερα εκτός αν ένας αριθμός υποβάλλεται οπότε σ'αυτή την περίπτωση η ημερομηνία θα είναι ότι πολλές ημέρες συν ή μείον σήμερα. Για τους τύπους ΧΡΟΝΙΚΩΝ τομέων, η προεπιλογή είναι έθεσε πάντα τον τρέχοντα χρόνο κεντρικών υπολογιστών εκτός αν ένας αριθμός υποβάλλεται οπότε σ'αυτή την περίπτωση ο χρόνος θα είναι ότι πολλά πρακτικά συν ή μείον τον τρέχοντα χρόνο| +MODIFY EXISTING FIELDS|ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΟΥΣ ΥΠΑΡΧΟΝΤΕΣ ΤΟΜΕΙΣ| +Field Name Position|Θέση ονόματος τομέων| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|Εάν θέστε ΑΡΙΣΤΕΡΑ, αυτό το όνομα τομέων θα εμφανιστεί αριστερά του τομέα, εάν θέστε για ΝΑ ΟΛΟΚΛΗΡΩΣΕΤΕ το όνομα τομέων θα λάβει την ολόκληρη γραμμή και θα εμφανιστεί επάνω από τον τομέα. Η προεπιλογή ΑΦΗΝΕΤΑΙ| +Option Position|Θέση επιλογής| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Για το ΤΕΤΡΑΓΩΝΙΔΙΟ και τους ΡΑΔΙΟ τύπους τομέων μόνο, εάν θέστε ΟΡΙΖΟΝΤΙΟΣ οι επιλογές θα εμφανιστούν στην ίδια γραμμή που τυλίγει ενδεχομένως στη γραμμή κατωτέρω εάν υπάρχουν πολλές επιλογές. Εάν θέστε την ΚΑΤΑΚΟΡΥΦΟ θα υπάρξει μόνο μια επιλογή ανά γραμμή. Η προεπιλογή είναι ΟΡΙΖΟΝΤΙΑ| +Hold Time Option Minimum|Ελάχιστο χρονικής επιλογής λαβής| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Εάν η χρονική επιλογή λαβής που επιτρέπεται, αυτό είναι ο ελάχιστος αριθμός δευτερολέπτων η κλήση πρέπει προτού να παρουσιαστεί με τη χρονική επιλογή λαβής. Η χρονική επιλογή λαβής θα παρουσιαστεί αμέσως αυτή τη στιγμή εάν ο κατ' εκτίμηση χρόνος λαβής είναι μεγαλύτερος από την αξία δευτερολέπτων χρονικής επιλογής λαβής. Η προεπιλογή είναι 0 δευτερόλεπτα| +ADDING COPIED CARRIER|ΠΡΟΣΘΗΚΗ ΤΟΥ ΑΝΤΙΓΡΑΜΜΕΝΟΥ ΜΕΤΑΦΟΡΕΑ| +ADD COPIED CARRIER|ΠΡΟΣΘΕΣΤΕ ΤΟΝ ΑΝΤΙΓΡΑΜΜΕΝΟ ΜΕΤΑΦΟΡΕΑ| +Source Carrier|Μεταφορέας πηγής| +COPIED CARRIER ADDED|ΑΝΤΙΓΡΑΜΜΕΝΟΣ ΜΕΤΑΦΟΡΕΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ| +Copy A Carrier|Αντιγράψτε έναν μεταφορέα| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Ο τομέας OrderIf περισσότεροι από ένας τομείς έχει την ίδια τάξη, θα τοποθετηθούν στην ίδια γραμμή και θα τοποθετηθούν στη διαταγή από αυτήν την αξία από χαμηλότερο σε υψηλότερο, αριστερός στο δικαίωμα| +Copy Fields to Another List|Τομείς αντιγράφων σε έναν άλλο κατάλογο| +List ID to Copy Fields to|Κατάλογος ταυτότητα στους τομείς αντιγράφων| +List ID to Copy Fields From|Κατάλογος ταυτότητα στους τομείς αντιγράφων από| +Copy Option|Επιλογή αντιγράφων| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Κατά αντιγραφή των ορισμών τομέων από έναν κατάλογο σε άλλος, την έχετε μερικές επιλογές για το πώς η διαδικασία αντιγραφής λειτουργεί. ΕΠΙΣΥΝΑΨΤΕ θα προσθέσει τους τομείς που δεν είναι παρόντες στον κατάλογο προορισμού, εάν υπάρχουν ετικέτες τομέων ταιριάσματος εκείνοι παραμένοντας άθικτοι, κανένα στοιχείο τομέων συνήθειας δεν θα διαγραφεί ή θα τροποποιηθεί χρησιμοποιώντας αυτήν την επιλογή. Η ΑΝΑΠΡΟΣΑΡΜΟΓΗ θα ενημερώσει τους κοινούς τομείς field_label στον κατάλογο προορισμού στους ορισμούς τομέων από τον κατάλογο πηγής. τα στοιχεία τομέων συνήθειας μπορούν να τροποποιηθούν ή να χαθούν χρησιμοποιώντας αυτήν την επιλογή. ΑΝΤΙΚΑΤΑΣΤΗΣΤΕ θα αφαιρέσει όλους τους υπάρχοντες τομείς συνήθειας στον κατάλογο προορισμού και θα τους αντικαταστήσει με τους τομείς συνήθειας από τον κατάλογο πηγής, όλα τα στοιχεία τομέων συνήθειας θα διαγραφούν χρησιμοποιώντας αυτήν την επιλογή| +ERROR: Source list has no custom fields|ΛΑΘΟΣ: Ο κατάλογος πηγής δεν έχει κανέναν τομέα συνήθειας| +SUCCESS: Custom Field Added|ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας προστιθέμενος| +SUCCESS: Custom Field Modified|ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας τροποποιημένος| +SUCCESS: Custom Field Deleted|ΕΠΙΤΥΧΙΑ: Τομέας συνήθειας που διαγράφεται| +Copy List Custom Fields|Τομείς συνήθειας καταλόγων αντιγράφων| +ERROR: You cannot copy fields to the same list|ΛΑΘΟΣ: Δεν μπορείτε να αντιγράψετε τους τομείς στον ίδιο κατάλογο| +DISPLAY will display only and not allow for modification by the agent|Η ΕΠΙΔΕΙΞΗ θα επιδείξει μόνο και δεν θα επιτρέψει την τροποποίηση από τον πράκτορα| +Hold Time Option Callmenu|Χρονική επιλογή Callmenu λαβής| +Hold Time Option Press Filename|Όνομα αρχείου Τύπου χρονικής επιλογής λαβής| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Εάν η χρονική επιλογή λαβής τίθεται CALL_MENU, αυτά είναι οι επιλογές κλήσης ότι η κλήση θα σταλεί εάν ο κατ' εκτίμηση χρόνος λαβής υπερβεί τα δευτερόλεπτα χρονικής επιλογής λαβής| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Εάν η χρονική επιλογή λαβής τίθεται μια από τις επιλογές PRESS_, αυτό είναι η υπαγόρευση ονομάτων αρχείου που παίζεται εάν ο κατ' εκτίμηση χρόνος λαβής υπερβαίνει τα δευτερόλεπτα χρονικής επιλογής λαβής για να δώσει στον πελάτη την επιλογή να πιέσει 1 στο τηλέφωνό τους για να τρέξει την επιλεγμένη επιλογή χρονικού Τύπου λαβής. Είναι πολύ σημαντικό ότι αυτό το ακουστικό αρχείο είναι 10 δευτερόλεπτα ή λιγότεροι ή θα υπάρξουν προβλήματα. Η προεπιλογή είναι -είμαι-καλώ-πίσω| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Εάν μια από τις επιλογές PRESS_ επιλέγεται, θα παίξει το όνομα αρχείου Τύπου που καθορίζεται κατωτέρω και θα δώσει στον πελάτη την επιλογή να πιέσει 1 στο τηλέφωνό τους για να αφήσει τη σειρά αναμονής και να τρέξει την επιλεγμένη επιλογή| +Hold Time Option After Press Filename|Χρονική επιλογή λαβής μετά από το όνομα αρχείου Τύπου| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Εάν η χρονική επιλογή λαβής τίθεται μια από τις επιλογές PRESS_ ή το CALLERID_CALLBACK, αυτό είναι η υπαγόρευση ονομάτων αρχείου που παίζεται αφότου έχει πιέσει ο πελάτης 1 ή η κλήση έχει προστεθεί στον κατάλογο επανάκλησης| +Inbound Queue No Dial|Εισερχόμενη σειρά αναμονής κανένας πίνακας| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Αυτό το χαρακτηριστικό γνώρισμα εάν θέστε επιτρέπει σε σας για να αποτρέψει τον εξερχόμενο αυτόματος-σχηματισμό αυτής της εκστρατείας εάν υπάρχουν οποιεσδήποτε εισερχόμενες κλήσεις που περιμένουν στη σειρά αναμονής που είναι μέρος των εισερχόμενων ομάδων που τίθενται σε αυτήν την εκστρατεία. Η ρύθμιση αυτού σε ALL_SERVERS θα αλλάξει τον αλγόριθμο για να υπολογίσει όλες τις εισερχόμενες κλήσεις όπως ενεργές κλήσεις σε αυτόν τον κεντρικό υπολογιστή ακόμα κι αν είναι σε έναν άλλο κεντρικό υπολογιστή που θα μειώσει την πιθανότητα τις περιττές εξερχόμενες κλήσεις εάν να έχοντας τις κλήσεις που μπαίνουν σε έναν άλλο κεντρικό υπολογιστή. Η προεπιλογή είναι ΕΚΤΟΣ ΛΕΙΤΟΥΡΓΊΑΣ| +After Hours Filename Override|Μετά από τη συμπληρωματική προμήθεια ονομάτων αρχείου ωρών| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|Αυτοί οι τομείς επιτρέπουν σε σας για να αγνοήσουν το μετέπειτα μήνυμα ωρών για τις εισερχόμενες ομάδες εάν τίθεται κάτι. Η προεπιλογή είναι κενή| +On Hold Prompt No Block|Στην υπαγόρευση λαβής κανένας φραγμός| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|Ο καθορισμός αυτής της επιλογής στο Υ θα επιτρέψει τις προσκλήσεις στη γραμμή πίσω από μια πρόσκληση όπου επάνω κρατήστε ότι γρήγορος παίζει για να πάει σε έναν πράκτορα εάν το ένα διατεθεί ενώ το μήνυμα παίζει. Ενώ επάνω κρατήστε ότι το γρήγορο μήνυμα ονομάτων αρχείου παίζει σε έναν πελάτη δεν μπορούν να σταλούν σε έναν πράκτορα. Η προεπιλογή είναι Ν| +On Hold Prompt Seconds|Στα γρήγορα δευτερόλεπτα λαβής| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Αυτός ο τομέας πρέπει να τεθεί τον αριθμό δευτερολέπτων ότι επάνω κρατήστε ότι η γρήγορη προεπιλογή παιχνιδιών ξέν. ονομάτων αρχείου είναι 10| +Hold Time Option Press No Block|Κρατήστε τον Τύπο χρονικής επιλογής κανένας φραγμός| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Ο καθορισμός αυτής της επιλογής στο Υ θα επιτρέψει τις προσκλήσεις στη γραμμή πίσω από μια πρόσκληση όπου η υπαγόρευση ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής παίζει για να πάει σε έναν πράκτορα εάν το ένα διατεθεί ενώ το μήνυμα παίζει. Ενώ το μήνυμα ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής παίζει σε έναν πελάτη δεν μπορούν να σταλούν σε έναν πράκτορα. Η προεπιλογή είναι Ν| +Hold Time Option Press Filename Seconds|Δευτερόλεπτα ονομάτων αρχείου Τύπου χρονικής επιλογής λαβής| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Αυτός ο τομέας πρέπει να τεθεί τον αριθμό δευτερολέπτων ότι το όνομα αρχείου Τύπου χρονικής επιλογής λαβής παίζει την προεπιλογή ξέν. είναι 10| +CallCard Generate New Numbers|Το CallCard παράγει τους νέους αριθμούς| +Call Menu In-Group Settings|Τοποθετήσεις -ομάδας επιλογών κλήσης| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Εάν η διαδρομή τίθεται INGROUP έπειτα υπάρχουν πολλές επιλογές που μπορείτε να θέσετε για να καθορίσετε πώς η κλήση στέλνεται στη σειρά αναμονής. Η -ομάδα είναι η εισερχόμενη ομάδα ότι θέλετε την κλήση για να πάτε. Η μέθοδος λαβών είναι ο τρόπος που θέλετε την κλήση για να αντιμετωπιστείτε| +Click here to see a list of the available handle methods|Χτυπήστε εδώ για να δείτε έναν κατάλογο των διαθέσιμων μεθόδων λαβών| +VID Enter Filename|VID εισάγει το όνομα αρχείου| +VID ID Number Filename|Όνομα αρχείου αριθμού ταυτότητας VID| +VID Confirm Filename|VID επιβεβαιώνει το όνομα αρχείου| +VID Digits|VID ψηφία| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Μέθοδος αναζήτησης καθορίζει πως η ουρά θα βρείτε το επόμενο πράκτορα, προτείνουμε το αφήσουμε αυτό στην LB. ID της λίστας είναι η λίστα ότι ο νέος επικεφαλής εισάγεται, επίσης, αν η μέθοδος δεν είναι μια αναζήτηση μεθόδου και ο μόλυβδος δεν έχει βρεθεί. ID εκστρατείας είναι η εκστρατεία για την αναζήτηση μέσω καταλόγων, αν μία από τις RC μεθόδων που χρησιμοποιούνται. Κωδικός τηλεφώνου είναι η phone_code πεδίο εισαγωγής για την πρωτοπορία που έχει εισαχθεί με. Πληκτρολογήστε το Όνομα VID χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι ο ήχος άμεση έπαιξε να ζητήσει από τον πελάτη να εισάγετε το ID τους. VID Όνομα Αριθμός Ταυτότητας χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι η άμεση ήχου παίζεται μετά την είσοδο του πελάτη τους ταυτότητα, κάτι σαν έχετε εισάγει. VID Επιβεβαίωση Όνομα χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, είναι ο ήχος άμεση έπαιξε για την επιβεβαίωση της αστυνομικής τους ταυτότητας, κάτι σαν ΤΥΠΟΥ 1 για να επιβεβαιώσετε και να μπει και πάλι 2. VID ψηφία χρησιμοποιείται εάν η μέθοδος έχει οριστεί σε μία από τις μεθόδους VIDPROMPT, εάν έχει οριστεί σε έναν αριθμό που είναι ο αριθμός των ψηφίων που πρέπει να αναγράφεται από τον πελάτη, όταν σας ζητηθεί για την ταυτότητα τους, αν οριστεί σε κενές ή X, τότε η πελάτης θα πρέπει να πιέσετε κιλό χασίς ή να ολοκληρώσετε την είσοδό τους της ταυτότητας τους| +Admin Web Directory|Διαχειριστής Web Directory| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Αυτό είναι ο κατάλογος Διοίκησης ότι το περιεχόμενό σας ιστοσελίδα, όπως admin.php, είναι μέσα Προεπιλογή vicidial. Για να καταλάβω Διαχειριστής της ιστοσελίδα σας, είναι ό, τι είναι μεταξύ του domain name και το admin.php στη διεύθυνση URL αυτής της σελίδας, χωρίς τις καθέτους που αρχίζουν και τελειώνουν| +TTS Voice|TTS φωνή| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|Αυτό είναι όπου μπορείτε να ορίσετε τη φωνή που πρέπει να χρησιμοποιούνται στην παραγωγή TTS. Προεπιλογή είναι Allison-8kHz| +Default Field Labels|Ετικέτες Πεδίο Προεπιλογή| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Αυτά τα 19 πεδία σας επιτρέπουν να ορίσετε το όνομα, όπως θα εμφανίζεται στο περιβάλλον ViciDial παράγοντα καθώς και τη διοικητική σελίδα μολύβδου τροποποιήσετε. Προεπιλογή είναι άδειο το οποίο θα χρησιμοποιεί τα σκληρά-κωδικοποιημένα προεπιλογές στη διεπαφή πράκτορα| +Label Title|Τίτλος Ετικέτα| +Label First Name|Ετικέτα Όνομα| +Label Middle Initial|Ετικέτα Μέση Αρχική| +Label Last Name|Ετικέτα Επώνυμο| +Label Address1|Ετικέτα Διεύθυνση1| +Label Address2|Ετικέτα Διεύθυνση2| +Label Address3|Ετικέτα 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|Ετικέτα Τηλέφωνο Alt| +Label Security Phrase|Ετικέτα Ασφάλειας Φράση| +Label Email|Αποστολή Ετικέτα| +Label Comments|Σχόλια Ετικέτα| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|Δεν συνιστάται η ρύθμιση εισερχόμενες κλήσεις σε υψηλότερη προτεραιότητα από τις εξερχόμενες κλήσεις, επειδή οι άνθρωποι της εκστρατείας καλώντας σε περιμένουν να περιμένουν και οι άνθρωποι που καλούνται να περιμένετε για κάποιον να είναι εκεί στο τηλέφωνο| +Formerly called Conf File Secret|Παλαιότερα ονομαζόταν Conf Μυστικό Αρχείο| +Registration Password|Κωδικός Εγγραφή| +Login Password|Υποσελίδες| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|Ο κωδικός που χρησιμοποιείται για τον χρήστη του τηλεφώνου για να συνδεθείτε με τα web-based εφαρμογές πελάτη. ΣΗΜΑΝΤΙΚΟ, αυτός είναι ο κωδικός πρόσβασης μόνο για το web παράγοντα σύνδεσης του τηλεφώνου interface, να αλλάξετε τον κωδικό πρόσβασης ή sip.conf iax.conf, ή μυστικό, για τη συγκεκριμένη συσκευή τηλεφώνου θα πρέπει να τροποποιήσετε τον κωδικό πρόσβασης Εγγραφή στο επόμενο πεδίο| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|SCRIPT θα εμφανίσει μόνο, αλλά μπορείτε να χρησιμοποιήσετε μεταβλητές σενάριο ακριβώς όπως στο χαρακτηριστικό Scripts. SCRIPT πεδία θα εμφανιστεί μόνο το περιεχόμενο των επιλογών, και όχι το όνομα του πεδίου, όπως τον τύπο οθόνης κάνει| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|Μπορείτε επίσης να συμπεριλάβετε τα προεπιλεγμένα ViciDial πεδία σε μια προσαρμοσμένη ρύθμιση στον τομέα, και θα δείτε τους σε κόκκινο χρώμα στη λίστα. Αυτά τα πεδία δεν θα προστεθεί στην προσαρμοσμένη λίστα πίνακα της βάσης δεδομένων, η διεπαφή θα πράκτορα αναφοράς αντί του πίνακα vicidial_list άμεσα. Οι ετικέτες που μπορείτε να χρησιμοποιήσετε για να συμπεριλάβετε τις fieds προεπιλογή είναι| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Αν είναι προσαρμοσμένα πεδία λίστας ενεργοποιημένη στο σύστημά σας, θα ΕΝΤΥΠΟ ανοίξτε την καρτέλα ΕΝΤΥΠΟ κατά τη σύνδεση μιας κλήσης σε έναν πράκτορα| +Enable Custom List Fields|Ενεργοποίηση προσαρμοσμένων πεδίων λίστας| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Αυτή η ρύθμιση επιτρέπει την προσαρμοσμένη λίστα χαρακτηριστικό πεδία που επιτρέπει για προσαρμοσμένα πεδία δεδομένων που θα καθοριστούν το web interface διαχείρισης με βάση την ανά-λίστα και στη συνέχεια να έχουν τα πεδία που είναι διαθέσιμα σε μια καρτέλα ΕΝΤΥΠΟ στον πράκτορα στο περιβάλλον web πράκτορα. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +CUSTOM FIELDS FOR THIS LEAD|Προσαρμοσμένα Πεδία ΓΙΑ ΑΥΤΟ ΤΟ ΜΟΛΥΒΔΟ| +Slave Database Server|Slave διακομιστή βάσης δεδομένων| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Εάν έχετε έναν σκλάβο MySQL server της βάσης δεδομένων και στη συνέχεια πληκτρολογήστε την τοπική διεύθυνση IP για το διακομιστή εδώ. Η επιλογή αυτή τη στιγμή χρησιμοποιούνται μόνο από τις επιλεγμένες αναφορές στην επόμενη επιλογή και δεν έχει τίποτα να κάνει με την αυτόματη ρύθμιση παραμέτρων MySQL κυρίου-υποτελούς αναπαραγωγή. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες| +Reports to use Slave DB|Εκθέσεις για την χρήση της DB Slave| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Αυτή η επιλογή σας επιτρέπει να επιλέξετε τις αναφορές που θέλετε να χρησιμοποιήσετε τη βάση δεδομένων MySQL σκλάβων, όπως ορίζεται στην παραπάνω επιλογή αντί της βάσης δεδομένων master ότι τα ζωντανά ViciDial σύστημά σας τρέχει σε. Θα πρέπει να συσταθεί η αναπαραγωγή σκλάβος της MySQL για να μπορέσετε να ενεργοποιήσετε αυτή την επιλογή. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες| +Custom fields defined for this list|Τα προσαρμοσμένα πεδία που ορίζονται για αυτόν τον κατάλογο| +Go to the list modification page for this list|Μετάβαση στη σελίδα τροποποίηση κατάλογο για αυτήν τη λίστα| +Estimated Hold Time Option|Εκτιμώμενος χρόνος επιλογή Αναμονή| +Hold Time Second Option|Κρατήστε δεύτερη φορά Επιλογή| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Ίδια με την πρώτη φορά στον τομέα επιλογή Hold παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 2. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν υπάρχει πρώτη επιλογή Χρόνος Αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν| +Hold Time Third Option|Κρατήστε Ώρα Τρίτη επιλογή| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Ίδια με την πρώτη φορά στον τομέα επιλογή Hold παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 3. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν Δεύτερη επιλογή Χρόνος Αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν| +Wait Time Option|Περιμένετε Επιλογή Χρόνος| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Αυτό σας επιτρέπει να προσφέρουμε στους πελάτες επιλογές για να αφήσει την ουρά, αν ο χρόνος αναμονής τους είναι πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν μία από τις επιλογές PRESS_ έχει επιλεγεί, θα παίξει το όνομα του αρχείου Τύπου ορίζονται κατωτέρω, και να δώσει στον πελάτη τη δυνατότητα να πατήστε το κουμπί 1 στο τηλέφωνό τους να φύγουν από την ουρά και να εκτελέσετε την επιλεγμένη επιλογή. Η PRESS_STAY επιλογή θα στείλει τον πελάτη πίσω στην ουρά, χωρίς να χάσει τη θέση τους στην γραμμή| +Wait Time Second Option|Περιμένετε δεύτερη φορά Επιλογή| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Ίδια με την πρώτη φορά στον τομέα Επιλογή Περιμένετε παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 2. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν υπάρχει πρώτη επιλογή χρόνος αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν| +Wait Time Third Option|Περιμένετε Ώρα Τρίτη επιλογή| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Ίδια με την πρώτη φορά στον τομέα Επιλογή Περιμένετε παραπάνω, εκτός από αυτήν θα ελέγξει για τον πελάτη πατώντας το πλήκτρο 3. Προεπιλογή είναι ΚΑΝΕΝΑ. Εάν δεν Δεύτερη επιλογή χρόνος αναμονής έχει επιλεγεί αυτή η επιλογή δεν θα προσφερθούν| +Wait Time Option Seconds|Περιμένετε Δευτερόλεπτα Επιλογή Χρόνος| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε οτιδήποτε, αλλά ΚΑΝΕΝΑ, αυτός είναι ο αριθμός των δευτερολέπτων που ο πελάτης έχει να περιμένει στην ουρά που θα ενεργοποιήσουν τις επιλογές του χρόνου αναμονής. Προεπιλογή είναι 120 δευτερόλεπτα| +Wait Time Option Extension|Περιμένετε Χρόνος Επέκταση Επιλογή| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_EXTEN, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή| +Wait Time Option Callmenu|Περιμένετε ώρα Callmenu Επιλογή| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_CALLMENU, αυτό είναι το μενού Κλήση ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή| +Wait Time Option Voicemail|Περιμένετε ώρα Τηλεφωνητής Επιλογή| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_VMAIL, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή. Σε ένα AGENTDIRECT στην ομάδα, θέτοντας αυτή την AGENTVMAIL θα επιλέξετε το αναγνωριστικό τηλεφωνητή χρήστη να χρησιμοποιεί| +Wait Time Option Transfer In-Group|Περιμένετε Χρόνος Μεταγωγής επιλογή-ομάδα| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_INGROUP, αυτή είναι η εισερχόμενη ομάδα ότι η πρόσκληση θα σταλεί στο αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή| +Wait Time Option Press Filename|Περιμένετε Ώρα Όνομα Επιλογή Τύπου| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε μία από τις επιλογές PRESS_, αυτή είναι η προτροπή του ονόματος αρχείου που παίζεται αν ο χρόνος αναμονής του πελάτη υπερβαίνει τις Δευτερόλεπτα Επιλογή χρόνος αναμονής για να δώσει στον πελάτη τη δυνατότητα να πιέσει 1, 2 ή 3 στο τηλέφωνό τους για να τρέξει οι επιλεγμένες επιλογές Πατήστε το χρόνο αναμονής. Είναι πολύ σημαντικό να περιλαμβάνει επιλογές από το αρχείο ήχου για όλα τα επιλεγμένα Επιλογές χρόνο αναμονής σας, και ότι το μήκος του αρχείου ήχου σε λίγα δευτερόλεπτα έχει οριστεί σωστά στο πεδίο Όνομα δευτερόλεπτα κάτω ή θα υπάρξουν προβλήματα. Η προεπιλογή είναι να-να-λέγεται-πίσω| +Wait Time Option Press No Block|Περιμένετε ώρα Τύπου επιλογή Χωρίς Κλείδωμα| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Η ρύθμιση αυτής της επιλογής στο Y θα επιτρέπει την πραγματοποίηση κλήσεων στη γραμμή πίσω από μια κλήση όπου ο χρόνος αναμονής Επιλογή Όνομα Τύπου προτροπή να πάει το παιχνίδι σε έναν πράκτορα εάν είναι διαθέσιμο, ενώ το μήνυμα που παίζει. Ενώ ο χρόνος αναμονής Επιλογή Τύπου μηνύματος Όνομα παίζει σε έναν πελάτη που δεν μπορεί να σταλεί σε έναν πράκτορα. Προεπιλογή είναι N| +Wait Time Option Press Filename Seconds|Περιμένετε δευτερόλεπτα χρόνος Επιλογή Όνομα Τύπου| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Αυτό το πεδίο πρέπει να ρυθμιστεί με τον αριθμό των δευτερολέπτων που ο χρόνος αναμονής Επιλογή Όνομα Τύπου παίζει. Η προεπιλογή είναι 10| +Wait Time Option After Press Filename|Περιμένετε Επιλογή ώρα μετά το όνομα αρχείου Τύπου| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε μία από τις επιλογές PRESS_, αυτή είναι η προτροπή του ονόματος αρχείου που παίζεται αφού ο πελάτης έχει πιεστεί 1, 2 ή 3| +Wait Time Option Callback List ID|Περιμένετε Χρόνος επανάκλησης Επιλογή ID της λίστας| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Αν Περιμένετε Επιλογή ώρα έχει οριστεί σε PRESS_CID_CALLBACK, αυτό είναι το ID της λίστας η κλήση προστίθεται ως νέο επικεφαλής, αν ο πελάτης πατήσει το πλήκτρο επιλογής, όταν παρουσιάζονται με την επιλογή| +Wait Hold Option Priority|Περιμένετε Κρατήστε Προτεραιότητα Επιλογή| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Αν και οι δύο επιλογές Εκτιμώμενος χρόνος συντήρησης και Περιμένετε ώρα επιλογές είναι ενεργές, η ρύθμιση αυτή θα καθορίσει κατά πόσο ένα, το άλλο ή και τα δύο αυτά χαρακτηριστικά είναι ενεργό. Για παράδειγμα, αν ο εκτιμώμενος χρόνος Hold επιλογή έχει οριστεί σε 360, η επιλογή χρόνος αναμονής έχει οριστεί σε 120 και ο πελάτης έχει να περιμένει για 120 δευτερόλεπτα και εξακολουθούν να υπάρχουν 400 δευτερόλεπτα εκτιμάται ότι κατέχουν χρόνο, τότε και οι δύο ενεργές την ίδια στιγμή και αυτή η ρύθμιση θα πρέπει να ελεγχθούν για να δούμε τι επιλογές θα πρέπει να προσφέρονται. Η προεπιλογή είναι μόνο ΑΝΑΜΟΝΗ| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|Οι ΑΣΦΑΛΙΣΜΕΝΗ επιλογές που χρησιμοποιείται για να κλειδώσει την τιμή στο κουμπί γρήγορης μεταφοράς, ακόμη και αν ο αντιπρόσωπος χρησιμοποιεί τις δυνατότητες μεταφοράς συνέδριο κατά τη διάρκεια μιας κλήσης πριν χρησιμοποιήσετε το κουμπί γρήγορης μεταφοράς| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|Hangup θα τερματίσετε την κλήση, όταν το χρονόμετρο έχει ενεργοποιηθεί, CALLMENU θα στείλει την κλήση στο μενού Κλήση καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, ΕΠΕΚΤΑΣΗ θα στείλει την κλήση της επέκτασης που καθορίζεται στο Πεδίο Δράσης Προορισμός χρονοδιακόπτη, θα στείλει IN_GROUP την κλήση στο In-ομάδα που προσδιορίζεται στο πεδίο της δράσης Προορισμός χρονοδιακόπτη| +Timer Action Destination|Χρονοδιακόπτης Προορισμός δράσης| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Αυτό το πεδίο είναι όπου μπορείτε να καθορίσετε το μενού Κλήση, επέκταση ή-Στην ομάδα που θέλετε να αποσταλεί κλήση αν ο χρόνος δράσης της έχει οριστεί σε CALLMENU, την επέκταση ή IN_GROUP. Προεπιλογή είναι άδειο| +You must enter field options when adding a|Θα πρέπει να εισάγετε τις επιλογές τομέα όταν η προσθήκη ενός| +You must enter field options when updating a|Θα πρέπει να εισάγετε τις επιλογές τομέα κατά την ενημέρωση ενός| +Allowed Reports|Επιτρέπονται Εκθέσεις| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Αν ένας χρήστης σε αυτήν την ομάδα έχει οριστεί σε επίπεδο χρήστη 7 ή νεότερη έκδοση, τότε αυτό το χαρακτηριστικό μπορεί να χρησιμοποιηθεί για να περιορίσει τις εκθέσεις ότι οι χρήστες μπορούν να δουν. Η προεπιλογή είναι το ALL. Εάν θέλετε να επιλέξετε περισσότερες από μία έκθεση και στη συνέχεια πατήστε το πλήκτρο Ctrl στο πληκτρολόγιό σας, όπως εσείς επιλέξετε τις εκθέσεις| +You are not allowed to view this report|Δεν σας επιτρέπεται να δείτε αυτήν την έκθεση| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - θα περιλαμβάνει καταλόγους ανενεργά στην αναζήτηση για τον αριθμό| +Add-Delete DNC Number|Προσθήκη-Διαγραφή DNC Αριθμός| +Add DNC Number|Προσθήκη DNC Αριθμός| +Copy Custom Fields|Αντιγραφή προσαρμοσμένων πεδίων| +Add Filter Phone Group|Προσθήκη φίλτρου Ομίλου Τηλ.| +New Filter Phone Group|Νέο φίλτρο Ομίλου Τηλ.| +Modify Filter Phone Group|Τροποποίηση φίλτρου Ομίλου Τηλ.| +Delete Phone Filter Group|Διαγραφή φίλτρου Τηλέφωνο Ομίλου| +Filter Phone Groups|Φίλτρο Ομάδες Τηλέφωνο| +Filter Phone Group ID|Φίλτρο ID Ομάδας Τηλέφωνο| +Filter Phone Group Name|Όνομα φίλτρου ομάδας Τηλέφωνο| +Filter Phone Group Description|Φίλτρο Περιγραφή ομάδας Τηλέφωνο| +PHONE FILTER GROUP NOT ADDED|ΤΗΛΕΦΩΝΟ ΦΙΛΤΡΟ ΟΜΑΔΑ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ| +there is already a PHONE FILTER GROUP in the system with this ID|υπάρχει ήδη ένα τηλέφωνο ΦΙΛΤΡΟ GROUP στο σύστημα με αυτό το αναγνωριστικό| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|Τηλέφωνο ID Ομάδας φίλτρου πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες και δεν περιέχουν| +PHONE FILTER GROUP ADDED|ΤΗΛΕΦΩΝΟ ΦΙΛΤΡΟ ΟΜΑΔΑ ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +Add Filter Phone Group|Προσθήκη φίλτρου Ομίλου Τηλ.| +Add-Delete FPG Number|Προσθήκη-Διαγραφή Αριθμός FPG| +Add FPG Number|Προσθήκη της FPG Αριθμός| +FILTER PHONE GROUP NOT MODIFIED|ΦΙΛΤΡΟ ΟΜΑΔΑ τηλέφωνο δεν ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +FILTER PHONE GROUP MODIFIED|ΦΙΛΤΡΟ ΟΜΙΛΟΣ ΤΡΟΠΟΠΟΙΗΜΕΝΑ ΤΗΛΕΦΩΝΟ| +FILTER PHONE GROUP NOT DELETED|ΦΙΛΤΡΟ ΟΜΑΔΑ τηλέφωνο δεν διαγράφονται| +Click here to delete FILTER PHONE GROUP|Κάντε κλικ εδώ για να διαγράψετε ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ| +FILTER PHONE GROUP DELETION CONFIRMATION|ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ| +FILTER PHONE GROUP DELETION COMPLETED|ΦΙΛΤΡΟ ΔΙΑΓΡΑΦΗ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ ΟΛΟΚΛΗΡΩΘΗΚΕ| +Click here to see Admin chages to this filter phone group|Κάντε κλικ εδώ για να δείτε Διαχειριστής chages για αυτό το φίλτρο της ομάδας τηλέφωνο| +DELETE THIS FILTER PHONE GROUP|ΔΙΑΓΡΑΦΗ ΠΑΡΟΥΣΑ ΦΙΛΤΡΟ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ| +FILTER PHONE GROUP LISTINGS|ΦΙΛΤΡΟ ΑΚΙΝΗΤΑ ΟΜΑΔΑ ΤΗΛΕΦΩΝΟ| +Filter Phone Group Numbers|Φιλτράρισμα αριθμών τηλεφώνου Ομίλου| +This phone number is not in the Filter Phone Group List|Αυτός ο αριθμός τηλεφώνου δεν είναι στην λίστα φίλτρων Ομίλου Τηλ.| +This phone number is already in the Filter Phone Group List|Αυτός ο αριθμός τηλεφώνου είναι ήδη στη λίστα φίλτρων Ομίλου Τηλ.| +FILTER PHONE GROUP NUMBER NOT DELETED|ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΙΛΟΣ δεν διαγράφεται| +FILTER PHONE GROUP NUMBER DELETED|ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΔΙΑΓΡΑΦΟΝΤΑΙ| +FILTER PHONE GROUP NUMBER NOT ADDED|ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ| +FILTER PHONE GROUP NUMBER ADDED|ΦΙΛΤΡΟ ΑΡΙΘΜΟΣ ΤΗΛΕΦΩΝΟΥ ΟΜΑΔΑ ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +Numbers in this Filter Phone Group|Οι αριθμοί σε αυτό το φίλτρο Ομίλου Τηλ.| +There are no phone numbers in list|Δεν υπάρχουν αριθμοί τηλεφώνου στη λίστα| +There are no leads in Campaign DNC list|Δεν υπάρχουν καλώδια στη λίστα DNC Εκστρατεία| +There are no leads in this filter phone group|Δεν υπάρχουν οδηγεί σε αυτό το φίλτρο της ομάδας τηλέφωνο| +Click here to download the numbers in this filter phone group|Κάντε κλικ εδώ για να κατεβάσετε τους αριθμούς σε αυτό το φίλτρο της ομάδας τηλέφωνο| +Filter Inbound Number|Φιλτράρισμα Εισερχόμενων Αριθμός| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Αυτή η επιλογή αν δυνατότητα σας επιτρέπει να φιλτράρετε κλήσεις που έρχονται σε αυτό το DID και να τα στείλετε σε μια εναλλακτική δράση και αν ταιριάζει με έναν αριθμό τηλεφώνου που βρίσκεται στην ομάδα φίλτρο τηλέφωνο ή μια διεύθυνση URL απάντηση, εάν έχετε ρυθμίσει ένα. Προεπιλογή είναι απενεργοποιημένη. GROUP θα αναζητήσει σε μια ομάδα Φίλτρο τηλέφωνο. URL θα στείλει μια διεύθυνση URL και θα ταιριάξει εάν ένα 1 αποστέλλεται πίσω| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Αν το φίλτρο εισερχόμενων πεδίο Αριθμός αναμένεται να ΟΜΙΛΟΣ τότε αυτό είναι το αναγνωριστικό της ομάδας Φίλτρο τηλέφωνο που θα έχουν οι αριθμοί του έψαξε ψάχνει για έναν αγώνα με τον αριθμό αναγνώρισης κλήσης της εισερχόμενης κλήσης| +Filter URL|Φίλτρο URL| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Αν το φίλτρο εισερχόμενων πεδίο Αριθμός ορίζεται στο URL τότε αυτή είναι η ηλεκτρονική διεύθυνση ενός σεναρίου που θα ψάξει ένα απομακρυσμένο σύστημα και να επιστρέψει ένα 1 για έναν αγώνα και σε 0 για κανένα αγώνα. Μόνο δύο μεταβλητές είναι διαθέσιμες στη διεύθυνση, αν χρησιμοποιείτε το πρόθεμα VAR όπως διευθύνσεις με έλθουν σε εκστρατείες, - Α - PHONE_NUMBER - Β - και - Α - did_pattern - Β - μπορεί να χρησιμοποιηθεί στο URL να αναφέρει την ταυτότητα του καλούντος καλούντος και η DID, ότι ο πελάτης καλείται μέσα σε| +Filter Action|Φίλτρο δράσης| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Αν φίλτρου εισερχόμενων Αριθμός ενεργοποιείται και ένας αγώνας που βρέθηκαν, τότε αυτό είναι η δράση που πρόκειται να ληφθούν. Αυτή είναι η ίδια με την διαδρομή που θα επιλέξετε για ένα DID, και οι παρακάτω ρυθμίσεις λειτουργούν όπως ακριβώς κάνουν για ένα πρότυπο δρομολόγησης| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|Αυτό είναι το αναγνωριστικό της ομάδας Φίλτρο τηλέφωνο που είναι το εμπορευματοκιβώτιο για μια ομάδα αριθμών τηλεφώνου που μπορείτε να έχετε ψάξει αυτόματα μέσα από μια κλήση όταν έρχεται σε μια DID, και να το στείλετε σε μια εναλλακτική διαδρομή, αν υπάρχει ένας αγώνας. Αυτό το πεδίο πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες και δεν έχουν σημεία στίξης εκτός υπογράμμισης| +Filter Phone Group Description|Φίλτρο Περιγραφή ομάδας Τηλέφωνο| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Αυτή είναι η περιγραφή του φίλτρου ομάδας τηλέφωνο, είναι καθαρά για σκοπούς σημειογραφία μόνο και δεν είναι υποχρεωτικό πεδίο| +Clean CID Number|Καθαρίστε CID Αριθμός| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|Αυτό το πεδίο σας επιτρέπει να ορίσετε ένα αριθμό ψηφίων για να περιορίσεις την εισερχόμενη αριθμό ταυτότητας καλούντος για βάζοντας ένα R μπροστά από τον αριθμό των ψηφίων, για παράδειγμα, να περιορίσει το δικαίωμα των 10 ψηφίων που θα εισάγετε στο R10. Μπορείτε επίσης να χρησιμοποιήσετε αυτή τη δυνατότητα να καταργήσετε μόνο ηγετικό ψηφίο ή ψηφία θέτοντας L μπροστά από τα συγκεκριμένα ψηφία που θέλετε να καταργήσετε, για παράδειγμα, να αφαιρέσετε ένα 1 ως πρώτο ψηφίο θα εισάγετε το L1. Προεπιλογή είναι άδειο. Εάν περισσότεροι από ένας κανόνας και φροντίστε να τις διαχωρίσετε με ένα διάστημα και η έρευνα θα λειτουργήσει πριν από το L| +must be an existing vicidial user|πρέπει να είναι μια υπάρχουσα vicidial χρήστη| +you must use a valid user as the user_start for remote agents|πρέπει να χρησιμοποιήσετε ένα έγκυρο χρήστη ως user_start για απομακρυσμένη πράκτορες| +your number of lines overlaps with another remote agent|αριθμό των γραμμών επικαλύπτεται με άλλο απομακρυσμένο πράκτορα| +Webphone URL Override|Διαδικτυακό κοινόχρηστο τηλέφωνο Παράκαμψη URL| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Η ρύθμιση αυτή σας επιτρέπει να ορίσετε μια εναλλακτική διεύθυνση URL Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι άδειο| +Calculate Estimated Hold Seconds|Υπολογίστε περίπου δευτερόλεπτα Hold| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Αυτό καθορίζει τον αριθμό των δευτερολέπτων στην ουρά ότι ο πελάτης θα περιμένει πριν την προβλεπόμενη ώρα Αναμονή θα πρέπει να υπολογίζονται και προαιρετικά έπαιξε. Ελάχιστες είναι 3 δευτερόλεπτα, ακόμα κι αν είναι μικρότερος από 3. Προεπιλογή είναι 0| +Campaign Preset Added|Προκαθορισμένη Εκστρατεία προσθήκης| +Campaign Presets|Προεπιλογές Εκστρατεία| +Modify Campaign Preset|Τροποποίηση Προκαθορισμένη Εκστρατεία| +Campaign Preset Removed|Προκαθορισμένη εκστρατεία απομάκρυνε| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Εάν η ρύθμιση καμπάνιας για προεπιλογές έχει οριστεί σε ΕΝΕΡΓΟΠΟΙΗΜΈΝΗ τότε έχετε τη δυνατότητα να καθορίσουν Μεταφορά της Διάσκεψης προκαθορισμένες ρυθμίσεις που θα είναι διαθέσιμες στον πράκτορα που τους επιτρέπει να 3-way ονομάσουμε αυτές τις προκαθορισμένες ρυθμίσεις ή τυφλή κλήσεις προς αυτά προεπιλεγμένους αριθμούς. Αυτές οι προκαθορισμένες ρυθμίσεις έχουν επίσης μια επιλογή για να κρύψει τον αριθμό που σχετίζεται με κάθε προκαθορισμένο από τον πράκτορα| +PRESET NOT ADDED|PRESET ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ| +there is already an entry for this campaign with this preset|υπάρχει ήδη μια καταχώρηση για την εκστρατεία αυτή με αυτήν την προκαθορισμένη ρύθμιση| +PRESET NOT MODIFIED|PRESET ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΑ| +>Presets<|> Προεπιλογές <| +Hide Transfer Number to Dial|Απόκρυψη Μεταφορά Αριθμός για κλήση| +Enable Transfer Presets|Ενεργοποίηση Προεπιλογές Μεταφορά| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Η επιλογή αυτή θα επιτρέψει στις Προεπιλογές υπομενού να εμφανίζονται στην κορυφή της σελίδας Τροποποίηση Καμπάνιας, και επίσης θα έχετε τη δυνατότητα να καθορίσετε προεπιλεγμένους αριθμούς κλήσης για πράκτορες να χρησιμοποιούν στο πλαίσιο μεταφοράς της Διάσκεψης της διεπαφής πράκτορα. Προεπιλογή είναι απενεργοποιημένη| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Αυτή η επιλογή θα κρύψει το αριθμό πρέπει να καλέσετε τον τομέα στο πλαίσιο μεταφοράς της Διάσκεψης της διεπαφής πράκτορα. Προεπιλογή είναι απενεργοποιημένη| +PRESETS FOR THIS CAMPAIGN|PRESETS για τη συγκεκριμένη καμπάνια| +ADD NEW PRESET|Προσθήκη νέου PRESET| +Hide Number|Απόκρυψη αριθμού| +Preset Name|Προκαθορισμένο όνομα| +Preset Number|Προκαθορισμένο αριθμό| +Preset DTMF|Προκαθορισμένη DTMF| +CAMPAIGN PRESET LISTINGS|ΕΚΣΤΡΑΤΕΙΑ PRESET ΑΚΙΝΗΤΑ| +CAMPAIGN PRESET NOT DELETED|PRESET ΕΚΣΤΡΑΤΕΙΑ δεν διαγράφεται| +Show Presets Stats|Εμφάνιση Προεπιλογές Στατιστικά| +AGENT DIAL PRESETS NAMES|PRESETS DIAL ΠΡΑΚΤΟΡΑΣ ΟΝΟΜΑΤΑ| +Manual Dial Prefix|Εγχειρίδιο Πρόθεμα κλήσης| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε το πρόθεμα κλήσης που πρέπει να χρησιμοποιούνται μόνο όταν τοποθετείτε το εγχειρίδιο κλήσεις μέσω τηλεφώνου από τη διεπαφή πράκτορα, όπως η χρήση της μη αυτόματης κλήσης ή Καλέστε τον επόμενο αριθμό, όταν στο εγχειρίδιο μέθοδο κλήσης, ή χειροκίνητη κλήση αριθμού alt, ή προγραμματισμένα από το χρήστη μόνο επιστροφές κλήσεων. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες, οι οποίες θα χρησιμοποιούν το πρόθεμα κλήσης που ορίζεται στο παραπάνω πεδίο. Αυτή η επιλογή δεν έρχεται σε αντίθεση με το 3way επιλογή Πρόθεμα κλήσης| +Here is a list of reserved phrases that cannot be used as menu IDs|Εδώ είναι μια λίστα των προστατευόμενων φράσεις που δεν μπορούν να χρησιμοποιηθούν ως αναγνωριστικά μενού| +Call Menu ID cannot use reserved words|Καλέστε ID μενού δεν μπορούν να χρησιμοποιήσουν δεσμευμένες λέξεις| +Webphone System Key Override|Διαδικτυακό κοινόχρηστο τηλέφωνο Σύστημα Βασικά Παράκαμψη| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Η ρύθμιση αυτή σας επιτρέπει να ορίσετε μια εναλλακτική Key System Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι άδειο| +Webphone Dialpad Override|Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad Παράκαμψη| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Η ρύθμιση αυτή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε το dialpad στο Διαδικτυακό κοινόχρηστο τηλέφωνο μόνο για τα μέλη μιας ομάδας χρηστών. Προεπιλογή είναι απενεργοποιημένη. TOGGLE θα επιτρέψει στο χρήστη να βλέπει και να κρύψει το dialpad κάνοντας κλικ σε ένα σύνδεσμο| +Webphone Dialpad|Διαδικτυακό κοινόχρηστο τηλέφωνο dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Η ρύθμιση αυτή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε το dialpad για αυτό το Διαδικτυακό κοινόχρηστο τηλέφωνο. Η προεπιλογή είναι ενεργοποιημένη για το Υ. TOGGLE θα επιτρέψει στο χρήστη να βλέπει και να κρύψει το dialpad κάνοντας κλικ σε ένα σύνδεσμο. Αυτή η δυνατότητα δεν είναι διαθέσιμη σε όλες τις εκδόσεις Διαδικτυακό κοινόχρηστο τηλέφωνο| +Webphone System Key|Διαδικτυακό κοινόχρηστο τηλέφωνο Key System| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Αν το σύστημά σας ή το φορέα παροχής απαιτεί, αυτό είναι όπου το βασικό σύστημα για το Διαδικτυακό κοινόχρηστο τηλέφωνο θα πρέπει να εγγραφεί μέσα Προεπιλογή είναι άδειο| + Strength| Δύναμη| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Ένας ισχυρός κωδικός πρόσβασης εγγραφή θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Ένα ισχυρό μυστικό αρχείο ρυθμίσεων θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Ένας ισχυρός κωδικός πρόσβασης χρήστη θα πρέπει να είναι τουλάχιστον 8 χαρακτήρες σε μήκος και έχουν πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό| +Force Change Password|Δύναμη Αλλαγή κωδικού πρόσβασης| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Εάν αυτή η επιλογή έχει οριστεί σε y και στη συνέχεια ο χρήστης θα σας ζητηθεί να αλλάξετε τον κωδικό πρόσβασης τους την επόμενη φορά που θα συνδεθείτε με την ιστοσελίδα διοίκηση. Προεπιλογή είναι N| +First Login Trigger|Πρώτη Trigger Είσοδος| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Αυτή η ρύθμιση δίνει τη δυνατότητα για την αρχική διαμόρφωση του διακομιστή οθόνης να εμφανίζεται στο διαχειριστή, όταν συνδέεστε για πρώτη φορά στο σύστημα| +Default Phone Registration Password|Προεπιλεγμένος κωδικός πρόσβασης Εγγραφή Τηλέφωνο| +This is the default registration password used when new phones are added to the system. Default is test|Αυτός είναι ο κωδικός εγγραφής προεπιλογή χρησιμοποιούνται όταν νέα τηλέφωνα προστεθούν στο σύστημα. Η προεπιλογή είναι δοκιμή| +Default Phone Login Password|Προεπιλογή Κωδικός Είσοδος Τηλέφωνο| +This is the default phone web login password used when new phones are added to the system. Default is test|Αυτό είναι το προεπιλεγμένο τηλέφωνο διαδίκτυο κωδικό πρόσβασης χρησιμοποιείται όταν τα νέα κινητά τηλέφωνα προστίθεται στο σύστημα. Η προεπιλογή είναι δοκιμή| +Default Server Password|Προεπιλεγμένος κωδικός πρόσβασης διακομιστή| +This is the default server password used when new servers are added to the system. Default is test|Αυτός είναι ο κωδικός προεπιλεγμένο διακομιστή που χρησιμοποιείται όταν οι νέοι διακομιστές προστεθούν στο σύστημα. Η προεπιλογή είναι δοκιμή| +CHANGE PASSWORD|Αλλαγή κωδικού πρόσβασης| +INITIAL INSTALL WELCOME|Αρχική εγκατάσταση ΚΑΛΩΣ ΗΡΘΑΤΕ| +COPYRIGHT TRADEMARK LICENSE|ΠΝΕΥΜΑΤΙΚΑ ΔΙΚΑΙΩΜΑΤΑ άδεια εκμετάλλευσης σήματος| +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|Είστε υποχρεωμένοι να αλλάξετε τον κωδικό σας για να μπορέσετε να συνεχίσετε με τη διοίκηση. Ένας ισχυρός κωδικός πρόσβασης έχει τόσο πεζά και κεφαλαία γράμματα, καθώς και τουλάχιστον έναν αριθμό. Ο κωδικός πρόσβασής σας πρέπει να είναι από 2 έως 20 χαρακτήρες σε μήκος και δεν μπορεί να περιέχει χαρακτήρες που δεν είναι γράμματα ή αριθμούς| +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|Να είστε βέβαιος ότι αυτός ο κωδικός είναι κάτι που μπορείτε να θυμηθείτε, επειδή μόλις κάνετε αυτή την αλλαγή θα σας ζητηθεί να εισάγετε το νέο κωδικό πρόσβασης για να συνδεθείτε ξανά με τη διοίκηση| +Password has not been changed, please try again|Κωδικός πρόσβασης δεν έχει αλλάξει, παρακαλώ προσπαθήστε ξανά| +New Password|Νέος κωδικός πρόσβασης| +Password has been updated, you may now continue|Κωδικός έχει ενημερωθεί, μπορείτε να συνεχίσετε τώρα| +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 Manager που διατίθεται στο| +there is a free version available|υπάρχει μια δωρεάν έκδοση διατίθεται| +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|Να είστε βέβαιος ότι αυτός ο κωδικός είναι κάτι που μπορείτε να θυμηθείτε, επειδή μόλις έχετε ολοκληρώσει αυτή την αρχική οθόνη εγκατάστασης θα σας ζητηθεί να εισάγετε το νέο κωδικό πρόσβασης ξανά για να συνδεθείτε ξανά με τη διοίκηση| +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|Οι επόμενες τρεις προεπιλεγμένους κωδικούς που ορίζονται στην ενότητα Ρυθμίσεις του συστήματος, και μπορείτε να τα αλλάξετε μετά τον ορισμό τους εδώ. Είναι μια καλή ιδέα να κάνουν οι κωδικοί πρόσβασης ισχυρή, έτσι ώστε κανείς δεν μπορεί να παρεισφρύσει λογαριασμούς του τηλεφώνου σας και τις τηλεφωνικές κλήσεις πραγματοποιούνται χωρίς να το γνωρίζετε. Ο κωδικός εγγραφής προεπιλογή χρησιμοποιούνται όταν νέα τηλέφωνα προστεθούν στο σύστημα ως το SIP ή τον κωδικό πρόσβασης IAX τηλέφωνο VOIP. Το τηλέφωνο προεπιλεγμένο web κωδικό πρόσβασης χρησιμοποιείται όταν τα νέα κινητά τηλέφωνα προστίθεται στο σύστημα, με τον κωδικό του τηλεφώνου ότι ο αντιπρόσωπος θα χρησιμοποιήσετε στο γραφείο διασύνδεσης ViciDial. Ο κωδικός πρόσβασης προεπιλεγμένο διακομιστή που χρησιμοποιείται όταν οι νέοι διακομιστές προστεθούν στο σύστημα για διακομιστές να επικοινωνούν μεταξύ τους| +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 Manager που διατίθεται στο| +there is a free version available|υπάρχει μια δωρεάν έκδοση διατίθεται| +Welcome to ViciDial|Καλώς ήλθατε στο ViciDial| +initial setup screen|αρχική οθόνη ρύθμισης| +copyright, trademark and license page|πνευματικά δικαιώματα, εμπορικό σήμα και άδεια σελίδα| +The ViciDial Call Center Suite is maintained by the|Το Call Center της ViciDial Σουίτα συντηρείται από το| +is a registered trademark of the|είναι σήμα κατατεθέν της| +Here is our|Εδώ είναι ο δικός μας| +trademark use policy|σήμα κατατεθέν της πολιτικής χρήσης| +The ViciDial Call Center Suite is released under the|Το Call Center της ViciDial σουίτα διατίθεται κάτω από το| +open source license|open source άδεια| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|Το Κέντρο ViciDial Σουίτα Call λογισμικό είναι διαθέσιμο για download, και για τη χρήση, χωρίς κόστος. Μπορείτε να κατεβάσετε το εύκολο στην εγκατάσταση| +ViciBox CD ISO version|ViciBox CD ISO έκδοση| +or only the|ή μόνο η| +source code|πηγαίο κώδικα| +Continue on to the Initial Setup|Συνεχίστε με την αρχική εγκατάσταση| +Customer 3-Way Hangup Logging|Πελάτης 3-Way καταγραφή Hangup| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Εάν αυτή η επιλογή είναι ενεργοποιημένη η user_call_log θα συνδεθείτε όταν ένα hangup πελάτη μέχρι και αν κολλήσει κατά τη διάρκεια μιας κλήσης 3-τρόπο. Επίσης, αυτό μπορεί να επιτρέψει για τον πελάτη 3-τρόπο δράσης hangup αν κάποιος defineed παρακάτω. Προεπιλογή ΔΥΝΑΤΟΤΗΤΑ| +Customer 3-Way Hangup Seconds|Πελάτης 3-Way Δευτερόλεπτα Hangup| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Εάν ο Πελάτης 3-τρόπο καταγραφής είναι ενεργοποιημένη, η επιλογή αυτή σας επιτρέπει να ορίσετε τον αριθμό των δευτερολέπτων μετά το hangup πελάτης έχει εντοπιστεί πριν από την πραγματική καταγράφεται και η προαιρετική πελάτη 3-τρόπο δράσης hangup εκτελείται. Προεπιλογή είναι 5 δευτερόλεπτα| +Customer 3-Way Hangup Action|Πελάτης 3-Way δράσης Hangup| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Εάν ο Πελάτης 3-τρόπο καταγραφής είναι ενεργοποιημένη, η επιλογή αυτή σας επιτρέπει να έχετε την οθόνη αυτόματα πράκτορα κλείσεις για την πρόσκληση και μεταβείτε στην οθόνη DISPO αν αυτή η επιλογή έχει οριστεί σε DISPO. Η προεπιλογή είναι ΚΑΝΕΝΑ| +Inbound Report by DID|Εισερχόμενος Έκθεση DID,| +Lists Campaign Status Stats|Λίστες Στατιστικά Κατάσταση Καμπάνιας| +Add Lead URL|Μόλυβδος Προσθήκη URL| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Αυτή η διεύθυνση URL ιστοσελίδας δεν θεωρείται από τον πράκτορα, αλλά καλείται κάθε φορά που ένας κύριος προστίθεται στο σύστημα μέσω της διαδικασίας εισερχόμενα. Η προεπιλογή είναι κενό. Θα πρέπει να αρχίσει με αυτή τη διεύθυνση URL VAR αν θέλετε να χρησιμοποιήσετε μεταβλητές, και φυσικά - Α - και - Β - γύρω από την πραγματική μεταβλητή στο URL όπου θέλετε να το χρησιμοποιήσετε. Αυτή είναι η λίστα των μεταβλητών που είναι διαθέσιμες για αυτή τη λειτουργία| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Αυτό το βοηθητικό πρόγραμμα σας επιτρέπει να ανεβάσετε τα αρχεία ήχου στον web server, έτσι ώστε να μπορεί να διανεμηθεί σε όλα τα ViciDial διακομιστές σε ένα πολυ-διακομιστή συμπλέγματος. Μια σημαντική σημείωση, μόνο δύο τύπους αρχείων ήχου θα δουλέψει,. Wav που είναι PCM Mono 16bit και 8k. GSM αρχεία που είναι 8bit 8K. Παρακαλώ βεβαιωθείτε ότι τα αρχεία σας σωστά διαμορφωθεί πριν ανεβάσετε εδώ| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Σας συνιστούμε ανέβασμα μόνο 16bit Mono 8k PCM WAV αρχεία ήχου| +Park Music-on-Hold|Πάρκο Μουσική-on-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|Αυτό είναι όπου μπορείτε να ορίσετε την on-hold πλαίσιο μουσική για αυτή την καμπάνια. Βεβαιωθείτε ότι έχετε επιλέξει μια έγκυρη μουσική σε αναμονή πλαίσιο από την λίστα επιλογής και ότι το πλαίσιο που έχετε επιλέξει έχει έγκυρη αρχεία σε αυτό. Προεπιλογή είναι προεπιλογή| +Park Call IVR|Πάρκο κλήσεων IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Η επιλογή αυτή θα επιτρέψει σε έναν πράκτορα να σταθμεύσετε μια κλήση με ένα ξεχωριστό πλήκτρο CALL IVR ΠΑΡΚΟ για την διασύνδεση του πράκτορά τους, αν αυτό είναι ενεργοποιημένο ή ENABLED_PARK_ONLY. Η επιλογή ENABLED_PARK_ONLY θα επιτρέπουν στον πράκτορα να στείλει την κλήση στο πάρκο, αλλά όχι κάντε κλικ για να ανακτήσετε την κλήση, όπως το έδωσε τη δυνατότητα επιλογής. Η επιλογή ENABLED_BUTTON_HIDDEN επιτρέπει τη λειτουργία μέσω του API μόνο. Προεπιλογή είναι απενεργοποιημένη| +Park Call IVR AGI|Πάρκο κλήσεων IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Εάν η πρόσκληση Πάρκο πεδίο IVR δεν είναι απενεργοποιημένη, τότε το πεδίο αυτό χρησιμοποιείται ως συμβολοσειρά εφαρμογή AGI ότι ο πελάτης έχει αποσταλεί. Αυτή είναι μια ρύθμιση που θα πρέπει να καθορίζεται από το διαχειριστή σας, ει δυνατόν,| +Manual Preview Dial|Εγχειρίδιο Ταχείας Προεπισκόπηση| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|Αυτό επιτρέπει στον πράκτορα στη χειροκίνητη λειτουργία κλήσης για να δείτε το προβάδισμα πληροφορίες όταν κάνουν κλικ στην επιλογή Καλέστε τον επόμενο αριθμό, πριν καλέσετε ενεργά την τηλεφωνική κλήση. Υπάρχει μια προαιρετική σύνδεση για να παρακάμψετε το προβάδισμα και να προχωρήσουμε στο επόμενο, αν επιλεγεί. Η προεπιλογή είναι PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Εκτιμώμενος χρόνος Κρατήστε Όνομα Ελάχιστες| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Εάν η Εκτιμώμενος χρόνος Hold είναι ενεργό και υπολογίζεται να είναι σε ή κάτω από το ελάχιστο 15 δευτερόλεπτα, τότε αυτό το αρχείο εντολών θα παίξει αντί της ανακοίνωσης προεπιλογή. Προεπιλογή είναι άδειο για ανενεργό| +Estimated Hold Time Minimum Prompt No Block|Εκτιμώμενος χρόνο παραμονής τουλάχιστον Ερώτηση αριθ. Μπλοκ| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Αν Εκτιμώμενος χρόνος Hold είναι ενεργή και ο προβλεπόμενος χρόνος τήρησης ελάχιστων πεδίο Όνομα αρχείου είναι πάνω από συμπληρωμένη, τότε η επιλογή αυτή να επιτρέπει την πραγματοποίηση κλήσεων στη γραμμή πίσω από μια κλήση όπου η προτροπή να πάει το παιχνίδι σε έναν πράκτορα εάν είναι διαθέσιμο, ενώ το μήνυμα που παίζει . Ενώ η άμεση παίζει σε έναν πελάτη που δεν μπορεί να σταλεί σε έναν πράκτορα. Προεπιλογή είναι N| +Estimated Hold Time Minimum Prompt Seconds|Εκτιμώμενος χρόνος Hold Ελάχιστη εντολών Δευτερόλεπτα| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Αυτό το πεδίο πρέπει να ρυθμιστεί με τον αριθμό των δευτερολέπτων που ο εκτιμώμενος χρόνος Hold Όνομα Ελάχιστες προτροπή παίζει. Η προεπιλογή είναι 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|Αυτό το πεδίο σας επιτρέπει να προσαρμόσετε το όνομα της εγγραφής κατά την ηχογράφηση της εκστρατείας είναι OnDemand ή ALLCALLS. Οι επιτρεπόμενες μεταβλητές| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|Η προεπιλογή είναι FULLDATE_AGENT και θα μοιάζουν με αυτό το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με αυτό| +Real-Time Agent Time Stats|Real-Time Χρονικά Στατιστικά γραφείο| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|Ορίζοντας αυτό σε τίποτα, όμως είναι απενεργοποιημένα θα επιτρέψει τη συλλογή των στατιστικών στοιχείων χρόνο παράγοντα για σήμερα για την εκστρατεία αυτή, που είναι ορατά μέσα από το Real-Time έκθεση. ΚΑΛΕΙ είναι ο μέσος όρος καλεί διακινούνται ανά πράκτορα, ΑΝΑΜΟΝΗ είναι ο μέσος χρόνος αναμονής πράκτορα, CUST είναι ο μέσος χρόνος ομιλίας των πελατών, ACW είναι ο μέσος χρόνος εργασίας Μετά από πρόσκληση, PAUSE είναι ο μέσος χρόνος παύσης. Προεπιλογή είναι απενεργοποιημένη| +Add A Dial Status to Call|Προσθέστε μια κατάσταση Dial για κλήσεων| +Admin Modify Auto-Refresh|Διαχειριστής Τροποποίηση Αυτόματη Ανανέωση| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|Αυτό είναι το χρονικό διάστημα ανανέωσης σε δευτερόλεπτα από τις οθόνες τροποποιήσετε σε αυτό το περιβάλλον του διαχειριστή. Ρύθμιση στο 0 θα απενεργοποιήσει την τοποθετεί κάτω από το 5 θα κάνουν ως επί το πλείστον οι οθόνες Τροποποίηση άχρηστα γιατί θα ανανεωθεί πολύ γρήγορα να αλλάξετε τα πεδία. Αυτή η επιλογή είναι χρήσιμη σε καταστάσεις όπου περισσότερα από ένα διαχειριστή ελέγχει τις ρυθμίσεις σε μια ενεργή εκστρατεία ή σε ομάδα, έτσι ώστε οι ρυθμίσεις ανανεώνονται συχνά. Προεπιλογή είναι 0| +Admin No-Cache|Διαχειριστής No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|Ρύθμιση αυτό 1 θα καθορίζονται όλα τα admin σελίδες του πλοηγού του no-cache, έτσι ώστε κάθε οθόνη πρέπει να ξαναφορτωθεί κάθε φορά που προβάλλεται, ακόμη και αν κάνετε κλικ πίσω στον browser. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +Generate Cross-Server Phone Extensions|Δημιουργία Σταυρού-Server Extensions Τηλέφωνο| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Αυτή η επιλογή αν ρυθμιστεί στο 1, θα δημιουργήσει dialplan καταχωρήσεις για κάθε τηλέφωνο σε ένα πολυ-server του συστήματος. Η προεπιλογή είναι 0 για ανενεργή| +QueueMetrics Addmember Enabled|QueueMetrics Addmember Ενεργοποιήθηκε| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Αυτή η επιλογή αν ρυθμιστεί στο 1, θα δημιουργήσει ADDMEMBER2 και REMOVEMEMBER καταχωρήσεις σε queue_log. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +Minimum Hopper Level|Ελάχιστο Επίπεδο Χόπερ| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Αυτός είναι ο ελάχιστος αριθμός των οδηγεί το σενάριο VDhopper προσπαθεί να κρατήσει στον πίνακα vicidial_hopper για αυτή την καμπάνια. Εάν η εκτέλεση του σεναρίου VDhopper κάθε λεπτό, κάνουν αυτό το ελαφρώς μεγαλύτερο από τον αριθμό των οδηγεί περνάτε σε ένα λεπτό| +Automatic Hopper Level|Αυτόματη Επίπεδο Χόπερ| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Ρύθμιση αυτό θα επιτρέψει Υ Vicidial να προσαρμόζει αυτόματα τη χοάνη που βασίζονται στα ανοικτά τις ρυθμίσεις που έχετε στην καμπάνια σας. Ο τύπος χρησιμοποιεί για να γίνει αυτό είναι| +Automatic Hopper Multiplier|Αυτόματη Πολλαπλασιαστής Χόπερ| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|Αυτό είναι πολλαπλασιαστής για τον Χόπερ Auto. Η ρύθμιση αυτής της λιγότερο από το 1 θα προκαλέσει ο αλγόριθμος Χόπερ Αυτόματη να φορτώσει οδηγεί λιγότερο από ό, τι συνήθως. Ρύθμιση αυτό υπερβαίνει το 1 θα προκαλέσει ο αλγόριθμος Χόπερ Αυτόματη να φορτώσει περισσότερο από ό, τι οδηγεί κανονικά. Προεπιλογή είναι 1| +Auto Trim Hopper|Αυτόματη Περικοπή Χόπερ| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Ρύθμιση αυτό θα επιτρέψει Υ Vicidial να αφαιρέσετε αυτόματα επιπλέον οδηγεί από τη χοάνη. Προεπιλογή είναι Y| +Manual Dial API|Εγχειρίδιο κλήσης API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Αυτή η επιλογή σας επιτρέπει να ορίσετε το API πράκτορα για να κάνετε είτε μια κλήση σε έναν χρόνο, STANDARD, ή την ικανότητα να περιμένω στην ουρά εγχειρίδιο κλήσεις μέσω τηλεφώνου και να τους καλέσετε αυτόματα μόλις ο πράκτορας συνεχίζει παύση ή είναι διαθέσιμα να πάρετε την επόμενη κλήση τους με το επιλογή για να απενεργοποιήσετε την αυτόματη κλήση αυτών των κλήσεων, ουρά, ή QUEUE_AND_AUTOCALL η οποία είναι η ίδια με ουρά, αλλά χωρίς την επιλογή για να απενεργοποιήσετε την αυτόματη κλήση αυτών των κλήσεων. Αν ένας αντιπρόσωπος έχει περισσότερες από μία κλήση σε ουρά για τους θα δουν τον λογαριασμό πόσες εγχειρίδιο κλήσεις μέσω τηλεφώνου είναι στην ουρά ακριβώς κάτω από το κουμπί παύσης, ή μέσω τηλεφώνου στο κουμπί Επόμενο Αριθμός. Προτείνουμε ότι αν χρησιμοποιείται ουρά που στέλνετε API ενέργειες χρησιμοποιώντας την προεπισκόπηση = ΝΑΙ επιλογή ώστε να μην καλείτε επανειλημμένα κλήσεις για τον πράκτορα χωρίς προειδοποίηση. Επίσης, αν χρησιμοποιείτε ουρά και σε μεγάλο βαθμό χρησιμοποιώντας χειροκίνητη κλήσεις μέσω τηλεφώνου σε ένα μη μέθοδο κλήσης ΕΓΧΕΙΡΙΔΙΟ, θα συνιστάται η ρύθμιση του Παύση γραφείο Μετά από κάθε επιλογή Κλήση στον Βήτα Προεπιλογή ΠΡΟΤΥΠΟ| +Manual Call Time Check|Εγχειρίδιο Χρόνος κλήσεων Έλεγχος| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Εάν αυτή η επιλογή είναι ενεργοποιημένη, θα ελέγξει όλες τις κλήσεις μέσω τηλεφώνου εγχειρίδιο για να βεβαιωθείτε ότι είναι εντός των χρονικών ρυθμίσεων κλήσης για την εκστρατεία. Προεπιλογή είναι απενεργοποιημένη| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Αν θέλετε να αλλάξετε αυτό οδήγησε σε μια προγραμματισμένη επανάκλησης, πρώτα να αλλάξετε την διάθεση να CBHOLD, τότε υποβάλλουν και θα είστε σε θέση να καθορίσει την ημερομηνία και την ώρα επανάκλησης| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Web Παράκαμψη Έντυπο - Αυτό είναι το έθιμο διεύθυνση ότι κάνοντας κλικ στο κουμπί ΦΟΡΜΑ σε VICIDIAL θα σας μεταφέρει σε κλήσεις που έρχονται σε αυτόν τον κατάλογο| +Agent Screen Login|Πράκτορας Είσοδος οθόνης| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|Η σύνδεση που χρησιμοποιείται για τον χρήστη του τηλεφώνου για να συνδεθείτε με τις εφαρμογές πελάτη, όπως η οθόνη ViciDial πράκτορα| +Phone Extension|Παράταση Τηλέφωνο| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Αυτό το πεδίο είναι όπου μπορείτε να βάλετε το όνομα τηλεφώνων, όπως φαίνεται και με το Asterisk δεν συμπεριλαμβανομένου του πρωτοκόλλου ή κάθετος στην αρχή. Για παράδειγμα: για το τηλέφωνο SIP SIP/test101 η επέκταση τηλέφωνο θα test101. Επίσης, για IAX2 τηλέφωνα: IAX2/IAXphone1 @ IAXphone1 θα IAXphone1. Για Zap και Dahdi συνημμένο channelbank ή FXS τηλέφωνα βεβαιωθείτε ότι έχετε θέσει τον πλήρη αριθμό καναλιού χωρίς το πρόθεμα: Zap/25-1 θα είναι 25-1. Ένα άλλο σημείωμα, βεβαιωθείτε ότι έχετε ορίσει το πεδίο πρωτόκολλο παρακάτω σωστά για τον τύπο του τηλεφώνου σας| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|ΚΑΤΑΣΤΑΣΕΙΣ στο ενεργό ΛΙΣΤΕΣ για τη συγκεκριμένη καμπάνια| +SHOW LEAD STATUSES IN THIS CAMPAIGN|ΔΕΙΞΤΕ ΚΑΤΑΣΤΑΣΕΙΣ ΜΟΛΥΒΔΟΥ σε αυτήν την εκστρατεία| +RELOAD NOW|Ξαναφορτώσετε τώρα| +refresh|ανανέωσης| +You can also set a label to ---HIDE--- to hide both the label and the field|Μπορείτε επίσης να ορίσετε μια ετικέτα για να ΑΠΟΚΡΥΨΗ --- --- να κρύψουν τόσο την ετικέτα και το πεδίο| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Για τα εισερχόμενα μόνο, μπορείτε επίσης να ρυθμίσετε τη διάρκεια των κλήσεων στάση υψηλότερες από 2400 αν θέλετε η ώρα κλήση για να πάει πέρα ​​από τα μεσάνυχτα. Έτσι, εάν θέλετε ο χρόνος κλήση σας θα διαρκέσει από τις 6 το πρωί έως τις 2 π.μ. της επόμενης ημέρας, που θα τεθεί 0600 ως την ώρα έναρξης και 2600 ως το χρονικό διάστημα διακοπής| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF προεπιλογή να μην δείχνουν την dialpad στο πρώτο φορτίο, αλλά θα επιτρέψει στο χρήστη να δείξει την dialpad κάνοντας κλικ στο σύνδεσμο dialpad| +Add Multi-Server Phones Form|Προσθήκη πολλαπλών διακομιστή Φόρμα Τηλέφωνα| +Phones Bulk Insert|Μαζική Εισαγωγή Τηλέφωνα| +List Order Randomize|Παραγγελία Λίστα Τυχαία| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Αυτή η επιλογή σας επιτρέπει να τυχαιοποιήσουμε τη σειρά των οδηγεί στη χοάνη του φορτίου εντός των αποτελεσμάτων καθορίζονται από τα ανωτέρω κριτήρια. Για παράδειγμα, η σειρά των ονομάτων θα πρέπει να διατηρηθεί, αλλά τα αποτελέσματα θα είναι τυχαία εντός της εν λόγω ταξινόμησης. Η ρύθμιση αυτής της επιλογής στο Y θα επιτρέψει αυτή τη δυνατότητα. Προεπιλογή N για άτομα με ειδικές ανάγκες. ΣΗΜΕΙΩΣΗ, εάν έχετε έναν μεγάλο αριθμό οδηγεί αυτή η επιλογή μπορεί να επιβραδύνει την ταχύτητα του σεναρίου χοάνη φόρτωσης| +NONE will not log any logins and logouts within queue_log|ΚΑΝΕΝΑ δεν θα καταγράψει τυχόν συνδέσεις και logouts μέσα queue_log| +QueueMetrics Dispo Pause Code|QueueMetrics Κωδικός Παύση DISPO| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Αυτή η επιλογή, αν συμπληρωθεί, σας επιτρέπει να ορίσετε αν η παύση dispo κωδικός έχει εισαχθεί queue_log όταν ένας πράκτορας βρίσκεται σε dispo κατάσταση. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες| +List Order Secondary|Παραγγελία Λίστα Δευτεροβάθμια| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Αυτή η επιλογή σας επιτρέπει να επιλέξετε τη δεύτερη σειρά ταξινόμησης των οδηγεί στο φορτίο χοάνη μετά τη σειρά των ονομάτων και εντός των αποτελεσμάτων καθορίζονται από τα ανωτέρω κριτήρια. Για παράδειγμα, η σειρά των ονομάτων θα χρησιμοποιηθεί για την πρώτη του είδους των αγωγών, αλλά τα αποτελέσματα θα ταξινομούνται για δεύτερη φορά εντός του εν λόγω ταξινόμηση σε ολόκληρη την ίδια σειρά της πρώτης Τάξης λίστα. Για παράδειγμα, εάν έχετε Παραγγελία Λίστα που να ΚΑΤΩ COUNT και έχετε μόνο τους μολύβδους που έχουν επιχειρήσει 1 και 2 φορές, στη συνέχεια, αν έχετε τη σειρά των ονομάτων Δευτεροβάθμια σύνολο LEAD_ASCEND σε όλες τις οδηγεί απόπειρα 1 θα ταξινομηθούν από τα παλαιότερα καλώδια πρώτο και θα τεθεί στη χοάνη με αυτόν τον τρόπο. Προεπιλογή LEAD_ASCEND. ΣΗΜΕΙΩΣΗ, εάν έχετε έναν μεγάλο αριθμό οδηγεί χρησιμοποιώντας μία από τις επιλογές μπορεί να CALLTIME επιβραδύνει την ταχύτητα του σεναρίου χοάνη φόρτωσης| +My Callbacks Checkbox Default|Προεπιλογή επιστροφές κλήσεις μου Checkbox| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Αυτή η επιλογή σας επιτρέπει να ρυθμίσετε εκ των προτέρων το κουτάκι μου επανάκλησης την προγραμματισμένη παράγοντα οθόνη επανάκλησης. ΕΛΕΓΧΟΜΕΝΗ θα ελέγξει αυτόματα το πλαίσιο ελέγχου για κάθε κλήση. Προεπιλογή είναι ανεξέλεγκτη| +Call Notes Per Call|Καλέστε Σημειώσεις ανά κλήση| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|Με την επιλογή αυτή έδωσε τη δυνατότητα να θα επιτρέψει στα πρακτορεία να εισέλθουν στις σημειώσεις για κάθε κλήση που χειρίζονται στο περιβάλλον μέσο. Το πεδίο καταχώρησης σημειώσεων θα εμφανίζεται κάτω από το πεδίο Σχόλια στο περιβάλλον μέσο. Επίσης, αν η ομάδα του πράκτορα χρήστη τη δυνατότητα να προβάλλω τα αρχεία καταγραφής κλήσεων τότε ο πράκτορας θα είναι σε θέση να δείτε τις σημειώσεις παρελθόν έκκληση για μια μολύβδου ανά πάσα στιγμή. Προεπιλογή είναι απενεργοποιημένη| +If List Order Randomize is enabled, this option will be ignored|Αν Παραγγελία Λίστα Τυχαία είναι ενεργοποιημένη, η επιλογή αυτή θα πρέπει να αγνοηθεί| +ERROR: Lead not added, please go back and look at what you entered|ΣΦΑΛΜΑ: Μόλυβδος δεν έχουν προστεθεί, παρακαλώ πηγαίνετε πίσω και να δούμε τι έχετε εισαγάγει| +Lead has been added|Ο μόλυβδος έχει προστεθεί| +Add A New Lead|Προσθέστε μια νέα πρωτοβουλία πρωτοποριακής| +Agent Lead Search Override|Πράκτορας Παράκαμψη Αναζήτηση μόλυβδο| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Αυτή η ρύθμιση θα αντικαταστήσει ό, τι η καμπάνια έχει οριστεί για αναζήτηση μολύβδου γραφείο. NOT_ACTIVE θα χρησιμοποιήσει τη ρύθμιση της καμπάνιας. Έδωσε τη δυνατότητα θα επιτρέπει την αναζήτηση και μολύβδου ΑΝΑΠΗΡΙΑ δεν θα επιτρέψει σε μόλυβδο αναζήτηση. Η προεπιλογή είναι NOT_ACTIVE| +Agent Lead Search|Πράκτορας Αναζήτηση μόλυβδο| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|Η ρύθμιση αυτής της επιλογής να ΕΝΕΡΓΟΠΟΙΗΜΈΝΗ θα επιτρέψει στα πρακτορεία για να αναζητήσετε και να δείτε οδηγεί μολύβδου πληροφορίες, ενώ σταμάτησε στο περιβάλλον παράγοντα. Επίσης, αν η ομάδα του πράκτορα χρήστη τη δυνατότητα να προβάλλω τα αρχεία καταγραφής κλήσεων τότε ο πράκτορας θα είναι σε θέση να δείτε το παρελθόν σημειώσεις κλήσεων για να καταλήξει ότι οι πληροφορίες σχετικά με την προβολή. Προεπιλογή είναι απενεργοποιημένη| +Agent Lead Search Method|Πράκτορας Μέθοδος Αναζήτηση μόλυβδο| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Εάν ο Αντιπρόσωπος Αναζήτηση μόλυβδος είναι ενεργοποιημένη, η ρύθμιση αυτή ορίζει όταν ο αντιπρόσωπος θα πρέπει να επιτρέπεται να οδηγεί την αναζήτηση. Σύστημα θα αναζητήσει το σύνολο του συστήματος, CAMPAIGNLISTS θα ψάξει μέσα σε όλα τα ενεργά καταλόγους στο πλαίσιο της εκστρατείας, CAMPLISTS_ALL θα ψάξουμε μέσα όλες τις ενεργές και ανενεργές λίστες στο πλαίσιο της εκστρατείας, ΚΑΤΑΛΟΓΟΣ θα ψάξει μόνο στο Εγχειρίδιο ID της λίστας κλήσης, όπως ορίζεται στην εκστρατεία . Η προεπιλογή είναι CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|ΜΟΛΥΒΔΟΣ ΕΡΕΥΝΕΣ για αυτή την περίοδο| +Routing Extension|Παράταση δρομολόγησης| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|Το πεδίο αυτό επιτρέπει μια προσαρμοσμένη εξερχόμενες επέκταση δρομολόγησης. Αυτό σας επιτρέπει να χρησιμοποιούν διαφορετικές μεθόδους για τον χειρισμό των κλήσεων ανάλογα με το πώς θέλετε να δρομολόγησης κλήσεων μέσω εξερχόμενων την καμπάνια σας. Παλαιότερα ονομαζόταν επέκταση VDAD Εκστρατεία| +same as|ίδιο| +Will send the call only to an agent on the same server as the call is placed on|Θα στείλετε την κλήση μόνο σε έναν πράκτορα στον ίδιο διακομιστή, όπως η κλήση τίθεται σε| +Used for press-1, broadcast and survey campaigns|Χρησιμοποιείται για Τύπου-1, εκπομπής και έρευνα εκστρατείες| +Will try to first send the call to an agent on the local server, then it will look on other servers|Θα προσπαθήσει να στείλει για πρώτη φορά την κλήση σε έναν πράκτορα στον τοπικό υπολογιστή, τότε θα δούμε σε άλλους servers| +DEFAULT - Will send the call to the next available agent no matter what server they are on|DEFAULT - θα στείλει την κλήση στον επόμενο διαθέσιμο πράκτορα δεν έχει σημασία τι server στον οποίο είναι| +Used for Answering Machine Detection after that, same behavior as|Χρησιμοποιείται για την ανίχνευση Απάντηση Machine μετά από αυτό, ίδια συμπεριφορά όπως| +Used for Answering Machine Detection after that same behavior as|Χρησιμοποιείται για την ανίχνευση Απάντηση μηχανή μετά από αυτή την ίδια συμπεριφορά όπως| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Χρησιμοποιείται για Τύπου-1, εκπομπής και έρευνα εκστρατείες με σαφματικός κειμένου σε ομιλία| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Χρησιμοποιείται για την ανίχνευση Machine Απάντηση στη συνέχεια πατήστε-1, εκπομπής και έρευνα εκστρατείες με σαφματικός κειμένου σε ομιλία| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Μία από αυτές τις επιλογές με USER_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη ταιριάζει με το αναγνωριστικό χρήστη του φορέα, οι επιλογές με GROUP_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη που ταιριάζουν στην ομάδα χρηστών ότι ο χρήστης είναι ένα μέλος της, με τις επιλογές TERRITORY_ μπροστά αναζήτηση θα γίνει μόνο μέσα σε δρόμους που έχουν το πεδίο ιδιοκτήτη ταιριάζουν με τα εδάφη που ο πράκτορας έχει επιλέξει| +QM Phone Environment|ΜΠ Περιβάλλοντος Τηλέφωνο| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Αν QueueMetrics ενσωμάτωση αυτή είναι ενεργοποιημένη στις ρυθμίσεις του συστήματος τότε η ρύθμιση αυτή επιτρέπει την προσθήκη αυτής της αξίας στοιχείων στον τομέα δεδομένων αυτών4 της queue_log για τα αρχεία δραστηριότητα πράκτορα. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες| +Active Twin Server IP|Ενεργός Twin IP του διακομιστή| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Μερικά συστήματα απαιτούν vicidial σύσταση vicidial διακομιστές σε ζεύγη. Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε την IP του διακομιστή του άλλου διακομιστή vicidial ότι αυτός ο server έχει αδελφοποιηθεί με. Προεπιλογή είναι άδειο για άτομα με ειδικές ανάγκες| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|ΣΗΜΕΙΩΣΕΙΣ: Για ring_all, οι παράγοντες που χρησιμοποιούν τα κινητά τηλέφωνα που έχουν την δυνατότητα γραφείο Hook θα έχει τα τηλέφωνα τους δαχτυλίδι και το πρώτο για να απαντήσετε θα λάβει την κλήση και τις πληροφορίες που εμφανίζονται στην οθόνη παράγοντα. Από ring_all αγνοεί παράγοντας χρόνος αναμονής και η σειρά κατάταξης και θα καλέσει κάθε παράγοντα που είναι διαθέσιμες για την ουρά, δεν συνιστούμε τη χρήση αυτής της μεθόδου για τις μεγάλες ουρές. Όταν χρησιμοποιείτε ring_all, παράγοντες συνδεδεμένοι με τηλέφωνα που έχουν το γραφείο Στις απενεργοποιηθεί Άγκιστρο θα πρέπει να χρησιμοποιούν τις καλεί Στην ουρά του πίνακα και κάντε κλικ στο σύνδεσμο ΠΑΡΑΛΑΒΗ ΠΡΟΣΚΛΗΣΗΣ να αναλάβουν τις κλήσεις στην ουρά. Το ποσό του χρόνου, το τηλέφωνο θα χτυπήσει παράγοντες για ring_all έχει οριστεί στη ρύθμιση Ring On-Hook ώρα ή στο συντομότερο χρονικό διάστημα δακτύλιο από τα τηλέφωνα που θα ονομάζεται. Δεν συνιστάται η χρήση ring_all την υψηλή ένταση του ήχου κλήσης ουρές, ουρές ή με πολλούς παράγοντες. Η μέθοδος ring_all προορίζεται να χρησιμοποιείται μόνο με λίγα μέσα και από το χαμηλό όγκο κλήσεων σε ομάδες| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Η επιλογή αυτή χρησιμοποιείται μόνο για τους πράκτορες που είναι συνδεδεμένοι με τηλέφωνα που έχουν το πρακτορείο-on-γάντζο ενεργοποιημένη τη λειτουργία. Αυτός είναι ο αριθμός των δευτερολέπτων που κάθε απόπειρα κλήσης του πράκτορα θα χτυπήσει για μέχρι το σύστημα θα περιμένει ένα δευτερόλεπτο και ήχο αρχίσουν τα διαθέσιμα τηλέφωνα πράκτορα και πάλι. Το πεδίο αυτό μπορεί να παρακαμφθεί εάν τα τηλέφωνα παράγοντας που σε χαμηλότερο χρόνο δαχτυλίδι που μπορεί να είναι απαραίτητες για την αποτροπή κλήσεων από το να στείλει ένα φωνητικό ταχυδρομείο τηλέφωνα. Η προεπιλογή είναι 15| +On-Hook Agent|On-Hook γραφείο| +On-Hook Ring Time|On-Hook Ώρα δαχτυλίδι| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Η επιλογή αυτή χρησιμοποιείται μόνο για εισερχόμενες κλήσεις πηγαίνουν σε αυτήν την απομακρυσμένη παράγοντα. Αυτό το χαρακτηριστικό θα καλέσει την απομακρυσμένη πράκτορα και δεν θα στείλει τον πελάτη στον απομακρυσμένο πράκτορα έως ότου η γραμμή απαντηθεί. Προεπιλογή N για άτομα με ειδικές ανάγκες| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Η επιλογή αυτή χρησιμοποιείται μόνο όταν η On-Hook πεδίο Agent παραπάνω αναμένεται να Y και στη συνέχεια μόνο για εισερχόμενες κλήσεις που προέρχονται σε αυτό το απομακρυσμένο πράκτορα. Αυτός είναι ο αριθμός των δευτερολέπτων που κάθε απόπειρα κλήσης θα χτυπήσει για να προσπαθήσει να πάρει μια απάντηση. Συνιστάται να ορίσετε αυτό σε μερικά δευτερόλεπτα λιγότερο από ό, τι χρειάζεται για μια κλήση που θα αποσταλεί στον τηλεφωνητή. Η προεπιλογή είναι 15| +On-Hook Agent Login|On-Hook Είσοδος Πράκτορας| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Η επιλογή αυτή χρησιμοποιείται μόνο για εισερχόμενες κλήσεις θα πράκτορα συνδεδεμένοι με αυτό το τηλέφωνο. Αυτό το χαρακτηριστικό θα καλέσει τον αντιπρόσωπο, και δεν θα στείλει τον πελάτη για τη σύνοδο παράγοντες μέχρι η γραμμή απαντηθεί. Προεπιλογή N για άτομα με ειδικές ανάγκες| +This is a Phone On-Hook Agent|Αυτό είναι ένα τηλέφωνο-Hook γραφείο| +Maximum Ring Time|Μέγιστος χρόνος δαχτυλίδι| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|Οι επιλογές Αναβολή θα σταματήσει να αναβοσβήνει και ή εμφάνιση στο κόκκινο, όταν ελέγχετε τις callbacks, έως ότου ο αριθμός των αλλαγών callbacks| +Auto Pause Pre-Call Work|Αυτόματη Παύση Προ-Call| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Στην αυτόματη λειτουργία κλήσης, η ρύθμιση αυτή θα ενεργοποιηθεί εάν το πρακτορείο που να σταματά αυτόματα όταν οι κλικ παράγοντα για οποιαδήποτε από τις ακόλουθες λειτουργίες που απαιτεί από αυτούς να είναι σε παύση, αυτόματη κλήση, το Fast Dial, επικεφαλής Αναζήτηση, Προβολή αρχείου καταγραφής κλήσεων, επιστροφές κλήσεις Έλεγχος, Εισάγετε τον κωδικό Παύση. Προεπιλογή N για ανενεργό| +Auto Resume Pre-Call Work|Αυτόματη Συνέχιση Προ-Call| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Στην αυτόματη λειτουργία κλήσης, η ρύθμιση αυτή θα ενεργοποιηθεί εάν ρυθμίσετε τον παράγοντα για ενεργό αυτόματα όταν πατήσει ο πράκτορας από, ή ακυρώνει, σε οποιαδήποτε από τις ακόλουθες λειτουργίες που απαιτεί από αυτούς να είναι σε παύση, αυτόματη κλήση, το Fast Dial, επικεφαλής Αναζήτηση, Κλήση Σύνδεση Προβολή, επιστροφές κλήσεις Ελέγξτε, εισάγετε τον κωδικό Παύση. Προεπιλογή N για ανενεργό| +Auto Pause Pre-Call Code|Αυτόματη Παύση Προ-Call Κώδικα| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Εάν η Αυτόματη Παύση Προ-κλήση της συνάρτησης εργασίας παραπάνω είναι ενεργό, και Κώδικες Παύση Agent είναι ενεργή, η ρύθμιση αυτή θα είναι η παύση κωδικό που χρησιμοποιείται όταν ο πράκτορας βρίσκεται σε παύση των δραστηριοτήτων αυτών. Η προεπιλογή είναι PRECAL| +This campaign is not set to Auto-Alt-Dial|Αυτή η καμπάνια δεν έχει οριστεί σε Αυτόματη-Alt-Dial| +Multi-Alt-Settings|Multi-Alt-Ρυθμίσεις| +Reload Dialplan On Servers|Ανανέωση Dialplan Στις Διακομιστές| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Αυτή η επιλογή σας επιτρέπει να αναγκάσει ένα επαναφορτώσετε του dialplan σε όλες τις Asterisk διακομιστές του συμπλέγματος. Αν έχετε κάνει αλλαγές στην Προσαρμοσμένη Dialplan Έναρξη παραπάνω θα πρέπει να ορίσετε στο 1 και να υποβάλει αυτές τις αλλαγές έχουν τεθεί σε ισχύ στις διακομιστές| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Χρησιμοποιώντας MULTI_LEAD σας επιτρέπει να χρησιμοποιήσετε ένα ξεχωριστό αγωγό για κάθε αριθμό σε λογαριασμό πελάτη ότι όλοι μοιράζονται μια κοινή vendor_lead_code, και ο τύπος του αριθμού τηλεφώνου για κάθε ορίζεται με μια ετικέτα στον τομέα ιδιοκτήτη. Αυτή η επιλογή θα απενεργοποιήσετε μερικές επιλογές στην οθόνη Εκστρατεία Τροποποίηση και δείχνουν μια σύνδεση με το Multi-Alt σελίδα Ρυθμίσεις που σας επιτρέπει να ορίσετε τους τύπους αριθμό τηλεφώνου, που ορίζεται από την ετικέτα του κάθε μόλυβδο, θα κληθεί και με ποια σειρά. Αυτό θα δημιουργήσει ένα ειδικό φίλτρο για το μόλυβδο και θα αλλάξει το πεδίο Κατάταξη όλων των οδηγεί στο εσωτερικό των καταλόγων που σε αυτήν την εκστρατεία, προκειμένου να τους καλέσει στη σειρά που έχετε καθορίσει| +Manual Dial CID|Εγχειρίδιο Ταχείας CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Αυτό καθορίζει αν ένας πράκτορας την ιδιόχειρη κλήσεις μέσω τηλεφώνου θα έχουν οι ρυθμίσεις της καμπάνιας CallerID που χρησιμοποιούνται, ή ο πράκτοράς τους τηλέφωνο ρυθμίσεις CallerID χρησιμοποιούνται. Η προεπιλογή είναι ΕΚΣΤΡΑΤΕΙΑ| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Εάν η χρήση Προσαρμοσμένη CID επιλογή καμπάνια έχει ενεργοποιηθεί ή η εκστρατεία λίστα CID ρύθμιση παράκαμψης χρησιμοποιείται, αυτή η ρύθμιση θα πρέπει να αγνοηθεί| +Phone Post Time Difference Alert|Τηλέφωνο Ώρα δημοσίευσης προειδοποίησης Διαφορά| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Αυτό το εγχειρίδιο κλήσης μόνο χαρακτηριστικό, εάν ενεργοποιηθεί, θα εμφανιστεί μια ειδοποίηση αν η ζώνη ώρας για το μόλυβδο ταχυδρομικό κώδικα, ή ο ταχυδρομικός κώδικας, είναι διαφορετική από την ζώνη ώρας του κώδικα περιοχής του αριθμού τηλεφώνου για το μόλυβδο. Η επιλογή OUTSIDE_CALLTIME_ONLY θα δείξει μόνο το σήμα, εάν οι δύο ζώνες ώρας είναι διαφορετικές και μία από τις ζώνες ώρας είναι εκτός του χρόνου εφημερίας που έχουν επιλεγεί για την καμπάνια. OUTSIDE_CALLTIME_PHONE θα ελέγχει μόνο τη ζώνη ώρας του αριθμού τηλεφώνου του μολύβδου και ειδοποιεί αν είναι έξω από την τοπική ώρα κλήσης. OUTSIDE_CALLTIME_POSTAL θα ελέγχει μόνο τη ζώνη ώρας του ταχυδρομικού κώδικα του μολύβδου και ειδοποιεί αν είναι έξω από την τοπική ώρα κλήσης. OUTSIDE_CALLTIME_BOTH θα ελέγξει τον ταχυδρομικό κώδικα και τον αριθμό τηλεφώνου για να είναι μέσα στην τοπική ώρα κλήσης, ακόμη και αν βρίσκονται στην ίδια ζώνη ώρας. Οι ειδοποιήσεις αυτές θα εμφανιστούν στο αρχείο κλήσεων πληροφορίες, callbacks λίστες, αναζητήστε πληροφορίες για τα αποτελέσματα, όταν ένας κύριος καλείται και όταν είναι επικεφαλής προεπισκόπηση. Προεπιλογή είναι απενεργοποιημένη| +Custom 3-Way Button Transfer|Προσαρμοσμένη 3-Way Μεταφορά Κουμπί| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Αυτή η επιλογή θα προσθέσετε ένα κουμπί Μεταφορά στην οθόνη του πράκτορα κάτω από το κουμπί Μεταβίβαση-Conf που θα επιτρέψει ένα κλικ τριών δρόμων κλήσεις χρησιμοποιώντας το επιλεγμένο Preset ή τομέα. Οι επιλογές PRESET_ θα πραγματοποιείτε κλήσεις χρησιμοποιώντας την προκαθορισμένη τιμή. Οι επιλογές FIELD_ θα πραγματοποιείτε κλήσεις χρησιμοποιώντας τον αριθμό του επιλεγμένου πεδίου από το μόλυβδο. ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΕΣ ΑΝΑΓΚΕΣ δεν θα εμφανιστεί το κουμπί στην οθόνη παράγοντα. Οι επιλογές που θα παρκάρετε PARK_ τον πελάτη πριν από την κλήση. Προεπιλογή είναι απενεργοποιημένη| +Auto Dial Level Threshold|Αυτόματη Κατώφλι Επίπεδο Dial| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Αυτή η ρύθμιση λειτουργεί μόνο με μία προσαρμογή ή ΑΝΑΛΟΓΙΑ Μέθοδος κλήσης, και πρέπει να ρυθμιστεί σε κάτι άλλο εκτός από ειδικές ανάγκες και ο αριθμός των πρακτόρων ρύθμιση πρέπει να είναι πάνω από 0. Αυτό το χαρακτηριστικό σας επιτρέπει να ορίσετε ένα ελάχιστο αριθμό παραγόντων ότι ο αλγόριθμος πρόβλεψης θα δουλέψει σε. Εάν ο αριθμός των αντιπροσώπων δεν εμπίπτει κάτω από τον αριθμό που έχετε ορίσει, τότε το επίπεδο καντράν θα πάει στο 1,0 μέχρι περισσότερους πράκτορες ή συνδεθείτε μεταβεί στην επιλεγμένη κατάσταση. Καταγράφηκε-IN_AGENTS θα μετράνε όλα τα παράγοντες συνδεδεμένοι με την εκστρατεία, ΜΗ PAUSED_AGENTS θα υπολογίζονται μόνον οι παράγοντες που είναι σε αναμονή ή να μιλάει, και WAITING_AGENTS θα μετρήσει μόνο παράγοντες που περιμένουν για μια κλήση. Προεπιλογή είναι απενεργοποιημένη| +Available Only Tally Threshold|Διαθέσιμο μόνο Κατώφλι Tally| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Αυτή η ρύθμιση λειτουργεί μόνο με μία προσαρμογή ή ΑΝΑΛΟΓΙΑ Μέθοδος κλήσης, Διαθέσιμο μόνο Tally πρέπει να οριστεί σε Ν, η ρύθμιση αυτή πρέπει να ρυθμιστεί σε κάτι άλλο εκτός από ειδικές ανάγκες και ο αριθμός των πρακτόρων ρύθμιση πρέπει να είναι πάνω από 0. Αυτό το χαρακτηριστικό σας επιτρέπει να ορίσετε τον αριθμό των πρακτόρων κάτω από το οποίο Διαθέσιμο μόνο Tally θα ενεργοποιηθεί. Εάν ο αριθμός των αντιπροσώπων δεν εμπίπτει κάτω από τον αριθμό που έχετε ορίσει, τότε η ρύθμιση Διαθέσιμο μόνο Tally με πάει σε Y προσωρινά μέχρι περισσότερους πράκτορες ή συνδεθείτε μεταβεί στην επιλεγμένη κατάσταση. Καταγράφηκε-IN_AGENTS θα μετράνε όλα τα παράγοντες συνδεδεμένοι με την εκστρατεία, ΜΗ PAUSED_AGENTS θα υπολογίζονται μόνον οι παράγοντες που είναι σε αναμονή ή να μιλάει, και WAITING_AGENTS θα μετρήσει μόνο παράγοντες που περιμένουν για μια κλήση. Προεπιλογή είναι απενεργοποιημένη| +Time Zone Setting|Ζώνη ώρας| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Αυτή η επιλογή σας επιτρέπει να ορίσετε τη μέθοδο της διατήρησης του σημερινού αναζήτησης ζώνη ώρας για τα καλώδια μέσα σε αυτή τη λίστα. Αυτή η διαδικασία γίνεται μόνο τη νύχτα, ώστε οι όποιες αλλαγές κάνετε, δεν θα είναι άμεση. COUNTRY_AND_AREA_CODE είναι η προεπιλογή, και θα χρησιμοποιήσει τον κωδικό της χώρας και τον κωδικό περιοχής του αριθμού τηλεφώνου για να καθορίσει τη ζώνη ώρας του μολύβδου. Postal_code θα χρησιμοποιήσει τον ταχυδρομικό κώδικα εάν είναι διαθέσιμη για να καθορίσει τη ζώνη ώρας του μολύβδου. NANPA_PREFIX λειτουργεί μόνο στις ΗΠΑ και θα χρησιμοποιήσει τον κωδικό της περιοχής και πρόθεμα του αριθμού τηλεφώνου για να καθορίσει τη ζώνη ώρας του μολύβδου, αλλά αυτό δεν είναι ενεργοποιημένη από προεπιλογή στο σύστημα, γι 'αυτό παρακαλώ να είστε βέβαιος ότι έχετε τα δεδομένα πρόθεμα NANPA φορτώνονται συστήματός σας πριν από την επιλογή αυτή την επιλογή. OWNER_TIME_ZONE_CODE θα χρησιμοποιήσετε το πρότυπο abbraviation ζώνη ώρας φορτωθεί στο πεδίο ιδιοκτήτη του μολύβδου να καθορίσει τη ζώνη ώρας, στα παραδείγματα ΗΠΑ είναι η AST, EST, CST, MST, PST, AKST, TGV. Αυτή η λειτουργία πρέπει να ενεργοποιηθεί από το διαχειριστή του συστήματος σας για να τεθεί σε ισχύ| +Dial Level Difference Target|Πληκτρολογήστε Διαφορά επιπέδου-στόχου| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Το πεδίο αυτό χρησιμοποιείται για να καθορίσει αν θέλετε να στοχεύσετε με ένα συγκεκριμένο αριθμό παραγόντων περιμένει κλήσεις ή κλήσεις σε αναμονή για τους πράκτορες. Για παράδειγμα, αν θα αρέσει πάντα να έχουν κατά μέσο όρο ένα παράγοντα να λάβει δωρεάν καλεί αμέσως θα ορίσετε σε -1, αν θα θέλατε να στοχεύσετε έχοντας πάντα μία κλήση σε αναμονή περιμένοντας για έναν παράγοντα που θα οριστεί στο 1. Η προεπιλογή είναι 0. Το πεδίο αυτό δεν χρησιμοποιείται από το εγχειρίδιο ή INBOUND_MAN μεθόδους κλήσης| +Admin Utilities|Διαχειριστής Utilities| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|κρυφή σελίδα κοινής ωφελείας - Αν δεν ξέρετε τι κάνουν αυτά τα προγράμματα, τότε μάλλον δεν πρέπει να τους χρησιμοποιήσετε| +Welcome Languages Page|Καλώς Σελίδα Γλώσσες| +Campaign Debug Page|Εκστρατεία Σελίδα Debug| +Bulk Phone Insert Page|Μαζική Εισαγωγή Σελίδα Τηλέφωνο| +Send a Call With Custom CID Page|Αποστολή κλήσεων Με CID προσαρμοσμένης σελίδας| +Speech Voice Lab Page|Ομιλία Σελίδα Εργαστήριο Φωνής| +Safe Harbor Audio|Ασφαλής ήχου Harbor| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Αυτή είναι η προτροπή ήχου αρχείο που παίζεται εάν η πτώση δράσης αναμένεται να AUDIO. Η προεπιλογή είναι buzz| +Safe Harbor Call Menu|Ασφαλής Μενού κλήσεων Harbor| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|Αυτό είναι το μενού κλήση ότι μια κλήση στέλνεται εάν η πτώση δράσης αναμένεται να CALLMENU| +Log Key Press|Σύνδεση πλήκτρων| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Αυτή η επιλογή, αν ενεργοποιηθεί θα καταγράψει το DTMF πλήκτρων από τον καλούντα σε αυτό το μενού Κλήση. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +No DTMF Logging|Δεν καταγραφή DTMF| +DTMF Logging Enabled|DTMF ενεργοποιημένη την καταγραφή| +Webphone Auto-Answer|Διαδικτυακό κοινόχρηστο τηλέφωνο Αυτόματη Απάντηση| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Αυτή η ρύθμιση επιτρέπει το τηλέφωνο στο Internet που θα οριστεί απαντά αυτόματα στις κλήσεις που έρχονται σε αυτό θέτοντας σε Y, ή να έχουν κλήσεις δαχτυλίδι από τη ρύθμιση του Ν. Προεπιλογή να είναι Υ| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU θα στείλει τον πελάτη στο μενού Κλήση ορίζεται στην παρακάτω λίστα επιλέξτε| +Survey Call Menu|Έρευνα Μενού κλήσεων| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Εάν η μέθοδος έχει οριστεί σε CALLMENU, αυτό είναι το μενού Κλήση ότι ο πελάτης έχει σταλεί αν opt-in| +Scheduled Callbacks Days Limit|Προγραμματισμένη Όριο επιστροφές κλήσεις Ημέρες| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Αυτή η επιλογή σας επιτρέπει να μειώσει το πρακτορείο προγραμματιστεί callbacks ημερολογίου με δυνατότητα επιλογής αριθμού των ημερών από σήμερα, την πλήρη ημερολογιακό μήνα 12 θα εξακολουθήσουν να εμφανίζονται, αλλά μόνο ο αριθμός σύνολο των ημερών θα επιλεγούν. Η προεπιλογή είναι 0 για απεριόριστο| +Dial Level Difference Target Method|Πληκτρολογήστε Επίπεδο Μέθοδος στόχος Διαφορά| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Αυτή η επιλογή σας επιτρέπει να ορίσετε αν το επίπεδο καντράν διαφορά στοχοθέτησης εφαρμόζεται μόνο για τον υπολογισμό του επιπέδου κλήσης ή επίσης με την πραγματική κλήση σε κάθε διακομιστή κλήση. Εάν εκτελείτε μια μικρή εκστρατεία με παράγοντες συνδεδεμένοι σε πολλούς servers μπορεί να θέλετε να χρησιμοποιήσετε την επιλογή ADAPT_CALC_ONLY, επειδή η CALLS_PLACED επιλογή μπορεί να οδηγήσει σε λιγότερες κλήσεις που τοποθετούνται από deisred. Αυτή η επιλογή είναι ενεργή μόνο όταν κλήσης στόχος Διαφορά επιπέδου έχει οριστεί σε κάτι άλλο από 0. Η προεπιλογή είναι ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Αν θέλετε να χρησιμοποιήσετε προσαρμοσμένα πεδία σε μια διεύθυνση ιστού μορφή, θα πρέπει να προσθέσετε| +as part of your URL|ως μέρος του URL σας| +Disable Dispo Screen|Απενεργοποίηση οθόνης DISPO| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Αυτή η επιλογή σας επιτρέπει να απενεργοποιήσετε την οθόνη διάθεση στο περιβάλλον μέσο. Η Απενεργοποίηση DISPO πεδίο Κατάσταση παρακάτω πρέπει να συμπληρωθεί για αυτή την επιλογή να εργαστούν. Η προεπιλογή είναι| +Disable Dispo Status|Απενεργοποίηση DISPO Κατάσταση| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Εάν η επιλογή Απενεργοποίηση DISPO οθόνης έχει οριστεί σε DISPO_DISABLED, τότε το πεδίο αυτό πρέπει να συμπληρωθεί αυτό το πεδίο, μπορείτε να χρησιμοποιήσετε οποιαδήποτε διάταξη θέλετε για αυτόν τον τομέα όσο είναι 1 προς 6 χαρακτήρες στο μήκος με μόνο γράμματα και αριθμούς| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Η ρύθμιση αυτή εφόσον έχει καθοριστεί στο 1 θα επιτρέψει σε έναν διαχειριστή να έχουν πρόσβαση στην κλήση των εξαγωγών και των εκθέσεων οδηγούν στην οθόνη ΕΚΘΕΣΕΙΣ. Η προεπιλογή είναι 0. Για την εξαγωγή κλήσεις και οδηγεί εκθέσεις, η ακόλουθη σειρά πεδίο χρησιμοποιείται για τις εξαγωγές| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Η παρούσα έκθεση τραβά μολύβδου πληροφορίες για κλήσεις στο επιλεγμένο εύρος ημερομηνιών. Ο μόλυβδος εξάγεται μόνο μία φορά δεν έχει σημασία πόσες κλήσεις αντιμετωπίστηκαν. Η τρέχουσα κατάσταση μόλυβδος χρησιμοποιείται.| +Export Leads Report|Εξαγωγή οδηγεί Έκθεση| +Screen Labels|Ετικέτες οθόνης| +Add A Screen Label|Προσθέσετε μια ετικέτα οθόνης| +ADD NEW SCREEN LABEL|Προσθήκη νέου ΕΤΙΚΕΤΑ ΟΘΟΝΗ| +ADDING NEW SCREEN LABEL|Προσθήκη νέων ΕΤΙΚΕΤΑ ΟΘΟΝΗ| +MODIFY SCREEN LABEL|ΤΡΟΠΟΠΟΙΗΣΗ ΕΤΙΚΕΤΑ ΟΘΟΝΗ| +DELETE SCREEN LABEL|Διαγραφή ετικέτας ΟΘΟΝΗ| +SCREEN LABELS LIST|ΟΘΟΝΗ ΚΑΤΑΛΟΓΟΣ ΕΤΙΚΕΤΕΣ| +Screen Label ID|Οθόνη ID ετικέτας| +Screen Label Name|Οθόνη Ονομασία ετικέτας| +SCREEN LABEL NOT ADDED|ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΧΩΡΙΣ ΠΡΟΣΘΗΚΗ| +there is already a label in the system with this ID|υπάρχει ήδη μια ετικέτα στο σύστημα με αυτό το αναγνωριστικό| +SCREEN LABEL ADDED|ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +SCREEN LABEL NOT DELETED|ΕΤΙΚΕΤΑ ΟΘΟΝΗ δεν διαγράφεται| +SCREEN LABEL DELETION CONFIRMATION|Οθόνη επιβεβαίωσης ΔΙΑΓΡΑΦΗ ΕΤΙΚΕΤΑ| +Click here to delete screen label|Κάντε κλικ εδώ για να διαγράψετε ετικέτα οθόνη| +SCREEN LABEL DELETION COMPLETED|ΟΘΟΝΗ ΔΙΑΓΡΑΦΗ ΕΤΙΚΕΤΑ ΟΛΟΚΛΗΡΩΘΗΚΕ| +DELETE THIS SCREEN LABEL|ΔΙΑΓΡΑΦΗ αυτή την ετικέτα ΟΘΟΝΗ| +Click here to see Admin changes to this screen label|Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την ετικέτα οθόνη| +Hide Label in Call Logs|Απόκρυψη ετικετών στα αρχεία καταγραφής κλήσεων| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Αν η ετικέτα έχει οριστεί σε ΑΠΟΚΡΥΨΗ --- --- τότε τα αρχεία καταγραφής κλήσεων πράκτορα, εφόσον είναι ενεργοποιημένη για την καμπάνια, θα εξακολουθούν να δείχνουν το πεδίο και τα δεδομένα, εκτός αν αυτή η επιλογή έχει οριστεί σε ΚΕ Προεπιλογή είναι N| +SCREEN LABEL NOT MODIFIED|ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +SCREEN LABEL MODIFIED|ΕΤΙΚΕΤΑ ΟΘΟΝΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Αυτό το πεδίο πρέπει να είναι τουλάχιστον 2 χαρακτήρες σε μήκος και δεν υπερβαίνει τους 20 χαρακτήρες, χωρίς κενά ή ειδικούς χαρακτήρες. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για να προσδιορίσει την ετικέτα οθόνη όλο το σύστημα| +This is the descriptive name of the screen label entry|Αυτό είναι το περιγραφικό όνομα του την ετικέτα της οθόνης| +Agent Screen Labels|Ετικέτες οθόνης γραφείο| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|Μπορείτε να επιλέξετε ένα σύνολο ετικετών οθόνη παράγοντα για χρήση με αυτή την επιλογή. Προεπιλογή είναι - ΣΥΣΤΗΜΑ-ΧΩΡΟΣ - για τις προεπιλεγμένες ετικέτες| +Status Display Fields|Εμφάνιση Πεδία Κατάσταση| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|Μπορείτε να επιλέξετε ποιες μεταβλητές για τις κλήσεις που θα εμφανίζεται στη γραμμή κατάστασης της οθόνης πράκτορα. CALLID θα εμφανίσει το 20 μοναδικό αναγνωριστικό χαρακτήρα κλήση, LEADID θα εμφανίσει το ID σύστημα ηλεκτροδίων, LISTID θα εμφανιστεί το ID της λίστας. Η προεπιλογή είναι CALLID| +CAMPAIGNS USING THIS SCREEN LABEL|Καμπάνιες που χρησιμοποιούν αυτή την ετικέτα ΟΘΟΝΗ| +QueueMetrics Phone Environment Phone Append|QueueMetrics Τηλέφωνο Περιβάλλοντος Τηλέφωνο Προσάρτηση| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Αυτή η επιλογή, εάν ενεργοποιηθεί, θα προσαρτήσει τη σύνδεση του τηλεφώνου παράγοντα στην εγγραφή δεδομένων αυτών4 στον πίνακα καταγραφής ουρά αν το τηλέφωνο εκστρατεία στον τομέα του περιβάλλοντος έχει συμπληρωθεί. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|HIDDEN δεν θα δείξει στον πράκτορα του πεδίου, αλλά θα επιτρέψει στον τομέα να έχουν τα δεδομένα που εισάγονται σε αυτήν και την εξαγωγή από αυτήν, καθώς και το έχουν διαθέσιμο στην καρτέλα σενάριο και τη διεύθυνση ιστού μορφή. Μόνο για ανάγνωση, θα εμφανιστεί η αξία των δεδομένων στον τομέα, αλλά δεν θα επιτρέπουν στον πράκτορα να αλλάξει τα δεδομένα| +Enable Campaign Test Calls|Ενεργοποίηση καλεί δοκιμής Εκστρατεία| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Αυτή η ρύθμιση επιτρέπει τη δυνατότητα να εισαγάγετε έναν κωδικό τηλεφώνου και τον αριθμό τηλεφώνου σε πεδία στο κάτω μέρος της οθόνης Λεπτομέρειες καμπάνιας και τοποθετήστε μια τηλεφωνική κλήση προς τον αριθμό αυτό σαν να ήταν ένας κύριος που αυτόματη κλήση στο σύστημα. Ο αριθμός τηλεφώνου θα αποθηκευτεί ως νέο επικεφαλής στο εγχειρίδιο λίστα λίστα αναγνώρισης κλήσης. Η καμπάνια πρέπει να είναι ενεργή η λειτουργία αυτή για να ενεργοποιηθεί, και συνιστάται ότι οι κατάλογοι που ανατίθενται στην εκστρατεία όλα να ρυθμιστεί σε ανενεργά. Το πρόθεμα κλήσης, χρονικό όριο κλήσης και όλα τα άλλα χαρακτηριστικά που σχετίζονται με κλήση, εκτός από το DNC και καλούν τις επιλογές του χρόνου, θα επηρεάσουν την κλήση του αριθμού δοκιμών. Το τηλεφώνημα θα τοποθετηθεί στο διακομιστή επιλεγεί ως το διακομιστή φωνητικού ταχυδρομείου στις ρυθμίσεις του συστήματος. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +Test calling disabled|Δοκιμή καλώντας άτομα με ειδικές ανάγκες| +PLACE TEST CALL|ΤΟΠΟΣ δοκιμαστική κλήση| +Test Outbound Call|Δοκιμάστε εξερχόμενη κλήση| +Agents Calls Reset|Πράκτορες Κλήσεις Επαναφορά| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Αυτή η ρύθμιση καθορίζει αν η συνδεδεμένων αντιπροσώπων και ενεργό τηλεφωνήματα αρχεία είναι να μηδενιστεί στο τέλος της ημέρας χρονομέτρησης. Η προεπιλογή είναι 1 για ενεργοποίηση| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|Η Προσαρμοσμένη 5 πεδίο μπορεί να χρησιμοποιηθεί ως ένα πεδίο για να καθορίσει μια σειρά dialplan να στείλετε μια κλήση σε ένα από AGENTDIRECT στην ομάδα, αν ο χρήστης δεν είναι διαθέσιμη, το μόνο που χρειάζεται να βάλετε AGENTEXT στον τομέα ΜΗΝΥΜΑ ή παράταση της AGENTDIRECT στην ομάδα και το σύστημα θα κοιτάξει το έθιμο των πέντε τομέων και να στείλει την κλήση σε αυτό τον αριθμό dialplan| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Για AGENTDIRECT σε ομάδες, αν ο χρήστης δεν είναι διαθέσιμη, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Για AGENTDIRECT σε ομάδες, μπορείτε να βάλετε AGENTEXT σε αυτόν τον τομέα και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|Μπορείτε επίσης να βάλετε AGENTEXT σε αυτόν τον τομέα, εφόσον έχει οριστεί για την παράταση και το σύστημα θα κοιτάξει το χρήστη έθιμο πέντε τομέα και να στείλει την κλήση σε αυτό τον αριθμό dialplan| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|παραγγελιών από την τελευταία φορά που ένας πράκτορας στάλθηκε μια εισερχόμενη κλήση. Αποτελέσματα σε παράγοντες που λαμβάνουν για τον ίδιο αριθμό καλεί συνολικής| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|παραγγελιών από την τελευταία φορά που ένας πράκτορας τελειώσει μια εισερχόμενη κλήση. AKA πράκτορα περιμένει μεγαλύτερη λαμβάνει την πρώτη κλήση| +Servers|Διακομιστές| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Αυτή είναι μια λίστα με τις διευθύνσεις IP του διακομιστή των servers στο σύστημα που θέλετε οι εγγραφές τηλέφωνο για να συμπληρωθεί ολόκληρη. Αυτές πρέπει να είναι έγκυρες διευθύνσεις IP, πρέπει να είναι ενεργή στο σύστημα και πρέπει να βάλετε μία ανά γραμμή σε αυτόν τον τομέα κουτί κειμένου| +Phones|Τηλέφωνα| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Αυτή είναι μια λίστα με τις επεκτάσεις τηλεφώνου που θέλετε να δημιουργηθούν σε όλους τους διακομιστές που αναφέρονται παραπάνω. Οι επεκτάσεις τηλεφώνου θα πρέπει να είναι μόνο γράμματα και αριθμούς, χωρίς ειδικούς χαρακτήρες και πρέπει να βάλετε μία ανά γραμμή σε αυτό το πλαίσιο περιοχή κειμένου| +Registration Password|Κωδικός Εγγραφή| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|Αυτός είναι ο κωδικός εγγραφής που θα χρησιμοποιηθεί για όλα τα τηλέφωνα που δημιουργούνται. Για SIP και IAX2 πρωτόκολλο θα πρέπει να χρησιμοποιήσετε έναν περίπλοκο κωδικό πρόσβασης για λόγους Secutiry| +Login Password|Υποσελίδες| +This is the agent screen login password that will be used for all of the phones that are created|Αυτή είναι η οθόνη παράγοντας κωδικό πρόσβασης που θα χρησιμοποιηθεί για όλα τα τηλέφωνα που δημιουργούνται| +Create Alias Entries|Δημιουργία Alias ​​εγγραφών| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Η ρύθμιση αυτής της επιλογής στο ΝΑΙ, θα δημιουργήσει ένα θυροτηλέφωνα ψευδώνυμο για κάθε μια από τις επεκτάσεις που αναφέρονται παραπάνω, που θα συνδέσει όλες τις ίδιες εγγραφές επέκταση σε κάθε server που επιτρέπει το τηλέφωνο μαζί εξισορρόπηση φορτίου login για να εργαστούν στη διεπαφή πράκτορα| +Alias Suffix|Ψευδώνυμο Κατάληξη| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|Αυτή είναι η κατάληξη που θα προστεθούν με την επέκταση για να σχηματίσουν το τηλέφωνο id ψευδώνυμο. Για παράδειγμα, αν η επέκταση είναι cc100 και η κατάληξη ψευδώνυμο είναι x, τότε το ψευδώνυμο τηλέφωνο αναγνωριστικού που χρησιμοποιείται για τα οποία θα ήταν cc100x| +Client Protocol|Πελάτης πρωτόκολλο| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Αυτό είναι το πρωτόκολλο του τηλεφώνου που θα χρησιμοποιηθεί για όλα τα τηλέφωνα που δημιουργούνται όταν υποβάλλονται. SIP και VOIP IAX2 είναι πρωτόκολλα που θα δημιουργήσει το αρχείο conf καταχωρήσεις επιτρέψει στους phoens να εγγραφούν στους διακομιστές| +Local GMT|Τοπική GMT| +This is the time zone that all of the phones will be created with|Αυτή είναι η ζώνη ώρας ότι όλα τα τηλέφωνα θα δημιουργηθεί με| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB είναι παρόμοια με ΒΡΕΣ εκτός από τον τύπο αποθήκευσης των δεδομένων στη βάση δεδομένων είναι ένας τύπος BLOB, κατάλληλο για δυαδικά δεδομένα ή δεδομένα που πρέπει να εξασφαλίζονται| +Default Local GMT|Προεπιλογή τοπική ώρα GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Αυτή η ρύθμιση ορίζει τι θα πρέπει να χρησιμοποιείται από προεπιλογή όταν τα νέα κινητά τηλέφωνα και servers χρησιμοποιώντας αυτή προστίθεται το admin web interface. Η προεπιλογή είναι -5| +Default Voicemail Zone|Προεπιλογή Ζώνη Τηλεφωνητής| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Αυτή η ρύθμιση καθορίζει ποια ζώνη θα πρέπει να χρησιμοποιείται από προεπιλογή όταν δημιουργούνται νέα κινητά τηλέφωνα και κουτιά τηλεφωνητή. Η λίστα των διαθέσιμων ζωνών λαμβάνονται απευθείας από την voicemail.conf αρχείο. Προεπιλογή είναι η ανατολική| +Voicemail Zone|Ζώνη Τηλεφωνητής| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Η ρύθμιση αυτή σας επιτρέπει να ορίσετε τη ζώνη ότι αυτό το πλαίσιο θα τηλεφωνητή που να όταν έρθει η ώρα καταγράφεται για ένα μήνυμα. Προεπιλογή έχει οριστεί στις ρυθμίσεις συστήματος| +Voicemail Options|Επιλογές Τηλεφωνητής| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Αυτή η προαιρετική ρύθμιση σας επιτρέπει να ορίσετε πρόσθετες ρυθμίσεις τηλεφωνητή. Συνιστάται να αφήσετε κενό αυτό, εκτός αν ξέρετε τι κάνετε| +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|Τα επόμενα δύο ρυθμίσεις επίσης ορίζεται στο τμήμα Ρυθμίσεις Συστήματος, και μπορείτε να τα αλλάξετε μετά τον ορισμό τους εδώ. Θα πρέπει να ορίσετε την προεπιλεγμένη τοπική ώρα GMT την ζώνη ώρας σας ότι οι πράκτορες θέλουν να είναι μέσα Η ζώνη Τηλεφωνητής είναι η λίστα των χρονικών ζωνών τηλεφωνητή ότι τα μηνύματα στον τηλεφωνητή θα είναι συνδεδεμένοι με το χρόνο, όταν έφυγε νέα μηνύματα| +ERROR: You cannot use reserved words for field labels|ΣΦΑΛΜΑ: Δεν μπορείτε να χρησιμοποιήσετε δεσμευμένες λέξεις για τις ετικέτες τομέα| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|Η DISPO_SELECT_DISABLED επιλογή δεν θα απενεργοποιήσει την οθόνη dispo εντελώς, αλλά θα εμφανιστεί η οθόνη dispo χωρίς διαθέσεις, η επιλογή αυτή πρέπει να χρησιμοποιείται μόνο εάν θέλετε να επιβάλετε πράκτορες σας για να χρησιμοποιήσετε το λογισμικό CRM σας, η οποία θα στείλει την κατάσταση με το σύστημα μέσω του API| +No Agent Call URL|Δεν URL Καλέστε τον πράκτορα| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Αυτή η διεύθυνση URL ιστοσελίδας δεν θεωρείται από τον πράκτορα, αλλά αν έχει συμπληρωθεί καλείται κάθε φορά που μια κλήση που δεν γίνεται από έναν πράκτορα είναι κρεμασμένα επάνω ή μεταφέρθηκαν. Χρησιμοποιεί τις ίδιες μεταβλητές όπως τα πεδία σενάρια διαδικτυακή φόρμα και. dispo μπορεί να χρησιμοποιηθεί για να ανακτήσει το σύστημα-που ορίζεται διάθεση για την κλήση. Αυτό το URL δεν μπορεί να είναι μια σχετική διαδρομή. Η προεπιλογή είναι κενό| +On-Hook CID|On-Hook CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Η επιλογή αυτή χρησιμοποιείται μόνο για τους πράκτορες που είναι συνδεδεμένοι με τηλέφωνα που έχουν το πρακτορείο-on-γάντζο ενεργοποιημένη τη λειτουργία. Αυτή είναι η ταυτότητα του καλούντος που θα εμφανιστούν στα τηλέφωνα πράκτορά τους, όταν οι κλήσεις χτυπούν. ΓΕΝΙΚΗ είναι ένας γενικός RINGAGENT00000000001 τύπο της κοινοποίησης. INGROUP θα δείξει μόνο την ομάδα-σε η κλήση προήλθε από. CUSTOMER_PHONE θα δείχνουν μόνο τον αριθμό τηλεφώνου του πελάτη. CUSTOMER_PHONE_RINGAGENT θα δείξει RINGAGENT_3125551212 με την RINGAGENT ως μέρος του CID με τον αριθμό τηλεφώνου του πελάτη. CUSTOMER_PHONE_INGROUP θα δείξει τα πρώτα 10 χαρακτήρες του σε ομάδα που ακολουθείται από τον αριθμό τηλεφώνου του πελάτη| +Please wait for the whole page to load before submitting the form|Παρακαλώ περιμένετε για την ολόκληρη σελίδα για να φορτώσει πριν από την υποβολή της αίτησης| +In-Group Calldate|Στην ομάδα-Calldate| +This is the last date and time that a call was directed to this inbound group|Αυτή είναι η τελευταία ημερομηνία και την ώρα που μια πρόσκληση απευθυνόταν σε αυτό το εισερχόμενο ομάδα| +No-Answer Log|Όχι-Απάντηση Σύνδεση| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Αυτή η επιλογή θα καταγράψει το auto-dial κλήσεις που δεν απαντώνται σε έναν ξεχωριστό πίνακα. Προεπιλογή είναι N| +Alt-Log DB Server|Alt-Σύνδεση διακομιστή DB| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|Αυτή είναι η εναλλακτική server της βάσης δεδομένων καταγραφής. Αυτό είναι προαιρετικό, και επιτρέπει σε ορισμένα αρχεία καταγραφής για να γραφτεί σε μια ξεχωριστή βάση δεδομένων. Προεπιλογή είναι άδειο| +Alt-Log Tables|Alt-Πίνακες Σύνδεση| +These are the tables that are available for logging on the alternate log database server. Default is blank|Αυτές είναι οι πίνακες που είναι διαθέσιμες για τη σύνδεση του εναλλακτικού διακομιστή της βάσης δεδομένων καταγραφής. Η προεπιλογή είναι κενό| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Αυτή είναι η πραγματική κειμένου σε ομιλία πεδίο δεδομένων που αποστέλλονται στην σαφματικός για τη δημιουργία του αρχείου ήχου για να παίξει στον πελάτη. μπορείτε να χρησιμοποιήσετε Γλώσσας Σήμανσης Σύνθεσης Ομιλίας-SSML-σε αυτόν τον τομέα, για παράδειγμα,| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|για 1 δεύτερο διάλειμμα. Μπορείτε επίσης να χρησιμοποιήσετε πολλές μεταβλητές όπως το όνομα, το επώνυμο και τον τίτλο του ως ViciDial μεταβλητές ακριβώς όπως κάνετε σε ένα Σενάριο: - Α - FIRST_NAME - Β -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Αν έχετε στατική αρχεία ήχου που θέλετε να χρησιμοποιήσετε με βάση την αξία του ένα από τα πεδία που μπορείτε να χρησιμοποιήσετε αυτούς καθώς και με Γ και Δ ετικέτες. Τα ονόματα των αρχείων πρέπει να είναι όλα τα πεζά και πρέπει να είναι 8k 16bit PCM WAV. Το όνομα τομέα πρέπει να είναι το ίδιο, αλλά χωρίς το. Wav με το όνομα του αρχείου. Για παράδειγμα - Γ ---- Α - address3 - Β ---- Δ - θα βρει πρώτα την τιμή για address3, τότε θα προσπαθήσουμε να βρούμε ένα αρχείο ήχου που ταιριάζουν ότι η αξία για να το θέσω στην έγκαιρη| +Here is a list of the available variables|Εδώ είναι μια λίστα των διαθέσιμων μεταβλητών| +DID Agent Log|Σύνδεση DID, γραφείο| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Αυτή η επιλογή θα καταγράψει τα εισερχόμενα κλήσεις DID, μαζί με μια ομάδα-σε και κωδικός ταυτότητας χρήστη, κατά περίπτωση, σε έναν ξεχωριστό πίνακα. Προεπιλογή είναι N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|TIMEOUT θα σας επιτρέψει να ρυθμίσετε το τι συμβαίνει στην κλήση όταν φορές έξω με καμία εισαγωγή από τον καλούντα. ΑΚΥΡΟ θα σας επιτρέψει να επιλέξετε τι συμβαίνει όταν ο επισκέπτης εισέρχεται σε μια μη έγκυρη επιλογή. INVALID_2ND και 3ου μπορεί να είναι ενεργό μόνο εάν ΑΚΥΡΟ δεν χρησιμοποιείται, θα περιμένουν μέχρι το δεύτερο ή τρίτο έγκυρη καταχώρηση από τον καλούντα πριν να εκτελέσει την επιλογή| +Survey Recording|Εγγραφή Έρευνα| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Αν ενεργοποιηθεί, αυτό θα ξεκινήσει να καταγράφει όταν η κλήση απαντηθεί. Συνιστάται μόνο εάν η μέθοδος δεν έχει οριστεί να μεταβεί σε άλλον παράγοντα. Προεπιλογή N για άτομα με ειδικές ανάγκες| +Campaign Areacode CID|Εκστρατεία Areacode CID| +AREACODE CIDS FOR THIS CAMPAIGN|CIDS AREACODE για τη συγκεκριμένη καμπάνια| +ADD NEW AREACODE CID|Προσθήκη νέου AREACODE CID| +AREACODE|AREACODE| +SUBMIT CHANGES|Υποβολή αλλαγών| +AREACODE CID NOT ADDED|AREACODE ΔΕΝ CID ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +there is already an entry for this campaign with this CID|υπάρχει ήδη μια καταχώρηση για την εκστρατεία αυτή με αυτό το CID| +AREACODE CID ADDED|AREACODE CID ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +AREACODE CID NOT DELETED|AREACODE CID δεν διαγράφεται| +this entry does not exist|Αυτή η καταχώρηση δεν υπάρχει| +AREACODE CID DELETED|AREACODE CID ΔΙΑΓΡΑΦΟΝΤΑΙ| +AREACODE CID MODIFIED|AREACODE CID ΤΡΟΠΟΠΟΙΗΘΗΚΕ| +Campaign Areacode CID Modify|Εκστρατεία Areacode CID Τροποποίηση| +CAMPAIGN AREACODE CID LISTINGS|ΕΚΣΤΡΑΤΕΙΑ AREACODE CID ΑΚΙΝΗΤΑ| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Όταν πρόκειται να AREACODE έχετε τη δυνατότητα να πάει σε AC-CID υπομενού και να ορίσετε πολλαπλά callerids να χρησιμοποιηθεί ανά areacode| +Enable Campaign Areacode CID|Ενεργοποίηση Areacode Εκστρατεία CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Αυτή η ρύθμιση επιτρέπει τη δυνατότητα να καθορίσει συγκεκριμένες εξερχόμενες CallerID αριθμοί που θα χρησιμοποιηθούν ανά καμπάνια. Η προεπιλογή είναι 1 για ενεργοποίηση| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Αν η ρύθμιση του συστήματος για Areacode CIDs είναι ενεργοποιημένη και η ρύθμιση Εκστρατεία για τη χρήση προσαρμοσμένων CallerID έχει οριστεί σε AREACODE τότε έχετε τη δυνατότητα να καθορίσει CIDs Areacode που θα χρησιμοποιηθούν όταν εξερχόμενη κλήση σε οδηγεί στη συγκεκριμένη καμπάνια. Μπορείτε να προσθέσετε πολλαπλές callerIDs ανά areacode και μπορείτε να ενεργοποιήσετε και να απενεργοποιήσετε κάθε τους σε πραγματικό χρόνο. Εάν περισσότερα από ένα CallerID είναι ενεργό για ένα συγκεκριμένο areacode τότε το σύστημα θα χρησιμοποιήσει το CallerID που έχει χρησιμοποιηθεί τουλάχιστον το πόσες φορές σήμερα. Εάν δεν callerIDs είναι ενεργά για την areacode τότε το CallerID εκστρατεία ή λίστα παράκαμψης CallerID θα χρησιμοποιηθεί| +PLLB Grouping|Ομαδοποίηση PLLB| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Τηλέφωνο φορτίου Είσοδος Ομαδοποίηση Εξισορρόπησης, επιτρέπεται μόνο αν υπάρχουν πολλοί διακομιστές πράκτορα και τα ψευδώνυμα του τηλεφώνου υπάρχουν στο σύστημα. Εάν πρόκειται να ONE_SERVER_ONLY θα αναγκάσει όλους τους αντιπροσώπους για την εκστρατεία αυτή για να συνδεθείτε στον ίδιο διακομιστή. Εάν οριστεί σε cascading θα ομαδοποιεί συνδεδεμένοι φορείς στον ίδιο διακομιστή μέχρι PLLB αριθμός Όριο Ομαδοποίηση των παραγόντων επιτυγχάνονται, τότε το επόμενο πράκτορα θα συνδεθείτε με το επόμενο server με το μικρότερο αριθμό παραγόντων. Εάν οριστεί σε Απενεργοποιημένη την τυπική συμπεριφορά Τηλέφωνο Ψευδώνυμα κάθε παράγοντα την εύρεση του διακομιστή με τον μικρότερο αριθμό μη απομακρυσμένες παράγοντες συνδεδεμένοι σε αυτό θα χρησιμοποιηθεί. Προεπιλογή είναι απενεργοποιημένη| +PLLB Grouping Limit|Όριο PLLB Ομαδοποίηση| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Τηλέφωνο φορτίου Είσοδος Εξισορρόπηση Όριο Όμιλο. Αν PLLB Όμιλος έχει οριστεί σε cascading τότε η ρύθμιση αυτή θα καθορίσει τον αριθμό των πρακτόρων αποδεκτή σε κάθε διακομιστή για τη συγκεκριμένη καμπάνια. Η προεπιλογή είναι 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Τηλέφωνο φορτίου Είσοδος Εξισορρόπηση Όριο Όμιλο. Αν PLLB Όμιλος έχει οριστεί σε cascading σε επίπεδο καμπάνιας τότε η ρύθμιση αυτή θα καθορίσει τον αριθμό των πρακτόρων αποδεκτή σε κάθε διακομιστή σε όλες τις καμπάνιες. Η προεπιλογή είναι 100| +Modify DID RA Extension Overrides|Τροποποίηση DID, RA Επέκταση Παρακάμπτει| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|ΔΕΝ REMOTE OVERRIDE ΕΠΕΚΤΑΣΗ ΠΡΑΚΤΟΡΑΣ ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +there is already an entry for this DID with this RA EXTENSION|υπάρχει ήδη μια καταχώρηση για αυτό το DID με την παράταση αυτή ΡΑ| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|DID REMOTE OVERRIDE ΕΠΕΚΤΑΣΗ ΠΡΑΚΤΟΡΑΣ ΠΡΟΣΤΙΘΕΜΕΝΗΣ| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|DID απομακρυσμένο τηλέφωνο Γραφείο υπερισχύσουν έναντι δεν διαγράφεται| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|DID απομακρυσμένο τηλέφωνο ΠΡΑΚΤΟΡΑΣ υπερισχύσουν έναντι ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +MODIFY THIS DID|ΤΡΟΠΟΠΟΙΗΣΗ αυτό το DID| +Enable Remote Agent Extension Overrides|Ενεργοποίηση απομακρυσμένης παρακάμψεων Επέκταση γραφείο| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Αυτή η ρύθμιση δίνει τη δυνατότητα να έχουν DIDs παρακάμπτει επέκταση δρομολογείται για απομακρυσμένες κλήσεις μέσω αντιπροσώπου σε ομάδες. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|ΤΗΛΕΧΕΙΡΙΣΤΗΡΙΟ παρακάμψεων ΕΠΕΚΤΑΣΗ Πράκτορες Για αυτό το DID| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|ΤΗΛΕΧΕΙΡΙΣΤΗΡΙΟ ΑΓΓΕΛΙΕΣ OVERRIDE παράγοντα επέκτασης| +DID Remote Agent Extension Overrides|DID, Απομακρυσμένη παρακάμψεων Επέκταση γραφείο| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Αυτό το τμήμα σάς επιτρέπει να ενεργοποιήσετε DIDs να παρακάμπτει επέκταση δρομολογείται για απομακρυσμένες κλήσεις μέσω αντιπροσώπου σε ομάδες. Η Έναρξη χρηστών πρέπει να είναι έγκυρο Εκκίνηση User Agent ή αν θέλετε η επέκταση Παράκαμψη πρόσβασης στην εργασία για όλες τις κλήσεις, τότε μπορείτε να χρησιμοποιήσετε --- Όλες --- στον τομέα Έναρξη χρήστη. Εάν υπάρχουν πολλαπλές καταχωρίσεις για το ίδιο έκαναν και στη συνέχεια ο χρήστης αρχίζει οι ενεργές συμμετοχές θα χρησιμοποιηθεί σε ένα γύρο μέθοδο robin| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|ΔΕΙΤΕ DID REMOTE παρακάμψεων ΕΠΕΚΤΑΣΗ Πράκτορες Για αυτό το DID| +THERE ARE|ΥΠΑΡΧΟΥΝ| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID, REMOTE παρακάμψεων ΠΡΑΚΤΟΡΑ ΓΙΑ ΑΥΤΗΝ ΤΗΝ ΕΠΕΚΤΑΣΗ Remote Agent| +Action Transfer CID|Μεταφορά δράσης CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Χρησιμοποιείται για την πτώση, μετά από ώρες και No-παράγοντας-δεν-ουρά ενέργειες. Αυτός είναι ο αριθμός ταυτότητας καλούντα ότι η κλήση χρησιμοποιεί προτού μεταφερθούν σε επεκτάσεις, μηνύματα, φωνητικό μενού ή κλήσης. Μπορείτε να χρησιμοποιήσετε ΠΕΛΑΤΗ σε αυτόν τον τομέα για να χρησιμοποιήσετε τον αριθμό τηλεφώνου του πελάτη, ή μια καμπάνια να χρησιμοποιεί το πρώτο επιτρέπεται καλούντος εκστρατεία αριθμό ταυτότητας. Προεπιλογή είναι ο πελάτης| +After Hours Call Menu|After Hours Καλέστε Μενού| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Αν After Hours δράσης αναμένεται να CALLMENU, η κλήση θα αποσταλεί σε αυτό το μενού Κλήση, αν αυτή τεθεί το σε ομάδα εκτός του συστήματος χρόνου εφημερίας ορίζεται για την ομάδα στην| +Drop Call Menu|Πτώση Μενού κλήσεων| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Εάν δράσης Drop έχει οριστεί σε CALLMENU, η κλήση θα αποσταλεί σε αυτό το μενού κλήση αν φτάσει δευτερόλεπτα κλήσης Drop| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|Προσαρμοσμένα Πεδία DID, - Αυτά τα πέντε πεδία μπορούν να χρησιμοποιηθούν για διάφορους σκοπούς, κυρίως όσον αφορά τον προγραμματισμό συνήθειας και εκθέσεις| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|Εάν πρόκειται να Y_WITH_AMD ακόμη τηλεφωνητή ανιχνευθεί κλήσεις μήνυμα θα πρέπει να καταγράφονται| +Log Field|Σύνδεση Πεδίο| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Εάν το κλειδί επιλογή Σύνδεση Τύπου είναι ενεργοποιημένη, η προαιρετική αυτή ρύθμιση μπορεί να επιτρέψει η απάντηση επίσης να αποθηκευτούν σε αυτόν τον τομέα λίστα| +Default is NONE for disabled|Προεπιλογή είναι ΚΑΝΕΝΑ για άτομα με ειδικές| +Call Count Limit|Αριθμός Κλήσεων Όριο| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Αυτό επιβάλλει ένα όριο στον αριθμό των προσπαθειών κλήσης για τις εξερχόμενες οδηγεί σε αυτή την εκστρατεία. Ο μόλυβδος μπορεί να πάει πέρα ​​από αυτό το όριο, αν ελαφρώς ανακύκλωση μολύβδου ή Auto-Alt-κλήσης είναι ενεργοποιημένη. Η προεπιλογή είναι 0 για χωρίς όριο| +Call Count Target|Αριθμός Κλήσεων στόχος| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Η επιλογή αυτή χρησιμοποιείται μόνο για σκοπούς αναφοράς και δεν έχει καμία επίδραση στις εξερχόμενες οδηγεί. Προεπιλογή είναι 3| +Enable Expanded List Stats|Ενεργοποίηση Διευρυμένη Στατιστικά Λίστα| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Αυτή η ρύθμιση δίνει τη δυνατότητα δύο επιπλέον στήλες που θα εμφανίζονται στις περισσότερες των πινάκων κατανομής Λίστα κατάσταση σχετικά με την τροποποίηση λίστα και σελίδες τροποποίηση εκστρατεία. Διείσδυση ορίζεται ως το ποσοστό των αγωγών οι οποίοι είναι επί ή υπεράνω του ορίου κλήσεων Count εκστρατεία και-ή η κατάσταση χαρακτηρίζεται ως Ολοκληρώθηκε. Η προεπιλογή είναι 1 για ενεργοποίηση| +Report Option|Επιλογή Έκθεση| +This option allows this specific shift to show up in selected reports that support this option|Αυτή η επιλογή επιτρέπει η συγκεκριμένη αλλαγή για να εμφανιστούν σε επιλεγμένες εκθέσεις που υποστηρίζουν αυτή την επιλογή| +There are|Υπάρχουν| +completed leads in those lists|ολοκληρώθηκε οδηγεί σε αυτές τις λίστες| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|Η επιλογή VIEW_PRESET θα ανοίξει απλά το πλαίσιο μεταφοράς και το προκαθορισμένο πλαίσιο| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|Επικοινωνία είναι μια επιλογή μόνο αν contact_information είναι ενεργοποιημένη στο σύστημά σας, αυτό είναι ένα χαρακτηριστικό έθιμο| +Preset Contact Search|Προκαθορισμένη Αναζήτηση Επικοινωνία| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Αν ο χρήστης έχει συνδεθεί σε μια καμπάνια που έχει Προεπιλογές μεταφοράς που να ΕΠΙΚΟΙΝΩΝΙΑ, τότε αυτή η ρύθμιση μπορεί να απενεργοποιήσετε την αναζήτηση επαφών για αυτόν τον χρήστη μόνο. Προεπιλογή είναι NOT_ACTIVE που θα χρησιμοποιήσει ό, τι η ρύθμιση της καμπάνιας είναι| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|Η επιλογή VIEW_CONTACTS θα ανοίξει ένα παράθυρο αναζήτησης επαφών, αυτό θα λειτουργήσει μόνο αν Προεπιλογές Ενεργοποίηση έχει οριστεί σε ΕΠΙΚΟΙΝΩΝΙΑ| +Contacts Enabled|Επαφές Ενεργοποιήθηκε| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Αυτή η ρύθμιση δίνει τη δυνατότητα στους Επαφές υπο-ενότητα του διαχειριστή που επιτρέπει σε ένα διαχειριστή να προσθέσει τροποποιήσετε ή να διαγράψετε επαφές στο σύστημα που μπορεί να χρησιμοποιηθεί ως μέρος μιας προσαρμοσμένης μεταφοράς σε μια εκστρατεία όπου ένας πράκτορας μπορεί να ψάξει για τις επαφές με το πρώτο όνομα το επώνυμο ή το γραφείο αριθμό και στη συνέχεια επιλέξτε μία από τις πολλές αριθμούς που σχετίζονται με αυτή την επαφή. Αυτή η δυνατότητα χρησιμοποιείται συχνά από τους φορείς εκμετάλλευσης ή σε λειτουργίες τηλεφωνικού κέντρου, όπου ο χρήστης θα χρειαστεί να μεταφέρετε μια κλήση σε μια μη-πράκτορα τηλέφωνο. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +CONTACTS LIST|ΚΑΤΑΛΟΓΟΣ ΕΠΙΚΟΙΝΩΝΙΑ| +Add A Contact|Προσθήκη μιας επαφής| +ADD NEW CONTACT|Προσθήκη νέας επαφής| +ADDING NEW CONTACT|ΠΡΟΣΘΗΚΗ ΝΕΑ ΕΠΙΚΟΙΝΩΝΙΑ| +MODIFY CONTACT|ΤΡΟΠΟΠΟΙΗΣΗ ΕΠΙΚΟΙΝΩΝΙΑ| +CONTACT NOT ADDED|Μην έρχεται σε επαφή ΠΡΟΣΘΗΚΗ| +there is already a contact in the system with this name and number|υπάρχει ήδη μια επαφή με το σύστημα με αυτό το όνομα και τον αριθμό| +CONTACT ADDED|ΕΠΙΚΟΙΝΩΝΙΑ ΠΡΟΣΘΗΚΗ| +DELETE THIS CONTACT|ΔΙΑΓΡΑΦΗ ΠΑΡΟΥΣΑ ΕΠΙΚΟΙΝΩΝΙΑ| +Click here to see Admin changes to this contact|Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την επαφή| +DELETE CONTACT|Διαγραφή επαφής| +CONTACT NOT DELETED|ΕΠΙΚΟΙΝΩΝΙΑ δεν διαγράφεται| +CONTACT DELETION CONFIRMATION|ΕΠΙΚΟΙΝΩΝΙΑ ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗ| +Office Number|Αριθμός Γραφείου| +Cell Number|Αριθμός κυττάρων| +Other Number|Άλλο Αριθμός| +CONTACT NOT MODIFIED|ΕΠΙΚΟΙΝΩΝΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΑ| +Scheduled Callbacks Hours Block|Προγραμματισμένη Μπλοκ επιστροφές κλήσεις Ώρες| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Αυτή η επιλογή σας επιτρέπει να περιορίσετε την προγραμματισμένη USERONLY επανάκλησης από το να εμφανίζεται στη λίστα επανάκλησης μέχρι παράγοντα Χ ώρες μετά έχει καθοριστεί. Η προεπιλογή είναι 0 για να μην μπλοκ| +Scheduled Callbacks Calltime Block|Προγραμματισμένη επιστροφές κλήσεις Calltime Μπλοκ| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Αυτή η επιλογή αν θα αποτρέψει την ενεργοποίηση της προγραμματισμένης επανάκλησης από τη λίστα επανάκλησης πράκτορα από το να καλέσει, αν είναι έξω από την προγραμματισμένη calltime για την εκστρατεία. Προεπιλογή είναι απενεργοποιημένη| +Modify Same User Level|Τροποποίηση ίδιο επίπεδο χρήστη| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Αυτή η ρύθμιση ισχύει μόνο για τους χρήστες Επίπεδο 9. Αν ενεργοποιηθεί επιτρέπει το επίπεδο 9 στο χρήστη να τροποποιήσει τις δικές τους ρυθμίσεις, καθώς και άλλες επίπεδο 9 χρήστες. Η προεπιλογή είναι 1 για ενεργοποίηση| +Admin Hide Lead Data|Διαχειριστής Απόκρυψη μολύβδου Δεδομένων| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Αυτή η ρύθμιση ισχύει μόνο για το επίπεδο 7, 8 και 9 χρήστες. Αν είναι ενεργοποιημένο το αντικαθιστά τα δεδομένα των πελατών οδηγούν σε πολλές εκθέσεις και τις οθόνες του συστήματος με Xs. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +Admin Hide Phone Data|Διαχειριστής Απόκρυψη Στοιχεία Τηλεφώνου| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Αυτή η ρύθμιση ισχύει μόνο για το επίπεδο 7, 8 και 9 χρήστες. Αν είναι ενεργοποιημένο αντικαθιστά τους αριθμούς τηλεφώνου των πελατών σε πολλές εκθέσεις και τις οθόνες του συστήματος με Xs. Οι ρυθμίσεις ΨΗΦΙΑ θα παρουσιάσει μόνο τα τελευταία ψηφία Χ του αριθμού τηλεφώνου. Η προεπιλογή είναι 0 για άτομα με ειδικές ανάγκες| +Allowed User Groups|Επιτρέπονται Ομάδες Χρηστών| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Αυτή είναι μια επιλογή λίστα με ομάδες χρηστών στις οποίες τα μέλη αυτής της ομάδας χρήστης μπορεί να δει και ενδεχομένως να επεξεργαστείτε. Ομάδες χρήστης μπορεί να περιορίσει την πρόσβαση σε όλες σχεδόν τις πτυχές του συστήματος, από εισερχόμενα τηλέφωνα για να DIDs τις θέσεις τηλεφωνητή. Η - ALL - επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να δείτε και να συνδεθείτε σε οποιαδήποτε εγγραφή στο σύστημα, εάν τα δικαιώματα των χρηστών για τους επιτρέπουν να| +Allowed Call Times|Επιτρέπονται χρόνους κλήσης| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Αυτή είναι μια επιλογή λίστα των Times Πρόσκληση στην οποία τα μέλη αυτής της ομάδας χρήστης μπορεί να χρησιμοποιήσει σε καμπάνιες, σε ομάδες και μενού κλήσης. Η - ALL - επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα για να χρησιμοποιήσεις όλες τις φορές κλήση στο σύστημα| +All call times in the system|Όλοι οι χρόνοι κλήσης στο σύστημα| +You are not allowed to edit your own user group|Δεν επιτρέπεται να επεξεργαστούν τα δικά σας ομάδα χρηστών| +You are not allowed to edit your own user|Δεν επιτρέπεται να επεξεργαστείτε το δικό σας χρήστη| +Admin User Group|Διαχειριστής Ομάδα Χρηστών| +All Admin User Groups|Όλες οι Ομάδες Χρηστών Διαχειριστής| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|Αυτή είναι η διοικητική ομάδα χρηστών για την εκστρατεία αυτή, αυτό επιτρέπει την προβολή του διαχειριστή αυτής της εκστρατείας, καθώς και οι λίστες έχουν ανατεθεί σε αυτήν την εκστρατεία που θα περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε διαχειριστή χρήστη με δικαιώματα εκστρατεία ομάδα χρηστών για να δείτε αυτήν την εκστρατεία| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το εισερχόμενο ομάδα, αυτό επιτρέπει την προβολή του διαχειριστή αυτής στην ομάδα περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό σε ομάδα| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το έκανε, αυτό επιτρέπει το admin προβολή αυτή δεν περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το έκανε| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|Αυτή είναι η διοικητική ομάδα χρηστών για αυτό το αρχείο, αυτό επιτρέπει την προβολή διαχειριστή αυτού του recoird περιορίζεται από ομάδα χρηστών. Προεπιλογή είναι - ALL - η οποία επιτρέπει σε κάθε χρήστη διαχειριστή για να δείτε αυτό το αρχείο| +User Start for this remote agent does not exist|Έναρξη χρήσης για αυτή την απομακρυσμένη παράγοντα δεν υπάρχει| +ADMIN GROUP|Μέλη της ομάδας admin| +Max Calls Method|Μέγιστη κλήσεις μεθόδων| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Αυτή η επιλογή μπορεί να επιτρέψει τη μέγιστη ταυτόχρονη λειτουργία προσκλήσεις για αυτό στην ομάδα. Εάν οριστεί σε ΣΥΝΟΛΟ, τότε ο συνολικός αριθμός των κλήσεων εξετάζονται από πράκτορες και σε ουρά σε αυτό της ομάδας δεν επιτρέπεται να υπερβαίνει τον αριθμό κλήσεις Μέγιστη αρίθμηση των γραμμών, όπως ορίζεται παρακάτω. Εάν οριστεί σε IN_QUEUE, στη συνέχεια, αν ο αριθμός των κλήσεων σε ουρά αναμονής για τους πράκτορες δεν θα επιτρέπεται να υπερβαίνει το Max κλήσεις Μετρήστε ανεξάρτητα από το πόσες κλήσεις με τους πράκτορες για αυτό-ομάδα. Προεπιλογή είναι απενεργοποιημένη| +Max Calls Count|Μέγιστη Κλήσεις Μετρήστε| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Η επιλογή αυτή πρέπει να ρυθμιστεί υψηλότερα από το 0 εάν θέλετε να χρησιμοποιήσετε το χαρακτηριστικό Μέγιστη καλεί τη μέθοδο. Προεπιλογή είναι 0| +Max Calls Action|Μέγιστη Κλήσεις δράσης| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|Αυτή είναι η δράση που πρέπει να ληφθούν αν η Μέγιστη κλήσεις μεθόδων είναι ενεργοποιημένη και ο αριθμός των κλήσεων υπερβαίνει ό, τι βρίσκεται πάνω στο Max κλήσεις Μετρήστε ρύθμιση. Οι προσκλήσεις άνω του ποσού αυτού θα σταλεί είτε τη δράση DROP, τη δράση ή την AFTERHOURS NO_AGENT_NO_QUEUE δράση και θα καταγραφεί ως MAXCAL του καθεστώτος, με λόγο hangup MAXCALLS. Η προεπιλογή είναι NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Εάν μια μέθοδος CIDLOOKUP χρησιμοποιείται με το πλήκτρο ALT, θα αναζητήσει το alt_phone πεδίο για τον αριθμό τηλεφώνου, εάν δεν βρεθεί αγώνες για τον κύριο αριθμό τηλεφώνου. Εάν μια μέθοδος CIDLOOKUP χρησιμοποιείται με ADDR3, θα αναζητήσει το address3 πεδίο για τον αριθμό τηλεφώνου, εάν δεν βρεθεί αγώνες για τον κύριο αριθμό τηλεφώνου και προαιρετικά το πεδίο alt_phone| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Ένας άλλος τομέας σε αυτή την ενότητα είναι η ποιότητα, η οποία επιτρέπει την campaign_grade_random Επόμενη πάρε τηλέφωνο ρύθμιση που πρέπει να χρησιμοποιούνται. Ο βαθμός αυτός ρύθμιση θα αυξήσετε ή να μειώσετε την πιθανότητα ότι ο πράκτορας θα λάβει την κλήση| +gives a higher probability of getting a call to the higher graded agents|δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων υπαλλήλων| +gives a higher probability of getting a call to the higher graded agents by in-group|δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων υπαλλήλων από ομάδα σε| +gives a higher probability of getting a call to the higher graded agents by campaign|δίνει μια μεγαλύτερη πιθανότητα να πάρει μια κλήση των υψηλόβαθμων παραγόντων από την εκστρατεία| +Day call count for this in-group|Ημέρα αριθμός κλήσης για το σκοπό αυτό στην ομάδα| +Day call count for this campaign|Ημέρα αριθμός κλήσης για τη συγκεκριμένη καμπάνια| +SUMMARY STATS|ΣΤΑΤΙΣΤΙΚΑ ΠΕΡΙΛΗΨΗ| +Daily Maximum Stats|Μέγιστη Ημερήσια Στατιστικά| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Αυτές είναι οι στατιστικές που παράγονται από το σύστημα κάθε μέρα όλη την ημέρα μέχρι το τέλος χρονομέτρησης της ημέρας, όπως έχει οριστεί στις ρυθμίσεις συστήματος. Οι αριθμοί αυτοί προκύπτουν από τα αρχεία στο σύστημα να καταστεί δυνατή η εμφάνιση πολύ πιο γρήγορα. Περιλαμβάνονται τα στατιστικά είναι - Σύνολο καλεί, Μέγιστο Πράκτορες, Μέγιστη εισερχόμενες κλήσεις, εξερχόμενες κλήσεις Μέγιστη| +Add or Remove In-Group Selected For Active Users in This User Group|Προσθαφαίρεση Στην ομάδα-επιλεγεί για την ενεργό χρηστών σε αυτή την ομάδα χρηστών| +Maximum System Stats Reports|Μέγιστη Σύστημα Εκθέσεις Στατιστικά| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Αυτά τα στατιστικά στοιχεία που αποθηκεύονται προσωρινά σύνολα που έχουν αποθηκευτεί στη διάρκεια κάθε ημέρας σε πραγματικό χρόνο μέσω του back-end διαδικασίες. Για τις εισερχόμενες κλήσεις, οι συνολικές κλήσεις ανά-σε ομάδα υπολογίζεται για κάθε κλήση που εισέρχεται στη διαδικασία που υπολογίζει. Για το σύνολο του συστήματος μετράει, είναι τα σύνολα που προέρχονται από τις καταχωρήσεις ημερολογίου, καθώς και άλλα σύνολα στην ομάδα και εκστρατεία. Αυτά τα σύνολα ενδέχεται να μην αθροίζονται λόγω των ρυθμίσεων που έχετε στο σύστημά σας, καθώς και όταν η κλήση κρέμασε| +Hopper VLC Dup Check|Χόπερ VLC Dup Έλεγχος| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Ρύθμιση αυτό Υ θα έχει ως αποτέλεσμα σε κάθε μόλυβδο που ενσωματώνεται στην χοάνη που ελέγχονται από vendor_lead_code να βεβαιωθείτε ότι δεν υπάρχει εις διπλούν οδηγεί εισάγεται με την ίδια vendor_lead_code. Αυτό είναι πολύ χρήσιμο όταν Auto-Alt-Κλήση με MULTI_LEAD. Προεπιλογή είναι N| +Inventory Report|Έκθεση απογραφής| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Εάν η έκθεση απογραφής είναι ενεργοποιημένη στο σύστημά σας, η επιλογή αυτή θα καθορίσει αν ο κατάλογος αυτός περιλαμβάνεται στην έκθεση ή όχι. Προεπιλογή είναι ναι Υ για| +Report Rank|Έκθεση Κατάταξη| +This option allows you to rank shifts in selected reports that support this option|Αυτή η επιλογή σας επιτρέπει να κατατάξουν αλλαγές σε επιλεγμένες εκθέσεις που υποστηρίζουν αυτή την επιλογή| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|Μπορείτε επίσης να χρησιμοποιήσετε μια ειδική μεταβλητή IGNORENOSCROLL να αναγκάσει κύλισης στην καρτέλα σενάριο, ακόμη και αν χρησιμοποιείτε ένα iframe μέσα σε αυτό| +Carrier Log Report|Μεταφορέας Έκθεση Σύνδεση| +ADMINISTRATION: Campaign Multi-Alt-Leads|ΔΙΟΙΚΗΣΗ: Εκστρατεία Multi-Alt-Εκκινήσεις| +Multi-Lead Auto Alt Dialing Settings Form|Multi-μολύβδου Ρυθμίσεις κλήσης Αυτόματη Alt Έντυπο| +List Custom Fields|Λίστα προσαρμοσμένων πεδίων| +Select custom template|Επιλέξτε προσαρμοσμένο πρότυπο| +template builder|οικοδόμος πρότυπο| +Load from Lead File|Φόρτωση αρχείων από μόλυβδο| +Listloader Custom Template Maker|Προσαρμοσμένη Listloader τσάι προτύπου| +Custom template to use|Προσαρμοσμένη πρότυπο που θα χρησιμοποιηθεί| +Create a new template|Δημιουργία νέου προτύπου| +Delete an existing template|Διαγραφή ενός υπάρχοντος προτύπου| +Sample file fitting template|Δείγμα αρχείου τοποθέτηση πρότυπο| +needed for field assignation||που απαιτούνται για την ανάθεση τομέα| +Select template to delete|Επιλέξτε το πρότυπο για να διαγράψετε| +DELETE TEMPLATE|Διαγραφή προτύπου| +New template form|Νέα μορφή προτύπου| +Template ID|ID Πρότυπο| +Template Name|Όνομα προτύπου| +Template Description|Περιγραφή Πρότυπο| +List ID template will load into|Λίστα πρότυπο ID θα φορτώσει σε| +Assign columns to file fields|Ορισμός στηλών για πεδία αρχείου| +selecting a different list will reset columns|Επιλέγοντας μια διαφορετική λίστα θα επαναφέρετε στήλες| +Standard Field|Πρότυπο Πεδίο| +Custom Field|προσαρμοσμένου πεδίου| +Select a list ID from the drop down menu above to show columns|Επιλέξτε ένα ID της λίστας από το drop down μενού για να δείξει παραπάνω στήλες| +SUBMIT TEMPLATE|ΑΠΟΣΤΟΛΗ ΥΠΟΔΕΙΓΜΑ| +Click here to see Admin changes to this campaign|Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την εκστρατεία| +Click here to see Admin changes to this record|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το αρχείο| +Click here to see Admin changes to this list|Κάντε κλικ εδώ για να δείτε Διαχειριστής τροποποιήσεις αυτού του καταλόγου| +Click here to see Admin changes to this script|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το σενάριο| +Click here to see Admin changes to this filter|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το φίλτρο| +Click here to see Admin changes to this In-Group|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτή την ομάδα In-| +Click here to see Admin changes to this DID|Κάντε κλικ εδώ για να δείτε τις αλλαγές στο διαχειριστή αυτό το DID| +Click here to see Admin changes to this filter phone group|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το φίλτρο της ομάδας τηλέφωνο| +Click here to see Admin changes to this user group|Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής σε αυτήν την ομάδα χρηστών| +Click here to see Admin changes to this remote agent|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το απομακρυσμένο πράκτορα| +Click here to see Admin changes|Κάντε κλικ εδώ για να δείτε τις αλλαγές Διαχειριστής| +CAMPAIGNS USING THIS SCRIPT|ΕΚΣΤΡΑΤΕΙΕΣ αυτήν τη δέσμη ενεργειών| +IN-GROUPS USING THIS SCRIPT|ΣΕ ΟΜΑΔΕΣ-αυτήν τη δέσμη ενεργειών| +LIST OVERRIDES USING THIS SCRIPT|Παρακάμψεων ΚΑΤΑΛΟΓΟΣ αυτήν τη δέσμη ενεργειών| +ADMIN REPORT OPTIONS|Τις επιλογές διαχείρισης ΕΚΘΕΣΗ| + Inbound |  εισερχόμενος| +Audio File|αρχείου ήχου| +USING THIS IN-GROUP|ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ ΣΤΗΝ ΟΜΑΔΑ-| +Handle Method|Χειριστείτε Μέθοδος| +Search Method|Μέθοδος Αναζήτηση| +USING THIS CALL MENU|Χρησιμοποιώντας αυτό το μενού ΠΡΟΣΚΛΗΣΗ| +DELETE THIS CALL MENU|ΔΙΑΓΡΑΨΕΤΕ αυτό το μενού Κλήση| +Click here to see Admin changes to this CALL MENU|Κάντε κλικ εδώ για να δείτε Διαχειριστής αλλαγές σε αυτό το μενού Κλήση | diff --git a/agc_2-X/trunk/translations/es_language_admin.txt b/agc_2-X/trunk/translations/es_language_admin.txt index 317c70b4..4010d70f 100644 --- a/agc_2-X/trunk/translations/es_language_admin.txt +++ b/agc_2-X/trunk/translations/es_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Ingles| @@ -951,7 +983,7 @@ BUILD|CONSTRUCCION| REPORTS|INFORMES| USERS|USUARIOS| CAMPAIGNS| CAMPAÑAS| -LISTS|LISTAS| +#LISTS|LISTAS| SCRIPTS|ESCRITURAS| FILTERS|FILTROS| IN-GROUPS|EN-GROUPOS| @@ -1479,7 +1511,7 @@ QC Allowed Inbound Groups: |CC permitidas entrantes Grupos:| Queue Priority -<\/B> This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode|Cola de prioridad - Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla| Queue Priority: |Cola de prioridad:| Drop Action: |Caída de Acción:| -Drop Transfer Group: |Grupo de Transferencia de caída:| +Drop Transfer Group|Grupo de Transferencia de caída| Drop Action -<\/B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below|Acción gota - Este menú le permite elegir lo que le sucede a una llamada cuando se ha estado esperando durante más de lo establecido en la Convocatoria de caída Segundos campo. Colgar simplemente colgar la llamada, enviar el mensaje de llamar a la Extensión de caída que ha definido a continuación, Buzón de voz se envía la llamada a la casilla de voz que ha definido a continuación y IN_GROUP enviará la convocatoria a la entrada del Grupo que se define a continuación| Drop Exten -<\/B> If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds|Caída Extensión - En caso de caída de acción se fija a un mensaje, este es el dial plan de ampliación que la convocatoria se enviará a si llega a soltar Convocatoria Segundos| Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Llame a gota Segundos - el número de segundos de una llamada se quedará en la cola antes de ser considerado uno de DROP| @@ -1521,7 +1553,7 @@ code name must be between 2 and 30 characters in length|nombre de código debe e CALL HANGUP REASON STATS|CONVOCATORIA colgar RAZÓN ESTADÍSTICAS| After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE|Horas después de Acción - La acción para llevar a cabo si es después de horas, tal como se definen en el tiempo de atención para este grupo entrante. Colgar inmediatamente colgar la llamada, MESSASGE de reproducir el archivo en el mensaje después de las horas Filenam campo, EXTENSIÓN enviará la llamada a la extensión del horario en el dialplan de voz y se envía la llamada al buzón de voz que figuran en el cuadro Después de horas de voz sobre el terreno , IN_GROUP enviará la convocatoria a la entrada seleccionada en el grupo después de las horas Grupo de Transferencia de seleccionar la lista. El valor predeterminado es MENSAJE| After Hours Transfer Group -<\/B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group|Horas después de la transferencia Grupo - Si después de las horas de Acción se establece en IN_GROUP, la llamada será enviada a este grupo de entrada si ésta entra en el grupo de fuera de la convocatoria régimen de tiempo definido para el grupo en -| -After Hours Transfer Group: |Horas después de la transferencia del Grupo:| +After Hours Transfer Group|Horas después de la transferencia del Grupo| Total calls taken in to this In-Group:|Total de llamadas a adoptarse en este In-Grupo:| CALL HOLD TIME BREAKDOWN IN SECONDS|LLAMADA EN ESPERA TEMNE DE SEGUNDOS| Date Range:|Rango de Fecha:| @@ -2073,8 +2105,8 @@ DOWNLOAD|DESCARGAR| Users|Usuarios| User|Usuario| Reports|Informes| -OUTBOUND|SALIENTE| -INBOUND|Entrantes| +#OUTBOUND|SALIENTE| +#INBOUND|Entrantes| Server Stats and Reports|Estadísticas e Informes servidor| Click here to see a VDAD report for this campaign|Haga clic aquí para ver un informe VDAD para esta campaña| Show DIDs|Mostrar DIDs| @@ -2483,3 +2515,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|Xfer-Conf Número Override| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Todos los usuarios en el sistema, ni siquiera los usuarios registrados| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|La opción NO-logged-in-Agentes permite a todos los usuarios del sistema que se muestra, incluso si no están registrados curently| +Voicemail ID|Correo de voz ID| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Este es el buzón de voz que las llamadas se dirigirán en un AGENTDIRECT en grupo en el tiempo de caída, si el grupo tiene en el método de caída establece en el campo de correo de voz y correo de voz configurado para AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar| +Record Call|Grabar llamadas| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Esta opción le permite definir las llamadas que viene a este DID a ser grabada. Y va a grabar toda la llamada, Y_QUEUESTOP grabará la llamada hasta que la llamada es hungup o entra en una cola en grupo, N no grabar la llamada. Por defecto es N.| +Click here to see a list of recordings and calls for this DID|Haga clic aquí para ver una lista de las grabaciones y las llamadas de este DID| +Ignore List Script Override|No haga caso de anulación de la lista de secuencias de comandos| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Esta opción le permite hacer caso omiso de la ID de la lista de secuencias de comandos opción de anulación de las llamadas que entran en este grupo de pertenencia. Si se establece en Y ignorará cualquier configuración del identificador de la lista de secuencias de comandos. El valor predeterminado es N| +External Server IP|IP del servidor externo| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Esta configuración es donde usted puede poner una dirección IP del servidor o el nombre de otra máquina que se puede utilizar en lugar de la server_ip cuando se utiliza un webphone en la interfaz de agente. Para que esto funcione debe tener también la entrada de teléfonos configurado para utilizar la dirección IP del servidor externo. Por defecto está vacío| +Set As Webphone|Establecer como Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|Al establecer esta opción a Y se intenta cargar un teléfono basado en la web cuando el agente se registra en la pantalla de su agente. Por defecto es N.| +Use External Server IP|Use IP del servidor externo| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Si se utiliza como un teléfono de Internet, usted puede definir a Y para utilizar los servidores IP externa para inscribirse para en lugar de la IP del servidor. Por defecto está vacío| +Default Webphone|Predeterminado Webphone| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Si se establece en 1, esta opción hará que todos los nuevos teléfonos creados han fijado como conjunto Webphone a predeterminado es 0 Y.| +Default External Server IP|IP por defecto del servidor externo| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Si se establece en 1, esta opción hará que todos los nuevos teléfonos creados han Use IP del servidor externo establecida en Y. El valor predeterminado es 0| +Webphone URL|URL del web phone| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|Esta es la URL de la web phone que se utilizará con este sistema, si está habilitada en el registro de los teléfonos que un agente está utilizando. Por defecto está vacío| +AGENT ACTIVITY FOR THIS TIME PERIOD|AGENTE DE LA ACTIVIDAD PARA ESTE PERIODO DE TIEMPO| +these fields are in seconds|estos campos son en segundos| +Enable Agent Disposition Logfile|Habilitar el archivo de registro del Agente Disposición| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Esta opción se conectará a un archivo de registro de texto en el servidor web cada vez que se dispositioned una llamada por un agente. El valor predeterminado es 0, desactivado| +Agent Call Log View|Llamar Ver registro| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Esta opción define si el agente va a ser capaz de ver su registro de llamadas de llamadas atendidas a través de la pantalla del agente Vicidial. El valor predeterminado es N para no o discapacitados| +Agent Call Log View Override|Agente de Registro de llamadas Ver anulación| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Este valor prevalecerá sobre lo que el grupo de usuarios de usuarios se ha fijado para la vista Registro de agentes de llamadas. MINUSVALIDOS utilizan la configuración de grupo de usuarios. N no permitirá que muestra el registro de llamadas los usuarios. Y permitirá mostrar el registro de llamadas del usuario. El valor predeterminado es DISABLED| +Custom Dialplan Entry|Entrada Dialplan personalizada| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Este campo le permite introducir en todos los elementos dialplan que desee para el servidor, las líneas se añadirán a la opción por defecto| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Este campo le permite introducir en todos los elementos dialplan que desee para todos los servidores de Asterisk, las líneas se añadirán a la opción por defecto| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Esta opción le permite introducir líneas personalizadas dialplan en los menús de llamadas, servidores y la configuración del sistema. El valor predeterminado es 0 para los inactivos| +Custom CallerID|Custom CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Cuando se establece en Y, esta opción le permite utilizar el campo security_phrase en la tabla vicidial_list como el identificador de llamadas para enviar al hacer de cada derivación específica. Si este campo no tiene CID en el que a continuación de la Campaña CallerID definido anteriormente se utilizará en su lugar. Esta opción no permite el CallerID lista de anulación, si se encuentra presente un CID en el campo security_phrase. El valor predeterminado es N| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID usará el CID personalizado que se define en el campo de la tabla security_phrase vicidial_list para el plomo| +Scheduled Callbacks Alert|Devoluciones de llamada de alerta programados| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Esta opción permite que la línea de estado devoluciones de llamada en la interfaz de agente a ser de color rojo, parpadear o parpadear en rojo cuando no se AGENTONLY programado devoluciones de llamada que han afectado a su tiempo de disparo y la fecha. El valor predeterminado es NONE para la línea de estado estándar| +QueueMetrics Login-Out|QueueMetrics sesión de salida| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Esta opción afecta al vicidial registrará los inicios de sesión y cierres de sesión de un agente en el queue_log. El valor predeterminado es norma estándar que se utilizará AGENTLOGIN AGENTLOGOFF, devolución de llamada se utiliza AgentCallbackLogin y la gestión de la calidad AGENTCALLBACKLOGOFF que analizará de forma diferente| +Enable CallCard|Habilitar CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Este ajuste permite que las características CallCard con Vicidial para permitir que las personas que llaman utilizar los números de los pines y card_ids que tienen un saldo de minutos y de esos saldos pueden tener el tiempo del agente charla sobre las llamadas del cliente a deducir en los grupos. El valor predeterminado es 0 para discapacitados| +CallCard Access|CallCard acceso| +Agent Transfer Options|Opciones del agente de transferencia| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Estas opciones permiten la desactivación de botones específicos en la sección Encuentros de Transferencia de la interfaz del agente. No está en S para sí o habilitado| +Agent Allow Park Customer Dial Xfer|Permitir al cliente Agente Parque Reenviar Dial| +Agent Allow Dial With Customer Xfer|Agente Permitir Dial Con Reenviar Cliente| +Agent Allow Blind Xfer|Agente Permitir Reenviar Ciegos| +Agent Allow Voicemail Message Xfer|Agente Permitir Reenviar correo de voz de mensajes| +Agent Allow Dial Override Xfer|Agente Permitir Reenviar Dial de anulación| +Agent Allow Consultative Xfer|Agente Permitir Reenviar Consultivo| +Agent Fullscreen|Agente de Pantalla Completa| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Esta opción si se ajusta a Y ajustar la altura y la anchura de la pantalla del agente Vicidial con el tamaño de la ventana del navegador sin ningún tipo de subsidio para la vista de los agentes, las llamadas en vista de cola de llamadas o en la vista Session. El valor predeterminado es N para no o discapacitados| +Add Extension Group|Añadir grupo de extensiones| +New Group Extension Addition|Nuevo grupo de adición de Extensión| +Modify Extension Group|Modificar Grupo de Extensión| +Delete Extension Group|Eliminar grupo de extensiones| +Extension Groups|Grupos de Extensión| +Add Extension Group Entry|Añadir entrada de Grupo de Extensiones| +Extension Group|Grupo de extensiones| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Este campo obligatorio es donde se introduce la ID de grupo que desea que esta extensión para ser puesto en. No hay espacios ni caracteres especiales a excepción de relieve las letras y números| +Extension:|Extensión:| +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Este campo requiere es donde se coloca la extensión de plan de marcado que desea que el agente remoto llama a ser enviadas a la entrada para este grupo de extensiones| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|Este campo le permite clasificar las entradas de grupo de extensión que comparten el mismo grupo de extensiones. El valor predeterminado es 0| +Campaigns Groups|Campañas Grupos| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|En este campo se puede poner una lista de identificadores de campaña y de entrada o ID de grupo que desee restringir el uso del grupo de extensión para. Lista debe ser separado por tuberías y tiene un tubo al principio y al final de la cadena| +EXTENSION GROUP ENTRY NOT ADDED|ENTRADA DE EXTENSIÓN DEL GRUPO NO ESTÁ SUJETA| +there is already an extension group entry with these values|ya hay una entrada de grupo de extensión con estos valores| +EXTENSION GROUP ENTRY ADDED|Entrada de extensión grupo añadió| +MODIFY AN EXTENSION GROUP ENTRY|Modificar una entrada de grupo de extensiones| +Click here to see Admin chages to this extension group entry|Haga clic aquí para ver chages administrador a esta entrada a grupo de extensiones| +DELETE THIS EXTENSION GROUP ENTRY|Borrar esta entrada del grupo de extensiones| +Call Count Today|Recuento de llamadas Hoy| +Last Call Time|Última llamada| +Last Call ID|Identificación de Última Convocatoria| +EXTENSION GROUP ENTRY NOT MODIFIED|ENTRADA DE EXTENSIÓN DEL GRUPO SIN MODIFICAR| +EXTENSION GROUP ENTRY MODIFIED|ENTRADA DE EXTENSIÓN DEL GRUPO MODIFICADO| +EXTENSION GROUP ENTRY NOT DELETED|ENTRADA DE EXTENSIÓN DEL GRUPO NO DELETED| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|GRUPO DE EXTENSIÓN DE ENTRADA LA ELIMINACIÓN DE CONFIRMACIÓN| +Click here to delete extension group entry|Haga clic aquí para eliminar la entrada de extensión del grupo| +EXTENSION GROUP ENTRY DELETION COMPLETED|GRUPO DE EXTENSIÓN BORRADO de inscripción debidamente cumplimentado| +EXTENSION GROUP LISTINGS|LISTADOS DE EXTENSIÓN DEL GRUPO| +Extension Group|Grupo de extensiones| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Si se establece en algo distinto de NONE o vacíos de este anula el campo de la extensión externa y utilizar las entradas de grupo de extensiones que tienen el ID de la extensión del mismo grupo. El valor predeterminado es NONE para desactivar| +Click here to see agents logged in to this inbound group|Haga clic aquí para ver los agentes registrados en este grupo de entrada| +Agent Choose Blended|Agente Elija Blended| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Esta opción, si se establece en 1 permite al usuario elegir si el agente tiene su conjunto de la campaña de mezclado o no, y si no, entonces el valor predeterminado de mezcla se utilizará. El valor predeterminado es 1 para habilitado| +Click here to see a log of the uploads to the audio store|Haga clic aquí para ver un registro de los archivos de audio a la tienda| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Esta opción, si se pone a 0 no se pone en la entrada CALLSTATUS en queue_log cuando un agente de las disposiciones de una llamada. El valor predeterminado es 1 para habilitado| +QM CallStatus Override|QM CallStatus anulación| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Si la integración QueueMetrics está activada en la configuración del sistema, esta configuración permite la primordial de la configuración del sistema de ajuste de las entradas CallStatus queue_log. El valor predeterminado es DISABLED que utilizará la configuración del sistema| +Extension Append CID|Anexar extensión de CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Si está activado, las llamadas realizadas a partir de esta campaña tendrá un espacio y la extensión telefónica del agente añade al final del nombre de CallerID de la llamada antes de ser enviada al agente. Defecto es n para discapacitados| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Si está activado, las llamadas que vienen de este grupo en-tendrá un espacio y la extensión telefónica del agente anexa al final del nombre de CallerID para la llamada antes de ser enviada al agente. Defecto es n para discapacitados| +Scheduled Callbacks Count|Rellamadas programadas Conde| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Esta opción le permite definir si sólo las devoluciones de llamada LIVE, el usuario sólo devoluciones de llamada programadas que han afectado a la fecha de activación y el tiempo, o devoluciones de llamada de ALL_ACTIVE, el usuario sólo las devoluciones de llamada que están activos en el sistema, así como las devoluciones de llamada VIVOS, BE3 debe contar int que agente de devolución de llamada de alerta sección en la pantalla del agente. El valor predeterminado es ALL_ACTIVE| +Realtime Block User Info|Bloqueo en tiempo real Información del Usuario| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Este ajuste, si se pone a 1 se bloqueará la información del usuario y la estación de que se muestre en el informe en tiempo real. El valor predeterminado es 0 para discapacitados| +Manual Dial Override|Marcación manual de anulación| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|El ajuste puede anular los Usuarios de ajuste de la capacidad de marcado manual para los agentes, cuando éstos son registrados en esta campaña. NINGUNO seguirá el ajuste de los usuarios, ALLOW_ALL permitirá que cualquier agente registrado en esta campaña para hacer llamadas marcación manual, DISABLE_ALL no permitirá que nadie ha iniciado sesión en esta campaña para hacer llamadas marcación manual. El valor predeterminado es NINGUNO| +Blind Monitor Warning|Advertencia Monitor de Ciegos| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Esta opción le permitirá si está habilitado el agente conoce de varias formas opcionales si están siendo ciego controlados por alguien. DISABLED significa que esta función no está activa, alerta sólo aparecerá una alerta en la pantalla el agente, la notificación se publique una nota que permanece en la pantalla el agente, siempre y cuando theyâ Re siendo monitoreados, de audio reproducirá el nombre define a continuación cuando un agente está empezando a ser monitoreados y las otras opciones son combibnations de las opciones anteriores. El valor predeterminado es DISABLED| +Blind Monitor Notice|Ciegos Aviso monitor| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Este es el mensaje que aparecerá en la pantalla del agente, mientras que están siendo monitoreados, si la opción se ha seleccionado AVISO. El valor predeterminado es| +Blind Monitor Filename|Nombre del Monitor de Ciegos| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Este es el archivo de audio que se reproducirá en la sesión de los agentes en el inicio del monitoreo que alguien les ciega. Este mensaje se reproducirá para todo el mundo, en la sesión, incluyendo al cliente si está presente. Por defecto está vacío| +Uniqueid Status Display|Pantalla de estado UniqueId| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Si está activado, cuando un agente recibe una llamada a través de este dentro del grupo que verá la identificación única de la llamada añadido a la línea de estado en su interfaz de agente. La opción de prefijo se añade el prefijo definido golpe en el comienzo de la uniqueid en la pantalla. El valor predeterminado es DISABLED. Si ya existía una identificación única definida en una llamada de entrar en este grupo de pertenencia, la identificación única original, se mostrará| +Uniqueid Status Prefix|Prefijo de Estado UniqueId| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Si la opción está seleccionada por encima de PREFIJO entonces este es el valor de ese prefijo. Por defecto está vacío| +Default Codecs|Códecs predeterminados| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|Se puede definir una lista delimitada por comas de los codecs que se establecerá como los codecs por defecto para todos los sistemas. Opciones para los codecs son ulaw, alaw, gsm, G729, Speex, G722, G723, G726, iLBC, ... Por defecto está vacío| +Allowed Codecs|Codecs animales| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|Se puede definir una lista delimitada por comas de los codecs que se establecerá como los codecs por defecto para este teléfono. Opciones para los codecs son ulaw, alaw, gsm, G729, Speex, G722, G723, G726, iLBC, ... Algunos de estos codecs pueden no estar disponibles en su sistema, como el G729 o G726. Si el campo está vacío, entonces los codecs por defecto del sistema o la entrada de teléfono por encima de éste se utilizará para los codecs permitidos. Por defecto está vacío| +Allowed Codecs With Template|Códecs de animales con plantilla| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Al establecer esta opción en 1, se incluyen los códecs definidos anteriormente, incluso si un archivo de plantilla se utiliza conf. El valor predeterminado es 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Si la opción PRESERVE se utiliza y la llamada se envía a un segundo agente, la identificación única y el prefijo de muestra para el primer agente también se mostrará en el segundo agente| +Custom Fields Modify|Modificar campos personalizados| +This option if set to 1 allows the user to modify custom list fields|Esta opción, si el valor 1 permite al usuario modificar los campos personalizados de la lista| +ERROR: Custom Fields are not active on this system|ERROR: Los campos personalizados no están activos en este sistema| +Lists Custom Field|Muestra una lista de campos personalizados| +Field Label|Campo Etiqueta| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Este es el identificador de campo de base de datos para este campo. Esto tiene que ser un identificador único dentro de los campos personalizados de la lista. No use espacios ni signos de puntuación para este campo. máximo de 50 caracteres, mínimo de 2 caracteres| +Field Name|Nombre del campo| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|Este es el nombre del campo como aparecerá a un agente a través de su interfaz. Puede utilizar los espacios en este campo, pero no caracteres puntuacion, un máximo de 50 caracteres y un mínimo de 2 caracteres| +Field Description|Campo Descripción| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|La descripción de este campo tal y como aparecerá en la interfaz de administración. Este es un campo opcional con un máximo de 100 caracteres| +Field Rank|Rango de campo| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|El orden en que estos campos se muestra al agente de menor a mayor en la parte superior en la parte inferior| +Field Help|Campo de Ayuda| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Campo opcional, si usted lo llene, el agente será capaz de ver este texto al hacer clic en un vínculo de ayuda al lado del campo en su interfaz de agente| +Field Type|Tipo de campo| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Esta opción define el tipo de campo que se mostrará. TEXTO es un estándar de una sola línea formulario de participación, el área es un cuadro de texto de varias líneas, SELECT es una selección única menú desplegable, MULTI es una caja de selección múltiple, RADIO es una lista de botones de radio, donde sólo una opción puede ser seleccionado, CheckBox es una lista de casillas de verificación, donde múltiples opciones pueden ser seleccionadas, la fecha es un calendario día mes año emergente donde el agente puede seleccionar la fecha y hora es un cuadro de selección del tiempo. El valor predeterminado es TEXT. Para las opciones de SELECT, MULTI, radio y checkbox debe definir los valores de las opciones a continuación en el cuadro Opciones de campo| +Field Options|Opciones de campo| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Para el SELECT, RADIO MULTI, y los tipos de casillas de verificación de campo, debe definir los valores de las opciones en este cuadro. Usted debe poner una lista de la etiqueta de opción separados por comas y el texto de opción aquí con cada opción de una línea propia. El primer valor no debe tener espacios en él, y ninguno de los valores debe tener ninguna puntuacion. Por ejemplo - electric_meter, medidor eléctrico| +Field Size|Tamaño del campo| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Este ajuste significa cosas diferentes en función de lo que el tipo de campo es. Para los campos de texto, el tamaño es el número de caracteres que se muestran en el campo. Para los campos de la zona, el tamaño es el ancho del cuadro de texto en caracteres. Para los campos de MULTI, este valor define el número de opciones que se muestran en la lista de selección múltiple. Para SELECT, RADIO, CheckBox, FECHA y HORA esta configuración se omite| +Field Max|Campo Max| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Este ajuste significa cosas diferentes en función de lo que el tipo de campo es. Para TEXT, campos ocultos y ReadOnly, el tamaño es el número máximo de caracteres que se permiten en el campo. Para los campos de interés, este campo define el número de filas de texto visible en el cuadro de texto. Para MULTI, SELECT, RADIO, CheckBox, FECHA y HORA esta configuración se omite| +Field Cost|Costo de campo| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Este campo de sólo lectura que indica cuál es el costo de este campo está en la tabla de campos personalizados para esta lista. No hay ningún límite para el número de campos personalizados que puedes tener en una lista, pero el total del costo de todos los campos de la lista debe estar por debajo de 65000. Normalmente, esto permite que cientos de campos, pero si se especifica varios campos de texto que son cientos o miles de caracteres de longitud, entonces pueden alcanzar el límite rápidamente. Si necesita que la cantidad de texto en un campo que debe elegir un tipo de zona, que se almacenan de forma diferente y no utiliza espacio de tabla tanto| +Field Required|Campo Obligatorio| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Si se establece en Y, en este campo hará que el agente para introducir texto o seleccionar una opción en este campo. El valor predeterminado es N| +Field Default|Campo por defecto| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Este campo opcional le permite definir qué valor asigna a un campo si no se carga en ese campo. El valor predeterminado es NULL, que desactiva la función por defecto| +MODIFY FIELDS|MODIFICAR LOS CAMPOS| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|LISTA DE LISTA DE CONTAR con campos personalizados| +SUMMARY OF FIELDS|RESUMEN DE CAMPOS| +ADD A NEW CUSTOM FIELD FOR THIS LIST|Agregar un campo personalizado NUEVO PARA ESTA LISTA| +ERROR: Field does not exist|ERROR: El campo no existe| +ERROR: Table does not exist|ERROR: La tabla no existe| +ERROR: Field already exists for this list|ERROR: El campo ya existe para esta lista| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|HAGA CLICK AQUI PARA confirmar la eliminación de este campo personalizado| +THIS CUSTOM FIELD HAS BEEN DELETED|Este campo personalizado HA SIDO BORRADO| +Records in this custom table|Los registros en esta tabla personalizada| +EXAMPLE OF CUSTOM FORM|EJEMPLO DE LA FORMA PERSONALIZADA| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Para los tipos de campo de fecha, el valor por defecto siempre se establece en la actualidad a menos que el número se pone en en cuyo caso la fecha será el que muchos días, más o menos en la actualidad. Para los tipos de campo de tiempo, el valor por defecto se establece siempre en la hora actual del servidor a menos que el número se pone en en cuyo caso el tiempo será el que durante muchos minutos, más o menos la hora actual| +MODIFY EXISTING FIELDS|MODIFICAR campos existentes| +Field Name Position|Campo Posición Nombre| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|Si se establece a izquierda, esta el nombre del campo aparecerá a la izquierda del campo, si se establece al principio El nombre del campo se ocupará de toda la línea y aparecerá sobre el campo. Defecto es de izquierda| +Option Position|Opción Posición| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Para los tipos de campo CheckBox y sólo en la radio, si se establece HORIZONTAL las opciones van a aparecer en la misma línea, posiblemente, envolviendo a la línea de abajo si hay muchas opciones. Si se establece en VERTICAL sólo habrá una opción por línea. El valor predeterminado es HORIZONTAL| +Hold Time Option Minimum|Mantenga mínima opción de tiempo| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Si la opción Hold Time habilitada, este es el número mínimo de segundos que la llamada debe esperar antes de que se le presentará la opción de tiempo de espera. La opción de tiempo de espera de inmediato se presentará en este momento si el tiempo de espera estimado es mayor que el tiempo de retención Opción Segundos valor. El valor predeterminado es 0 segundos| +ADDING COPIED CARRIER|AGREGAR CARRIER COPIADO| +ADD COPIED CARRIER|Añadido de los operadores COPIADO| +Source Carrier|Fuente Carrier| +COPIED CARRIER ADDED|CARRIER copiaban agregaban| +Copy A Carrier|Copie Un Transportista| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Campo OrderIf más de un campo tiene el mismo rango, que se colocará en la misma línea y se colocarán en orden por el valor de menor a mayor, de izquierda a derecha| +Copy Fields to Another List|Copie los campos a otra lista| +List ID to Copy Fields to|Lista de ID para copiar campos de| +List ID to Copy Fields From|Lista de ID para copiar campos de| +Copy Option|Copia Opción| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Al copiar las definiciones de campo de una lista a otra, usted tiene algunas opciones para cómo funciona el proceso de copia. APPEND agregar los campos que no están presentes en la lista de destinos, si no se pongan en venta las etiquetas de los campos voluntad permanecido relativamente intactas, no hay datos de campos personalizados serán borrados o modificados por esta opción. UPDATE actualizar los campos comunes field_label en la lista de destinos a las definiciones de los campos de la lista de origen. datos de campos personalizados pueden ser modificados o perdidos mediante esta opción. REPLACE se eliminarán todos los campos personalizados existentes en la lista de destinos y reemplazarlos con los campos personalizados de la lista de fuentes, todos los datos de campos personalizados se pueden borrar con esta opción| +ERROR: Source list has no custom fields|ERROR: no tiene lista de fuentes de campos personalizados| +SUCCESS: Custom Field Added|ÉXITO: ​​Campo personalizado Alta| +SUCCESS: Custom Field Modified|ÉXITO: ​​Campo personalizado Modificado| +SUCCESS: Custom Field Deleted|ÉXITO: ​​Campo personalizado eliminados| +Copy List Custom Fields|Copiar campos de lista personalizados| +ERROR: You cannot copy fields to the same list|ERROR: No se puede copiar los campos a la misma lista| +DISPLAY will display only and not allow for modification by the agent|DISPLAY se visualizará y no permitir la modificación introducida por el agente de| +Hold Time Option Callmenu|Mantenga Callmenu Tiempo Opción| +Hold Time Option Press Filename|Mantenga la opción Time Nombre del archivo de prensa| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Si Opción Hold Time está ajustado a CALL_MENU, este es el menú de llamadas que el llamado se enviará a si el tiempo de espera estimada supera los Segundos Tiempo de Espera de opciones| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Si la opción Hold Time está establecido en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega, si el tiempo de espera estimado superior a los Segundos Tiempo de Espera de opciones para dar al cliente la opción de pulsar 1 en su teléfono para ejecutar el tiempo de retención seleccionado Pulse Opción. Es muy importante que este archivo de audio es de 10 segundos o menos, o habrá problemas. El valor predeterminado es a-ser-llamada-back| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Si una de las opciones PRESS_ está seleccionada, se reproducirá el nombre de archivo de prensa se define más adelante y dar al cliente la opción de pulsar 1 en su teléfono para salir de la cola y ejecutar la opción seleccionada| +Hold Time Option After Press Filename|Mantenga la opción Tiempo Después de Archivo de Prensa| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Si la opción Hold Time está establecido en una de las opciones PRESS_ o CALLERID_CALLBACK, este es el símbolo de nombre de archivo que se juega después de que el cliente haya presionado 1 o la llamada ha sido añadido a la lista de devolución de llamada| +Inbound Queue No Dial|Cola de entrada n º telefónico| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Esta función está establecida en Activada le permite evitar el marcado automático de salida de esta campaña si hay llamadas entrantes esperando en la cola que forman parte de los grupos entrantes permitidas establecidas en la presente campaña. Si se establece en ALL_SERVERS va a cambiar el algoritmo de cálculo para todas las llamadas entrantes como las llamadas activas en este servidor, incluso si están en otro servidor que reducirá la posibilidad de colocar innecesarias las llamadas salientes si tiene llamadas que entran en otro servidor. El valor predeterminado es DISABLED| +After Hours Filename Override|Después de anulación Nombre Horas| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|Estos campos le permiten anular el mensaje horas después para los grupos de entrada si se ha definido a algo. Por defecto está vacío| +On Hold Prompt No Block|Preguntar en espera ningún bloque| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada en espera cuando el sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras el mensaje en espera Nombre del sistema está jugando a un cliente que no puede ser enviado a un agente. El valor predeterminado es N| +On Hold Prompt Seconds|Segundos en espera prontas| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Este campo debe ser establecido en el número de segundos que el nombre de archivo en espera del sistema juega. El valor predeterminado es 10| +Hold Time Option Press No Block|Hold Time Prensa opción No Bloquear| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada donde nos depara el tiempo de la opción Archivo de Prensa del sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras que el tiempo de retención Pulse la tecla Opción mensaje Nombre está jugando a un cliente que no puede ser enviado a un agente. Por defecto es N| +Hold Time Option Press Filename Seconds|Tiempo de espera Opción Segundos Nombre de archivo de prensa| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Este campo debe ser establecido en el número de segundos que el tiempo de retención de la opción Archivo de Prensa juega. El valor predeterminado es 10| +CallCard Generate New Numbers|CallCard generar nuevos números| +Call Menu In-Group Settings|Llame al menú en la configuración del grupo de| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Si la ruta se establece en endogrupal entonces hay muchas opciones que se pueden establecer para definir cómo la llamada se envía a en la cola. Dentro del grupo es el grupo de entrada que desea que la llamada para ir a. Método de Mango es la forma en que desea que la llamada se maneja| +Click here to see a list of the available handle methods|Haga clic aquí para ver una lista de los métodos de mango disponibles| +VID Enter Filename|VID Ingrese Nombre del archivo| +VID ID Number Filename|VID ID Nombre del archivo Número| +VID Confirm Filename|VID Confirmar Archivo| +VID Digits|VID dígitos| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Método de búsqueda define la forma en la cola se encuentra el siguiente agente, recomendamos dejarlo en LB. Identificación de lista es la lista que la nueva pista se inserta en, también, si el método no es un método de búsqueda y el plomo no se encuentra. ID de campaña es la campaña para buscar a través de listas si uno de los métodos de RC se utiliza. Código de teléfono es la entrada del campo phone_code por el liderato con el que se inserta. VID Ingrese Nombre del archivo se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida a pedir al cliente que introduzca su identificación. VID Nombre Número de identificación se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida después de cliente entra en su documento de identidad, algo así como que ha introducido. VID Nombre Confirmar si se utiliza el método se ajusta a uno de los métodos VIDPROMPT, es el símbolo del sistema de audio reproducida para confirmar su identidad, algo así como tecla 1 para confirmar y 2 para volver a entrar. Dígitos VID se utiliza si el método se ajusta a uno de los métodos VIDPROMPT, si se establece en un número que es el número de dígitos que deben ser introducidos por el cliente cuando se le solicite para su identificación, si se establece en vacío o X, entonces la cliente tendrá que presione la tecla o hash para terminar su entrada de su documento de identidad| +Admin Web Directory|Directorio Web de administración| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Este es el directorio que el contenido de la web Administación, como admin.php, son in por defecto es vicidial. Para averiguar el directorio web de administración, es todo lo que está entre el nombre de dominio y el admin.php en la dirección URL de esta página, sin las barras de inicio y finalización| +TTS Voice|TTS Voz| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|Aquí es donde se define la voz para ser utilizado en la generación de TTS. El valor predeterminado es Allison-8kHz| +Default Field Labels|Las etiquetas de campo predeterminadas| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Estos 19 campos le permiten establecer el nombre tal y como aparecerá en la interfaz de agente de Vicidial, así como la página principal de modificación administrativa. El valor predeterminado es vacío, que utilizará los valores por defecto en el código en la interfaz de agente| +Label Title|Etiqueta del título| +Label First Name|Etiqueta Nombre| +Label Middle Initial|Etiqueta inicial del segundo nombre| +Label Last Name|Etiqueta Apellido| +Label Address1|Etiqueta Dirección1| +Label Address2|Etiqueta de Dirección 2| +Label Address3|Etiqueta Dirección3| +Label City|Etiqueta de la Ciudad| +Label State|Sello del Estado| +Label Province|Etiqueta Provincia| +Label Postal Code|Etiqueta Código postal| +Label Vendor Lead Code|Vendedor de etiquetas de código de plomo| +Label Gender|Etiqueta de Género| +Label Phone Number|Etiqueta de número de teléfono| +Label Phone Code|Etiqueta de código de teléfono| +Label Alt Phone|Etiqueta de teléfono Alt| +Label Security Phrase|Etiqueta Frase de Seguridad| +Label Email|Etiqueta de correo electrónico| +Label Comments|Comentarios de etiquetas| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|No se recomienda establecer las llamadas entrantes a una prioridad más alta que las llamadas salientes de la campaña porque la gente de llamadas en espera que esperar a la gente que se llama espera a alguien para estar allí en el teléfono| +Formerly called Conf File Secret|Anteriormente conocido como Secreto Conf. Archivo| +Registration Password|Registro Contraseña| +Login Password|Inicio de sesión Contraseña| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|Es la contraseña para el usuario del teléfono para acceder a las aplicaciones cliente basadas en la Web. Importante, esta es la contraseña sólo para el inicio de sesión Web agente de interfaz del teléfono, para cambiar la contraseña de sip.conf o iax.conf, o secreta, para este dispositivo móvil tiene que modificar la contraseña de registro en el siguiente campo| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|Script también mostrará solamente, sino que son capaces de utilizar las variables de secuencia de comandos al igual que en la función de secuencias de comandos. Campos de secuencia de comandos también sólo muestran el contenido de las opciones, y no el nombre del campo como el tipo de pantalla| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|También puede incluir los campos predeterminados Vicidial en una configuración de campo personalizado, y los verás en rojo en la lista. Estos campos no se añadirá a la tabla de lista de base de datos personalizada, la interfaz del agente en cambio, referencia a la tabla vicidial_list directamente. Las etiquetas que se pueden utilizar para incluir a los fieds por defecto son| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Si los campos de lista personalizados están habilitados en su sistema, FORMA abrirá la ficha del formulario cuando la conexión de una llamada a un agente| +Enable Custom List Fields|Habilitar Lista de campos personalizados| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Esta configuración permite que la función de los campos de lista personalizada que permite a los campos de datos personalizados que se definen en la interfaz web de administración en función de cada lista y luego hacer que los campos disponibles en una ficha de formulario al agente en la interfaz web del agente. El valor predeterminado es 0 para discapacitados| +CUSTOM FIELDS FOR THIS LEAD|Campos personalizados para ESTE CABLE| +Slave Database Server|Esclavo del servidor de base de datos| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Si usted tiene un esclavo MySQL base de datos a continuación, introduzca la dirección IP local para que el servidor aquí. Esta opción sólo se usa actualmente por los informes seleccionados en la siguiente opción y no tiene nada que ver con la configuración automática de MySQL maestro-esclavo de replicación. El valor predeterminado es vacío para discapacitados| +Reports to use Slave DB|Informes de utilizar DB Esclavo| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Esta opción le permite seleccionar los informes que desea que se utilice la base de datos MySQL de esclavos como se define en la opción anterior en lugar de la base de datos maestra de que su sistema Vicidial vivo se está ejecutando. Usted debe configurar el esclavo de replicación de MySQL antes de habilitar esta opción. El valor predeterminado es vacío para discapacitados| +Custom fields defined for this list|Los campos personalizados definidos para esta lista| +Go to the list modification page for this list|Ir a la página de modificación de la lista para esta lista| +Estimated Hold Time Option|Espera estimado Opción Tiempo| +Hold Time Second Option|Mantenga la opción segunda vez| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Igual que el campo Opción Hold primera vez que el anterior, excepto éste comprobará si el cliente pulsa el botón 2. El valor predeterminado es NINGUNO. Si no hay ninguna opción Hold primera vez que se selecciona esta opción no se le ofrecerá| +Hold Time Third Option|Mantenga la opción tercera vez| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Igual que el campo Opción Hold primera vez anterior, pero éste comprobará si el cliente pulsa la tecla 3. El valor predeterminado es NINGUNO. Si no hay ninguna opción Hold segunda vez se selecciona esta opción no se le ofrecerá| +Wait Time Option|Espere Opción Tiempo| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Esto le permite ofrecer a los clientes opciones para salir de la cola si su tiempo de espera es más de la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNO. Si una de las opciones PRESS_ está seleccionada, se reproducirá el nombre de archivo de prensa se define más adelante y darle al cliente la opción de pulsar 1 en su teléfono para salir de la cola y ejecutar la opción seleccionada. La opción PRESS_STAY le enviará al cliente a la cola sin perder su lugar en la fila| +Wait Time Second Option|Espere Opción segunda vez| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Igual que el campo de opción de espera primera vez que el anterior, excepto éste comprobará si el cliente pulsa el botón 2. El valor predeterminado es NINGUNO. Si no hay ninguna opción Tiempo de espera del primero se selecciona esta opción no se le ofrecerá| +Wait Time Third Option|Espere Opción tercera vez| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Igual que el campo Opción Espera primera vez anterior, pero éste comprobará si el cliente pulsa la tecla 3. El valor predeterminado es NINGUNO. Si no hay ninguna opción Tiempo de espera del segundo lugar se selecciona esta opción no se le ofrecerá| +Wait Time Option Seconds|Espere unos segundos tiempo de la opción| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Si la opción Tiempo de espera se establece en algo, pero NINGUNO, este es el número de segundos que el cliente ha estado esperando en la cola que activará las opciones de tiempo de espera. Por defecto es 120 segundos| +Wait Time Option Extension|Espere plazo de prórroga de la opción| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Si la opción Tiempo de espera se establece en PRESS_EXTEN, esta es la extensión de plan de marcado que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción| +Wait Time Option Callmenu|Espere Callmenu Tiempo Opción| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Si la opción Tiempo de espera se establece en PRESS_CALLMENU, este es el menú de llamada que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción| +Wait Time Option Voicemail|Espera Tiempo de correo de voz opcional| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Si la opción Tiempo de espera se establece en PRESS_VMAIL, este es el buzón de voz que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción. En un AGENTDIRECT en grupo, dejando esto en AGENTVMAIL se seleccione el ID de buzón de voz del usuario para utilizar| +Wait Time Option Transfer In-Group|Espera Tiempo de Transferencia opción dentro del grupo| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Si la opción Tiempo de espera se establece en PRESS_INGROUP, este es el grupo de entrada que la llamada se enviará a si el cliente pulsa la tecla de opción cuando se presentan con la opción| +Wait Time Option Press Filename|Espere Opción Tiempo Archivo de Prensa| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Si la opción Tiempo de espera se establece en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega, si el tiempo de espera de clientes que supera los segundos de tiempo de espera de opciones para dar al cliente la opción de pulsar 1, 2 o 3 en su teléfono para ejecutar los seleccionados de espera las opciones de esta edición. Es muy importante que incluya las opciones en el archivo de audio para todas las opciones seleccionadas tiempo de espera, y que la longitud del archivo de audio en cuestión de segundos está bien definido en el campo Nombre de archivo segundos por debajo o habrá problemas. El valor predeterminado es a-ser-llamada-back| +Wait Time Option Press No Block|Espere Prensa opción de tiempo de ningún bloque| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Al establecer esta opción a Y permitirá que las llamadas en fila detrás de una llamada cuando el Tiempo de espera Pulse la tecla Opción Nombre del sistema está jugando para ir a un agente, si uno está disponible, mientras que el mensaje es reproducido. Mientras que el tiempo de espera Pulse la tecla Opción mensaje de nombre de archivo está jugando a un cliente que no puede ser enviado a un agente. El valor predeterminado es N| +Wait Time Option Press Filename Seconds|Tiempo de espera Opción Segundos Nombre de archivo de prensa| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Este campo debe ser establecido en el número de segundos que el tiempo de espera de la opción Archivo de Prensa juega. El valor predeterminado es 10| +Wait Time Option After Press Filename|Espere Opción Tiempo Después de Archivo de Prensa| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Si la opción Tiempo de espera se establece en una de las opciones PRESS_, este es el símbolo de nombre de archivo que se juega después de que el cliente haya presionado 1, 2 o 3| +Wait Time Option Callback List ID|Espere opción Tiempo de devolución de llamada ID Lista| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Si la opción Tiempo de espera se establece en PRESS_CID_CALLBACK, este es el ID de la lista de la llamada se añade como una nueva pista, si el cliente pulsa la tecla opción cuando se presentan con la opción| +Wait Hold Option Priority|Espera tener prioridad Opción| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Si ambas opciones estimado tiempo de retención y Wait opciones de tiempo son activos, esta configuración definirá si una, otra o ambas de estas funciones están activas. Por ejemplo, si la opción de espera Tiempo estimado se establece en 360, la opción Tiempo de espera está establecido en 120 y el cliente ha estado esperando durante 120 segundos y todavía hay 400 segundos el tiempo de espera estimado, entonces ellos están activos al mismo tiempo, y este valor será revisado para ver qué opciones se ofrecen. El valor predeterminado es esperar sólo| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|Las opciones de bloqueados se utiliza para bloquear el valor en el botón de transferencia rápida, incluso si el agente utiliza las características de transferencia de la conferencia durante una llamada antes de utilizar el botón de transferencia rápida| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|COLGAR colgará la llamada cuando el temporizador se activa, se CALLMENU enviar la llamada al menú de llamadas especificado en el campo de acción del temporizador de destino, EXTENSIÓN enviará la llamada a la extensión que se especifica en el campo de acción del temporizador de destino, IN_GROUP enviará la llamada a la En-Grupo especificado en el campo de acción del temporizador de destino| +Timer Action Destination|Temporizador de destino Acción| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Este campo es donde se especifica el menú de llamada, extensión o en grupo que desea la convocatoria enviada a si la acción de hora está en la CALLMENU, prórroga o IN_GROUP. Por defecto está vacío| +You must enter field options when adding a|Usted debe entrar en las opciones de campo cuando se agrega un| +You must enter field options when updating a|Usted debe entrar en las opciones de campo cuando se actualiza un| +Allowed Reports|Informes de animales| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Si un usuario en este grupo se establece en el nivel de usuario 7 o superior, entonces esta función se puede utilizar para restringir los informes que los usuarios pueden ver. El valor predeterminado es ALL. Si desea seleccionar más de un informe a continuación, pulse la tecla Ctrl de su teclado mientras selecciona los informes| +You are not allowed to view this report|No tienes permiso para ver este informe| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - se incluyen las listas de inactivos en la búsqueda de la cantidad| +Add-Delete DNC Number|Agregar-Eliminar Número de DNC| +Add DNC Number|Agregar número de DNC| +Copy Custom Fields|Copia de campos personalizados| +Add Filter Phone Group|Agregar Grupo de teléfono Filtro| +New Filter Phone Group|Grupo Nuevo Teléfono filtro| +Modify Filter Phone Group|Modificar Grupo de teléfono Filtro| +Delete Phone Filter Group|Eliminar filtro Group Teléfono| +Filter Phone Groups|Filtrar Grupos de teléfono| +Filter Phone Group ID|Teléfono filtro ID de grupo| +Filter Phone Group Name|Teléfono Filtro Nombre del grupo| +Filter Phone Group Description|Teléfono Filtro Descripción del Grupo| +PHONE FILTER GROUP NOT ADDED|TELÉFONO DEL GRUPO FILTRO NO ESTÁ SUJETA| +there is already a PHONE FILTER GROUP in the system with this ID|ya hay un grupo de telefonía filtro en el sistema con este ID| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|Teléfono ID de grupo del filtro debe ser entre 2 y 20 caracteres de longitud y no contienen| +PHONE FILTER GROUP ADDED|Group Teléfono filtro añadido| +Add Filter Phone Group|Agregar Grupo de teléfono Filtro| +Add-Delete FPG Number|Agregar-Eliminar FPG Número| +Add FPG Number|Agregar número de FPG| +FILTER PHONE GROUP NOT MODIFIED|GRUPO DE TELÉFONO DEL FILTRO SIN MODIFICAR| +FILTER PHONE GROUP MODIFIED|GRUPO DE TELÉFONO filtro modificado| +FILTER PHONE GROUP NOT DELETED|GRUPO DE TELÉFONO DEL FILTRO NO DELETED| +Click here to delete FILTER PHONE GROUP|Haga clic aquí para borrar GRUPO DE TELÉFONO DEL FILTRO| +FILTER PHONE GROUP DELETION CONFIRMATION|GRUPO DE FILTRO DE TELÉFONO ELIMINACIÓN DE CONFIRMACIÓN| +FILTER PHONE GROUP DELETION COMPLETED|SUPRESIÓN DEL FILTRO DEL GRUPO COMPLETO TELÉFONO| +Click here to see Admin chages to this filter phone group|Haga clic aquí para ver chages de administrador para este grupo de teléfono del filtro| +DELETE THIS FILTER PHONE GROUP|Eliminar este grupo TELÉFONO DEL FILTRO| +FILTER PHONE GROUP LISTINGS|Filtrar los resultados del grupo de teléfono| +Filter Phone Group Numbers|Filtrar números de teléfono del grupo| +This phone number is not in the Filter Phone Group List|Este número de teléfono no está en la lista de teléfonos como filtro de grupo| +This phone number is already in the Filter Phone Group List|Este número de teléfono ya está en la lista de teléfonos como filtro de grupo| +FILTER PHONE GROUP NUMBER NOT DELETED|FILTRO TELÉFONO NÚMERO DE GRUPO NO DELETED| +FILTER PHONE GROUP NUMBER DELETED|FILTRO TELÉFONO NÚMERO DE GRUPO Shakira| +FILTER PHONE GROUP NUMBER NOT ADDED|NÚMERO DE TELÉFONO DEL FILTRO DEL GRUPO NO ESTÁ SUJETA| +FILTER PHONE GROUP NUMBER ADDED|Número de filtro grupo de telefonía AGREGADOS| +Numbers in this Filter Phone Group|Los números en este Grupo de teléfono Filtro| +There are no phone numbers in list|No hay números de teléfono en la lista| +There are no leads in Campaign DNC list|No hay pistas en la lista de Campaña DNC| +There are no leads in this filter phone group|No hay pistas de este grupo de teléfono del filtro| +Click here to download the numbers in this filter phone group|Haga clic aquí para descargar los números de teléfono en este grupo de filtro| +Filter Inbound Number|Número de entrada del filtro| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Esta opción si está activada permite filtrar las llamadas que entran en este DID y enviarlos a una acción alternativa si coinciden con un número de teléfono que hay en el grupo de teléfonos, filtro o una respuesta de dirección si ha configurado una. El valor predeterminado es DISABLED. GRUPO buscará en un grupo de Teléfono del filtro. URL enviar una dirección URL y se ajustará si uno es enviado de vuelta| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Si el campo Filtro Número de entrada se cambia al grupo, entonces este es el ID del Grupo de teléfono de filtro que tiene el número de sus búsquedas en busca de una coincidencia con el número de identificador de llamadas de la llamada entrante| +Filter URL|Filtro de URL| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Si el campo Filtro Número de entrada se establece en la URL, entonces este es la dirección web de un script que buscar un sistema remoto y devuelve un 1 en un partido y un 0 para ninguna coincidencia. Sólo dos variables están disponibles en la dirección si se utiliza el prefijo var como con las direcciones de formulario web en campañas, - A - PHONE_NUMBER - B - y - A - did_pattern - B - se puede utilizar en la URL para indicar el identificador de llamadas de la persona que llama y el DID que el cliente llama en el| +Filter Action|Acción de filtrado| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Si el número de entrada del filtro se activa y se encuentra una coincidencia, entonces este es la acción que debe ser tomada. Esta es la misma que la ruta que se seleccione para un DID, y los ajustes por debajo de funcionar igual que lo hacen de una norma de enrutamiento| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|Este es el ID del Grupo de teléfono de filtro que es el contenedor de un grupo de números de teléfono que usted puede tener de forma automática a través de búsquedas en cuando entra una llamada en un archivo. DID y enviar a una ruta alternativa si hay una coincidencia Este campo debe ser entre 2 y 20 caracteres y no tienen puntuacion excepto para destacar| +Filter Phone Group Description|Teléfono Filtro Descripción del Grupo| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Esta es la descripción del Grupo Teléfono del filtro, es exclusivamente para propósitos de notación y no es un campo obligatorio| +Clean CID Number|Limpie Número CID| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|Este campo le permite especificar un número de dígitos para restringir el número de identificación de llamada entrante, poniendo una R delante del número de dígitos, por ejemplo, para restringir a la derecha de 10 dígitos que se deben introducir en el R10. También puede utilizar esta función para eliminar sólo un primer dígito o los dígitos al poner una L en la frente de los dígitos específicos que desea eliminar, por ejemplo para eliminar un 1 como el primer dígito quieres entrar en la L1. El valor predeterminado es vacío. Si más de una regla se especifica asegúrese de separarlos con un espacio y la R se ejecutará antes de la L| +must be an existing vicidial user|debe ser un usuario existente vicidial| +you must use a valid user as the user_start for remote agents|debe utilizar un usuario válido como el user_start de agentes remotos| +your number of lines overlaps with another remote agent|el número de líneas se superpone con otro agente remoto| +Webphone URL Override|Anulación de URL Webphone| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Esta configuración le permite configurar una URL webphone alternativo sólo para los miembros de un grupo de usuarios. Por defecto está vacío| +Calculate Estimated Hold Seconds|Calcular estimado Segundos Hold| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Esto define el número de segundos en la cola que el cliente va a esperar antes de que el tiempo de espera estimado se calculará y jugó de forma opcional. Mínima es de 3 segundos, incluso si se ajusta por debajo de 3. El valor predeterminado es 0| +Campaign Preset Added|Preestablecido Campaña Alta| +Campaign Presets|Ajustes preestablecidos de la campaña| +Modify Campaign Preset|EDITAR Campaña| +Campaign Preset Removed|Preestablecido Campaña eliminado| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Si el escenario de campaña para los presets se establece en Habilitado entonces usted tiene la capacidad de definir de la Conferencia de transferencia-presets que estarán disponibles para el agente que les permite 3-way llamar a estos presets o llamadas ciegas transferencia a estos números predefinidos. Estas configuraciones también tienen una opción para ocultar el número asociado a cada preset del agente| +PRESET NOT ADDED|PRESET NO ESTÁ SUJETA| +there is already an entry for this campaign with this preset|ya hay una entrada para esta campaña con este ajuste de| +PRESET NOT MODIFIED|PRESET SIN MODIFICAR| +>Presets<|> Valores de menores| +Hide Transfer Number to Dial|Ocultar número de transferencia para marcar| +Enable Transfer Presets|Activar presets de transferencia| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Esta opción permitirá a los presets del submenú que aparece en la parte superior de la página de modificación de la campaña, y también tendrá la posibilidad de especificar los números predeterminados de marcación para los agentes a utilizar en el marco de transferencia a la Conferencia de la interfaz de agente. El valor predeterminado es DISABLED| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Esta opción se oculta el número a marcar el terreno en el marco de transferencia a la Conferencia de la interfaz de agente. El valor predeterminado es DISABLED| +PRESETS FOR THIS CAMPAIGN|PRESETS para esta campaña| +ADD NEW PRESET|AÑADIR NUEVO PRESET| +Hide Number|Ocultar número| +Preset Name|Nombre del ajuste| +Preset Number|Número de preset| +Preset DTMF|Preestablecido DTMF| +CAMPAIGN PRESET LISTINGS|CAMPAÑA PRESET LISTADOS| +CAMPAIGN PRESET NOT DELETED|PRESET CAMPAÑA NO DELETED| +Show Presets Stats|Mostrar Estadísticas Presets| +AGENT DIAL PRESETS NAMES|PRESETS AGENTE marcar nombres| +Manual Dial Prefix|Prefijo Manual| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Este campo opcional le permite configurar el prefijo de marcación para ser utilizado solamente cuando la colocación de las llamadas Marcación manual desde la interfaz de agente, como el uso de la función de Marcación manual, o marque el siguiente número, cuando en el método de marcación MANUAL, o marcación manual alt número, o programado por el usuario sólo las devoluciones de llamada. El valor predeterminado es vacío para personas con discapacidad, que utilizan el prefijo de marcación se define en el campo de arriba. Esta opción no interfiere con la opción de marcación de prefijo 3way| +Here is a list of reserved phrases that cannot be used as menu IDs|Aquí es una lista de frases reservadas que no se puede utilizar como menú identificadores| +Call Menu ID cannot use reserved words|Identificación de llamada del menú no puede utilizar las palabras reservadas| +Webphone System Key Override|Webphone sistema de llave de anulación| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Este ajuste le permite configurar una clave de webphone sistema alternativo sólo para los miembros de un grupo de usuarios. Por defecto está vacío| +Webphone Dialpad Override|Webphone teclado de marcación de anulación| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Esta opción le permite activar o desactivar el teclado de marcación en el webphone sólo para los miembros de un grupo de usuarios. El valor predeterminado es DISABLED. TOGGLE permitirá al usuario ver y ocultar el teclado haciendo clic en un enlace| +Webphone Dialpad|Webphone Dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Esta opción le permite activar o desactivar el teclado de marcación para este webphone. Por defecto es Y para activado. TOGGLE permitirá al usuario ver y ocultar el teclado haciendo clic en un enlace. Esta característica no está disponible en todas las versiones Webphone| +Webphone System Key|Webphone clave del sistema| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Si su sistema o el proveedor lo requiere, aquí es donde la clave del sistema para el webphone deben introducirse in por defecto está vacío| + Strength| Fuerza| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Una contraseña segura debe tener registro de al menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como al menos un número| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Un secreto conf fuerte del archivo debe ser de al menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como al menos un número| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|La contraseña de usuario fuerte debe ser por lo menos 8 caracteres de longitud y tienen minúsculas y mayúsculas, así como el número por lo menos una| +Force Change Password|Forzar cambio de contraseña| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Si esta opción está establecida en Y entonces el usuario se le pedirá que cambie su contraseña la próxima vez que inicie sesión en la página web de la administración. El valor predeterminado es N| +First Login Trigger|Primera sesión de disparo| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Esta configuración permite la configuración inicial de la pantalla del servidor para ser mostrado al administrador cuando se registre por primera vez en el sistema| +Default Phone Registration Password|Teléfono predeterminado Registro Contraseña| +This is the default registration password used when new phones are added to the system. Default is test|Esta es la contraseña de registro predeterminado que se utiliza cuando los teléfonos nuevos se agregan al sistema. El valor predeterminado es la prueba| +Default Phone Login Password|Teléfono predeterminado Login| +This is the default phone web login password used when new phones are added to the system. Default is test|Este es el teléfono web por defecto la contraseña de inicio de sesión utiliza cuando los teléfonos nuevos se agregan al sistema. El valor predeterminado es la prueba| +Default Server Password|Contraseña por defecto del servidor| +This is the default server password used when new servers are added to the system. Default is test|Esta es la contraseña del servidor predeterminado que se utiliza cuando los servidores se añaden al sistema. El valor predeterminado es la prueba| +CHANGE PASSWORD|CAMBIO DE CONTRASEÑA| +INITIAL INSTALL WELCOME|Instalación inicial BIENVENIDOS| +COPYRIGHT TRADEMARK LICENSE|DERECHOS DE AUTOR licencia de marca| +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|Usted está obligado a cambiar su contraseña antes de poder continuar en la Administración. Una contraseña segura tiene tanto en minúsculas y mayúsculas, así como al menos un número. Su contraseña debe ser de 2 a 20 caracteres de longitud y no puede contener caracteres que no sean letras o números| +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|Asegúrese de que la contraseña es algo que pueda recordar, porque tan pronto como se realice este cambio se le pedirá que introduzca su nueva contraseña para ingresar de nuevo a la Administración| +Password has not been changed, please try again|La contraseña no ha cambiado, por favor, inténtalo de nuevo| +New Password|Nueva contraseña| +Password has been updated, you may now continue|La contraseña ha sido actualizada, ahora pueden continuar| +Passwords have been updated, you may now continue on into Administration|Las contraseñas se han actualizado, ahora se puede continuar en la Administración| +You may want to start by reading the ViciDial Manager Manual available at|Es posible que desee comenzar a leer el Manual de Administrador de Vicidial disponible en| +there is a free version available|hay una versión disponible gratuitamente| +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|Asegúrese de que la contraseña es algo que pueda recordar, porque tan pronto como se complete esta pantalla de configuración inicial se le pedirá que introduzca su nueva contraseña de nuevo para volver a iniciar sesión en Administración de| +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|Los próximos tres contraseñas por defecto se definen en la sección de configuración del sistema, y ​​se pueden cambiar después de que los definen aquí. Es una buena idea hacer estas contraseñas fuertes para que no se puede cortar en sus cuentas de teléfono y hacer llamadas telefónicas sin que usted lo sepa. La contraseña de registro predeterminado que se utiliza cuando los teléfonos nuevos se añaden al sistema como el SIP o IAX contraseña del teléfono VOIP. El teléfono web por defecto la contraseña de inicio de sesión utiliza cuando los teléfonos nuevos se añaden al sistema, como la contraseña del teléfono que un agente se utiliza en la interfaz del agente Vicidial. La contraseña del servidor predeterminado que se utiliza cuando los servidores se añaden al sistema para que los servidores se comunican entre sí| +Passwords have been updated, you may now continue on into Administration|Las contraseñas se han actualizado, ahora se puede continuar en la Administración| +You may want to start by reading the ViciDial Manager Manual available at|Es posible que desee comenzar a leer el Manual de Administrador de Vicidial disponible en| +there is a free version available|hay una versión disponible gratuitamente| +Welcome to ViciDial|Bienvenido a Vicidial| +initial setup screen|pantalla de configuración inicial| +copyright, trademark and license page|los derechos de autor, marca registrada y la licencia de la página| +The ViciDial Call Center Suite is maintained by the|El Call Center Vicidial Suite está mantenido por el| +is a registered trademark of the|es una marca registrada de la| +Here is our|Aquí está nuestra| +trademark use policy|marca la política de uso| +The ViciDial Call Center Suite is released under the|El Call Center Vicidial Suite está publicado bajo la| +open source license|licencia de código abierto| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|El Centro de Vicidial llamada suite de software está disponible para su descarga, y para el uso, libre de costo. Puede descargar el sencillo de instalar| +ViciBox CD ISO version|ViciBox ISO de CD la versión| +or only the|o sólo el| +source code|de código fuente| +Continue on to the Initial Setup|Continúe con la configuración inicial| +Customer 3-Way Hangup Logging|Cliente 3-Way Colgar el registro de| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Si esta opción está activada, el user_call_log registrará cuando un cliente hasta colgar si se cuelga durante una llamada de 3 vías. Además, esto puede permitir que para el cliente de 3 vías de acción de colgar si se defineed a continuación. Valor predeterminado es Activado| +Customer 3-Way Hangup Seconds|Cliente 3-Way Segundos hangup| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Si el cliente de 3 vías está habilitado el registro, esta opción le permite definir el número de segundos después de colgar los clientes se detecta antes de que realmente se registra y el cliente opcional de 3 vías de acción de colgar se ejecuta. El valor predeterminado es 5 segundos| +Customer 3-Way Hangup Action|Cliente 3-Way Colgar Acción| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Si el cliente de 3 vías está habilitado el registro, esta opción le permite tener la pantalla del agente de forma automática que cuelgan de la llamada y volver a la pantalla DISPO si esta opción está establecida en DISPO. El valor predeterminado es NINGUNO| +Inbound Report by DID|Informe de entrada DID| +Lists Campaign Status Stats|Lista de Estadísticas de Estado de la campaña| +Add Lead URL|Agregar el URL de plomo| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Esta dirección URL de la tela no se ve por el agente, sino que es llamado cada vez que se añade una ventaja al sistema a través del proceso de entrada. El valor predeterminado es en blanco. Usted debe comenzar la siguiente dirección URL con VAR, si desea utilizar las variables y, por supuesto - una - y - B - en torno a la variable real en la dirección URL en la que desea utilizar. Aquí está la lista de variables que están disponibles para esta función| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Esta utilidad te permite subir archivos de audio en el servidor web para que puedan ser distribuidos a todos los servidores Vicidial en un clúster de varios servidores. Una nota importante, sólo dos tipos de archivos de audio va a funcionar,. Wav que son 8k PCM mono de 16 bits y archivos. GSM, que son 8k de 8 bits. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Le recomendamos ENCARECIDAMENTE carga de sólo 16 bits Mono 8k archivos de audio WAV PCM| +Park Music-on-Hold|Parque de la Música-on-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|Aquí es donde usted puede definir el contexto de la música en espera para esta campaña. Asegúrese de seleccionar una música válida en el contexto de la bodega la lista de selección y que el contexto que ha seleccionado tiene los archivos válidos en el mismo. Por defecto es default| +Park Call IVR|Estacionamiento de llamadas IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Esta opción permite a un agente para aparcar una llamada con un botón de llamada independiente IVR parque en su interfaz de agente, si esta opción está activada o ENABLED_PARK_ONLY. La opción ENABLED_PARK_ONLY permitirá que el agente para enviar la llamada al parque pero no haga clic en para recuperar la llamada como la opción habilitada. La opción ENABLED_BUTTON_HIDDEN permite que la función a través de la API sólo. El valor predeterminado es DISABLED| +Park Call IVR AGI|Estacionamiento de llamadas IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Si el Estacionamiento de llamadas IVR campo no está desactivado, este campo se utiliza como la cadena de aplicación de AGI que el cliente se envía. Este es un ajuste que debe ser fijado por el administrador, si es posible| +Manual Preview Dial|Manual de marcación previa| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|Esto permite al agente en el modo de marcación manual para ver la información de plomo cuando se haga clic en Marque el siguiente número antes de marcar activamente la llamada telefónica. Hay un enlace opcional a SKIP la iniciativa y pasar a la siguiente si se ha seleccionado. El valor predeterminado es PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Nombre del archivo estimado Hold tiempo mínimo| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Si el tiempo de espera estimado es activo y se calcula que es igual o inferior al mínimo de 15 segundos, y luego el archivo del sistema se jugará en lugar del anuncio de fábrica. El valor predeterminado es Empty de las personas inactivas| +Estimated Hold Time Minimum Prompt No Block|Mínimo Estimado Tiempo de Espera Preguntar no hay un bloque| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Si Tiempo estimado de espera está activa y el tiempo estimado de espera mínima campo Nombre de archivo anterior es rellenado, entonces esta opción para permitir las llamadas en fila detrás de una llamada en donde el indicador está jugando para ir a un agente, si uno está disponible, mientras que el mensaje se está reproduciendo . Mientras que el sistema está jugando a un cliente no puede ser enviado a un agente. El valor predeterminado es N| +Estimated Hold Time Minimum Prompt Seconds|Estimación de Hold segundos de tiempo mínimo Prompt| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Este campo tiene que estar en el número de segundos que el tiempo estimado de retención mínima del sistema Nombre juega. El valor predeterminado es 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|Este campo le permite personalizar el nombre de la grabación cuando la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|El valor predeterminado es FULLDATE_AGENT y se vería así-20051020 103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así| +Real-Time Agent Time Stats|Estadísticas en tiempo real agente de tiempo| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|Al establecer este a cualquier cosa, pero está deshabilitado permitirá la recolección de estadísticas de los agentes de hoy para esta campaña, que se pueden ver a través del informe en tiempo real. LLAMADAS son el promedio de llamadas atendidas por agente, de espera es el tiempo promedio de espera agente, Cust es el tiempo medio de conversación al cliente, ACW es el promedio de llamadas Después de un tiempo de trabajo, pausa es el tiempo de pausa media. El valor predeterminado es DISABLED| +Add A Dial Status to Call|Añadir un Estado Marcar para llamar| +Admin Modify Auto-Refresh|Admin modifica Auto-actualización| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|Este es el intervalo de actualización en segundos de las pantallas de modificar en esta interfaz de administración. Si se establece en 0, se desactivará, estableciendo que en su mayoría por debajo de 5 hará que las pantallas modifican inutilizables debido a que se actualizará con demasiada rapidez para cambiar de campo. Esta opción es útil en situaciones en las que más de un gerente es el control de la configuración de una campaña activa o en grupo, de modo que los ajustes se actualizan con frecuencia. El valor predeterminado es 0| +Admin No-Cache|Administración de No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|Si se establece en 1 pondrá todas las páginas de administración del navegador de no-cache, por lo que cada pantalla tiene que ser recargada cada vez que se ve, incluso si al hacer clic de nuevo en el navegador. El valor predeterminado es 0 para discapacitados| +Generate Cross-Server Phone Extensions|Generar entre servidores Extensiones de teléfono| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Esta opción, si se pone a 1 generará entradas dialplan para todos los teléfonos en un sistema multi-servidor. El valor predeterminado es 0 para los inactivos| +QueueMetrics Addmember Enabled|QueueMetrics Addmember Activado| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Esta opción, si se pone a 1 generará ADDMEMBER2 y las entradas REMOVEMEMBER en queue_log. El valor predeterminado es 0 para discapacitados| +Minimum Hopper Level|Mínimo nivel de la tolva| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Este es el número mínimo de lleva el guión VDhopper trata de mantener en la tabla vicidial_hopper para esta campaña. Si al ejecutar el script de VDhopper cada minuto, hacen de esta un poco mayor que el número de conductores que pasan por en un minuto| +Automatic Hopper Level|Nivel de la tolva automática| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Al establecer esta a Y permitirá Vicidial para ajustar automáticamente la tolva de la base de la configuración que tienes en tu campaña. La fórmula que utiliza para hacer esto es| +Automatic Hopper Multiplier|Multiplicador de la tolva automática| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|Esto es multiplicador de la tolva automática. Al establecer esta a menos de 1 hará que el algoritmo de la tolva automática para cargar menos pistas de lo que haría normalmente. Al establecer esta mayor que 1, hará que el algoritmo de la tolva automática para cargar más clientes potenciales que lo haría normalmente. El valor predeterminado es 1| +Auto Trim Hopper|Auto Trim Hopper| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Al establecer esta a Y permitirá Vicidial para eliminar automáticamente los cables sobrantes de la tolva. El valor predeterminado es Y| +Manual Dial API|Marcación manual de la API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Esta opción le permite definir la API de Agente a hacer ya sea una llamada a la vez, ESTÁNDAR, o la capacidad de la cola de llamadas de marcación manual y tienen que marcar automáticamente una vez que el agente va a hacer una pausa o está disponible para tomar su próxima convocatoria con la opción para desactivar la marcación automática de estas llamadas, cola o QUEUE_AND_AUTOCALL que es lo mismo que cola, pero sin la opción para desactivar la marcación automática de estas llamadas. Si un agente tiene más de una llamada en cola para ellos verán la cuenta de cuántas llamadas marcación manual se encuentran en la cola justo debajo del botón de pausa, o marque el botón número siguiente. Le sugerimos que si la lista se utiliza que envíe las acciones de la API con la vista previa = yes por lo que no están en repetidas ocasiones de marcar las llamadas para el agente sin previo aviso. Asimismo, si utiliza la cola y en gran medida mediante llamadas de marcación manual en un método de marcación manual no, le recomendamos ajustar la pausa después de cada agente de opción de compra para Y. valor predeterminado es Normal| +Manual Call Time Check|Duración de la llamada Manual de Entrada| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Si esta opción está activada, se comprobarán todas las llamadas de marcado manual para asegurarse de que están dentro de los ajustes de llamada de tiempo establecidos para la campaña. El valor predeterminado es DISABLED| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Si desea cambiar esta dado lugar a una devolución de llamada programada, primero cambie la disposición de CBHOLD, a continuación, enviar y usted será capaz de establecer la fecha de devolución de llamada y el tiempo| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Anulación Web Form - Esta es la dirección a medida que al hacer clic en el botón Web Form en VICIDIAL le llevará a las llamadas que entran en en esta lista| +Agent Screen Login|Agente de sesión de pantalla| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|El inicio de sesión para el usuario del teléfono para acceder a las aplicaciones cliente, como la pantalla del agente Vicidial| +Phone Extension|Teléfono de Extensión| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Este campo es donde se pone el nombre de los teléfonos, ya que parece Asterisk sin incluir el protocolo o barra al principio. Por ejemplo: para el teléfono SIP SIP/test101 la extensión del teléfono sería test101. Además, para IAX2 teléfonos: IAX2/IAXphone1 @ IAXphone1 sería IAXphone1. Para Zap y Dahdi adjunta channelbank o FXS teléfono, asegúrese de poner el número de canal completa, sin el prefijo: Zap/25-1 sería 25-1. Otra nota, asegúrese de que establece el Protocolo sobre el terreno a continuación correctamente para su tipo de teléfono| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|ESTADOS DE ACTIVOS EN LAS LISTAS PARA ESTA CAMPAÑA| +SHOW LEAD STATUSES IN THIS CAMPAIGN|Indican los estados de PLOMO EN ESTA CAMPAÑA| +RELOAD NOW|Actualiza ahora| +refresh|refrescar| +You can also set a label to ---HIDE--- to hide both the label and the field|También puede establecer una etiqueta a --- --- HIDE para ocultar la etiqueta y el campo| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Por sólo de entrada, también puede ajustar la duración de la llamada parada superior a 2400 si desea que el tiempo de llamada a ir más allá de la medianoche. Así que si usted quiere que su tiempo de llamada para funcionar desde las 6 am hasta las 2 am del día siguiente, se pondría a 0600 como el tiempo de inicio y 2600 como el tiempo de parada| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF por defecto para no mostrar el teclado de marcación en la primera carga, pero le permitirá al usuario para mostrar el teclado haciendo clic en el enlace de teclado| +Add Multi-Server Phones Form|Añadir Multi-Form Server Móviles| +Phones Bulk Insert|Móviles de inserción masiva| +List Order Randomize|Orden de lista aleatoria| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Esta opción le permite al azar el orden de los cables en la tolva de carga dentro de los resultados definidos por los criterios establecidos anteriormente. Por ejemplo, el orden del listado se mantendrá, pero los resultados serán escogidos al azar dentro de esa clasificación. Al establecer esta opción a Y se activa esta función. Defecto es n para discapacitados. NOTA, si usted tiene un gran número de lleva esta opción puede ralentizar la velocidad de la secuencia de comandos de carga de la tolva| +NONE will not log any logins and logouts within queue_log|NINGUNO no registrará los inicios de sesión y cierres de sesión dentro de queue_log| +QueueMetrics Dispo Pause Code|QueueMetrics dispo Código Pausa| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Esta opción, si se rellena, le permite definir si un código de pausa dispo ha entrado en queue_log cuando un agente se encuentra en estado dispo. El valor predeterminado es vacío para discapacitados| +List Order Secondary|Lista de Secundaria Orden| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Esta opción le permite seleccionar el orden de clasificación de segundo de los conductores en la carga de la tolva después de la Orden de la lista y dentro de los resultados definidos por los criterios establecidos anteriormente. Por ejemplo, el orden de lista se utilizará para la primera clase de los cables, pero los resultados se ordenarán una segunda vez en que la clasificación a través de la misma serie de la Orden primera lista. Por ejemplo, si usted tiene la lista de Orden establece que la cuenta regresiva y sólo disponen de guías que se han intentado una y 2 veces, entonces, si usted tiene el conjunto de Orden Lista de Secundaria a LEAD_ASCEND todos los cables de tentativa 1, serán ordenados por los más antiguos cables primero y se puso en la tolva de esa manera. El valor predeterminado es LEAD_ASCEND. NOTA, si usted tiene un gran número de conductores que utilizan una de las opciones CALLTIME puede ralentizar la velocidad de la secuencia de comandos de carga de la tolva| +My Callbacks Checkbox Default|Mi devoluciones de llamada predeterminado casilla de verificación| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Esta opción le permite pre-configurar la casilla de verificación Mi Devolución de llamada en la pantalla del agente de devolución de llamada programada. Facturado se marque la casilla de forma automática para cada llamada. El valor predeterminado es NO FACTURADO| +Call Notes Per Call|Llame a notas por llamada| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|Al establecer esta opción en ENABLED permitirá a los agentes para entrar en las notas de cada llamada que manejan en la interfaz de agente. El campo de entrada de notas aparecerá debajo del campo de comentarios en la interfaz de agente. Además, si el Grupo de agente de usuario se pueden ver los registros de llamadas a continuación, el agente será capaz de ver las notas anteriores de llamadas para tomar una ventaja en cualquier momento. El valor predeterminado es DISABLED| +If List Order Randomize is enabled, this option will be ignored|Si la lista de Orden aleatoria está activada, esta opción será ignorada| +ERROR: Lead not added, please go back and look at what you entered|ERROR: El plomo no se añade, por favor, volver atrás y ver lo que ha introducido| +Lead has been added|El plomo se ha añadido| +Add A New Lead|Añadir una nueva pista| +Agent Lead Search Override|Principal agente de búsqueda de anulación| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Este valor prevalecerá sobre lo que la campaña ha creado para la búsqueda del agente principal. NOT_ACTIVE utilizará el ajuste de la campaña. HABILITADO facilitará la búsqueda de plomo y no discapacitados facilitará la búsqueda de plomo. El valor predeterminado es NOT_ACTIVE| +Agent Lead Search|Agente de Búsqueda de plomo| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|Al establecer esta opción en ENABLED permitirá a los agentes a buscar pistas y ver la información de plomo durante la pausa en la interfaz de agente. Además, si el Grupo de agente de usuario se pueden ver los registros de llamadas a continuación, el agente será capaz de ver las notas anteriores de llamadas para cualquier iniciativa que se está viendo la información sobre. El valor predeterminado es DISABLED| +Agent Lead Search Method|Plomo Agente Método de búsqueda| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Si la búsqueda del agente de plomo está habilitado, este parámetro define el lugar donde el agente se le permitirá la búsqueda de clientes potenciales. Sistema buscará todo el sistema, se CAMPAIGNLISTS buscar dentro de todas las listas de activos dentro de la campaña, se CAMPLISTS_ALL buscar dentro de todas las listas de activos e inactivos dentro de la campaña, LISTA sólo buscará en el Manual de Identificación de Llamada de lista tal como se define en la campaña . El valor predeterminado es CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|PLOMO PARA BÚSQUEDAS Este período de tiempo| +Routing Extension|Extensión de enrutamiento| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|Este campo permite una extensión de enrutamiento de salida personalizado. Esto le permite utilizar diferentes métodos de manejo de llamadas, dependiendo de cómo desea enrutar las llamadas a través de su campaña de salida. Anteriormente conocido como la Campaña de extensión VDAD| +same as|misma| +Will send the call only to an agent on the same server as the call is placed on|Enviará la única llamada a un agente en el mismo servidor que la llamada se pone en| +Used for press-1, broadcast and survey campaigns|Se utiliza para las campañas de prensa-1, de difusión y estudio| +Will try to first send the call to an agent on the local server, then it will look on other servers|Se trata de enviar la primera llamada a un agente en el servidor local, y luego se verá en otros servidores| +DEFAULT - Will send the call to the next available agent no matter what server they are on|DEFAULT - Se envía la llamada al siguiente agente disponible independientemente del servidor en que se encuentran en| +Used for Answering Machine Detection after that, same behavior as|Se utiliza para contestar la detección de la máquina después de eso, mismo comportamiento que| +Used for Answering Machine Detection after that same behavior as|Se utiliza para contestar la detección de la máquina después de que el mismo comportamiento que| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Se utiliza para las campañas de prensa-1, de difusión y estudio con Cepstral Texto a voz| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Se utiliza para la detección de la máquina contestadora a continuación, pulse-1, de difusión y estudio de las campañas con Cepstral Texto a voz| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Una de estas opciones con USER_ frente a sólo buscará dentro de los cables que tienen el campo propietario coincide con el ID de usuario del agente, las opciones con Sonidos reales frente a sólo buscará dentro de los cables que tienen el campo propietario coincide con el grupo de usuarios que el usuario es un miembro de las opciones con TERRITORY_ frente a sólo buscará dentro de los cables que tienen el campo propietario adecuación de los territorios que el agente ha seleccionado| +QM Phone Environment|Gestión de calidad para el Medio Ambiente Teléfono| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Si la integración QueueMetrics está activada en la configuración del sistema, esta configuración permite la inserción de este valor de datos en el campo de la data4 queue_log para los registros de la actividad del agente. El valor predeterminado es vacío para discapacitados| +Active Twin Server IP|IP del servidor de Active doble| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Algunos sistemas Vicidial requieren la configuración de servidores Vicidial en parejas. Esta configuración es donde usted puede poner la IP del servidor de otro servidor vicidial que este servidor está hermanada con. El valor predeterminado es vacío para discapacitados| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|NOTAS: Para ring_all, los agentes que utilizan los teléfonos que tengan habilitado El gancho del agente tendrá su anillo de los teléfonos y el primero en responder recibirá la llamada y la información en la pantalla del agente. Desde ring_all ignora el tiempo de espera y agente de la clasificación y se llame a todos los agentes que se encuentra disponible para la cola, no se recomienda utilizar este método para las colas grandes. Cuando se utiliza ring_all, agentes conectados con los teléfonos que tienen el Agente Colgar discapacitados tendrán que utilizar las llamadas en el panel de cola y haga clic en el enlace de mis llamadas para atender las llamadas en cola. La cantidad de tiempo que el teléfono sonará para los agentes ring_all se ajusta a la configuración de anillo con el teléfono colgado de tiempo o el tiempo más corto el anillo de los teléfonos que serán llamados. Nosotros no recomendamos el uso de ring_all de colas de llamadas de alto volumen, o colas con muchos agentes. El método ring_all se destina a ser utilizado con sólo unos pocos agentes y en el volumen de llamadas baja en los grupos| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Esta opción sólo se utiliza para los agentes que se conectan con los teléfonos que tienen la función de agente con el teléfono colgado habilitado. Este es el número de segundos que cada intento de llamada al agente sonará hasta que el sistema va a esperar un segundo y comienzan a sonar los teléfonos de agentes disponibles de nuevo. Este campo puede ser anulada si los teléfonos del agente se establecen en un momento en el anillo inferior, que puede ser necesario para evitar que las llamadas que se envíe un mensaje de voz móviles. El valor predeterminado es 15| +On-Hook Agent|Con el teléfono colgado del Agente| +On-Hook Ring Time|Con el teléfono colgado del timbre| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Esta opción sólo se utiliza para las llamadas entrantes van a este agente remoto. Esta función se llama el agente remoto y no enviar al cliente al agente de control remoto hasta que la línea se contesta. Defecto es n para discapacitados| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Esta opción sólo se utiliza cuando el campo Agente con el teléfono colgado anterior se establece en Y, y entonces sólo para las llamadas entrantes que llegan a este agente remoto. Este es el número de segundos que cada intento de llamada sonará a tratar de obtener una respuesta. Se recomienda que se ponga esto en unos pocos segundos a menos de que se necesita para una llamada a ser enviada al correo de voz. El valor predeterminado es 15| +On-Hook Agent Login|Con el teléfono colgado Agent Login| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Esta opción sólo se utiliza para las llamadas entrantes van a un agente registrado con este teléfono. Esta función se llama al agente y no le enviará al cliente a la sesión de los agentes hasta que la línea se contesta. Defecto es n para discapacitados| +This is a Phone On-Hook Agent|Se trata de un teléfono colgado del Agente| +Maximum Ring Time|Tiempo de timbre de máxima| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|Las opciones de aplazar dejará de parpadear y mostrar-o en rojo cuando se echa las devoluciones de llamada, hasta que el número de devoluciones de llamada de los cambios| +Auto Pause Pre-Call Work|Auto Pause antes de la llamada de trabajo| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|En el modo de marcación automática, esta opción si está habilitado se establece que el agente se detuvo automáticamente cuando se hace clic agente en cualquiera de las siguientes funciones que les obliga a ser una pausa-Manual de marcación, marcación abreviada, Búsqueda de plomo, llame a Ver registro, devoluciones de llamada de cheque, Ingrese el código de pausa. Defecto es n de las personas inactivas| +Auto Resume Pre-Call Work|Auto Reanudar una llamada previa de trabajo| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|En el modo de marcación automática, esta opción si está habilitado se establece que el agente activo de forma automática cuando el agente hace clic fuera de, o se cancela, en cualquiera de las siguientes funciones que les obliga a estar marcado una pausa-manual, marcación abreviada, Búsqueda de plomo, llame Ver registro, devoluciones de llamada Check, Introduzca el código de pausa. Defecto es n de las personas inactivas| +Auto Pause Pre-Call Code|Auto Pause antes de la llamada Código| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Si el Auto Pause antes de la llamada Función de trabajo anterior es activo, y los códigos de agentes de pausa está activado, este ajuste será el código de pausa que se utiliza cuando el agente se detuvo para estas actividades. El valor predeterminado es PRECAL| +This campaign is not set to Auto-Alt-Dial|Esta campaña no está establecido en Auto-Alt-Dial| +Multi-Alt-Settings|Multi-Alt-Configuración| +Reload Dialplan On Servers|Actualizar Dialplan En los servidores| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Esta opción le permite forzar una recarga del plan de marcado en todos los servidores de Asterisk en el clúster. Si ha realizado cambios en el plan de marcado de entrada por encima de Custom debe establecer este a 1 y en enviar para que los cambios entren en vigor en los servidores| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Usando MULTI_LEAD le permite utilizar un cable separado para cada número de una cuenta de cliente de que todos comparten un vendor_lead_code común, y el tipo de número de teléfono de cada uno se define con una etiqueta en el campo Propietario. Esta opción no permite algunas opciones en la pantalla Modificar la campaña y mostrar un enlace a la página Multi-Alt configuración que le permite establecer el tipo de número de teléfono, que se define por la etiqueta de cada cable, se puede marcar y en qué orden. Esto creará un filtro especial de plomo y alterar el campo Rango de todos los cables dentro de las listas que figuran en esta campaña con el fin de llamar en el orden que haya especificado| +Manual Dial CID|Manual de marcación CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Esto define si un agente de la realización de llamadas Marcación manual tendrá las opciones de campaña CallerID utiliza, o utiliza sus agentes telefónicos configuración de CallerID. El valor predeterminado es CAMPAÑA| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Si el uso personalizado opción de campaña de CID está activado o el Escenario de Campaña de la lista de anulación del CID se utiliza, este ajuste se tendrá en cuenta| +Phone Post Time Difference Alert|Mensaje Teléfono Diferencia de tiempo de alerta| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Esta función de marcación manual sólo si está activado, se mostrará una alerta si la zona horaria para el código postal de plomo, o el código postal, es diferente de la zona horaria del código de área del número de teléfono para el plomo. La opción OUTSIDE_CALLTIME_ONLY sólo se mostrará la alerta si las dos zonas de tiempo son diferentes y una de las zonas horarias se encuentra fuera del tiempo de llamada seleccionada para la campaña. OUTSIDE_CALLTIME_PHONE sólo comprueba si la zona horaria del número de teléfono del conductor y alertar si está fuera del tiempo de llamada local. OUTSIDE_CALLTIME_POSTAL sólo comprueba si la zona horaria del código postal de la iniciativa y alertar si está fuera del tiempo de llamada local. OUTSIDE_CALLTIME_BOTH comprobará el código postal y número de teléfono para estar dentro de la duración de la llamada local, incluso si se encuentran en la misma zona horaria. Estas alertas se muestran en la información del registro de llamadas, información de devoluciones de llamada de la lista, la información de resultados de búsqueda, cuando un líder se marca y cuando una ventaja de una vista previa. El valor predeterminado es DISABLED| +Custom 3-Way Button Transfer|Custom 3-Way Botón de Transferencia| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Esta opción, se agregará un botón de transferencia personalizada a la pantalla del agente por debajo de la tecla de Transferencia-Conf que permitirá a un clic de tres vías llamadas mediante el programa seleccionado o en el campo. Las opciones se PRESET_ realizar llamadas utilizando el valor definido preestablecido. Las opciones se FIELD_ realizar llamadas con el número en el campo seleccionado de la iniciativa. MINUSVALIDOS no se mostrará el botón en la pantalla del agente. Las opciones se PARK_ aparcar el cliente antes de marcar. El valor predeterminado es DISABLED| +Auto Dial Level Threshold|Marcación automática de nivel de umbral| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Esta opción sólo funciona con un ADAPT o RATIO Método de marcación, y se debe establecer en algo más que MINUSVALIDOS y el número de agentes de ajuste debe ser superior a 0. Esta característica le permite establecer un número mínimo de agentes que el algoritmo de predicción van a funcionar. Si el número de agentes es inferior al número que usted ha fijado, entonces el nivel de acceso telefónico se destinarán a 1,0 hasta que haya más agentes de ingresar o entrar en el estado seleccionado. Logueados IN_AGENTS contará con todos los agentes registrados en la campaña, NO PAUSED_AGENTS sólo contará los agentes que están esperando o hablar, y sólo contará WAITING_AGENTS agentes que están esperando una llamada. El valor predeterminado es DISABLED| +Available Only Tally Threshold|Umbral Disponible cifra sólo| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Esta opción sólo funciona con un ADAPT o método de la razón Dial, esta cifra sólo disponible se debe establecer en N, esta configuración se debe establecer en algo más que MINUSVALIDOS y el número de agentes de ajuste debe ser superior a 0. Esta característica le permite establecer el número de agentes por debajo del cual se cifra sólo disponible habilitado. Si el número de agentes es inferior al número que usted ha fijado, a continuación, la configuración disponible Tally Sólo con ir a Y temporalmente hasta que más agentes de ingresar o entrar en el estado seleccionado. Logueados IN_AGENTS contará con todos los agentes registrados en la campaña, NO PAUSED_AGENTS sólo contará los agentes que están esperando o hablar, y sólo contará WAITING_AGENTS agentes que están esperando una llamada. El valor predeterminado es DISABLED| +Time Zone Setting|Ajuste de Huso Horario| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Esta opción le permite definir el método de mantener la búsqueda de la zona horaria actual de los cables dentro de esta lista. Este proceso sólo se realiza por la noche para los cambios que realice no será inmediata. COUNTRY_AND_AREA_CODE es el predeterminado, y utilizará el código de país y código de área del número de teléfono para determinar la zona horaria de la iniciativa. Postal_code utilizará el código postal si está disponible para determinar la zona horaria de la iniciativa. NANPA_PREFIX sólo funciona en los EE.UU. y utilizará el código de área y el prefijo del número de teléfono para determinar la zona horaria de la iniciativa, pero esto no está habilitado por defecto en el sistema, así que por favor asegúrese de tener los datos cargados en el prefijo NANPA su sistema antes de seleccionar esta opción. OWNER_TIME_ZONE_CODE utilizará la zona horaria estándar abbraviation carga en el campo propietario de la mina para determinar la zona horaria, en los ejemplos de Estados Unidos son AST, EST, CST, MST, PST, el CCTA, HST. Esta característica debe ser habilitada por el administrador del sistema para entrar en vigor| +Dial Level Difference Target|Marque la diferencia de nivel de destino| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Este campo se utiliza para definir si desea tener como objetivo un determinado número de agentes de espera para las llamadas o las llamadas en espera de los agentes. Por ejemplo, si siempre quisiera tener en promedio un agente libre para recibir llamadas de inmediato que se ponga esto en -1, si usted quisiera tener siempre como objetivo una llamada en espera la espera de un agente que se pone a 1. El valor predeterminado es 0. Este campo no es utilizado por el MANUAL o métodos de marcación INBOUND_MAN| +Admin Utilities|Utilidades admin| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|Página de utilidades ocultas - Si usted no sabe lo que estos servicios lo hace, usted probablemente no debería usarlos| +Welcome Languages Page|Idiomas página de bienvenida| +Campaign Debug Page|Campaña Página de depuración| +Bulk Phone Insert Page|Teléfono granel Insertar página| +Send a Call With Custom CID Page|Enviar una llamada con la página personalizada CID| +Speech Voice Lab Page|La voz del discurso Lab Página| +Safe Harbor Audio|Safe Harbor de audio| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Este es el archivo de audio del sistema que se juega, si la acción de colocar está en AUDIO. El valor predeterminado es rumor| +Safe Harbor Call Menu|Safe Harbor menú de llamadas| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|Este es el menú que una llamada se envía a si la acción de la gota está en CALLMENU| +Log Key Press|Oprima la tecla Entrar| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Esta opción si está habilitado registrará la pulsación de una tecla DTMF por la persona que llama en este menú de llamada. El valor predeterminado es 0 para discapacitados| +No DTMF Logging|Sin registro DTMF| +DTMF Logging Enabled|DTMF registro habilitado| +Webphone Auto-Answer|Webphone Respuesta automática| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Esta configuración permite que el teléfono web para ser configurado para responder automáticamente a las llamadas que entran en estableciéndola en Y, o tener anillo de llamadas mediante el establecimiento de que por defecto es N. Y| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU enviará al cliente el menú de llamada se define en la lista de selección a continuación| +Survey Call Menu|Encuesta del menú de llamadas| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Si el método se ajusta a CALLMENU, este es el menú de llamadas que el cliente se envía a si optar por| +Scheduled Callbacks Days Limit|Programado devoluciones de llamada Días Límite| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Esta opción le permite reducir el agente devoluciones de llamada programadas del calendario para un número seleccionable de días a partir de hoy, el pleno del calendario de 12 meses todavía se muestra, pero sólo el número de días va a ser seleccionable. El valor predeterminado es 0 para un número ilimitado| +Dial Level Difference Target Method|Marque la diferencia de nivel método de destino| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Esta opción le permite definir si el nivel marcado la diferencia de fijación de objetivos sólo se aplica al cálculo del nivel de línea o también a la marcación real en cada servidor de marcación. Si está ejecutando una pequeña campaña con los agentes conectados en muchos servidores es posible que desee utilizar la opción ADAPT_CALC_ONLY, porque la opción CALLS_PLACED puede resultar en un menor número de llamadas que se colocan a deisred. Esta opción sólo está activa si el nivel objetivo marcado la diferencia se establece en algo distinto de 0. El valor predeterminado es ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Si desea utilizar campos personalizados en un formulario web de direcciones, es necesario agregar| +as part of your URL|como parte de su URL| +Disable Dispo Screen|Desactivar la pantalla de dispo| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Esta opción le permite desactivar la pantalla de la disposición en la interfaz de agente. El campo Desactivar Estado Dispo a continuación deben ser llenados para que funcione esta opción. El valor predeterminado es| +Disable Dispo Status|Desactivar estado de dispo| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Si la opción Desactivar la pantalla se ajusta a dispo DISPO_DISABLED, este campo debe ser llenado pulg Usted puede usar cualquier disposición que desee para este campo, siempre y cuando sea de 1 a 6 caracteres de longitud, con sólo letras y números| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Este ajuste, si se pone a 1 permitirá a un administrador para acceder a la llamada a la exportación y los informes de plomo en la pantalla Informes. El valor predeterminado es 0. Para la exportación Llama y conduce los informes, el orden siguiente campo se utiliza para las exportaciones| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Este informe recoge la información contenida de plomo para las llamadas realizadas en el intervalo de fechas seleccionado. Una ventaja sólo se exporta una vez sin importar cuántas llamadas han sido manipulados. El estado actual de plomo se utiliza.| +Export Leads Report|Informe de las exportaciones genera| +Screen Labels|Las etiquetas de la pantalla| +Add A Screen Label|Añadir una etiqueta de la pantalla| +ADD NEW SCREEN LABEL|ADD ETIQUETA NUEVA PANTALLA| +ADDING NEW SCREEN LABEL|AGREGAR LA ETIQUETA NUEVA PANTALLA| +MODIFY SCREEN LABEL|Modificar la etiqueta PANTALLA| +DELETE SCREEN LABEL|BORRAR LA ETIQUETA DE PANTALLA| +SCREEN LABELS LIST|ETIQUETAS DE PANTALLA DE LISTA| +Screen Label ID|Pantalla del identificador de etiqueta| +Screen Label Name|Pantalla de Nombre de etiqueta| +SCREEN LABEL NOT ADDED|ETIQUETA DE LA PANTALLA NO ESTÁ SUJETA| +there is already a label in the system with this ID|ya hay una etiqueta en el sistema con este ID| +SCREEN LABEL ADDED|ETIQUETA DE LA PANTALLA ESTÁ SUJETA| +SCREEN LABEL NOT DELETED|ETIQUETA DE LA PANTALLA NO DELETED| +SCREEN LABEL DELETION CONFIRMATION|ETIQUETA pantalla de eliminación CONFIRMACIÓN| +Click here to delete screen label|Haga clic aquí para borrar la etiqueta de pantalla| +SCREEN LABEL DELETION COMPLETED|SUPRESIÓN DE PANTALLA COMPLETA LA ETIQUETA| +DELETE THIS SCREEN LABEL|BORRAR LA ETIQUETA DE PANTALLA| +Click here to see Admin changes to this screen label|Haga clic aquí para ver los cambios de administrador para esta etiqueta de pantalla| +Hide Label in Call Logs|Ocultar etiqueta en los registros de llamadas| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Si una etiqueta se establece en OCULTAR --- --- entonces los registros de llamadas de los agentes, si está activado en la campaña, seguirá mostrando el campo y los datos a menos que esta opción está establecida en Y. El valor predeterminado es N| +SCREEN LABEL NOT MODIFIED|ETIQUETA DE LA PANTALLA SIN MODIFICAR| +SCREEN LABEL MODIFIED|ETIQUETA DE PANTALLA MODIFICADO| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Este campo tiene que ser por lo menos 2 caracteres de longitud y no más de 20 caracteres de longitud, sin espacios ni caracteres especiales. Este es el identificador que se utilizará para identificar la etiqueta de pantalla en todo el sistema| +This is the descriptive name of the screen label entry|Este es el nombre descriptivo de la entrada de etiqueta de la pantalla| +Agent Screen Labels|Las etiquetas de la pantalla del agente| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|Puede seleccionar un conjunto de etiquetas de la pantalla del agente a utilizar con esta opción. El valor predeterminado es - de escenarios del sistema - para las etiquetas predeterminadas| +Status Display Fields|Campos de la pantalla de estado| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|Usted puede seleccionar las variables de las llamadas se mostrará en la línea de estado de la pantalla del agente. CallID mostrará el identificador de llamada única de 20 caracteres, LEADID mostrará el ID de sistema de cable, ListId mostrará el ID de la lista. El valor predeterminado es CallID| +CAMPAIGNS USING THIS SCREEN LABEL|Las campañas que usan ESTA ETIQUETA DE PANTALLA| +QueueMetrics Phone Environment Phone Append|Teléfono Teléfono QueueMetrics Medio Ambiente Anexar| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Esta opción, si está habilitado, tiene que añadir el inicio de sesión de teléfono del agente en el registro de data4 en la tabla de registro de cola si el teléfono de campaña de campo para el Medio Ambiente está poblada. El valor predeterminado es 0 para discapacitados| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|HIDDEN no se mostrará el agente sobre el terreno, pero permitirá que el campo para que los datos importados y exportados en ella de la misma, así como tener a disposición de la ficha de guión y dirección de formulario web. READONLY mostrará el valor de los datos de la esfera, pero no permitirá que el agente de alterar los datos| +Enable Campaign Test Calls|Habilitar llamadas campaña de pruebas| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Esta configuración permite la posibilidad de ingresar un código de teléfono y número de teléfono a los campos en la parte inferior de la pantalla Detalle de la campaña y hacer una llamada a ese número como si fuera una ventaja de ser auto-marcado en el sistema. El número de teléfono se almacenan como una nueva pista en la lista del identificador de marcado manual lista. La campaña debe estar activa para que esta función esté habilitada, y se recomienda que las listas de asignados a la campaña de que todo se haya establecido como inactivo. El prefijo de marcación, marcación de tiempo de espera y todas las funciones de marcación relacionadas con otras, a excepción de DNC y opciones de compra de tiempo, afectará a la marcación del número de prueba. La llamada se coloca en el servidor seleccionado como el servidor de correo de voz en la configuración del sistema. El valor predeterminado es 0 para discapacitados| +Test calling disabled|Prueba llamando a discapacitados| +PLACE TEST CALL|LUGAR LLAMADO DE PRUEBA| +Test Outbound Call|Prueba de llamadas salientes| +Agents Calls Reset|Agentes de Llamadas Restablecer| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Esta configuración define si ha iniciado la sesión en los agentes activos y registros telefónicos las llamadas se deben restaurar en el extremo reloj horario del día. El valor predeterminado es 1 para habilitado| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|El campo personalizado 5 puede ser utilizado como un campo para definir un número de plan de marcado para enviar una llamada a partir de una AGENTDIRECT en grupo, si el usuario no está disponible, sólo tiene que poner AGENTEXT en el campo del mensaje o la extensión de la AGENTDIRECT dentro del grupo y el sistema buscará la costumbre de cinco de campo y enviar la llamada a ese número dialplan| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Para AGENTDIRECT en los grupos, si el usuario no está disponible, usted puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Para AGENTDIRECT en grupos, se puede poner AGENTEXT en este campo y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|También se puede poner AGENTEXT en este campo si se ha definido a la extensión y el sistema buscará el usuario personalizada cinco de campo y enviar la llamada a ese número dialplan| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|las órdenes de la última vez que un agente fue enviado a una llamada entrante. Resultados de los agentes que reciben el mismo número de llamadas en general| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|las órdenes de la última vez que un agente de terminar una llamada entrante. También conocido como agente de la espera más larga recibe primera llamada| +Servers|Servidores| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Esta es una lista de las direcciones IP del servidor de los servidores existentes en el sistema que desea que las entradas de teléfono a poblarse de ancho. Estos deben ser direcciones IP válidas, deben ser activos en el sistema y hay que poner uno por línea en este cuadro de texto de entrada de la zona| +Phones|Móviles| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Esta es una lista de las extensiones de teléfono que desea que se crea en todos los servidores antes mencionados. Las extensiones de teléfono deben ser letras y números, sin caracteres especiales y hay que poner uno por línea en este cuadro de área de texto| +Registration Password|Registro Contraseña| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|Esta es la clave de registro que se utilizará para todos los teléfonos que se crean. Para el protocolo SIP y IAX2 usted debe utilizar una contraseña compleja por razones Secutiry| +Login Password|Inicio de sesión Contraseña| +This is the agent screen login password that will be used for all of the phones that are created|Esta es la pantalla del agente clave de acceso que se utilizará para todos los teléfonos que se crean| +Create Alias Entries|Crear entradas de alias| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Al establecer esta opción en Sí se creará una entrada de teléfonos alias para cada una de las extensiones mencionadas anteriormente, que vincula todas las entradas de la misma extensión en cada servidor en conjunto permitir la entrada de teléfono de equilibrio de carga para trabajar en la interfaz de agente| +Alias Suffix|Alias ​​Sufijo| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|Este es el sufijo que se añadirá a la extensión para formar el identificador del teléfono de alias. Por ejemplo, si la extensión es CC100 y el sufijo alias es x, entonces el alias de teléfono con Identificador de utilizar para que sea cc100x| +Client Protocol|Protocolo de Cliente| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Este es el protocolo de teléfono que se utilizará para todos los teléfonos creados cuando presentado. SIP y IAX2 son los protocolos de VoIP que se crean las entradas de archivo conf para permitir que los phoens para registrarse en los servidores| +Local GMT|Local GMT| +This is the time zone that all of the phones will be created with|Esta es la zona horaria de que todos los teléfonos se creará con| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB es similar a HIDDEN excepto el tipo de almacenamiento de datos en la base de datos es un tipo BLOB, adecuado para los datos binarios o datos que debe ser garantizado| +Default Local GMT|Local por omisión GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Este ajuste define lo que se utilizará por defecto cuando los nuevos teléfonos y servidores se agregan utilizando esta interfaz web de administración. El valor predeterminado es -5| +Default Voicemail Zone|Zona de correo de voz por defecto| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Esta configuración define qué zona se utilizará por defecto cuando los nuevos teléfonos y buzones de voz se crean. La lista de zonas disponibles se toma directamente desde el archivo voicemail.conf. No está en este| +Voicemail Zone|Correo de voz Zona| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Esta configuración le permite configurar la zona que este buzón de voz se establecerá cuando el tiempo se registra para un mensaje. Por defecto se encuentra en la configuración del sistema| +Voicemail Options|Opciones de correo de voz| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Esta configuración opcional le permite definir la configuración de correo de voz adicionales. Se recomienda que lo deja en blanco a menos que sepa lo que está haciendo| +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|Las siguientes dos opciones se han definido en la sección de configuración del sistema, y ​​se pueden cambiar después de que los definen aquí. Usted debe establecer el valor predeterminado local a la zona horaria GMT de que sus agentes quieren estar adentro La zona de buzón de voz es la lista de zonas horarias de correo de voz que los mensajes de correo de voz será el momento cuando se registra con los nuevos mensajes se quedan| +ERROR: You cannot use reserved words for field labels|ERROR: No se puede utilizar palabras reservadas para las etiquetas de campo| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|La opción DISPO_SELECT_DISABLED no desactivar la pantalla de dispo por completo, pero se mostrará la pantalla dispo sin ningún tipo de disposiciones, esta opción sólo debe utilizarse si usted quiere forzar a los agentes a utilizar su software de CRM, que enviará el estado del sistema a través de la API| +No Agent Call URL|No Llamar URL| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Esta dirección URL de la tela no se ve por el agente, pero si está poblado se llama cada vez que se cuelga una llamada que no es manejado por un agente de arriba o transferido. Utiliza las mismas variables que los campos de formularios web y scripts. dispo puede utilizarse para recuperar el sistema definido por la disposición para la llamada. Esta URL no puede ser una ruta relativa. El valor predeterminado es en blanco| +On-Hook CID|Con el teléfono colgado del CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Esta opción sólo se utiliza para los agentes que se conectan con los teléfonos que tienen la función de agente con el teléfono colgado habilitado. Este es el identificador de llamadas que se mostrará en sus teléfonos de agentes cuando las llamadas son de llamada. Genérico es un genérico RINGAGENT00000000001 tipo de notificación. Endogrupal mostrará sólo el grupo en la llamada vino. CUSTOMER_PHONE sólo mostrará el número de teléfono del cliente. CUSTOMER_PHONE_RINGAGENT mostrará RINGAGENT_3125551212 con la RINGAGENT como parte de la policía judicial, con el número de teléfono del cliente. CUSTOMER_PHONE_INGROUP mostrará los primeros 10 caracteres del en-grupo seguido por el número de teléfono del cliente| +Please wait for the whole page to load before submitting the form|Por favor, espere a que toda la página se cargue antes de enviar el formulario| +In-Group Calldate|En-Grupo Calldate| +This is the last date and time that a call was directed to this inbound group|Esta es la última fecha y hora en que una llamada fue dirigida a este grupo de entrada| +No-Answer Log|Si no hay respuesta Conectarse| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Esta opción será registrar las llamadas de marcado automático que no se responden a una tabla separada. El valor predeterminado es N| +Alt-Log DB Server|Alt-Log DB del servidor| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|Este es el servidor de registro de base de datos alternativa. Esto es opcional, y permite que algunos registros que se escriben en una base de datos separada. Por defecto está vacío| +Alt-Log Tables|Registro de Alt-Tablas| +These are the tables that are available for logging on the alternate log database server. Default is blank|Estas son las tablas que están disponibles para el registro en el servidor de registro de base de datos alternativa. El valor predeterminado es en blanco| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Este es el texto real a voz campo de datos que se envía a Cepstral para la creación del archivo de audio para ser jugado con el cliente. puede utilizar Speech Synthesis Markup Language-SSML en este campo, por ejemplo| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|para un descanso de 1 segundo. También puede utilizar varias variables, como el nombre, apellido y el título como variables Vicidial al igual que lo hacen en una secuencia de comandos: - A - nombre apellido - B -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Si usted tiene estáticos archivos de audio que desee utilizar la base en el valor de uno de los campos que puede utilizar, así como con los C y D etiquetas. Los nombres de archivo deben estar todas en minúscula y deben ser de 16 bits PCM 8k archivos wav. El nombre del campo debe ser el mismo pero sin el wav. En el nombre de archivo. Por ejemplo - C ---- A - address3 - B ---- D - en primer lugar encontrar el valor para address3, entonces sería tratar de encontrar un archivo de audio correspondiente que el valor de ponerlo en el símbolo del sistema| +Here is a list of the available variables|Aquí está una lista de las variables disponibles| +DID Agent Log|DID registro de agentes| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Esta opción registrará la entrada DID llamadas, junto con un grupo cerrado y la ID de usuario, en su caso, a una tabla separada. El valor predeterminado es N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|Tiempo de espera le permiten establecer lo que ocurre con la llamada cuando el tiempo de espera sin el aporte de la persona que llama. INVALID le permiten establecer lo que sucede cuando la persona que llama entra en una opción no válida. INVALID_2ND y 3 sólo puede ser activo si INVALID no se utiliza, se va a esperar hasta que la entrada no válida la segunda o tercera por la persona que llama antes de ejecutar la opción| +Survey Recording|Estudio de grabación| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Si está activado, este empezará a grabar cuando la llamada es contestada. Sólo se recomienda si el método no está configurado para transferir a un agente. Defecto es n para discapacitados| +Campaign Areacode CID|Campaña CID Areacode| +AREACODE CIDS FOR THIS CAMPAIGN|CIDS CódigoÁrea para esta campaña| +ADD NEW AREACODE CID|ADD CódigoÁrea CID NUEVO| +AREACODE|CódigoÁrea| +SUBMIT CHANGES|Enviar cambios| +AREACODE CID NOT ADDED|CódigoÁrea CID NO ESTÁ SUJETA| +there is already an entry for this campaign with this CID|ya hay una entrada para esta campaña con el CID| +AREACODE CID ADDED|CódigoÁrea CID AGREGADOS| +AREACODE CID NOT DELETED|CódigoÁrea CID NO DELETED| +this entry does not exist|esta entrada no existe| +AREACODE CID DELETED|CódigoÁrea CID DELETED| +AREACODE CID MODIFIED|CódigoÁrea CID MODIFICADO| +Campaign Areacode CID Modify|Campaña Modificar Areacode CID| +CAMPAIGN AREACODE CID LISTINGS|LISTADOS DE LA CAMPAÑA CódigoÁrea CID| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Cuando se establece en CódigoÁrea usted tiene la capacidad para entrar en el submenú de CA-CID y definir callerids múltiples para ser utilizado por código de área| +Enable Campaign Areacode CID|Habilitar Areacode Campaña CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Esta configuración permite la posibilidad de configurar los números específicos de salida callerid para ser utilizados por campaña. El valor predeterminado es 1 para habilitado| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Si la configuración del sistema de Areacode CID está habilitada y la configuración de la campaña para el uso personalizado de CallerID se establece CódigoÁrea entonces usted tiene la capacidad de definir CID Areacode que se utilizarán cuando las llamadas salientes a los conductores en esta campaña específica. Usted puede agregar múltiples callerids por código de área y se puede activar y desactivar cada uno de ellos en tiempo real. Si más de un identificador de llamadas está activo para un código de área específico, entonces el sistema va a utilizar el identificador de llamadas que se ha utilizado el menor número de veces que en la actualidad. Si no callerids están activos para el código de área a continuación de la campaña de identificación de llamadas o una lista de anulación CallerID se utilizará| +PLLB Grouping|PLLB Agrupación| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Ingresar Teléfono de carga Agrupación de equilibrio, sólo se permite si hay varios servidores de agentes y los alias de teléfono están presentes en el sistema. Si se establece en ONE_SERVER_ONLY que obligará a todos los agentes de esta campaña para iniciar sesión en el mismo servidor. Si se establece a una cascada que se registra en agrupar los agentes en el mismo servidor hasta la Agrupación PLLB Limitar el número de agentes que se alcanzan, entonces el siguiente agente se conectará al servidor de al lado con el menor número de agentes. Si se establece en DISABLED el teléfono el comportamiento estándar de alias de cada agente para encontrar el servidor con el menor número de agentes remotos no han iniciado sesión en que serán utilizados. El valor predeterminado es DISABLED| +PLLB Grouping Limit|PLLB límite Agrupación| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Ingresar Teléfono de equilibrio de carga agrupación Límite. Si Agrupación PLLB se encuentra a una cascada de decir que este ajuste se determinará el número de agentes aceptable en cada servidor para esta campaña. Por defecto es 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Ingresar Teléfono de equilibrio de carga agrupación Límite. Si Agrupación PLLB se encuentra a una cascada en el nivel de la campaña que este ajuste se determinará el número de agentes aceptables en cada servidor en todas las campañas. El valor predeterminado es 100| +Modify DID RA Extension Overrides|Modificar DID RA Extensión Invalida| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|¿NO AUMENTO A DISTANCIA agente de extensión AGREGADOS| +there is already an entry for this DID with this RA EXTENSION|ya hay una entrada para este hecho con esta EXTENSIÓN AR| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|¿SABÍA DE AUMENTO A DISTANCIA agente de extensión AGREGADOS| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|Extensión DID Remote Agent presupuesto NO DELETED| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|Extensión DID Remote Agent OVERRIDE MODIFICADO| +MODIFY THIS DID|MODIFICAR ESTE DID| +Enable Remote Agent Extension Overrides|Habilitar remoto anula Agente de Extensión| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Esta configuración permite DID tener reemplazos de extensión de agente remoto enruta las llamadas a través de los grupos. El valor predeterminado es 0 para discapacitados| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|El remoto omite agente de extensión por eso los| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|Remote Agent LISTADOS DE EXTENSIÓN DE ANULACION| +DID Remote Agent Extension Overrides|DID remoto anula Agente de Extensión| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Esta sección le permite activar DID para que las anulaciones de extensión de agente remoto enruta las llamadas a través de los grupos. El inicio debe ser un usuario válido de arranque remoto de agente de usuario o si desea que la extensión de anulación de entrada al trabajo para todas las llamadas, puede utilizar --- Todos --- en el campo de inicio del usuario. Si hay varias entradas para el mismo DID y el Usuario en Inicio y luego las entradas de activos serán utilizados en una ronda de todos contra todos método| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|VER QUÉ remoto omite agente de extensión por eso los| +THERE ARE|HAY| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID remoto omite agente de extensión de este agente A DISTANCIA| +Action Transfer CID|Acción de transferencia de CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Se utiliza para la gota, Abierto por la noche y las acciones no-agente-no-cola. Este es el número identificador de llamadas que utiliza la llamada antes de ser transferida a las extensiones, mensajes, correo de voz o menús de llamadas. Usted puede utilizar CLIENTE en este campo para utilizar el número de teléfono del cliente, o hacer campaña para usar la primera persona que llama permitido campaña de número de identificación. El valor predeterminado es CLIENTE| +After Hours Call Menu|Después del horario de llamada Menú| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Si después de Acción de horas se establece CALLMENU, la llamada será enviada a este menú de llamada si entra en el exterior dentro del grupo del sistema de tiempo de llamada definido para el grupo de pertenencia| +Drop Call Menu|Menú desplegable de llamadas| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Si la gota de Acción se establece CALLMENU, la llamada será enviada a este menú de llamadas si llega a segundos de caída de llamadas| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|Custom DID Campos - Estos cinco campos se pueden utilizar para diversos fines, principalmente en relación a la programación personalizada y los informes| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|Si se establece en Y_WITH_AMD incluso contestador detectado llamadas de mensajes serán registrados| +Log Field|Diario de campo| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Si la clave de registro de opción de Prensa está habilitada, esta configuración opcional se puede permitir que la respuesta también sea almacenada en este campo de lista| +Default is NONE for disabled|El valor predeterminado es NONE para discapacitados| +Call Count Limit|Recuento de llamadas Límite| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Esto impone un límite en el número de intentos de llamada para los conductores marcados en esta campaña. Un líder puede ir encima de este límite un poco si el reciclaje de plomo o Auto-Alt-Marcación está habilitado. El valor predeterminado es 0 para ningún límite| +Call Count Target|Recuento de llamadas de destino| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Esta opción sólo se utiliza con fines de información y no tiene ningún efecto en los conductores marcados. El valor predeterminado es 3| +Enable Expanded List Stats|Habilitar Estadísticas ampliados Lista| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Esta configuración permite que dos columnas adicionales que se muestran en la mayoría de los cuadros de detalle de lista de estado de la modificación de la lista y las páginas de la campaña de modificación. La penetración se define como el porcentaje de conductores que están en o por encima del límite de campaña de llamadas y de visitas-o el estado está marcado como Completado. El valor predeterminado es 1 para habilitado| +Report Option|Informe Opción| +This option allows this specific shift to show up in selected reports that support this option|Esta opción permite que este cambio específico para mostrar en los informes seleccionados que apoyan esta opción| +There are|Hay| +completed leads in those lists|cables terminados en esas listas| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|La opción VIEW_PRESET simplemente abrir el marco de la transferencia y el marco preestablecido| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|CONTACTOS es una opción sólo si Contact_Information está habilitado en su sistema, que es una función personalizada| +Preset Contact Search|Búsqueda de contactos preestablecido| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Si el usuario está conectado a una campaña que tiene presets de transferencia establecidos en la Guía, a continuación, esta opción se puede deshabilitar la búsqueda de contactos sólo para este usuario. El valor predeterminado es NOT_ACTIVE que utilizará cualquiera que sea el ajuste de la campaña es| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|La opción VIEW_CONTACTS se abrirá una ventana de búsqueda de contactos, esto sólo funcionará si se selecciona Valores Habilitar se establece CONTACTOS| +Contacts Enabled|Contactos Activado| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Esta configuración permite que los contactos sub-sección de administración que permite a un administrador para añadir modificar o eliminar contactos en el sistema que pueden ser utilizados como parte de una transferencia personalizada en una campaña donde un agente puede buscar contactos por nombre primer apellido o en la oficina número y luego seleccionar uno de los muchos números asociados con ese contacto. Esta característica se utiliza a menudo por los operadores o en las funciones de centralita telefónica donde el usuario necesita para transferir una llamada a un teléfono que no sea agente. El valor predeterminado es 0 para discapacitados| +CONTACTS LIST|Lista de Contactos| +Add A Contact|Agregar un contacto| +ADD NEW CONTACT|Añadir nuevo contacto| +ADDING NEW CONTACT|AÑADIR NUEVO CONTACTO| +MODIFY CONTACT|MODIFICAR CONTACTO| +CONTACT NOT ADDED|CONTACTO NO ESTÁ SUJETA| +there is already a contact in the system with this name and number|ya hay un contacto en el sistema con este nombre y número| +CONTACT ADDED|Contacto añadido| +DELETE THIS CONTACT|Eliminar este contacto| +Click here to see Admin changes to this contact|Haga clic aquí para ver los cambios de administrador para este contacto| +DELETE CONTACT|Eliminar contacto| +CONTACT NOT DELETED|CONTACTO NO DELETED| +CONTACT DELETION CONFIRMATION|CONTACTO confirmación de la eliminación| +Office Number|Número de la oficina| +Cell Number|Número de la célula| +Other Number|Otro número| +CONTACT NOT MODIFIED|CONTACTO SIN MODIFICAR| +Scheduled Callbacks Hours Block|Programado devoluciones de llamada de horas de vuelo| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Esta opción le permite restringir una devolución de llamada useronly previsto que se muestre en la lista de devolución de llamada hasta que el agente X horas después de que se ha establecido. El valor predeterminado es 0 para no bloquear| +Scheduled Callbacks Calltime Block|Rellamadas programadas bloque Calltime| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Esta opción si está habilitado impedirá la devolución de llamada programado en la lista de devolución de llamada del agente de que se está marcando si está fuera de la calltime prevista para la campaña. El valor predeterminado es DISABLED| +Modify Same User Level|Modificar el nivel de usuario del mismo| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Este ajuste sólo se aplica al nivel 9 usuarios. Si se activa permite que el nivel 9 el usuario puede modificar su propia configuración, así como otros 9 usuarios de nivel. El valor predeterminado es 1 para habilitado| +Admin Hide Lead Data|Ocultar datos de administración de plomo| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Este ajuste sólo se aplica a nivel de 7, 8 y 9 usuarios. Si se activa reemplaza los datos principales de los clientes en los muchos informes y pantallas en el sistema con Xs. El valor predeterminado es 0 para discapacitados| +Admin Hide Phone Data|Ocultar datos de administración del teléfono| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Este ajuste sólo se aplica a nivel de 7, 8 y 9 usuarios. Si está activado, reemplaza los números de teléfono de los clientes en los muchos informes y pantallas en el sistema con Xs. Los ajustes DÍGITOS sólo mostrará los dígitos de los últimos X el número de teléfono. El valor predeterminado es 0 para discapacitados| +Allowed User Groups|Se admiten grupos de usuarios| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Esta es una lista seleccionable de los grupos de usuarios a los que los miembros de este grupo de usuarios pueden ver y, posiblemente, editar. Grupos de usuarios se puede restringir el acceso a casi todos los aspectos del sistema, a partir de DIDs entrantes a los teléfonos a los buzones de voz. El - TODOS - opción permite a los usuarios de este grupo para ver y acceder a cualquier registro en el sistema si sus permisos de usuario permiten que| +Allowed Call Times|Se admiten Tiempo de Llamadas| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Esta es una lista seleccionable de los tiempos de llamadas para que los miembros de este grupo de usuarios puede utilizar en las campañas, en los grupos y menús de llamadas. El - TODOS - opción permite a los usuarios en este grupo a usar todos los tiempos de las llamadas en el sistema| +All call times in the system|Todos los horarios de llamadas en el sistema| +You are not allowed to edit your own user group|Usted no está autorizado a editar su grupo de usuarios propia| +You are not allowed to edit your own user|Usted no está autorizado a editar su propio usuario| +Admin User Group|Grupo de usuarios de administración| +All Admin User Groups|Todos los grupos de usuarios de administrador| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|Este es el grupo de usuarios administrativos de esta campaña, lo que permite la visualización de administrador de esta campaña, así como las listas de asignados a esta campaña para ser restringido por un grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario con permisos de usuario administrador de la campaña del grupo para ver esta campaña| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|Este es el grupo de usuarios administrativa para este grupo entrante, esto permite la visualización de esta administración en grupo restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver esta dentro del grupo| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|Este es el grupo de usuarios administrativos de este lo hizo, lo que permite la visualización de esta administración ha restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para acceder a este hecho| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|Este es el grupo de usuarios administrativos de este registro, lo que permite la visualización de este administrador recoird restringido por grupo de usuarios. El valor predeterminado es - TODOS - que permite a cualquier usuario de administración para ver este expediente| +User Start for this remote agent does not exist|Inicio usuario de este agente remoto no existe| +ADMIN GROUP|GRUPO DE ADMIN| +Max Calls Method|Llama al método Max| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Esta opción se puede activar la función de máxima llamadas simultáneas para esta dentro del grupo. Si se establece en total, entonces el número total de llamadas que son manejados por los agentes y en la cola en este en-grupo no podrá exceder el máximo número de llamadas número de líneas se definen a continuación. Si se establece en IN_QUEUE, entonces, si el número de llamadas en cola de espera para los agentes no podrán exceder el máximo de llamadas Conde no importa cuántas llamadas están con agentes de este grupo de pertenencia. El valor predeterminado es DISABLED| +Max Calls Count|Max llama Conde| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Esta opción debe ser mayor que 0 si desea utilizar la función Max llama Método. El valor predeterminado es 0| +Max Calls Action|Max llama Acción| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|Esta es la acción a tomar si el máximo de llamadas a métodos es activada y el número de llamadas excede lo establecido anteriormente en la Cuenta Max llama ajuste. Las llamadas por encima de esa cantidad será enviado a cualquiera de la acción DROP, la acción o la acción AfterHours NO_AGENT_NO_QUEUE y se registrará como un estado MAXCAL con una razón de colgar MaxCalls. El valor predeterminado es NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Si un método CIDLOOKUP se utiliza con ALT, buscará el campo alt_phone el número de teléfono si no se encuentran coincidencias con el número de teléfono principal. Si un método se usa con CIDLOOKUP ADDR3, buscará el campo address3 el número de teléfono si no se encuentran coincidencias con el número de teléfono principal y, opcionalmente, el campo alt_phone| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Otro campo en esta sección es de grado, lo que permite la campaign_grade_random siguiente agente Call establecimiento para ser utilizado. Esta opción de grado para aumentar o disminuir la probabilidad de que el agente recibirá la llamada| +gives a higher probability of getting a call to the higher graded agents|da una mayor probabilidad de recibir una llamada a los agentes de mayor grado| +gives a higher probability of getting a call to the higher graded agents by in-group|da una mayor probabilidad de recibir una llamada a los agentes de mayor grado por el grupo de pertenencia| +gives a higher probability of getting a call to the higher graded agents by campaign|da una mayor probabilidad de recibir una llamada a los agentes de mayor grado por la campaña| +Day call count for this in-group|El día del recuento de llamadas para esta dentro del grupo| +Day call count for this campaign|El día del recuento de llamadas para esta campaña| +SUMMARY STATS|Resumen estadístico| +Daily Maximum Stats|Estadísticas Diarias máxima| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Estas son las estadísticas que se generan por el sistema cada día durante todo el día hasta que el reloj horario de fin de día, ya que se encuentra en la configuración del sistema. Estos números son generados a partir de los registros en el sistema para permitir la visualización mucho más rápido. Las estadísticas se incluyen son - Total de llamadas, agentes de Máximo, Máximo llamadas entrantes, llamadas salientes máximos| +Add or Remove In-Group Selected For Active Users in This User Group|En Agregar o quitar-grupo seleccionado para Usuarios activos en este grupo de usuarios| +Maximum System Stats Reports|Máximo del sistema Estadísticas Informes| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Estas estadísticas son totales almacenados en caché que se almacenan a lo largo de cada día en tiempo real a través de procesos de back-end. Para las llamadas entrantes, las llamadas totales por dentro del grupo se calculan para cada llamada que entra en el proceso que se calcula. Para el recuento de todo el sistema, los totales que se generan a partir de entradas de registro, así como los totales del grupo en otros-y la campaña. Estos totales pueden no sumar debido a la configuración que tienes en tu sistema, así como cuando la llamada se cuelga| +Hopper VLC Dup Check|Hopper VLC Dup Compruebe| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Si se establece en Y se traducirá en todas las pistas que se inserta dentro de la tolva que se comprueba por vendor_lead_code para asegurarse de que no hay duplicados cables insertados con la vendor_lead_code misma. Esto es muy útil cuando se auto-Alt-marcado con MULTI_LEAD. El valor predeterminado es N| +Inventory Report|Informe de Inventario| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Si el Informe de Inventario está habilitado en su sistema, esta opción se determinará si esta lista está incluido en el informe o no. No está en S para sí| +Report Rank|Informe Rank| +This option allows you to rank shifts in selected reports that support this option|Esta opción le permite clasificar los cambios en los informes seleccionados que apoyan esta opción| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|También puede utilizar una variable especial IGNORENOSCROLL para obligar a las barras de desplazamiento en la pestaña de secuencias de comandos, incluso si usted está usando un iframe dentro de ella| +Carrier Log Report|Carrier Informe de registro| +ADMINISTRATION: Campaign Multi-Alt-Leads|ADMINISTRACIÓN: campaña multi-Alt-Leads| +Multi-Lead Auto Alt Dialing Settings Form|Multi-plomo Auto ajustes de marcado Alt Formulario| +List Custom Fields|Lista Campos Personalizados| +Select custom template|Seleccione plantilla| +template builder|template builder| +Load from Lead File|Cargar desde un archivo de plomo| +Listloader Custom Template Maker|Listloader creador de plantillas personalizadas| +Custom template to use|Plantilla para usar| +Create a new template|Crear una nueva plantilla| +Delete an existing template|Eliminar una plantilla existente| +Sample file fitting template|Ejemplo de archivo de plantilla de montaje| +needed for field assignation||necesaria para la asignación de campo| +Select template to delete|Seleccione plantilla para eliminar| +DELETE TEMPLATE|BORRAR LA PLANTILLA| +New template form|Nueva forma de la plantilla| +Template ID|Plantilla de Identificación| +Template Name|Nombre de la plantilla| +Template Description|descripción de plantillas| +List ID template will load into|Plantilla de la lista de ID se cargará en| +Assign columns to file fields|Asignar columnas a los campos de archivos| +selecting a different list will reset columns|la selección de una lista diferente, restablecer las columnas| +Standard Field|Campo Estándar| +Custom Field|Campo Personalizado| +Select a list ID from the drop down menu above to show columns|Seleccione un ID de la lista del menú desplegable de arriba para mostrar las columnas| +SUBMIT TEMPLATE|ENVIAR LA PLANTILLA| +Click here to see Admin changes to this campaign|Haga clic aquí para ver los cambios de administrador para esta campaña| +Click here to see Admin changes to this record|Haga clic aquí para ver los cambios de administrador para este disco| +Click here to see Admin changes to this list|Haga clic aquí para ver los cambios de administrador para esta lista| +Click here to see Admin changes to this script|Haga clic aquí para ver los cambios de administrador para esta secuencia de comandos| +Click here to see Admin changes to this filter|Haga clic aquí para ver los cambios de administrador para este filtro| +Click here to see Admin changes to this In-Group|Haga clic aquí para ver los cambios de administrador para el Grupo-En| +Click here to see Admin changes to this DID|Haga clic aquí para ver los cambios de administrador para este DID| +Click here to see Admin changes to this filter phone group|Haga clic aquí para ver los cambios de administrador para este grupo de teléfono del filtro| +Click here to see Admin changes to this user group|Haga clic aquí para ver los cambios de administrador para este grupo de usuarios| +Click here to see Admin changes to this remote agent|Haga clic aquí para ver los cambios de administrador para el agente remoto| +Click here to see Admin changes|Haga clic aquí para ver los cambios admin| +CAMPAIGNS USING THIS SCRIPT|CAMPAÑAS uso de este script| +IN-GROUPS USING THIS SCRIPT|EN LOS GRUPOS uso de este script| +LIST OVERRIDES USING THIS SCRIPT|Invalida LISTA uso de este script| +ADMIN REPORT OPTIONS|Opciones de Administración INFORME| + Inbound | Entrante | +Audio File|archivo de audio| +USING THIS IN-GROUP|EL USO DE ESTE GRUPO-EN| +Handle Method|Manejar el método| +Search Method|Método de búsqueda| +USING THIS CALL MENU|EL USO DE ESTE MENÚ DE LLAMADA| +DELETE THIS CALL MENU|ELIMINAR ESTE MENÚ DE LLAMADA| +Click here to see Admin changes to this CALL MENU|Haga clic aquí para ver los cambios de administrador para el menú de llamadas| diff --git a/agc_2-X/trunk/translations/fr_language_admin.txt b/agc_2-X/trunk/translations/fr_language_admin.txt index 39a697ce..67d44d8d 100644 --- a/agc_2-X/trunk/translations/fr_language_admin.txt +++ b/agc_2-X/trunk/translations/fr_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|BORDER| VALUE=SUBMIT|VALUE=VALIDER| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Anglais| @@ -950,7 +982,7 @@ VERSION|VERSION| BUILD|CONSTRUCTION| REPORTS|RAPPORTS| USERS|UTILISATEURS| -LISTS|LISTES| +#LISTS|LISTES| SCRIPTS|SCRIPTS| FILTERS|FILTRES| IN-GROUPS|IN-GROUPS| @@ -2072,8 +2104,8 @@ DOWNLOAD|TÉLÉCHARGER| Users|Utilisateurs| User|Utilisateur| Reports|Rapports| -OUTBOUND|SORTANT| -INBOUND|ENTRANT| +#OUTBOUND|SORTANT| +#INBOUND|ENTRANT| Server Stats and Reports|Stats Reports Server et| Click here to see a VDAD report for this campaign|Cliquez ici pour voir une VDAD rapport de cette campagne| Show DIDs|Voir DiDs| @@ -2482,3 +2514,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|Xfer-Conf Nombre Override| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Ces cinq domaines pour vous permettre d-emporter les préréglages numéro de la conférence de transfert lorsque le plomb est de cette liste. Par défaut est vide| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Ces quatre domaines pour vous permettre d-avoir deux ensembles de transfert de conférence et les préréglages DTMF. Lorsque l-appel ou de la campagne est chargé, le script vicidial.php montrera deux boutons sur le transfert-cadre de conférences et automatiquement le numéro à composer et envoyer les champs DTMF lorsqu-ils sont pressés. Si vous souhaitez autoriser consultatif transferts, un fronter à un proche, que l-agent utiliser la case à cocher consultatif, qui ne fonctionne pas pour les tiers VICIDIAL demande de consultation. Pour ceux qui viennent de l-agent, cliquez le bouton de cadran avec la clientèle. Alors l-agent pouvez aussi le laisser-3way-Call et passer à leur prochain appel. Si vous souhaitez autoriser les transferts aveugles de clients à un script AGI VICIDIAL l-exploitation forestière ou un SVI, puis AXFER lieu dans le numéro à composer sur le terrain. Vous pouvez également spécifier une extension personnalisée après la AXFER, par exemple si vous voulez faire un appel vers un IVR spéciaux que vous avez défini à l-extension 83900 vous mettriez AXFER83900 dans le numéro à composer sur le terrain| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Tous les utilisateurs du système, même pas les utilisateurs inscrits| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|L'option non-logé-IN-AGENTS permet à tous les utilisateurs dans le système pour être affiché, même si elles ne sont pas enregistrés curently| +Voicemail ID|ID vocale| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Il s'agit de la boîte vocale que les appels seront dirigés vers dans un AGENTDIRECT en groupe à la fois si la baisse en groupe a la méthode de la goutte réglé sur VOCAL et le champ de messagerie vocale mis au AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale| +Record Call|Enregistrement de l'appel| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Cette option vous permet de définir les appels à venir dans ce fait pour être enregistrées. Y va enregistrer tout l'appel, Y_QUEUESTOP enregistrera l'appel jusqu'à ce que l'appel est hungup ou pénètre dans une file d'attente en groupe N ne sera pas enregistrer l'appel. Par défaut est N.| +Click here to see a list of recordings and calls for this DID|Cliquez ici pour voir la liste des enregistrements et des appels pour ce DID| +Ignore List Script Override|Ignorer Override Script Liste| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Cette option vous permet d'ignorer l'ID de liste Override Script l'option pour les appels à venir dans ce groupe-En. Mettre ce paramètre à Y ignorera tous les paramètres de la liste ID du script. Par défaut est N| +External Server IP|IP du serveur externe| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Ce paramètre est l'endroit où vous pouvez mettre une adresse IP du serveur ou nom de la machine qui peut être utilisé à la place de l'server_ip lorsque vous utilisez un webphone dans l'interface agent. Pour que cela fonctionne vous devez également avoir l'entrée téléphones configuré pour utiliser l'adresse IP du serveur externe. Par défaut est vide| +Set As Webphone|Définir en tant que Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|La définition de cette option à Y va tenter de charger un téléphone basé sur le Web lorsque l'agent se connecte à l'écran de leur agent. Par défaut est N.| +Use External Server IP|Utilisez IP du serveur externe| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Si vous utilisez un téléphone Web, vous pouvez définir cette sur Y pour utiliser les serveurs IP externe pour vous inscrire à la place de l'adresse IP du serveur. Par défaut est vide| +Default Webphone|Webphone par défaut| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Si définie à 1, cette option fera tous les nouveaux téléphones ont créés Définir en tant que jeu Webphone à défaut Y. est égal à 0| +Default External Server IP|IP par défaut du serveur externe| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Si définie à 1, cette option fera tous les nouveaux téléphones ont créés Utilisez IP du serveur externe mis à Y. par défaut est 0| +Webphone URL|URL Webphone| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|C'est l'URL de la webphone qui sera utilisé avec ce système si elle est activée dans le dossier des téléphones qui est un agent à l'aide. Par défaut est vide| +AGENT ACTIVITY FOR THIS TIME PERIOD|Activité de l'agent Pour cette période| +these fields are in seconds|ces champs sont en quelques secondes| +Enable Agent Disposition Logfile|Activer Logfile Disposition Agent| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Cette option se connecter à un fichier journal texte sur le serveur web à chaque fois qu'un appel est rejetées par un agent. Par défaut est 0, désactivé| +Agent Call Log View|Voir le journal de l'Agent d'appel| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Cette option définit si l'agent sera en mesure de voir leur journal d'appels pour les appels traités par le biais de l'écran l'agent Vicidial. Par défaut est N pour non ou désactivé| +Agent Call Log View Override|Agent Call Log Voir Override| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Ce paramètre remplace quel que soit le groupe d'utilisateurs utilisateurs s'est fixé pour View Log Agent d'appel. HANDICAPÉS utilisera le réglage du groupe utilisateur. N ne permettra pas montrer le journal des appels utilisateurs. Y permettra montrant le journal des appels de l'utilisateur. Par défaut est DISABLED| +Custom Dialplan Entry|Entrée personnalisée Dialplan| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Ce champ vous permet d'entrer dans tous les éléments plan de numérotation que vous souhaitez pour le serveur, les lignes seront ajoutées au contexte par défaut| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Ce champ vous permet d'entrer dans tous les éléments plan de numérotation que vous souhaitez pour l'ensemble des serveurs Asterisk, les lignes seront ajoutées au contexte par défaut| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Cette option vous permet d'entrer des lignes personnalisées plan de numérotation dans les menus d'appels, serveurs et les paramètres système. Par défaut est 0 pour inactif| +Custom CallerID|Personnalisé CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Lorsqu'il est réglé sur Y, cette option vous permet d'utiliser le domaine security_phrase dans le tableau vicidial_list que le CallerID d'envoyer lors de la passation pour chaque chef de file spécifique. Si ce champ n'a pas de CID en elle, puis la campagne CallerID défini ci-dessus sera utilisé à la place. Cette option permet de désactiver la liste CallerID Remplacer s'il ya un cadeau CID dans le domaine security_phrase. Par défaut est N| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID utilisera le CID personnalisé qui est défini dans le champ de la table security_phrase vicidial_list pour le plomb| +Scheduled Callbacks Alert|Rappels réguliers d'alerte| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Cette option permet de la ligne d'état rappels dans l'interface agent d'être rouge, clignote ou clignote en rouge quand il ya AGENTONLY prévue rappels qui ont frappé leur temps de déclenchement et la date. Par défaut est NONE pour la ligne d'état standard| +QueueMetrics Login-Out|QueueMetrics connecter-Out| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Cette option affecte la manière dont Vicidial va enregistrer les connexions et déconnexions d'un agent dans le queue_log. Par défaut est la norme à utiliser la norme AGENTLOGIN AGENTLOGOFF, CALLBACK utilisera AGENTCALLBACKLOGIN et AGENTCALLBACKLOGOFF que QM va analyser différemment| +Enable CallCard|Activer CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Ce paramètre permet les fonctions CallCard avec Vicidial pour permettre aux appelants d'utiliser les numéros de broches et card_ids qui ont un solde de minutes et les soldes peuvent avoir temps de conversation agent sur les appels des clients vers des groupes déduits. Par défaut est 0 pour les handicapés| +CallCard Access|CallCard accès| +Agent Transfer Options|Options de transfert de l'agent| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Ces options permettent la désactivation des boutons spécifiques dans la section Transfert Conférence de l'interface de l'agent. Par défaut est O pour oui ou permis| +Agent Allow Park Customer Dial Xfer|Agent Autoriser Xfer Parc Dial Client| +Agent Allow Dial With Customer Xfer|Agent Autoriser Dial Avec Xfer clientèle| +Agent Allow Blind Xfer|Agent Autoriser Xfer aveugles| +Agent Allow Voicemail Message Xfer|Agent Autoriser Xfer message vocal| +Agent Allow Dial Override Xfer|Agent Autoriser Xfer Override Dial| +Agent Allow Consultative Xfer|Agent Autoriser Xfer consultatif| +Agent Fullscreen|Agent plein écran| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Cette option si elle est définie à Y définir la hauteur et la largeur de l'écran l'agent Vicidial à la taille de la fenêtre du navigateur web sans aucune indemnité pour la vue d 'agents, Appels en file d'attente ou de demande en vue de la session. Par défaut est N pour non ou désactivé| +Add Extension Group|Ajouter un groupe d'extension| +New Group Extension Addition|New Ajout d'extension du groupe| +Modify Extension Group|Modifier le groupe d'extension| +Delete Extension Group|Supprimer le groupe d'extension| +Extension Groups|Groupes d'extension| +Add Extension Group Entry|Ajouter une entrée du groupe d'extension| +Extension Group|Groupe d'extension| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Ce champ est requis lorsque vous entrez l'ID du groupe que vous voulez cette extension pour être mis en. Pas d'espaces ni de caractères spéciaux à l'exception des lettres et des chiffres soulignent| +Extension:|Extension:| +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Ce champ doit là où vous mettez l'extension que vous souhaitez plan de numérotation de l'agent à distance appelle à être envoyé à cette entrée du groupe d'extension| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|Ce champ vous permet de classer les entrées de groupe de vulgarisation qui partagent le groupe même extension. Par défaut est 0| +Campaigns Groups|Groupes Campagnes| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|Dans ce domaine, vous pouvez mettre une liste d'ID de campagne et ou ID de groupe entrants que vous souhaitez restreindre l'utilisation du groupe d'extension pour. Liste doivent être séparés par des tuyaux et un tuyau au début et à la fin de la chaîne| +EXTENSION GROUP ENTRY NOT ADDED|ENTRÉE DU GROUPE D'EXTENSION PAS AJOUTÉE| +there is already an extension group entry with these values|il ya déjà une entrée de groupe d'extension avec ces valeurs| +EXTENSION GROUP ENTRY ADDED|ENTRÉE DU GROUPE extension ajoutée| +MODIFY AN EXTENSION GROUP ENTRY|Modifier une entrée GROUPE D'EXTENSION| +Click here to see Admin chages to this extension group entry|Cliquez ici pour voir chages d'administration à cette entrée du groupe d'extension| +DELETE THIS EXTENSION GROUP ENTRY|Supprimer cette rubrique GROUPE D'EXTENSION| +Call Count Today|Appelez le comte Aujourd'hui| +Last Call Time|Durée dernier appel| +Last Call ID|ID Last Call| +EXTENSION GROUP ENTRY NOT MODIFIED|ENTRÉE DU GROUPE D'EXTENSION PAS MODIFIÉ| +EXTENSION GROUP ENTRY MODIFIED|ENTRÉE DU GROUPE D'EXTENSION mise à jour| +EXTENSION GROUP ENTRY NOT DELETED|ENTRÉE DU GROUPE D'EXTENSION PAS SUPPRIMER| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|GROUPE D'EXTENSION DE SUPPRESSION D'ENTRÉE DE CONFIRMATION| +Click here to delete extension group entry|Cliquez ici pour supprimer l'entrée du groupe d'extension| +EXTENSION GROUP ENTRY DELETION COMPLETED|Suppression de la commande EXTENSION groupe a achevé| +EXTENSION GROUP LISTINGS|LISTE DES GROUPES D'EXTENSION| +Extension Group|Groupe d'extension| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Si réglé sur autre chose que NONE ou vide cela surcharger le champ d'extension externe et d'utiliser les entrées de groupe de vulgarisation qui ont la même extension ID groupe. Par défaut est NONE pour désactiver| +Click here to see agents logged in to this inbound group|Cliquez ici pour voir les agents connectés à ce groupe entrant| +Agent Choose Blended|Agent Choisissez Blended| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Cette option si elle est définie à 1 permet à l'utilisateur de choisir si l'agent a son ensemble campagne pour mélangés ou non, et si non, le réglage par défaut sera utilisé mélangé. Par défaut est 1 pour activé| +Click here to see a log of the uploads to the audio store|Cliquez ici pour voir un journal des ajouts à la boutique audio| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Cette option si elle est définie à 0 ne sera pas mis dans l'entrée en CALLSTATUS queue_log quand un agent de dispositions d'un appel. Par défaut est 1 pour activé| +QM CallStatus Override|QM CallStatus Override| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Si l'intégration QueueMetrics est activée dans les paramètres du système, alors ce paramètre permet l'impérieuse des paramètres du système de réglage pour les entrées queue_log CallStatus. Par défaut est DISABLED qui utilisera le réglage du système| +Extension Append CID|Extension Ajoutez CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Si elle est activée, les appels effectués à partir de cette campagne aura un espace et l'extension de téléphone de l'agent ajouté à la fin du nom de CallerID de l'appel avant qu'il ne soit envoyé à l'agent. Par défaut est N pour les handicapés| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Si elle est activée, les appels à venir à partir de cet en-groupe disposera d'un espace et l'extension de téléphone de l'agent ajouté à la fin du nom de CallerID de l'appel avant qu'il ne soit envoyé à l'agent. Par défaut est N pour les handicapés| +Scheduled Callbacks Count|Rappels réguliers comte| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Cette option vous permet de définir si seuls rappels VIVANTS, l'utilisateur seulement rappels réguliers qui ont frappé leur date de déclenchement et le temps, ou les rappels ALL_ACTIVE, l'utilisateur ne les rappels qui sont actives dans le système ainsi que les rappels vivent, doivent be3 compté, il int la section d'alerte de rappel d'agent sur l'écran l'agent. Par défaut est ALL_ACTIVE| +Realtime Block User Info|En temps réel Infos Message Bloquer| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Ce paramètre si elle est définie à 1 permet de bloquer les informations utilisateur et de la station ne sera pas affichée dans le rapport en temps réel. Par défaut est 0 pour les handicapés| +Manual Dial Override|Composition manuelle Override| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|Le réglage peut l'emporter sur les utilisateurs de réglage de la capacité numérotation manuelle pour les agents quand ils sont enregistrés dans cette campagne. NONE suivra la mise en utilisateurs, ALLOW_ALL permettra à tout agent connecté dans cette campagne pour passer des appels numérotation manuelle, DISABLE_ALL ne permettra à personne connecté à cette campagne pour passer des appels numérotation manuelle. Par défaut est NONE| +Blind Monitor Warning|Attention Moniteur aveugles| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Cette option si elle est activée permettra à l'agent sais de diverses manières optionnelles si elles sont d'être aveugle contrôlée par quelqu'un. DISABLED signifie que cette fonction n'est pas active, alerte ne s'affiche une alerte à l'écran l'agent, AVIS publiera une note qui reste sur l'écran aussi longtemps que l'agent theyâ re objet d'un suivi, AUDIO jouera le nom de fichier défini ci-dessous lors d'un agent commence à être surveillés et les autres options sont combibnations des options susmentionnées. Par défaut est DISABLED| +Blind Monitor Notice|Avis aveugles Moniteur| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Tel est le message qui apparaîtra sur l'écran tandis que l'agent qu'ils sont surveillés si l'option est sélectionnée AVIS. Par défaut est| +Blind Monitor Filename|Nom du moniteur aveugles| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Il s'agit du fichier audio qui jouera lors de la session des agents au début de la surveillance quelqu'un aveugler. Cette invite sera joué pour tout le monde lors de la session, y compris le client le cas échéant est présent. Par défaut est vide| +Uniqueid Status Display|Affichage de l'état uniqueid| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Si elle est activée, lorsqu'un agent reçoit un appel à travers ce en groupe, ils verront le uniqueid de l'appel a ajouté à la ligne d'état dans leur interface de l'agent. L'option PREFIX va ajouter le préfixe défini coup au début de l'uniqueid à l'écran. Défaut est Disabled. Si il y avait déjà un UniqueId définie sur un appel entrant ce en groupe, puis le uniqueid original sera affiché| +Uniqueid Status Prefix|Préfixe Statut uniqueid| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Si l'option PREFIX est sélectionné ci-dessus, alors c'est la valeur de ce préfixe. Par défaut est vide| +Default Codecs|Codecs par défaut| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|Vous pouvez définir une liste délimitée par des virgules des codecs d'être défini comme les codecs par défaut pour tous les systèmes. Options pour les codecs comprennent ulaw, alaw, gsm, g729, speex, G722, G723, G726, ILBC, ... Par défaut est vide| +Allowed Codecs|Codecs admis| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|Vous pouvez définir une liste délimitée par des virgules des codecs d'être défini comme les codecs par défaut pour ce téléphone. Options pour les codecs comprennent ulaw, alaw, gsm, g729, speex, G722, G723, G726, ILBC, ... Certains de ces codecs ne sont pas disponibles sur votre système, comme g729 ou G726. Si le champ est vide, alors les codecs par défaut du système ou de l'entrée de téléphone ci-dessus celle-ci sera utilisée pour les codecs admissibles. Par défaut est vide| +Allowed Codecs With Template|Codecs admis avec la matrice| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Mettre cette option à 1 comprendra les codecs définis ci-dessus, même si un modèle de fichier de conf est utilisé. Par défaut est 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Si l'option PRESERVE est utilisé et l'appel est envoyé à un second agent, le préfixe uniqueid et affiché au premier agent sera également affiché au second agent| +Custom Fields Modify|Modifier les champs personnalisés| +This option if set to 1 allows the user to modify custom list fields|Cette option, si mis à 1 permet à l'utilisateur de modifier les champs de listes personnalisées| +ERROR: Custom Fields are not active on this system|ERREUR: les champs personnalisés ne sont pas actifs sur ce système| +Lists Custom Field|Listes de champ personnalisé| +Field Label|Étiquette de zone| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|C'est l'identificateur de champ de base de données pour ce champ. Ce doit être un identifiant unique dans les champs personnalisés pour cette liste. Ne pas utiliser les espaces ou la ponctuation pour ce domaine. max 50 caractères, un minimum de 2 caractères| +Field Name|Nom du champ| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|C'est le nom du champ tel qu'il apparaîtra à un agent par le biais de leur interface. Vous pouvez utiliser des espaces dans ce domaine, mais aucun signe de ponctuation caractères, maximum de 50 caractères et un minimum de 2 caractères| +Field Description|Description du champ| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|La description de ce champ tel qu'il apparaîtra dans l'interface d'administration. Ce champ est facultatif avec un maximum de 100 caractères| +Field Rank|Rang de terrain| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|L'ordre dans lequel ces champs est affiché à l'agent le plus faible d'en haut vers le plus haut sur le fond| +Field Help|Aide de terrain| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Champ optionnel, si vous le remplir, l'agent sera en mesure de voir ce texte quand ils cliquent sur un lien d'aide à côté du champ dans leur interface de l'agent| +Field Type|Type de champ| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Cette option définit le type de champ qui sera affiché. TEXTE est un formulaire d'inscription standard unique en ligne, AREA est une zone de texte multi-lignes, SELECT est une sélection unique menu déroulant, MULTI est une boîte multi-sélection, la radio est une liste de boutons radio, où une seule option peut être sélectionné, CHECKBOX est une liste de cases à cocher où plusieurs options peuvent être sélectionnées, DATE est un calendrier jour mois année popup où l'agent peut sélectionner la date et l'heure est une boîte de sélection du temps. La valeur par défaut est TEXT. Pour les options SELECT, MULTI, RADIO et CHECKBOX vous devez définir les valeurs des options ci-dessous dans le champ Options de la boîte| +Field Options|Options pour les champs| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Pour la touche SELECT, MULTI, RADIO et les types de champs case, vous devez définir les valeurs des options dans cette boîte. Vous devez mettre une liste de l'étiquette possibilité séparées par des virgules et texte de l'option ici à chaque option un sa propre ligne. La première valeur ne devrait pas avoir des espaces, et ni les valeurs devraient avoir aucun signe de ponctuation. Par exemple - electric_meter, compteur électrique| +Field Size|Taille du champ| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Ce réglage signifie des choses différentes en fonction de ce que le type de champ est. Pour les champs texte, la taille est le nombre de caractères qui apparaîtra dans le domaine. Pour les champs ZONE, la taille est la largeur de la zone de texte en caractères. Pour les champs MULTI, ce paramètre définit le nombre d'options à afficher dans la liste sélection multiple. Pour SELECT, RADIO, CHECKBOX, DATE et HEURE ce paramètre est ignoré| +Field Max|Champ Max| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Ce réglage signifie des choses différentes en fonction de ce que le type de champ est. Pour le texte, les champs cachés et READONLY, la taille est le nombre maximum de caractères autorisés dans le domaine. Pour les champs AREA, ce champ définit le nombre de lignes de texte visible dans la zone de texte. Pour MULTI, SELECT, RADIO, CHECKBOX, DATE et HEURE ce paramètre est ignoré| +Field Cost|Coût de terrain| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Ce champ en lecture seule vous indique quel est le coût de ce champ est dans le tableau champ personnalisé pour cette liste. Il n'y a pas de limite pour le nombre de champs personnalisés que vous pouvez avoir dans une liste, mais le total du coût de tous les champs de la liste doit être inférieure à 65000. Cela permet généralement pour des centaines de champs, mais si vous spécifiez plusieurs champs de texte qui sont des centaines ou des milliers de caractères de longueur, vous pouvez atteindre cette limite rapidement. Si vous avez besoin que beaucoup de texte dans un champ, vous devez choisir un type de région, qui sont stockés différemment et ne pas utiliser l'espace de table autant| +Field Required|Champ obligatoire| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Si réglé sur Y, ce champ forcer l'agent à entrer du texte ou sélectionner une option pour ce domaine. Par défaut est N| +Field Default|Par défaut le terrain| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Ce champ optionnel vous permet de définir quelle est la valeur à attribuer à un champ si rien n'est chargé dans ce domaine. Par défaut est NULL, qui désactive la fonction par défaut| +MODIFY FIELDS|MODIFIER LES CHAMPS| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|LISTE LISTE avec des champs personnalisés COUNT| +SUMMARY OF FIELDS|RÉSUMÉ DES CHAMPS| +ADD A NEW CUSTOM FIELD FOR THIS LIST|Ajouter un nouveau champ MESURE POUR CETTE LISTE| +ERROR: Field does not exist|ERREUR: Champ n'existe pas| +ERROR: Table does not exist|ERREUR: La table n'existe pas| +ERROR: Field already exists for this list|ERREUR: Champ existe déjà pour cette liste| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|CLIQUEZ ICI pour confirmer la suppression ce champ personnalisé| +THIS CUSTOM FIELD HAS BEEN DELETED|Ce champ personnalisé a été supprimé| +Records in this custom table|Les dossiers de cette table personnalisée| +EXAMPLE OF CUSTOM FORM|EXEMPLE DE FORMULAIRE DE MESURE| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Pour les types de champ DATE, la valeur par défaut est toujours mis à jour à moins qu'un nombre est mis en auquel cas la date sera celle de nombreux jours, plus ou moins aujourd'hui. Pour les types de champ Heure, la valeur par défaut est toujours mis à l'heure actuelle du serveur sauf si un nombre est mis en auquel cas le temps sera que plusieurs minutes plus ou moins de temps en cours| +MODIFY EXISTING FIELDS|MODIFIER LES CHAMPS EXISTANTS| +Field Name Position|Position Nom du champ| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|S'il est défini à GAUCHE, ce nom de champ apparaît à gauche du champ, si elle est définie de la page le nom du champ prendra toute la ligne et apparaissent au-dessus du champ. Par défaut est laissé| +Option Position|Position Option| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Pour les types de terrain CheckBox et RADIO seulement, s'il est réglé sur HORIZONTAL les options apparaissent sur la même ligne éventuellement retour à la ligne ci-dessous si il ya beaucoup d'options. Si la valeur Vertical, il y aura seulement une option par ligne. Par défaut est HORIZONTAL| +Hold Time Option Minimum|Tenez minimum Option Temps| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Si l'option Hold Time est activé, c'est le nombre minimum de secondes de l'appel doit être en attente avant d'être présenté avec l'option temps de maintien. L'option temps de maintien sera immédiatement présenté à ce moment si le temps de maintien estimée est supérieure à la touche Option secondes la valeur temps. Par défaut est 0 secondes| +ADDING COPIED CARRIER|AJOUT CARRIER COPIE| +ADD COPIED CARRIER|Ajouter le transporteur COPIE| +Source Carrier|Transporteur de source| +COPIED CARRIER ADDED|CARRIER COPIE AJOUTÉE| +Copy A Carrier|Copier Un Transporteur| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Champ OrderIf plus d'un champ a le même rang, ils seront placés sur la même ligne et ils seront placés dans l'ordre par cette valeur la plus faible au plus élevé, de gauche à droite| +Copy Fields to Another List|Copier les champs à une autre liste| +List ID to Copy Fields to|La liste des ID pour copier les champs pour| +List ID to Copy Fields From|La liste des ID pour copier les champs De| +Copy Option|Option de copie| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Lors de la copie des définitions de champs d'une liste à l'autre, vous avez quelques options pour le fonctionnement du processus de copie. APPEND ajoute les champs qui ne sont pas présents dans la liste de destination, si il ya des étiquettes sur le terrain correspondant à ceux volonté est resté inchangé, pas de données de champs personnalisés seront supprimés ou modifiés en utilisant cette option. UPDATE met à jour les champs communs field_label dans la liste de destination pour les définitions des champs de la liste source. des données de champs personnalisés peuvent être modifiées ou perdues en utilisant cette option. REMPLACER va supprimer tous les champs personnalisés existants dans la liste de destination et de les remplacer par des champs personnalisés à partir de la liste des sources, toutes les données de champs personnalisés seront supprimés à l'aide de cette option| +ERROR: Source list has no custom fields|ERREUR: la liste Source n'a pas de champs personnalisés| +SUCCESS: Custom Field Added|SUCCÈS: Champ personnalisé Ajouté| +SUCCESS: Custom Field Modified|SUCCÈS: champ personnalisé de modification| +SUCCESS: Custom Field Deleted|SUCCÈS: Champ personnalisé supprimé| +Copy List Custom Fields|Copier les champs de liste personnalisés| +ERROR: You cannot copy fields to the same list|ERREUR: Vous ne pouvez pas copier les champs à la même liste| +DISPLAY will display only and not allow for modification by the agent|AFFICHAGE affiche uniquement et ne pas permettre la modification par l'agent| +Hold Time Option Callmenu|Tenez Callmenu Option Temps| +Hold Time Option Press Filename|Tenez Nom de presse Heure Option| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Si l'option Hold Time est réglé sur CALL_MENU, c'est le menu Appel que l'appel sera envoyé à si le temps de maintien estimée dépasse les secondes touche Option Temps| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Si l'option Hold Time est réglé sur l'une des options PRESS_, c'est le nom de fichier rapide qui se joue, si le temps de maintien estimée dépasse les secondes touche Option Temps de donner au client l'option d'appuyer sur 1 sur leur téléphone afin de fonctionner le temps de maintien sélectionné Appuyez sur Option. Il est très important que ce fichier audio est de 10 secondes ou moins, ou il y aura des problèmes. Par défaut est à-être-appelé-back| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Si l'une des options PRESS_ est sélectionné, il jouera le nom de fichier de presse défini ci-dessous et donner au client l'option d'appuyer sur 1 sur leur téléphone à quitter la file d'attente et d'exécuter l'option sélectionnée| +Hold Time Option After Press Filename|Tenez Option Time After Nom de presse| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Si l'option Hold Time est réglé sur l'une des options PRESS_ ou CALLERID_CALLBACK, c'est le nom de fichier rapide qui se joue après que le client a appuyé sur 1 ou l'appel a été ajouté à la liste de rappel| +Inbound Queue No Dial|Pas de file d'attente entrante Composez| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Cette fonctionnalité, si la valeur ENABLED vous permet d'empêcher sortant numérotation automatique de cette campagne s'il ya des appels entrants en attente dans la file d'attente qui font partie des groupes entrantes autorisées fixés dans cette campagne. Mettre cette option à ALL_SERVERS va changer l'algorithme pour calculer tous les appels entrants que les appels actifs sur ce serveur, même si elles sont sur un autre serveur qui permettra de réduire le risque de placer des appels sortants inutiles si vous avez des appels arrivant sur un autre serveur. Par défaut est DISABLED| +After Hours Filename Override|Après Nom Heures Override| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|Ces champs vous permettent de remplacer le message après les heures pour les groupes entrants si elle est définie à quelque chose. Par défaut est vide| +On Hold Prompt No Block|En attente Demander Non Bloquer| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|La définition de cette option à Y permettra appels en ligne derrière un appel en attente, où l'invite à jouer est d'aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le message d'attente Nom Prompt joue à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N| +On Hold Prompt Seconds|En attente secondes Prompt| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Ce champ doit être réglé sur le nombre de secondes que le nom de fichier en attente d'invite joue pour. Par défaut est 10| +Hold Time Option Press No Block|Maintenez Appuyez sur Option No Time Bloquer| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|La définition de cette option à Y permettra appels en ligne derrière un appel où la touche Option Temps de presse Nom invite joue pour aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le temps de maintien Option Nom message Appuyez sur la lecture à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N| +Hold Time Option Press Filename Seconds|Hold Time Seconds Appuyez sur Option Nom de fichier| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Ce champ doit être réglé sur le nombre de secondes que le temps de maintien de presse Option Nom joue pour. Par défaut est 10| +CallCard Generate New Numbers|CallCard Générer nouveaux numéros| +Call Menu In-Group Settings|Appelez le menu Réglages En-Groupe| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Si l'itinéraire est défini à l'endogroupe puis, il ya de nombreuses options que vous pouvez utiliser pour définir la manière dont l'appel est envoyé à la file d'attente en. En-Group est le groupe entrant que vous voulez l'appel à aller. Méthode La poignée est la façon dont vous voulez que l'appel à être manipulés| +Click here to see a list of the available handle methods|Cliquez ici pour voir une liste des méthodes disponibles poignée| +VID Enter Filename|VID Entrez Nom| +VID ID Number Filename|Nom du fichier VID Numéro d'identification| +VID Confirm Filename|VID Confirmer Nom| +VID Digits|Chiffres VID| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Méthode de recherche définit la manière dont la file d'attente se trouve le prochain agent, de recommander le laisser sur LB. ID de liste est la liste que le nouveau chef de file est inséré, même si la méthode n'est pas une méthode LOOKUP et le plomb ne se trouve pas. ID de la campagne est la campagne pour chercher des listes par le biais si l'un des méthodes RC est utilisé. Code de téléphone est l'entrée du champ phone_code pour le plomb qui est insérée avec. VID Entrez nom de fichier est utilisé si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio joué de demander au client d'entrer son identifiant. Nom du fichier VID Numéro d'identification est utilisée si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio jouée après la clientèle entre leur carte d'identité, quelque chose comme vous avez saisies. VID Confirmer nom de fichier est utilisé si la méthode est définie à l'une des méthodes VIDPROMPT, il est l'invite audio joué afin de confirmer leur identité, quelque chose comme 1 COMMUNIQUÉ DE PRESSE POUR CONFIRMER ET 2 DE RETOURNER. Chiffres VID est utilisée si la méthode est définie à l'une des méthodes VIDPROMPT, si elle est définie à un certain nombre, c'est le nombre de chiffres qui doivent être saisies par le client lorsque vous êtes invité pour leur identité, s'il est réglé à vide ou X puis le client devra appuyer sur la livre ou le hachage pour terminer leur entrée sur leur carte d'identité| +Admin Web Directory|Annuaire Web Admin| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Il s'agit du répertoire que votre contenu web administation, comme admin.php, sont po par défaut est Vicidial. Pour déterminer votre répertoire web d'administration, il est tout ce qui est entre le nom de domaine et le admin.php dans l'URL de cette page, sans les barres obliques de début et de fin| +TTS Voice|TTS Voix| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|C'est là que vous définissez la voix pour être utilisé dans la génération TTS. Par défaut est Allison-8kHz| +Default Field Labels|Les étiquettes de champs par défaut| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Ces 19 champs vous permettent de définir le nom tel qu'il apparaîtra dans l'interface agent de Vicidial ainsi que la page de modification administrative plomb. Par défaut est vide, ce qui va utiliser les valeurs par défaut codées en dur dans l'interface agent de| +Label Title|Titre Label| +Label First Name|Nom Étiquette| +Label Middle Initial|Moyen-étiquette initiale| +Label Last Name|Nom de la dernière étiquette| +Label Address1|Étiquette Adresse1| +Label Address2|Étiquette Adresse2| +Label Address3|Étiquette Address3| +Label City|Ville d'étiquettes| +Label State|Etat d'étiquettes| +Label Province|Province d'étiquettes| +Label Postal Code|Étiquette Code postal| +Label Vendor Lead Code|Code de plomb étiquette du vendeur| +Label Gender|Sexe étiquette| +Label Phone Number|Numéro de téléphone d'étiquettes| +Label Phone Code|Code de Téléphone étiquette| +Label Alt Phone|Téléphone Alt étiquette| +Label Security Phrase|Phrase Label Security| +Label Email|Email étiquette| +Label Comments|Commentaires étiquettes| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|Nous ne recommandons pas la mise en appels entrants vers une plus grande priorité que les appels sortants de la campagne parce que les gens font escale dans s'attendre à attendre et les gens sont appelés attendre pour que quelqu'un soit là sur le téléphone| +Formerly called Conf File Secret|Anciennement appelé secret fichier de conf| +Registration Password|Inscription Mot de passe| +Login Password|Login Mot de passe| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|Le mot de passe utilisé pour l'utilisateur du téléphone pour se connecter à des applications clientes basées sur le Web. IMPORTANT, c'est le seul mot de passe pour la connexion agent web interface téléphonique, de changer le sip.conf ou mot de passe iax.conf, ou secret, pour cet appareil de téléphone dont vous avez besoin de modifier le mot de passe d'inscription dans le champ suivant| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|SCRIPT également afficher uniquement, mais vous êtes en mesure d'utiliser des variables de script comme dans la fonction de scripts. Champs script va aussi afficher uniquement le contenu dans les options, et non pas le nom du champ comme le type d'affichage ne| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|Vous pouvez également inclure les champs par défaut Vicidial dans une configuration de champ personnalisé, et vous les voir en rouge dans la liste. Ces champs ne seront pas ajoutés à la table de la base liste personnalisée, l'interface agent au lieu référence à la table vicidial_list directement. Les étiquettes que vous pouvez utiliser afin d'inclure les fieds par défaut sont| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Si les champs de liste personnalisées sont activées sur votre système, formulaire s'ouvrira sur l'onglet FORMULAIRE lors de la connexion d'un appel à un agent| +Enable Custom List Fields|Activer les champs de liste personnalisés| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Ce paramètre permet la liste personnalisée fonction des champs qui permet de champs de données personnalisés à définir dans l'interface Web d'administration sur une base par liste et alors ces champs disponibles dans un onglet formulaire à l'agent dans l'interface web agent. Par défaut est 0 pour les handicapés| +CUSTOM FIELDS FOR THIS LEAD|CHAMPS SUR MESURE POUR CE FIL| +Slave Database Server|Database Server esclave| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Si vous avez un serveur base de données MySQL esclave puis entrez l'adresse IP locale de ce serveur ici. Cette option n'est actuellement utilisé que par les rapports sélectionnés dans l'option suivante et n'a rien à voir avec la configuration automatique de MySQL réplication maître-esclave. Par défaut est vide pour les handicapés| +Reports to use Slave DB|Rapports d'utiliser DB Slave| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Cette option vous permet de sélectionner les rapports que vous souhaitez utiliser la base de données ont esclave MySQL tel que défini dans l'option ci-dessus au lieu de la base de données master que votre système en direct Vicidial est exécuté. Vous devez mettre en place la réplication MySQL esclave avant que vous pouvez activer cette option. Par défaut est vide pour les handicapés| +Custom fields defined for this list|Les champs personnalisés définis pour cette liste| +Go to the list modification page for this list|Aller à la page de modification liste pour cette liste| +Estimated Hold Time Option|Estimation Option Temps de maintien| +Hold Time Second Option|Tenez Option Second Time| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Même que le champ Option temps de maintien ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 2. Par défaut est NONE. Si aucune option de maintien première fois est sélectionné, cette option ne sera pas offert| +Hold Time Third Option|Tenez Option troisième fois| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Même que le champ Option temps de maintien ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 3. Par défaut est NONE. Si aucune option Mise en attente Deuxième temps est sélectionné, cette option ne sera pas offert| +Wait Time Option|Attendre Option Temps| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Cela vous permet de donner aux clients des options pour sortir de la file d'attente si leur temps d'attente est plus le nombre de secondes indiquées ci-dessous. Par défaut est NONE. Si l'une des options PRESS_ est sélectionné, il jouera le nom de fichier de presse défini ci-dessous et donner au client l'option d'appuyer sur 1 sur leur téléphone à quitter la file d'attente et d'exécuter l'option sélectionnée. L'option PRESS_STAY enverra le client vers la file d'attente sans pour autant perdre leur place dans la ligne| +Wait Time Second Option|Attendre Option Second Time| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Même que le champ Option temps d'attente ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 2. Par défaut est NONE. Si aucune option d'attente première fois est sélectionné, cette option ne sera pas offert| +Wait Time Third Option|Attendre Option troisième fois| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Même que le champ Option temps d'attente ci-dessus, sauf celle-ci va vérifier pour le client en appuyant sur la touche 3. Par défaut est NONE. Si aucune option d'attente Deuxième temps est sélectionné, cette option ne sera pas offert| +Wait Time Option Seconds|Attendez quelques secondes Option Temps| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Si l'option temps d'attente est fixé à quelque chose, mais AUCUN, c'est le nombre de secondes que le client a été en attente dans la file d'attente qui va déclencher les options de temps d'attente. Par défaut est 120 secondes| +Wait Time Option Extension|Attendre Extension Option Temps| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Si l'option temps d'attente est fixé à PRESS_EXTEN, c'est l'extension que le plan de numérotation téléphonique sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option| +Wait Time Option Callmenu|Attendre Callmenu Option Temps| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Si l'option temps d'attente est fixé à PRESS_CALLMENU, c'est le menu Appel que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option| +Wait Time Option Voicemail|Attendre la messagerie vocale Option Temps| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Si l'option temps d'attente est fixé à PRESS_VMAIL, c'est la boîte vocale que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option. Dans un AGENTDIRECT en groupe, le réglage à AGENTVMAIL sera sélectionnez l'ID utilisateur à utiliser la messagerie vocale| +Wait Time Option Transfer In-Group|Attendre transfert Option Temps En-Groupe| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Si l'option temps d'attente est fixé à PRESS_INGROUP, c'est le groupe entrant que l'appel sera envoyé à si le client appuie sur la touche option lorsque présentés avec l'option| +Wait Time Option Press Filename|Attendre Nom de presse Heure Option| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Si l'option temps d'attente est fixé à l'une des options PRESS_, c'est le nom de fichier rapide qui se joue, si le temps d'attente des clients dépasse les secondes des temps d'attente Option de donner au client l'option d'appuyer sur 1, 2 ou 3 sur leur téléphone afin de fonctionner les options choisies temps d'attente de presse. Il est très important que vous inclure des options dans le fichier audio pour l'ensemble de vos options sélectionnées les temps d'attente, et que la longueur du fichier audio en quelques secondes est bien définie dans le domaine du fichier secondes ci-dessous ou il y aura des problèmes. Par défaut est à-être-appelé-back| +Wait Time Option Press No Block|Attendre Appuyez sur Option No Time Bloquer| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|La définition de cette option à Y permettra appels en ligne derrière un appel où l'attente Option Temps de presse Nom invite joue pour aller à un agent si l'on devient disponible pendant la lecture du message. Alors que le temps d'attente Option Nom message Appuyez sur la lecture à un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N| +Wait Time Option Press Filename Seconds|Les temps d'attente secondes Appuyez sur Option Nom de fichier| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Ce champ doit être réglé sur le nombre de secondes que le temps d'attente Appuyez sur Option Nom joue pour. Par défaut est 10| +Wait Time Option After Press Filename|Attendre Option Time After Nom de presse| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Si l'option temps d'attente est fixé à l'une des options PRESS_, c'est le nom de fichier rapide qui se joue après que le client a appuyé sur 1, 2 ou 3| +Wait Time Option Callback List ID|Attendre Option Temps liste de rappel ID| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Si l'option temps d'attente est fixé à PRESS_CID_CALLBACK, c'est l'ID de la liste de l'appel est ajouté à un nouveau chef de file si le client appuie sur la touche option lorsque présentés avec l'option| +Wait Hold Option Priority|Attendre Tenez priorité Option| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Si les deux options de temps estimé le protéger et attendre les options de temps sont actifs, ce paramètre sera de définir si un, l'autre ou les deux de ces fonctions sont actives. Par exemple, si l'option de maintien Durée estimée est fixé à 360, l'option temps d'attente est fixé à 120 et le client a été en attente pendant 120 secondes et il ya encore 400 secondes estimé la durée de rétention, puis ils sont tous deux actifs en même temps et ce paramètre sera vérifié pour voir quelles options seront offertes. Par défaut, c'est d'attendre que| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|Les options verrouillés sont utilisés pour verrouiller la valeur de la touche de transfert rapide, même si l'agent utilise les fonctionnalités de conférence de transfert lors d'un appel avant d'utiliser le bouton de transfert rapide| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|HANGUP raccroche l'appel lorsque la minuterie est déclenchée, CALLMENU enverra l'appel au menu Appel spécifié dans le champ Destination minuterie d'action, EXTENSION enverra l'appel à l'extension qui est spécifié dans le champ Destination minuterie d'action, IN_GROUP enverra l'appel à l'en-groupe spécifié dans le champ Destination minuterie d'action| +Timer Action Destination|Destination action minuterie| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Ce champ est l'endroit où vous spécifiez le menu Appel, Extension ou en groupe que vous voulez que l'appel envoyé à l'action si l'heure est défini CALLMENU, EXTENSION ou IN_GROUP. Par défaut est vide| +You must enter field options when adding a|Vous devez entrer dans les options sur le terrain lors de l'ajout d'un| +You must enter field options when updating a|Vous devez entrer dans les options sur le terrain lors de mettre à jour un| +Allowed Reports|Rapports admis| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Si un utilisateur dans ce groupe est fixé à 7 niveau de l'utilisateur ou plus, cette fonction peut être utilisée pour restreindre les rapports que les utilisateurs peuvent visualiser. Par défaut est ALL. Si vous voulez sélectionner plus d'un rapport, puis appuyez sur la touche Ctrl de votre clavier pendant que vous sélectionnez les rapports| +You are not allowed to view this report|Vous n'êtes pas autorisé à consulter ce rapport| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - comportera des listes inactives dans la recherche pour le nombre| +Add-Delete DNC Number|Ajouter-Supprimer Nombre DNC| +Add DNC Number|Ajouter un numéro de DNC| +Copy Custom Fields|Copier les champs personnalisés| +Add Filter Phone Group|Ajouter un groupe Téléphone filtre| +New Filter Phone Group|Nouveau groupe Téléphone filtre| +Modify Filter Phone Group|Modifier le groupe Téléphone filtre| +Delete Phone Filter Group|Supprimer Téléphone Filtre Groupe| +Filter Phone Groups|Téléphone Groupes Filter| +Filter Phone Group ID|Filtre ID Groupe Téléphone| +Filter Phone Group Name|Filtre Nom du groupe Téléphone| +Filter Phone Group Description|Filtre Description du groupe Téléphone| +PHONE FILTER GROUP NOT ADDED|TÉLÉPHONE filtre de groupe PAS AJOUTÉE| +there is already a PHONE FILTER GROUP in the system with this ID|il ya déjà un groupe TÉLÉPHONE FILTRE dans le système avec cet ID| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|ID Group Téléphone filtre doit être comprise entre 2 et 20 caractères de longueur et ne contiennent pas| +PHONE FILTER GROUP ADDED|TÉLÉPHONE filtre de groupe AJOUTÉE| +Add Filter Phone Group|Ajouter un groupe Téléphone filtre| +Add-Delete FPG Number|Nombre FPG Ajouter-Supprimer| +Add FPG Number|Ajouter un numéro de GJ| +FILTER PHONE GROUP NOT MODIFIED|GROUPE DE TÉLÉPHONE FILTRE PAS MODIFIÉ| +FILTER PHONE GROUP MODIFIED|GROUPE DE TÉLÉPHONE filtre modifié| +FILTER PHONE GROUP NOT DELETED|GROUPE DE TÉLÉPHONE FILTRE PAS SUPPRIMER| +Click here to delete FILTER PHONE GROUP|Cliquez ici pour supprimer le groupe TÉLÉPHONE FILTRE| +FILTER PHONE GROUP DELETION CONFIRMATION|FILTRE CONFIRMATION DE SUPPRESSION DE TÉLÉPHONE DU GROUPE| +FILTER PHONE GROUP DELETION COMPLETED|FILTRE DE SUPPRESSION DU GROUPE DE TÉLÉPHONE REMPLI| +Click here to see Admin chages to this filter phone group|Cliquez ici pour voir chages d'administrateur pour ce groupe de téléphone du filtre| +DELETE THIS FILTER PHONE GROUP|Supprimer ce groupe TÉLÉPHONE FILTRE| +FILTER PHONE GROUP LISTINGS|Filtrer les listings Group Téléphone| +Filter Phone Group Numbers|Filtre à Numéros de téléphone du groupe| +This phone number is not in the Filter Phone Group List|Ce numéro de téléphone n'est pas dans la liste Groupe Téléphone filtre| +This phone number is already in the Filter Phone Group List|Ce numéro de téléphone est déjà dans la liste Groupe Téléphone filtre| +FILTER PHONE GROUP NUMBER NOT DELETED|FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE PAS SUPPRIMER| +FILTER PHONE GROUP NUMBER DELETED|FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE SUPPRIMÉ| +FILTER PHONE GROUP NUMBER NOT ADDED|FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE PAS AJOUTÉE| +FILTER PHONE GROUP NUMBER ADDED|FILTRE NUMÉRO DE TÉLÉPHONE DU GROUPE AJOUTÉE| +Numbers in this Filter Phone Group|Numéros de ce groupe Téléphone filtre| +There are no phone numbers in list|Il n'y a pas les numéros de téléphone figurant sur la liste| +There are no leads in Campaign DNC list|Il n'y a pas conduit dans la liste DNC Campagne| +There are no leads in this filter phone group|Il n'y a pas conduit dans ce groupe de téléphone du filtre| +Click here to download the numbers in this filter phone group|Cliquez ici pour télécharger les numéros de téléphone dans ce groupe filtre| +Filter Inbound Number|Filtre Nombre entrants| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Cette option, si activée, vous permet de filtrer les appels à venir dans ce DID et les envoyer à une autre action si elles correspondent à un numéro de téléphone qui se trouve dans le groupe téléphone filtre ou une réponse URL si vous avez configuré un. Défaut est Disabled. GROUPE va chercher dans un groupe Téléphone filtre. URL enverra une URL et correspondra si un 1 est renvoyé| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Si le champ Numéro de filtre entrant est réglé sur GROUPE, alors c'est l'ID du groupe Téléphone filtre qui aura ses numéros de recherche à la recherche d'un match à l'identification de l'appelant le numéro de l'appel entrant| +Filter URL|URL Filter| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Si le champ Numéro de filtre entrant est réglé à l'URL, alors c'est l'adresse Web d'un script qui va chercher un système distant et retourner un 1 pour un match et un 0 pour aucun match. Seuls les deux variables sont disponibles à l'adresse si vous utilisez le préfixe VAR comme avec des adresses formulaire en ligne dans les campagnes, - A - phone_number - B - et - A - did_pattern - B - peut être utilisé dans l'URL pour indiquer l'ID de l'appelant de l'appelant et l'a fait que le client a appelé dans le| +Filter Action|Action de filtrage| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Si le filtre est activé Nombre entrants et une correspondance est trouvée, alors c'est l'action qui doit être prise. C'est la même chose que la route que vous sélectionnez pour un SDA, et les réglages ci-dessous fonctionnent comme ils le font pour une norme de routage| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|C'est l'ID du groupe Téléphone filtre qui est le conteneur pour un groupe de numéros de téléphone que vous pouvez avoir automatiquement fouillé quand un appel arrive dans un fichier. DID et l'envoyer à un autre itinéraire si il ya un match Ce champ doit être comprise entre 2 et 20 caractères et n'ont pas de ponctuation à l'exception de soulignement| +Filter Phone Group Description|Filtre Description du groupe Téléphone| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Ceci est la description du groupe Téléphone filtre, il est purement à des fins de notation et n'est pas un champ obligatoire| +Clean CID Number|Nettoyez Nombre CID| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|Ce champ vous permet de spécifier un certain nombre de chiffres à limiter le nombre d'appel entrant ID en mettant un R en face de le nombre de chiffres, par exemple pour limiter les 10 chiffres de droite, vous devez entrer dans R10. Vous pouvez également utiliser cette fonctionnalité pour supprimer seulement un chiffre de premier plan ou de chiffres en mettant un L devant les chiffres spécifiques que vous souhaitez supprimer, par exemple pour enlever un 1 comme le premier chiffre que vous entrez en L1. Par défaut est vide. Si plus d'une règle est prévue assurez-vous de les séparer par un espace et du R sera exécuté avant la L| +must be an existing vicidial user|doit être un utilisateur existant Vicidial| +you must use a valid user as the user_start for remote agents|vous devez utiliser un utilisateur valide que l'user_start pour les agents à distance| +your number of lines overlaps with another remote agent|votre nombre de chevauchements de lignes avec un autre agent à distance| +Webphone URL Override|Remplacer URL Webphone| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Ce paramètre vous permet de définir une URL webphone autre seulement pour les membres d'un groupe d'utilisateurs. Par défaut est vide| +Calculate Estimated Hold Seconds|Calculer secondes Attente Estimation| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Ceci définit le nombre de secondes dans la file d'attente que le client doit attendre avant de le temps de maintien estimée sera calculée et éventuellement joué. Minimum est de 3 secondes, même s'il est réglé inférieur à 3. Par défaut est 0| +Campaign Preset Added|Preset Campagne Ajouté| +Campaign Presets|Préréglages de la campagne| +Modify Campaign Preset|Modifier numéro de la campagne| +Campaign Preset Removed|Preset campagne Suppression| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Si le réglage de la campagne pour les presets est ENABLED alors vous avez la possibilité de définir le transfert à la Conférence des préréglages qui seront disponibles à l'agent qui leur permet de 3-way appeler ces préréglages ou transférer des appels aveugles à ces numéros de présélection. Ces presets ont également une option pour cacher le numéro associé à chaque préréglage de l'agent| +PRESET NOT ADDED|PRESET PAS AJOUTÉE| +there is already an entry for this campaign with this preset|il ya déjà une entrée pour cette campagne avec ce preset| +PRESET NOT MODIFIED|PRESET PAS MODIFIÉ| +>Presets<|> Presets moins de| +Hide Transfer Number to Dial|Masquer le numéro de transfert à composer| +Enable Transfer Presets|Activer Presets de transfert| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Cette option permettra aux présélections de menu sous de comparaître à la partie supérieure de la page de modification de la campagne, et aussi vous aurez la possibilité de spécifier prédéfinis numéros de numérotation pour les agents à utiliser dans le cadre de transfert de la conférence de l'interface de l'agent. Par défaut est DISABLED| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Cette option permet de cacher le numéro à composer le terrain dans le cadre de transfert de la conférence de l'interface de l'agent. Par défaut est DISABLED| +PRESETS FOR THIS CAMPAIGN|PRESETS pour cette campagne| +ADD NEW PRESET|ADD NEW PRESET| +Hide Number|Masquer numéro| +Preset Name|Nom du paramètre prédéfini| +Preset Number|Numéro préréglé| +Preset DTMF|Preset DTMF| +CAMPAIGN PRESET LISTINGS|LISTE DE CAMPAGNE PRESET| +CAMPAIGN PRESET NOT DELETED|PRESET CAMPAGNE PAS SUPPRIMER| +Show Presets Stats|Voir les statistiques Presets| +AGENT DIAL PRESETS NAMES|AGENT PRESETS DIAL NOMS| +Manual Dial Prefix|Préfixe Manuel| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Ce champ optionnel vous permet de définir le préfixe doit être utilisé que lors d'un appel numérotation manuelle à partir de l'interface agent, comme l'utilisation de la fonction numérotation manuelle, ou Composez le numéro suivant dans la méthode lorsque la numérotation manuelle, ou numérotation manuelle nombre alt, ou prévue par l'utilisateur seulement rappels. Par défaut est vide pour les handicapés, qui utilisent le préfixe défini dans le champ ci-dessus. Cette option ne pas interférer avec l'option Préfixe 3way| +Here is a list of reserved phrases that cannot be used as menu IDs|Voici une liste de phrases réservés qui ne peuvent pas être utilisés en tant que menu ID| +Call Menu ID cannot use reserved words|ID Menu Appel ne pouvez pas utiliser des mots réservés| +Webphone System Key Override|Webphone Key System Override| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Ce paramètre vous permet de définir une clé de remplacement webphone système juste pour les membres d'un groupe d'utilisateurs. Par défaut est vide| +Webphone Dialpad Override|Webphone Dialpad Override| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Ce paramètre vous permet d'activer ou de désactiver le clavier sur le webphone seulement pour les membres d'un groupe d'utilisateurs. Défaut est Disabled. Toggle va permettre à l'utilisateur de visualiser et de cacher le clavier en cliquant sur un lien| +Webphone Dialpad|Webphone Dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Ce paramètre vous permet d'activer ou de désactiver le clavier pour cette webphone. Par défaut est Y pour activé. Toggle va permettre à l'utilisateur de visualiser et de cacher le clavier en cliquant sur un lien. Cette fonctionnalité n'est pas disponible sur toutes les versions webphone| +Webphone System Key|Key System Webphone| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Si votre système ou votre fournisseur l'exige, c'est là la clé du système pour le webphone doit être inscrit po par défaut est vide| + Strength| Force| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Un mot de passe d'enregistrement forte doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Un secret conf forte du fichier doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Un mot de passe forte de l'utilisateur doit être au moins 8 caractères de longueur et ont minuscules et majuscules, ainsi que au moins un numéro| +Force Change Password|Forcer Changer mot de passe| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Si cette option est réglée sur Y, alors l'utilisateur sera invité à modifier leur mot de passe la prochaine fois qu'ils se connectent à la page Web d'administration. Par défaut est N| +First Login Trigger|Trigger connecter d'abord| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Ce paramètre permet la configuration initiale de l'écran du serveur pour être montré à l'administrateur lors de leur première session dans le système| +Default Phone Registration Password|Mot de passe par défaut d'inscription Téléphone| +This is the default registration password used when new phones are added to the system. Default is test|C'est le mot de passe d'enregistrement par défaut utilisée lors de nouveaux téléphones sont ajoutés au système. Par défaut est test| +Default Phone Login Password|Login Mot de passe par défaut Téléphone| +This is the default phone web login password used when new phones are added to the system. Default is test|C'est le téléphone de connexion par défaut mot de passe utilisé lors web nouveaux téléphones sont ajoutés au système. Par défaut est test| +Default Server Password|Mot de passe par défaut du serveur| +This is the default server password used when new servers are added to the system. Default is test|C'est le mot de passe par défaut du serveur utilisé lorsque de nouveaux serveurs sont ajoutés au système. Par défaut est test| +CHANGE PASSWORD|CHANGEMENT DE MOT DE PASSE| +INITIAL INSTALL WELCOME|L'installation initiale BIENVENUE| +COPYRIGHT TRADEMARK LICENSE|Licence de marque déposée COPYRIGHT| +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|Vous êtes tenu de changer votre mot de passe avant de pouvoir continuer à l'administration. Un mot de passe fort est à la fois minuscules et majuscules, ainsi que au moins un numéro. Votre mot de passe doit être de 2 à 20 caractères de long et ne peut pas contenir tous les caractères qui ne sont pas des lettres ou des numéros| +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|Assurez-vous que ce mot de passe est quelque chose que vous pouvez vous rappeler, parce que dès que vous effectuez cette modification, vous serez invité à saisir votre nouveau mot de passe pour vous reconnecter à l'administration| +Password has not been changed, please try again|Mot de passe n'a pas été modifié, s'il vous plaît essayer de nouveau| +New Password|Nouveau mot de passe| +Password has been updated, you may now continue|Mot de passe a été mis à jour, vous pouvez maintenant continuer| +Passwords have been updated, you may now continue on into Administration|Les mots de passe ont été mis à jour, vous pouvez maintenant continuer sur dans l'administration| +You may want to start by reading the ViciDial Manager Manual available at|Vous voudrez peut-être commencer par lire le manuel Gestionnaire Vicidial disponible à l'adresse| +there is a free version available|il ya une version gratuite disponible| +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|Assurez-vous que ce mot de passe est quelque chose que vous pouvez vous rappeler, parce que dès que vous avez terminé cet écran de configuration initiale, vous serez invité à saisir votre nouveau mot de passe à nouveau de se reconnecter à l'administration| +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|Les trois prochaines mots de passe par défaut sont définis dans la section Paramètres système, et vous pouvez les changer après que vous les définir ici. Il s'agit d'une bonne idée de faire ces mots de passe fort pour que personne ne peut pirater vos comptes de téléphone et des appels téléphoniques lieu sans que vous sachiez. Le mot de passe d'enregistrement par défaut utilisée lors de nouveaux téléphones sont ajoutés au système en tant que SIP ou IAX mot de passe téléphone VOIP. Le téléphone de connexion par défaut mot de passe utilisé lors web nouveaux téléphones sont ajoutés au système, comme le mot de passe de téléphone que l'agent aurait utiliser dans l'interface agent Vicidial. Le mot de passe par défaut du serveur utilisé lorsque de nouveaux serveurs sont ajoutés au système pour les serveurs de communiquer les uns avec les autres| +Passwords have been updated, you may now continue on into Administration|Les mots de passe ont été mis à jour, vous pouvez maintenant continuer sur dans l'administration| +You may want to start by reading the ViciDial Manager Manual available at|Vous voudrez peut-être commencer par lire le manuel Gestionnaire Vicidial disponible à l'adresse| +there is a free version available|il ya une version gratuite disponible| +Welcome to ViciDial|Bienvenue à Vicidial| +initial setup screen|écran de configuration initiale| +copyright, trademark and license page|page de copyright, marque et de licence| +The ViciDial Call Center Suite is maintained by the|Le Call Center Suite Vicidial est maintenue par le| +is a registered trademark of the|est une marque déposée de la| +Here is our|Voici notre| +trademark use policy|politique d'utilisation des marques| +The ViciDial Call Center Suite is released under the|Le Call Center Suite Vicidial est publié sous la| +open source license|licence open source| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|Le Centre Vicidial Appel Suite logicielle est disponible pour téléchargement, et pour l'utilisation, exempt du coût. Vous pouvez télécharger le facile à installer| +ViciBox CD ISO version|ViciBox CD ISO version| +or only the|ou seulement l'| +source code|le code source| +Continue on to the Initial Setup|Continuer sur la configuration initiale| +Customer 3-Way Hangup Logging|Logging Raccrocher à la clientèle 3-voies| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Si cette option est activée, le user_call_log se connectera quand un raccrochage à la clientèle jusqu'à s'ils raccrocher pendant un appel 3-way. En outre, cela peut permettre au Client d'action de raccrochage 3-way si l'on est defineed ci-dessous. Par défaut est Enabled| +Customer 3-Way Hangup Seconds|Secondes hangup clientèle 3-voies| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Si le Client 3-way journalisation est activée, cette option vous permet de définir le nombre de secondes après le raccrochage client est détecté avant qu'il ne soit connecté et l'action à la clientèle en option raccrochage 3-way est exécuté. Par défaut est de 5 secondes| +Customer 3-Way Hangup Action|Raccrocher à la clientèle d'action 3-voies| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Si le Client 3-way journalisation est activée, cette option vous permet d'avoir l'écran l'agent raccroche automatiquement sur l'appel et passer à l'écran DISPO si cette option est réglée sur DISPO. Par défaut est NONE| +Inbound Report by DID|Rapport entrant par DID| +Lists Campaign Status Stats|Listes Statistiques d'état de la campagne| +Add Lead URL|Ajouter plomb URL| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Cette adresse URL Web n'est pas vu par l'agent, mais il est appelé chaque fois qu'un chef de file est ajouté au système par le biais du processus de rapprochement. Par défaut est vide. Vous devez commencer cette URL avec VAR si vous voulez utiliser des variables, et bien sûr - A - et - B - autour de la variable réelle dans l'URL où vous souhaitez l'utiliser. Voici la liste des variables qui sont disponibles pour cette fonction| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Cet utilitaire vous permet de télécharger des fichiers audio vers le serveur Web de sorte qu'ils puissent être distribués à tous les serveurs Vicidial dans un cluster multi-serveur. Une remarque importante, seuls deux types de fichiers audio fonctionne, les fichiers. Wav qui sont PCM Mono 16 bits et 8k. Fichiers gsm qui sont 8k 8bit. S'il vous plaît vérifier que vos fichiers sont correctement mis en forme avant de les télécharger ici| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Nous vous recommandons vivement le téléchargement ne 16bit mono PCM 8k fichiers audio WAV| +Park Music-on-Hold|Parc de la Musique-sur-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|C'est là que vous pouvez définir le contexte de la musique en attente pour cette campagne. Assurez-vous que vous sélectionnez une musique valable sur le contexte de maintien de la liste de sélection et que le contexte que vous avez sélectionné les fichiers valides a en elle. Par défaut est par défaut| +Park Call IVR|Parc Appel IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Cette option permettra à un agent de parquer un appel avec un bouton séparé IVR APPEL DU PARC sur leur interface de l'agent, si cette option est activée ou ENABLED_PARK_ONLY. L'option ENABLED_PARK_ONLY permettra à l'agent d'envoyer l'appel à parc, mais ne cliquez pas sur pour récupérer l'appel, comme l'option Activé. L'option ENABLED_BUTTON_HIDDEN permet à la fonction via l'API uniquement. Par défaut est DISABLED| +Park Call IVR AGI|Parc Appel IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Si le champ Parc IVR Appel n'est pas désactivé, alors ce champ est utilisé comme la chaîne de l'application AGI que le client est envoyé. Il s'agit d'un réglage qui doit être définie par votre administrateur si possible| +Manual Preview Dial|Dial Aperçu Manuel| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|Cela permet à l'agent en mode numérotation manuelle pour voir le principal de l'information quand ils cliquez Composez le numéro suivant avant de composer activement l'appel téléphonique. Il ya un lien en option pour sauter la tête et de passer à la suivante si elle est sélectionnée. Par défaut est PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Estimation Tenez Nom minimum de temps| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Si le temps de maintien estimée est actif et il est calculé pour être égal ou inférieur au minimum de 15 secondes, alors ce fichier sera joué invite au lieu de l'annonce par défaut. Par défaut est vide pour inactive| +Estimated Hold Time Minimum Prompt No Block|Estimation minimale Hold Time Demander Non Bloquer| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Si Hold Time estimée est actif et l'heure estimée de maintien Nom minimum champ ci-dessus est remplie, alors cette option pour autoriser les appels en file derrière un appel où l'invite à jouer est d'aller à un agent si l'on devient disponible pendant la lecture du message . Alors que l'invite est de jouer pour un client, ils ne peuvent pas être envoyé à un agent. Par défaut est N| +Estimated Hold Time Minimum Prompt Seconds|Estimation secondes Hold Time minimum Prompt| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Ce champ doit être réglé sur le nombre de secondes que le nom de fichier en attente estimée Temps minimum invite joue pour. Par défaut est 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|Ce champ vous permet de personnaliser le nom de l'enregistrement quand la campagne est ONDEMAND ou ALLCALLS. Les variables sont permis| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|La valeur par défaut est FULLDATE_AGENT et devrait ressembler à ceci 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui devrait ressembler à ceci| +Real-Time Agent Time Stats|Real-Time Temps Stats Agent| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|Mettre cette option à quoi que ce soit, mais HANDICAPÉS permettra la collecte de statistiques en temps des agents pour aujourd'hui pour cette campagne, qui sont visibles au travers du rapport en temps réel. Les appels sont la moyenne appels traités par agent, attente est le temps moyen d'attente d'agent, le CUST est le temps moyen de clients discours, ACW est la moyenne Après le temps de travail Appel, PAUSE est le temps de pause en moyenne. Par défaut est DISABLED| +Add A Dial Status to Call|Ajouter un statut Composer pour appeler| +Admin Modify Auto-Refresh|Administrateur Modifier Auto-Refresh| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|C'est l'intervalle de rafraîchissement en secondes des écrans modifier dans ce interface d'administration. Un réglage à 0 sera le désactiver, il la mise en-dessous de 5 sera la plupart du temps faire des écrans de forçage inutilisables car ils se rafraîchira trop vite pour changer les champs. Cette option est utile dans les situations où plus d'un gestionnaire est le contrôle des paramètres sur une campagne active ou en groupe afin que les paramètres sont rafraîchies fréquemment. Par défaut est 0| +Admin No-Cache|Admin No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|Si définie à 1 permet de régler toutes les pages d'administration du navigateur internet de no-cache, de sorte que chaque écran doit être rechargé à chaque fois qu'il est considéré, même si le clic de retour sur le navigateur. Par défaut est 0 pour les handicapés| +Generate Cross-Server Phone Extensions|Générer les extensions de téléphone de la Croix-Server| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Cette option si elle est définie à 1, générer des entrées pour chaque plan de numérotation de téléphone sur un système multi-serveur. Par défaut est 0 pour inactif| +QueueMetrics Addmember Enabled|QueueMetrics addMember Enabled| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Cette option si elle est définie à 1 générera ADDMEMBER2 et les entrées dans removeMember queue_log. Par défaut est 0 pour les handicapés| +Minimum Hopper Level|Niveau minimum Hopper| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|C'est le nombre minimum de conduit le script VDhopper essaie de garder dans le tableau vicidial_hopper pour cette campagne. Si vous exécutez le script VDhopper chaque minute, faire ce peu supérieur au nombre de conducteurs vous passez par une minute| +Automatic Hopper Level|Niveau Hopper automatique| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Mettre ce paramètre à Y permettra Vicidial pour ajuster automatiquement la trémie basé sur les paramètres que vous avez dans votre campagne. La formule qu'il utilise pour ce faire est| +Automatic Hopper Multiplier|Multiplicateur Hopper automatique| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|C'est multiplicateur pour l'Hopper Auto. La définition de cette moins de 1 fera l'algorithme Hopper Auto à charger moins que fils il le ferait normalement. La définition de cette supérieur à 1 fera l'algorithme Hopper Auto pour charger plus de prospects que normalement. Par défaut est 1| +Auto Trim Hopper|Auto Trim Hopper| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Mettre ce paramètre à Y permettra Vicidial pour supprimer automatiquement l'excès mène à partir de la trémie. Par défaut est Y| +Manual Dial API|Composition manuelle API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Cette option vous permet de définir l'API agent de faire soit un appel à la fois, STANDARD, ou la capacité de la file d'attente des appels numérotation manuelle et de les faire composer automatiquement une fois que l'agent va le mettre en pause ou est disponible pour prendre leur prochain appel à la option pour désactiver la numérotation automatique de ces appels, file d'attente ou QUEUE_AND_AUTOCALL qui est le même que file d'attente mais sans l'option pour désactiver la numérotation automatique de ces appels. Si un agent a plus d'un appel en file d'attente pour eux, ils verront le nombre de combien d'appels numérotation manuelle sont en file d'attente juste au-dessous sur le bouton Pause, ou Composez le bouton numéro suivant. Nous suggérons que si QUEUE est utilisé que vous envoyez en utilisant l'API actions de la preview = OUI option de sorte que vous ne sont pas reprises pour composer les appels de l'agent sans préavis. En outre, si vous utilisez file d'attente et fortement en utilisant les appels de numérotation manuelle à une méthode cadran MANUEL non, nous recommandons de régler le Pause agent après chaque option Appel à Y. par défaut est Standard| +Manual Call Time Check|Durée de l'appel Vérification manuelle| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Si cette option est activée, il va vérifier tous les appels numérotation manuelle pour s'assurer qu'ils sont dans les paramètres de temps d'appel fixés pour la campagne. Par défaut est DISABLED| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Si vous voulez changer ce fil à un rappel prévu, d'abord changer la disposition à CBHOLD, puis le soumettre et vous serez en mesure de fixer la date et l'heure de rappel| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Override formulaire Web - C'est l'adresse personnalisée que cliquant sur le bouton Web Form dans Vicidial vous amène à des appels qui viennent sur cette liste| +Agent Screen Login|Écran de connexion Agent| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|La connexion utilisée pour l'utilisateur du téléphone pour se connecter à des applications clientes, comme l'écran d'agent Vicidial| +Phone Extension|Extension Téléphone| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Ce champ est l'endroit où vous mettez le nom téléphones tel qu'il apparaît à Asterisk pas y compris le protocole ou une barre oblique au début. Par exemple: pour le téléphone SIP SIP/test101 l'extension Téléphone serait test101. En outre, pour IAX2 téléphones: IAX2/IAXphone1 @ IAXphone1 serait IAXphone1. Pour Zap et dahdi joint channelbank ou FXS téléphones assurez-vous que vous mettez le numéro de canal complète sans le préfixe: Zap/25-1 serait 25-1. Une autre note, assurez-vous que vous définissez le champ ci-dessous Protocole correctement pour votre type de téléphone| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|STATUTS dans les listes ACTIFS POUR CETTE CAMPAGNE| +SHOW LEAD STATUSES IN THIS CAMPAIGN|MONTRER STATUTS DE PLOMB DANS CETTE CAMPAGNE| +RELOAD NOW|Rechargez maintenant| +refresh|rafraîchir| +You can also set a label to ---HIDE--- to hide both the label and the field|Vous pouvez également définir une étiquette à --- --- HIDE pour cacher l'étiquette et le champ| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Pour entrant seulement, vous pouvez également définir la durée d'appel d'arrêt supérieur à 2400 si vous voulez que le temps appel à aller au-delà de minuit. Donc, si vous voulez que votre temps d'appel à courir à partir de 6 h jusqu'à 2 h du matin le lendemain, vous mettriez 0600 que l'heure de début et 2600 que le temps d'arrêt| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF par défaut pour ne pas montrer le clavier sur la première charge, mais permettra à l'utilisateur d'afficher le clavier en cliquant sur le lien clavier| +Add Multi-Server Phones Form|Ajouter Multi-Form Server Mobiles| +Phones Bulk Insert|D'insertion en bloc Mobiles| +List Order Randomize|Commandez Liste Randomize| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Cette option vous permet de randomiser l'ordre des pistes dans la charge trémie dans les résultats définis par les critères énoncés ci-dessus. Par exemple, la liste de commande seront préservés, mais les résultats seront randomisés dans ce tri. Mettre cette option à Y activer cette fonctionnalité. Par défaut est N pour les handicapés. REMARQUE, si vous avez un grand nombre de conducteurs de cette option peut ralentir la vitesse du script trémie de chargement| +NONE will not log any logins and logouts within queue_log|AUCUN ne sera pas journaliser toutes les connexions et déconnexions dans queue_log| +QueueMetrics Dispo Pause Code|Code de QueueMetrics Pause Dispo| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Cette option, si peuplée, vous permet de définir si un code de pause dispo est entré en queue_log quand un agent est en état de dispo. Par défaut est vide pour les handicapés| +List Order Secondary|Commandez Liste secondaire| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Cette option vous permet de sélectionner l'ordre de tri second des fils de la charge trémie après l'Ordre et au sein de la liste des résultats définis par les critères énoncés ci-dessus. Par exemple, la liste de commande sera utilisé pour la première sorte de les fils, mais les résultats seront triés une seconde fois au sein de ce tri dans le même ensemble de l'Ordre de la première liste. Par exemple, si vous avez la liste de commandes mis à décomptage et vous avez seulement des pistes qui ont été tentées 1 et 2 fois, puis si vous avez l'ensemble de commande Liste secondaire à LEAD_ASCEND tous les fils 1 tentative sera triée par les plus anciens conducteurs premier et sera placée dans la trémie de cette façon. Par défaut est LEAD_ASCEND. REMARQUE, si vous avez un grand nombre de prospects en utilisant l'une des options CALLTIME peut ralentir la vitesse du script trémie de chargement| +My Callbacks Checkbox Default|Mon défaut Checkbox rappels| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Cette option vous permet de prédéfinir la case à cocher Mon rappel sur l'écran de rappel agent programmé. Enregistrés seront cochez la case automatiquement pour chaque appel. Par défaut est désactivé| +Call Notes Per Call|Appelez-notes par Appel| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|La définition de cette option pour activer permettra aux agents d'entrer dans les notes pour chaque appel ils ont accès dans l'interface agent. Le champ de saisie des notes apparaît en dessous du champ de commentaires dans l'interface agent. En outre, si le Groupe de l'agent utilisateur est autorisé à afficher des journaux d'appels, puis l'agent sera en mesure d'afficher des notes d'appel passées pour une avance à tout moment. Par défaut est DISABLED| +If List Order Randomize is enabled, this option will be ignored|Si la liste de commandes Aléatoire est activée, cette option sera ignorée| +ERROR: Lead not added, please go back and look at what you entered|ERREUR: pas encore ajouté de plomb, s'il vous plaît revenir en arrière et regarder ce que vous avez entré| +Lead has been added|Le plomb a été ajouté| +Add A New Lead|Ajouter une nouvelle piste| +Agent Lead Search Override|Override Recherche Agent principal| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Ce paramètre remplace quelle que soit la campagne s'est fixé pour principal agent de recherche. NOT_ACTIVE utilisera le paramètre de campagne. ENABLED permettra recherche de plomb et de DISABLED ne permettra pas la recherche de plomb. Par défaut est NOT_ACTIVE| +Agent Lead Search|Recherche de plomb Agent| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|La définition de cette option pour activer permettra aux agents de rechercher des pistes et afficher des informations de plomb pendant la pause dans l'interface agent. En outre, si le Groupe de l'agent utilisateur est autorisé à afficher des journaux d'appels, puis l'agent sera en mesure d'afficher des notes d'appel passées pour toute avance qu'ils sont affichés sur les informations. Par défaut est DISABLED| +Agent Lead Search Method|Méthode de recherche d'agent principal| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Si la recherche de plomb Agent est activé, ce paramètre définit l'endroit où l'agent ne sera autorisé à rechercher des pistes. Système va rechercher l'ensemble du système, sera CAMPAIGNLISTS chercher au cœur de toutes les listes actives au sein de la campagne, sera CAMPLISTS_ALL chercher au cœur de toutes les listes actives et inactives au sein de la campagne, LISTE va rechercher uniquement dans le ID de liste numérotation manuelle tel que défini dans la campagne . Par défaut est CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|LEAD RECHERCHES POUR CETTE PÉRIODE| +Routing Extension|Routage Extension| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|Ce champ permet à une extension de routage sortant personnalisé. Cela vous permet d'utiliser différentes méthodes de traitement des appels en fonction de la façon dont vous voulez acheminer les appels sortants grâce à votre campagne. Anciennement appelée l'extension VDAD Campagne| +same as|même| +Will send the call only to an agent on the same server as the call is placed on|Enverra l'appel uniquement à un agent sur le même serveur que l'appel est placé sur| +Used for press-1, broadcast and survey campaigns|Utilisé pour des campagnes de presse-1, de diffusion et d'enquête| +Will try to first send the call to an agent on the local server, then it will look on other servers|Je vais essayer d'envoyer d'abord l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs| +DEFAULT - Will send the call to the next available agent no matter what server they are on|DEFAULT - Permet d'envoyer l'appel vers le prochain agent disponible, peu importe quel serveur ils sont sur| +Used for Answering Machine Detection after that, same behavior as|Utilisé pour Détection des répondeurs après que, même comportement que| +Used for Answering Machine Detection after that same behavior as|Utilisé pour Détection des répondeurs après cette même comportement que| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Utilisé pour des campagnes de presse-1, de diffusion et d'enquête avec Cepstral Text-to-speech| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Utilisé pour Détection des répondeurs puis appuyez-1, de diffusion et d'enquête des campagnes avec Cepstral Text-to-speech| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Une de ces options avec USER_ en face ne recherche que dans les pistes qui ont le champ propriétaire correspondant de l'ID utilisateur de l'agent, les options avec GROUP_ en face ne recherche que dans les pistes qui ont le champ propriétaire correspondant au groupe d'utilisateurs que l'utilisateur est un membre de la, les options avec TERRITORY_ en face ne recherche que dans les pistes qui ont le champ propriétaire adéquation des territoires que l'agent a choisi| +QM Phone Environment|Environnement Téléphone QM| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Si l'intégration QueueMetrics est activée dans les paramètres du système, alors ce paramètre permet l'insertion de cette valeur de données dans le domaine de l'données4 queue_log pour les enregistrements d'activité des agents. Par défaut est vide pour les handicapés| +Active Twin Server IP|Actif IP du serveur double| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Certains systèmes Vicidial faudrait mettre en place des serveurs Vicidial en paires. Ce paramètre est l'endroit où vous pouvez mettre l'IP du serveur d'un autre serveur Vicidial que ce serveur est jumelée avec. Par défaut est vide pour les handicapés| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|NOTES: Pour ring_all, les agents qui utilisent les téléphones qui ont permis d'agent Le crochet auront leur téléphone sonne et le premier à répondre recevront l'appel et les informations sur l'écran l'agent. Depuis ring_all ignore le temps d'attente d'agent et le classement et fera appel à tout agent qui est disponible pour la file d'attente, nous ne recommandons pas d'utiliser cette méthode pour grandes files d'attente. Lorsque vous utilisez ring_all, agents connectés avec les téléphones qui ont de l'agent Crochet Sur désactivé devrez utiliser les appels en file d'attente et panneau de cliquer sur le lien APPEL TAKE pour prendre des appels en file d'attente. La quantité de temps au téléphone sonnera pour les agents ring_all est réglé sur le réglage On-Hook durée de sonnerie ou le temps le plus court anneau des téléphones qui seront appelés. Nous ne recommandons pas d'utiliser ring_all sur les files d'attente de haute volume d'appels, ou les files d'attente avec de nombreux agents. Procédé ring_all est destiné à être utilisé avec seulement quelques agents et le volume d'appels à faible dans les groupes| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Cette option n'est utilisée que pour les agents qui sont connectés avec des téléphones qui ont la fonction d'agent-sur-crochet activé. C'est le nombre de secondes que chaque tentative d'appel à l'agent se fera entendre pendant que le système va attendre une seconde et se mettent à sonner les téléphones des agents disponibles à nouveau. Ce champ peut être modifié si les téléphones des agents sont fixés à un moment anneau inférieur qui peut être nécessaire pour empêcher les appels d'être envoyé un message vocal téléphones. Par défaut est 15| +On-Hook Agent|On-Hook Agent| +On-Hook Ring Time|Temps Ring On-Hook| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Cette option est utilisée uniquement pour les appels entrants vont à cet agent à distance. Cette fonctionnalité sera appeler l'agent à distance et ne pas envoyer le client à l'agent à distance jusqu'à ce que la ligne est répondu. Par défaut est N pour les handicapés| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Cette option n'est utilisée que lorsque le champ Agent Sur-crochet ci-dessus est fixé à Y et alors seulement pour les appels entrants à venir à cet agent à distance. C'est le nombre de secondes que chaque tentative d'appel sonne pour essayer d'obtenir une réponse. Il est recommandé que vous définissez cette option sur quelques secondes inférieur à ce qu'il prend pour un appel à être envoyé vers la messagerie vocale. Par défaut est 15| +On-Hook Agent Login|Connexion Agent Sur-Crochet| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Cette option est utilisée uniquement pour les appels entrants vont à un agent connecté avec ce téléphone. Cette fonctionnalité sera appeler l'agent et ne pas envoyer le client à la session des agents jusqu'à ce que la ligne est répondu. Par défaut est N pour les handicapés| +This is a Phone On-Hook Agent|Il s'agit d'un téléphone en raccrochant Agent| +Maximum Ring Time|Durée de sonnerie maximum| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|Les options reporter s'arrête de clignoter et-ou l'affichage en rouge lorsque vous vérifiez les rappels, jusqu'à ce que le nombre de rappels des changements| +Auto Pause Pre-Call Work|Auto Pause pré-Appel de travail| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Dans l'auto-sélecteur de mode, ce paramètre si elle est activée seront mis à l'agent de pause automatiquement lorsque l'agent clique sur l'une des fonctions suivantes, qui les oblige à être en pause-Manuel Dial, Fast Dial, Recherche de plomb, Appelez-View Log, rappels Vérifiez, Entrez le code de pause. Par défaut est N pour inactive| +Auto Resume Pre-Call Work|Auto Reprendre pré-Appel de travail| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|Dans l'auto-sélecteur de mode, ce paramètre si elle est activée fixera l'agent à l'état actif automatiquement lorsque l'agent clique sur, ou annule, sur l'une des fonctions suivantes, qui les oblige à être en pause Dial-Manuel, Fast Dial, Recherche de plomb, Appelez Connectez-vous Voir, rappels Vérifiez, Entrez le code de pause. Par défaut est N pour inactive| +Auto Pause Pre-Call Code|Auto Pause pré-Appel de code| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Si la fonction Auto Pause de travail fonction de pré-appel ci-dessus est active, et les codes de pause Agent est actif, ce paramètre sera le code de pause qui est utilisé lorsque l'agent est en pause pour ces activités. Par défaut est PRECAL| +This campaign is not set to Auto-Alt-Dial|Cette campagne n'est pas réglé sur Auto-Alt-Dial| +Multi-Alt-Settings|Multi-Alt-Paramètres| +Reload Dialplan On Servers|Recharger Dialplan Sur les serveurs| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Cette option vous permet de forcer un rechargement de la dialplan sur tous les serveurs Asterisk dans le cluster. Si vous avez fait des changements dans l'entrée personnalisé Dialplan ci-dessus vous devez définir cette valeur à 1 et se soumettre à ces changements ont entrera en vigueur sur les serveurs| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Utilisation MULTI_LEAD vous permet d'utiliser un câble séparé pour chaque numéro sur un compte client qui partagent tous une vendor_lead_code commune, et le type de numéro de téléphone pour chacun d'eux est défini avec une étiquette dans le domaine du propriétaire. Cette option permet de désactiver certaines options sur l'écran de la campagne Modifier et afficher un lien vers la page Multi-Alt Paramètres qui vous permet de définir quels types de numéros de téléphone, définis par l'étiquette de chaque plomb, sera composé et dans quel ordre. Cela va créer un filtre spécial de plomb et de modifier le champ Rang de tous les fils à l'intérieur des listes établies à cette campagne afin de les appeler dans l'ordre que vous avez spécifié| +Manual Dial CID|Composition manuelle CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Ceci définit si un agent des appels numérotation manuelle aura les paramètres de campagne CallerID utilisé, ou de leurs agents téléphoniques paramètres CallerID utilisé. Par défaut est CAMPAGNE| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Si l'option Utiliser personnalisé campagne CID est activée ou de la Campagne liste Override réglage CID est utilisé, ce paramètre sera ignoré| +Phone Post Time Difference Alert|Message Téléphone Décalage horaire alerte| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Cette fonction manuelle cadran seule, si elle est activée, va afficher une alerte si le fuseau horaire pour le code postal de plomb, ou le code postal, est différente de la zone de temps de l'indicatif régional du numéro de téléphone pour le plomb. L'option OUTSIDE_CALLTIME_ONLY ne montrent l'alerte si les deux fuseaux horaires sont différents et l'un des fuseaux horaires est en dehors de la durée d'appel choisi pour la campagne. OUTSIDE_CALLTIME_PHONE ne fera que vérifier le fuseau horaire du numéro de téléphone de la tête et d'alerter si elle est en dehors du temps d'un appel local. OUTSIDE_CALLTIME_POSTAL ne fera que vérifier le fuseau horaire du code postal du plomb et d'alerter si elle est en dehors du temps d'un appel local. OUTSIDE_CALLTIME_BOTH va vérifier le code postal et le numéro de téléphone pour être dans le délai d'un appel local, même si elles sont dans le même fuseau horaire. Ces alertes seront afficher dans l'info journal des appels, Informations sur la liste des rappels, des résultats de recherche d'info, quand un chef de file est composé et quand un chef de file est visualisé. Par défaut est DISABLED| +Custom 3-Way Button Transfer|Transfert personnalisé Bouton 3-voies| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Cette option permet d'ajouter un bouton de transfert personnalisé à l'écran ci-dessous sur le bouton d'agent de transfert-Conf qui permettra d'un clic à trois voies des appels en utilisant le préréglage sélectionné ou sur le terrain. Les options seront PRESET_ passer des appels en utilisant la valeur définie prédéfinie. Les options seront field_ passer des appels en utilisant le numéro dans le champ sélectionné à partir du plomb. HANDICAPÉS ne sera pas afficher le bouton sur l'écran l'agent. Les options seront PARK_ garer le client avant de composer. Par défaut est DISABLED| +Auto Dial Level Threshold|Seuil Auto Level Dial| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Ce paramètre ne fonctionne qu'avec un ADAPT ou la méthode de rapport Dial, et il doit être réglé sur autre chose que HANDICAPÉS et le nombre de paramètre agents doit être supérieure à 0. Cette fonctionnalité vous permet de définir un nombre minimum d'agents que l'algorithme prédictif travailler. Si le nombre d'agents en deçà du nombre que vous avez défini, alors le niveau de numérotation ira à 1,0 jusqu'à plus d'agents connecter ou entrer dans l'état sélectionné. Logged-IN_AGENTS comptera tous les agents connectés à la campagne, NON-PAUSED_AGENTS comptera seulement les agents qui sont en attente ou en parlant, et WAITING_AGENTS comptera seulement des agents qui sont en attente d'un appel. Par défaut est DISABLED| +Available Only Tally Threshold|Disponible Seuil Tally seulement| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Ce paramètre ne fonctionne qu'avec un ADAPT ou la méthode de rapport Dial, disponible seulement Tally doit être réglé sur N, ce paramètre doit être réglé sur autre chose que HANDICAPÉS et le nombre de paramètre agents doit être supérieure à 0. Cette fonctionnalité vous permet de définir le nombre d'agents en dessous duquel Disponible Tally Seuls seront permis. Si le nombre d'agents en deçà du nombre que vous avez défini, puis la mise en Tally Disponible seulement au rendez-vous à Y temporairement jusqu'à ce que plus d'agents connecter ou entrer dans l'état sélectionné. Logged-IN_AGENTS comptera tous les agents connectés à la campagne, NON-PAUSED_AGENTS comptera seulement les agents qui sont en attente ou en parlant, et WAITING_AGENTS comptera seulement des agents qui sont en attente d'un appel. Par défaut est DISABLED| +Time Zone Setting|Réglage du fuseau horaire| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Cette option vous permet de définir la méthode de maintien de la recherche fuseau horaire actuel pour les fils de cette liste. Ce processus se fait uniquement la nuit de sorte que toute modification apportée ne sera pas immédiate. COUNTRY_AND_AREA_CODE est la valeur par défaut, et utiliser le code pays et l'indicatif régional du numéro de téléphone afin de déterminer le fuseau horaire de la tête. Postal_code utilisera le code postal si disponible afin de déterminer le fuseau horaire de la tête. NANPA_PREFIX ne fonctionne que dans les Etats-Unis et utiliser le code régional et le préfixe du numéro de téléphone afin de déterminer le fuseau horaire de la tête, mais ce n'est pas activée par défaut dans le système, donc s'il vous plaît assurez-vous que vous avez les données chargées sur le préfixe NANPA votre système avant de sélectionner cette option. OWNER_TIME_ZONE_CODE utilisera le abbraviation fuseau horaire standard chargé dans le domaine propriétaire du plomb afin de déterminer le fuseau horaire, dans les exemples USA sont AST, HNE, CST, MST, PST, AKST, TVH. Cette fonction doit être activée par votre administrateur système pour entrer en vigueur| +Dial Level Difference Target|Composez cible la différence de niveau| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Ce champ est utilisé pour définir si vous souhaitez cibler ayant un nombre précis d'agents d'attente pour les appels ou les appels en attente pour les agents. Par exemple, si vous voulez toujours avoir en moyenne un agent libre de prendre les appels immédiatement, vous devez définir cette valeur à -1, si vous souhaitez cibler avoir toujours un appel en attente en attente d'un agent, vous devez définir cette valeur à 1. Par défaut est 0. Ce champ n'est pas utilisé dans le manuel ou les méthodes de numérotation INBOUND_MAN| +Admin Utilities|Utilitaire Admin| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|Page cachée utilitaires - Si vous ne savez pas ce que ces utilitaires, vous ne devriez pas les utiliser| +Welcome Languages Page|La page d'accueil Langues| +Campaign Debug Page|Page Debug Campagne| +Bulk Phone Insert Page|Insérer une page en vrac Téléphone| +Send a Call With Custom CID Page|Envoyer un appel Avec la page CID personnalisé| +Speech Voice Lab Page|Page Lab discours vocal| +Safe Harbor Audio|Safe Harbour Audio| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Il s'agit du fichier audio rapide qui se joue, si l'action Drop est réglé sur AUDIO. Par défaut est buzz| +Safe Harbor Call Menu|Coffre-fort Menu Appel port| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|C'est le menu d'appel que l'appel est envoyé à si l'action Drop est réglé sur CALLMENU| +Log Key Press|Connectez-vous Appuyer sur la touche| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Cette option si elle est activée vous connecterez la presse DTMF clé par l'appelant dans ce menu Appel. Par défaut est 0 pour les handicapés| +No DTMF Logging|Pas de journalisation DTMF| +DTMF Logging Enabled|DTMF Logging Enabled| +Webphone Auto-Answer|Webphone Réponse automatique| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Ce paramètre permet au téléphone Web pour être automatiquement configuré pour répondre aux appels qui entrent en en le mettant à Y, ou d'avoir anneau appels en le mettant à défaut N. Y est| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU enverra au client dans le menu Appel défini dans la liste de sélection ci-dessous| +Survey Call Menu|Menu Appel Enquête| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Si la méthode est réglé sur CALLMENU, c'est le menu Appel que le client est envoyé à si elles optent en| +Scheduled Callbacks Days Limit|Prévu rappels Jours Limite| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Cette option vous permet de réduire l'agent rappels réguliers de calendrier pour un nombre sélectionnable de jours à partir d'aujourd'hui, la totalité des 12 mois civils seront toujours affichées, mais seulement le nombre de jours sera sélectionnable. Par défaut est 0 pour un nombre illimité| +Dial Level Difference Target Method|Composez méthode cible de différence de niveau| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Cette option vous permet de définir si le niveau cible cadran différence paramètre est appliqué uniquement sur le calcul du niveau de cadran ou également à la composition réelle sur chaque serveur de numérotation. Si vous exécutez une petite campagne avec des agents connectés sur de nombreux serveurs, vous voudrez peut-être utiliser l'option ADAPT_CALC_ONLY, parce que l'option CALLS_PLACED peut entraîner une diminution des appels en cours placés que deisred. Cette option n'est active que si la cible Différence Dial Level est réglé sur autre chose que 0. Par défaut est ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Si vous voulez utiliser des champs personnalisés dans un formulaire Web l'adresse, vous devez ajouter| +as part of your URL|dans le cadre de votre URL| +Disable Dispo Screen|Désactiver l'écran Dispo| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Cette option vous permet de désactiver l'écran de la disposition dans l'interface agent. Le champ Désactiver Statut Dispo ci-dessous doit être rempli pour que cette option fonctionne. Par défaut est| +Disable Dispo Status|Désactiver Statut Dispo| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Si l'option Désactiver l'écran est réglé sur Dispo DISPO_DISABLED, ce champ doit être rempli en jeu. Vous pouvez utiliser n'importe quel caractère que vous voulez pour ce domaine tant qu'il est de 1 à 6 caractères de longueur avec des lettres et des chiffres| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Ce paramètre si elle est définie à 1, permettre à un gestionnaire d'accéder à l'appel d'exportation et les rapports de plomb sur l'écran RAPPORTS. Par défaut est 0. Pour l'exportation Appels et mène des rapports, l'ordre des champs ci-dessous est utilisé pour les exportations| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Ce rapport rassemble les informations de plomb pour les appels émis dans la plage de dates sélectionnée. Un plomb est seulement exporté une fois, peu importe combien d'appels ont été traités. Le statut de plomb actuelle est utilisée.| +Export Leads Report|Pistes d'exportation Rapport| +Screen Labels|Les étiquettes d'écran| +Add A Screen Label|Ajoutez un contrôle Label écran| +ADD NEW SCREEN LABEL|Ajouter une étiquette ECRAN NEW| +ADDING NEW SCREEN LABEL|AJOUT LABEL ECRAN NEW| +MODIFY SCREEN LABEL|Modifier l'étiquette ÉCRAN| +DELETE SCREEN LABEL|EFFACER ECRAN LABEL| +SCREEN LABELS LIST|ECRAN LISTE DES ETIQUETTES| +Screen Label ID|Label ID écran| +Screen Label Name|Nom du Label écran| +SCREEN LABEL NOT ADDED|LABEL ECRAN PAS AJOUTÉE| +there is already a label in the system with this ID|il ya déjà une étiquette dans le système avec cet ID| +SCREEN LABEL ADDED|LABEL supplémentaire de l'écran| +SCREEN LABEL NOT DELETED|LABEL ECRAN PAS SUPPRIMER| +SCREEN LABEL DELETION CONFIRMATION|CONFIRMATION DE SUPPRESSION D'ÉCRAN LABEL| +Click here to delete screen label|Cliquez ici pour supprimer l'étiquette d'écran| +SCREEN LABEL DELETION COMPLETED|SUPPRESSION LABEL écran Terminé| +DELETE THIS SCREEN LABEL|SUPPRIMER CETTE ETIQUETTE ECRAN| +Click here to see Admin changes to this screen label|Cliquez ici pour voir les changements d'administration à cette étiquette écran| +Hide Label in Call Logs|Masquer Label dans des journaux d'appels| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Si une étiquette est fixée à --- HIDE --- puis les journaux d'appels d'agents, si elle est activée sur la campagne, seront toujours visibles sur le terrain et des données à moins que cette option est activée par défaut est à Y. N| +SCREEN LABEL NOT MODIFIED|LABEL écran n'est pas mise à jour| +SCREEN LABEL MODIFIED|LABEL écran modifié| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Ce champ doit être d'au moins 2 caractères et pas plus de 20 caractères de long, sans espaces ni de caractères spéciaux. Il s'agit du N qui sera utilisé pour identifier l'étiquette écran à travers le système| +This is the descriptive name of the screen label entry|Il s'agit du nom descriptif de l'entrée étiquette écran| +Agent Screen Labels|Les étiquettes de l'écran de l'agent| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|Vous pouvez sélectionner un ensemble d'étiquettes d'écran agents à utiliser avec cette option. Par défaut est - SYSTEM-SETTINGS - pour les étiquettes par défaut| +Status Display Fields|Les champs d'affichage d'état| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|Vous pouvez sélectionner les variables pour les appels seront affichés dans la ligne d'état de l'écran l'agent. CALLID affiche l'ID 20 caractères appel unique, LEADID affiche l'ID de plomb du système, ListId affiche l'ID de liste. Par défaut est CALLID| +CAMPAIGNS USING THIS SCREEN LABEL|CAMPAGNES UTILISANT CE LABEL ÉCRAN| +QueueMetrics Phone Environment Phone Append|Téléphone QueueMetrics Environnement Téléphone Append| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Cette option, si elle est activée, va ajouter le login de téléphone d'agent à l'enregistrement données4 dans la table du journal file d'attente si le domaine de l'environnement de la campagne est peuplée Téléphone. Par défaut est 0 pour les handicapés| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|HIDDEN ne sera pas affiché l'agent sur le terrain, mais permettra le terrain pour avoir des données importées en elle et exportées hors de l', ainsi que le rendre disponible à l'onglet script et l'adresse de formulaire Web. READONLY affichera la valeur des données dans le domaine, mais ne permettra pas à l'agent de modifier les données| +Enable Campaign Test Calls|Permettre des appels de test de la campagne| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Ce paramètre permet la possibilité d'entrer un code de téléphone et numéro de téléphone dans les champs au bas de l'écran Détail de la campagne et placer un appel téléphonique à ce numéro comme s'il s'agissait d'une avance en cours d'auto-composé dans le système. Le numéro de téléphone sera stocké en tant que nouveau chef de file dans la liste ID cadran liste manuelle. La campagne doit être activé pour que cette fonctionnalité soit activée, et il est recommandé que les listes affectés à la campagne tous être mis à l'état inactif. Le préfixe de numérotation, délai d'attente de numérotation et toutes les fonctions de numérotation autres connexes, à l'exception de la DNC et des options d'achat de temps, aura une incidence sur la numérotation du nombre d'essai. L'appel téléphonique sera placé sur le serveur sélectionné comme serveur de messagerie vocale dans les paramètres du système. Par défaut est 0 pour les handicapés| +Test calling disabled|Test de l'appel désactivé| +PLACE TEST CALL|APPEL DE TEST LIEU| +Test Outbound Call|Testez des appels sortants| +Agents Calls Reset|Agents Appels Réinitialiser| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Ce paramètre définit si l'utilisateur connecté et les agents actifs des appels téléphoniques des dossiers doivent être remis à zéro à la fin de la journée minuterie. Par défaut est 1 pour activé| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|Le Custom 5 champ peut être utilisé comme un champ de définir un certain nombre dialplan d'envoyer un appel à partir d'un AGENTDIRECT en groupe si l'utilisateur n'est pas disponible, vous avez juste besoin de mettre AGENTEXT dans le champ Message ou EXTENSION dans le AGENTDIRECT en groupe et le système va chercher la coutume cinq sur le terrain et envoyer l'appel vers ce numéro dialplan| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Pour AGENTDIRECT dans les groupes, si l'utilisateur n'est pas disponible, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Pour AGENTDIRECT dans les groupes, vous pouvez mettre AGENTEXT dans ce domaine et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|Vous pouvez aussi mettre AGENTEXT dans ce domaine si elle est définie à l'extension et le système va chercher l'utilisateur personnalisée cinq sur le terrain et envoyer l'appel vers ce numéro dialplan| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|les commandes par la dernière fois qu'un agent a été envoyé un appel entrant. Résultats dans les agents recevant environ le même nombre d'appels globale| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|les commandes par la dernière fois un agent de terminer un appel entrant. Agent de AKA attente plus longue reçoit d'abord appeler| +Servers|Serveurs| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Ceci est une liste des adresses IP des serveurs de serveurs existants dans le système que vous voulez que les entrées de téléphone pour être peuplée à travers. Ceux-ci doivent être des adresses IP valides, ils doivent être actifs dans le système et vous devez mettre un par ligne dans cette boîte de saisie de texte zone| +Phones|Mobiles| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Ceci est une liste des extensions de téléphone que vous souhaitez être créé sur tous les serveurs répertoriés ci-dessus. Les postes téléphoniques doivent être des lettres et des chiffres seulement, sans caractères spéciaux et vous devez mettre un par ligne dans cette boîte de zone de texte| +Registration Password|Inscription Mot de passe| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|C'est le mot de passe d'enregistrement qui sera utilisé pour tous les téléphones qui sont créés. Pour le protocole SIP et IAX2 vous devez utiliser un mot de passe complexe pour des raisons Secutiry| +Login Password|Login Mot de passe| +This is the agent screen login password that will be used for all of the phones that are created|C'est le mot de passe de connexion agent de l'écran qui sera utilisé pour tous les téléphones qui sont créés| +Create Alias Entries|Créer des entrées d'alias| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Mettre cette option à OUI créera une entrée pour chaque alias téléphones des extensions mentionnées ci-dessus qui liera toutes les entrées d'extension mêmes sur chaque serveur ainsi que l'équilibrage de charge permettant de téléphone de connexion à travailler dans l'interface agent de| +Alias Suffix|Suffixe Alias| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|C'est le suffixe qui sera ajouté à l'extension pour former l'id de téléphone alias. Par exemple, si l'extension est CC100 et le suffixe alias est x, alors l'alias de téléphone identifiant utilisé pour ce serait cc100x| +Client Protocol|Protocole client| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Il s'agit du protocole de téléphone qui sera utilisé pour tous les téléphones créés lors de son dépôt. SIP et IAX2 sont des protocoles VOIP qui permettra de créer des entrées de fichier de conf pour permettre à ces phoens à s'inscrire sur les serveurs| +Local GMT|Local GMT| +This is the time zone that all of the phones will be created with|C'est le fuseau horaire que tous les téléphones seront créés avec| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB est similaire à l'exception du type HIDDEN stockage de données sur la base de données est un type BLOB, approprié pour des données binaires ou des données qui doit être garanti| +Default Local GMT|Par défaut locale GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Ce paramètre définit ce qui sera utilisé par défaut lors de nouveaux téléphones et les serveurs sont ajoutés à l'aide de cette interface web d'administration. Par défaut est de -5| +Default Voicemail Zone|Zone messagerie vocale par défaut| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Ce paramètre définit quelle zone sera utilisé par défaut lors de nouveaux téléphones et boîtes vocales sont créées. La liste des zones disponibles est directement pris à partir du fichier voicemail.conf. Par défaut est l'Est| +Voicemail Zone|Zone de messagerie vocale| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Ce paramètre vous permet de définir la zone que cette boîte vocale sera réglé lorsque le temps est enregistré pour un message. Par défaut est définie dans les paramètres système| +Voicemail Options|Options de la messagerie vocale| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Ce paramètre optionnel vous permet de définir les paramètres de messagerie vocale supplémentaires. Il est recommandé que vous laissez ce champ vide si vous ne savez ce que vous faites| +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|Les deux prochaines paramètres sont également définis dans la section Paramètres système, et vous pouvez les changer après que vous les définir ici. Vous devez régler le défaut local GMT avec le fuseau horaire que vos agents veulent être po La zone de messagerie vocale est la liste des fuseaux horaires boîte vocale que les messages vocaux seront enregistrés avec le temps lorsque de nouveaux messages sont laissés| +ERROR: You cannot use reserved words for field labels|ERREUR: Vous ne pouvez pas utiliser des mots réservés pour les étiquettes sur le terrain| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|L'option ne sera pas DISPO_SELECT_DISABLED désactiver l'écran de dispo complètement, mais afficher l'écran de dispo sans dispositions, cette option ne doit être utilisé si vous voulez forcer vos agents à utiliser votre logiciel de CRM qui enverra le statut du système via l'API| +No Agent Call URL|Aucune URL Appel Agent| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Cette adresse URL Web n'est pas vu par l'agent, mais si elle est peuplée, il est appelé à chaque fois un appel qui n'est pas gérée par un agent est suspendu ou transféré. Utilise les mêmes variables que les champs du formulaire Web et les scripts. dispo peut être utilisée pour récupérer le système défini par la disposition de l'appel. Cette URL ne peut pas être un chemin relatif. Par défaut est vide| +On-Hook CID|On-Hook CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Cette option n'est utilisée que pour les agents qui sont connectés avec des téléphones qui ont la fonction d'agent-sur-crochet activé. Il s'agit de la identification de l'appelant qui s'affichera sur leurs téléphones agent lorsque les appels sonnent. GENERIC est un générique RINGAGENT00000000001 type de notification. Endogroupe montrera que l'en-groupe de l'appel est venu. CUSTOMER_PHONE n'affiche que le numéro de téléphone du client. CUSTOMER_PHONE_RINGAGENT montrera RINGAGENT_3125551212 avec le RINGAGENT dans le cadre du CID avec le numéro de téléphone du client. CUSTOMER_PHONE_INGROUP montrera les 10 premiers caractères de l'en-groupe suivi par le numéro de téléphone à la clientèle| +Please wait for the whole page to load before submitting the form|S'il vous plaît attendre la page entière à se charger avant de soumettre le formulaire| +In-Group Calldate|En-Groupe Calldate| +This is the last date and time that a call was directed to this inbound group|Il s'agit de la dernière date et l'heure qu'un appel a été orientée vers ce groupe entrant| +No-Answer Log|Non-Réponse Connexion| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Cette option vous connecter les appels à composition automatique qui ne sont pas répondu à une table séparée. Par défaut est N| +Alt-Log DB Server|Alt-Server Log DB| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|C'est le serveur de log alternatif base de données. Cette option est facultative, et permet à certains journaux soient écrits à une base de données distincte. Par défaut est vide| +Alt-Log Tables|Alt-Log tableaux| +These are the tables that are available for logging on the alternate log database server. Default is blank|Ce sont les tableaux qui sont disponibles pour la connexion sur le serveur de base de données journal alternatif. Par défaut est vide| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Ceci est le texte réel To Speech champ de données qui est envoyé à cepstraux pour la création du fichier audio pour être joué pour le client. vous pouvez utiliser la synthèse vocale SSML Markup Language--dans ce domaine, par exemple| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|pour une pause de 1 seconde. Vous pouvez également utiliser plusieurs variables telles que le nom, prénom et titre en tant que variables Vicidial comme vous le faites dans un script: - A - prenom - B -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Si vous avez statiques fichiers audio que vous souhaitez utiliser en fonction de la valeur de l'un des domaines que vous pouvez utiliser aussi bien avec ceux C et D balises. Les noms de fichiers doivent être en minuscules et ils doivent être 8k 16bit pcm wav. Le nom de domaine doit être le même, mais sans le wav. Dans le nom du fichier. Par exemple - C ---- A - address3 - B ---- D - tout d'abord trouver la valeur pour address3, alors il serait tenter de trouver un fichier audio correspondant à celle de la valeur à mettre dans l'invite| +Here is a list of the available variables|Voici une liste des variables disponibles| +DID Agent Log|DID journal de l'Agent| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Cette option enregistre l'arrivée des appels DID long avec un en-groupe et l'ID utilisateur, le cas échéant, à une table séparée. Par défaut est N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|TIMEOUT vous permettra de mettre ce qui se passe à l'appel quand il arrive à expiration sans la participation de l'appelant. INVALID vous permettra de définir ce qui se passe lorsque l'appelant entre une option non valide. INVALID_2ND et 3e ne peut être active que si INVALID n'est pas utilisé, il faudra patienter jusqu'à l'entrée deuxième ou troisième invalide par l'appelant avant d'exécuter l'option| +Survey Recording|Enregistrement Enquête| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Si elle est activée, cela va démarrer l'enregistrement lorsque l'appel est répondu. Seulement recommandé si la méthode n'est pas réglé pour le transfert à un agent. Par défaut est N pour les handicapés| +Campaign Areacode CID|Indicatif régional Campagne CID| +AREACODE CIDS FOR THIS CAMPAIGN|CIDS indicatif régional pour cette campagne| +ADD NEW AREACODE CID|ADD NEW indicatif régional CID| +AREACODE|Indicatif régional| +SUBMIT CHANGES|Soumettre les modifications| +AREACODE CID NOT ADDED|Indicatif régional CID PAS AJOUTÉE| +there is already an entry for this campaign with this CID|il ya déjà une entrée pour cette campagne avec ce CID| +AREACODE CID ADDED|Indicatif régional CID AJOUTÉE| +AREACODE CID NOT DELETED|Indicatif régional CID PAS SUPPRIMER| +this entry does not exist|cette entrée n'existe pas| +AREACODE CID DELETED|Indicatif régional CID Vues| +AREACODE CID MODIFIED|Indicatif régional CID mise à jour| +Campaign Areacode CID Modify|Modifier le code zonal de la campagne CID| +CAMPAIGN AREACODE CID LISTINGS|LISTE DE CAMPAGNE indicatif régional CID| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Lorsqu'il est réglé sur le code zonal vous avez la possibilité d'aller dans le sous-menu AC-CID et de définir plusieurs callerids être utilisés par indicatif régional| +Enable Campaign Areacode CID|Activer le code zonal de la campagne CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Ce paramètre permet la possibilité de définir spécifiques sortants numéros callerid à être utilisés par campagne. Par défaut est 1 pour activé| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Si le réglage du système pour le code zonal CID est activée et la mise en campagne pour une utilisation personnalisée CallerID est réglé sur le code zonal alors vous avez la possibilité de définir CID indicatif régional qui seront utilisés lors d'appels sortants à des fils dans cette campagne spécifique. Vous pouvez ajouter plusieurs callerIDs par indicatif régional et vous pouvez activer et désactiver à chacun en temps réel. Si plus d'un callerID est actif pour un indicatif régional spécifique, le système utilisera la callerid qui a été utilisé le moins de fois aujourd'hui. Si aucun callerIDs sont actifs pour le code zonal alors le CallerID campagne ou la liste prioritaire CallerID sera utilisé| +PLLB Grouping|Groupement PLLB| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Connexion Téléphone Load Balancing Groupement, n'est autorisée que si il ya des serveurs d'agents multiples et les alias de téléphone sont présents sur le système. S'il est défini à ONE_SERVER_ONLY il va forcer tous les agents de cette campagne pour se connecter au même serveur. S'il est défini à CASCADE il regroupera connecté agents sur le même serveur jusqu'à ce que le numéro PLLB Limite Regroupement des agents sont atteints, alors le prochain agent va se connecter au serveur suivant avec le plus petit nombre d'agents. Si elle est désactivée le téléphone comportement standard alias de chaque agent de trouver le serveur avec le moins grand nombre de non-distance des agents connectés à elle sera utilisée. Par défaut est DISABLED| +PLLB Grouping Limit|Limite Groupement PLLB| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Connexion Charge Téléphone Groupement Limite d'équilibrage. Si Groupement PLLB est réglé sur CASCADE, alors ce paramètre détermine le nombre d'agents acceptable dans chaque serveur pour cette campagne. Par défaut est 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Connexion Charge Téléphone Groupement Limite d'équilibrage. Si Groupement PLLB est réglé sur CASCADE au niveau de la campagne, alors ce paramètre détermine le nombre d'agents acceptable sur chaque serveur dans toutes les campagnes. Par défaut est 100| +Modify DID RA Extension Overrides|Modifier DID RA Extension Remplace| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|SAVIEZ-REMOTE OVERRIDE extension de l'agent PAS AJOUTÉE| +there is already an entry for this DID with this RA EXTENSION|il ya déjà une entrée pour ce DID avec cette extension RA| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|SAVIEZ-REMOTE OVERRIDE extension de l'agent AJOUTÉE| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|Extension DID Remote Agent OVERRIDE PAS SUPPRIMER| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|Extension DID Remote Agent OVERRIDE mise à jour| +MODIFY THIS DID|MODIFIER LE PRÉSENT DID| +Enable Remote Agent Extension Overrides|Activer télécommande remplace extension de l'agent| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Ce réglage permet d'avoir DID remplacements de vulgarisation pour l'agent à distance acheminés par le biais de demande-groupes. Par défaut est 0 pour les handicapés| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|Télécommande remplace EXTENSION agent pour cette DID| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|DISTANCE LISTE DES AGENTS DE VULGARISATION SURPASSEMENTS| +DID Remote Agent Extension Overrides|DID télécommande remplace extension de l'agent| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Cette section vous permet d'activer DID d'avoir des remplacements de vulgarisation pour l'agent à distance acheminés par le biais de demande-groupes. Le début d'utilisateur doit être valide démarrage à distance de l'agent utilisateur ou si vous voulez l'extension Remplacer l'entrée de travailler pour tous les appels, vous pouvez utiliser --- Tous --- dans le champ Début de l'utilisateur. S'il ya des entrées multiples pour le même DID et l'utilisateur sur Démarrer, puis les entrées actives sera utilisé dans un procédé à la ronde| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|VOIR AVEZ télécommande remplace EXTENSION agent pour cette DID| +THERE ARE|IL YA| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID télécommande remplace extension de l'agent pour cet agent DISTANCE| +Action Transfer CID|Transfert d'action CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Utilisé pour Drop, après les heures et les Non-agent-pas-de file d'attente des actions. C'est le numéro de l'appelant que l'appel utilise avant qu'il ne soit transféré à des extensions, des messages, la messagerie vocale ou des menus d'appel. Vous pouvez utiliser CLIENT dans ce domaine à utiliser le numéro de téléphone du client, ou CAMPAGNE à utiliser le premier numéro de permis Identifiant campagne appelant. Par défaut est CLIENT| +After Hours Call Menu|After Hours Call Menu| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Si après action Heures est réglé sur CALLMENU, l'appel sera envoyé à cette Menu Appel si elle pénètre à l'extérieur en groupe du régime du temps d'appel définie pour l'en-groupe| +Drop Call Menu|Menu déroulant Appel| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Si l'action chute est fixé à CALLMENU, l'appel sera envoyé à ce menu d'appel si elle atteint secondes de chute d'appels| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|La coutume voulait Champs - Ces cinq champs peuvent être utilisés à des fins diverses, la plupart ayant trait à la programmation personnalisée et des rapports| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|S'il est défini à Y_WITH_AMD même machine à répondre aux appels de messages détectés seront enregistrées| +Log Field|Connectez-vous Champ| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Si l'option de presse Key Log est activé, ce paramètre optionnel peut permettre à la réponse aussi être stocké dans ce champ la liste| +Default is NONE for disabled|Par défaut est NONE pour personnes à mobilité réduite| +Call Count Limit|Appelez le comte Limite| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Ceci impose une limite sur le nombre de tentatives d'appel pour les conducteurs composés dans cette campagne. Un plomb peut dépasser cette limite légèrement si le recyclage de plomb ou Auto-Alt-numérotation est activée. Par défaut est 0 pour aucune limite| +Call Count Target|Appelez le comte cible| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Cette option est uniquement utilisée pour des fins de rapport et n'a aucun effet sur les pistes composés. Par défaut est 3| +Enable Expanded List Stats|Activer Statistiques liste élargie| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Ce réglage permet à deux colonnes supplémentaires pour être affichés sur la plupart des tables de la Liste des dégradation de situation sur la liste et la modification des pages de modification de la campagne. La pénétration est définie comme étant la pour cent des conducteurs qui sont au niveau ou au-dessus de la limite de comptage des appels et la campagne ou le statut est marqué comme complété. Par défaut est 1 pour activé| +Report Option|Option Report| +This option allows this specific shift to show up in selected reports that support this option|Cette option permet ce changement spécifique à apparaître dans les rapports sélectionnés qui soutiennent cette option| +There are|Il ya| +completed leads in those lists|fils terminés dans ces listes| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|L'option sera VIEW_PRESET il suffit d'ouvrir le cadre de transfert et le cadre prédéfini| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|CONTACTS est une option seulement si Information_sur_le_contact est activé sur votre système, qui est une fonction personnalisée| +Preset Contact Search|Contact Recherche Preset| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Si l'utilisateur est connecté à une campagne qui a Presets de transfert prévues à l'CONTACTS, alors ce paramètre peut désactiver la recherche de contact pour cet utilisateur uniquement. Par défaut est NOT_ACTIVE qui utilisera quelle que soit la campagne est mise en| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|L'option VIEW_CONTACTS va ouvrir une fenêtre de recherche de contacts, cela ne fonctionnera que si Presets Activer est réglé sur CONTACTS| +Contacts Enabled|Contacts Enabled| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Ce paramètre permet les contacts dans la sous-section Admin qui permet à un gestionnaire d'ajouter, modifier ou supprimer des contacts dans le système qui peuvent être utilisés dans le cadre d'un transfert personnalisé dans une campagne où un agent peut rechercher des contacts par Prénom Nom ou au bureau numéro, puis sélectionnez l'une des nombreux numéros associés à ce contact. Cette fonction est souvent utilisée par les opérateurs ou dans les fonctions de standard où l'utilisateur aurait besoin de transférer un appel vers un téléphone non-agent. Par défaut est 0 pour les handicapés| +CONTACTS LIST|LA LISTE DES CONTACTS| +Add A Contact|Ajout d'un contact| +ADD NEW CONTACT|Ajouter un nouveau contact| +ADDING NEW CONTACT|AJOUT NOUVEAU CONTACT| +MODIFY CONTACT|Modifier un contact| +CONTACT NOT ADDED|Contact non AJOUTÉE| +there is already a contact in the system with this name and number|il ya déjà un contact dans le système avec ce nom et le numéro| +CONTACT ADDED|Contact ajouté| +DELETE THIS CONTACT|Supprimer ce contact| +Click here to see Admin changes to this contact|Cliquez ici pour voir les changements d'administration à ce contact| +DELETE CONTACT|Supprimer un contact| +CONTACT NOT DELETED|CONTACT PAS SUPPRIMER| +CONTACT DELETION CONFIRMATION|CONTACT Confirmation de suppression| +Office Number|Nombre Bureau| +Cell Number|Nombre de cellules| +Other Number|Nombre d'autres| +CONTACT NOT MODIFIED|Contact non mise à jour| +Scheduled Callbacks Hours Block|Prévu rappels Heures Bloquer| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Cette option vous permet de restreindre un rappel useronly prévu d'être affiché sur la liste de rappel jusqu'à ce que l'agent X heures après qu'elle a été définie. Par défaut est 0 pour pas de bloc| +Scheduled Callbacks Calltime Block|Rappels réguliers bloc Calltime| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Cette option, si activée, permettra d'éviter le rappel prévu dans la liste de rappel d'agent d'être composé si elle est en dehors de la calltime prévue pour la campagne. Par défaut est DISABLED| +Modify Same User Level|Modifier niveau de l'utilisateur même| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Ce paramètre s'applique uniquement au niveau 9 utilisateurs. Si elle est activée elle permet à l'utilisateur de niveau 9 à modifier leurs paramètres propres ainsi que d'autres au niveau 9 utilisateurs. Par défaut est 1 pour activé| +Admin Hide Lead Data|Administrateur de données masquer plomb| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Ce paramètre s'applique uniquement au niveau 7, 8 et 9 utilisateurs. Si elle est activée elle remplace les données de plomb clients dans les nombreux rapports et des écrans dans le système avec Xs. Par défaut est 0 pour les handicapés| +Admin Hide Phone Data|Administrateur masquer les données du téléphone| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Ce paramètre s'applique uniquement au niveau 7, 8 et 9 utilisateurs. Si elle est activée elle remplace les numéros de téléphone des clients dans les nombreux rapports et des écrans dans le système avec Xs. Les paramètres chiffres seront montrent que les chiffres X derniers du numéro de téléphone. Par défaut est 0 pour les handicapés| +Allowed User Groups|Groupes d'utilisateurs autorisés| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Ceci est une liste sélectionnable de groupes d'utilisateurs à laquelle les membres de ce groupe d'utilisateurs peuvent visualiser et éventuellement modifier. Groupes d'utilisateurs peuvent restreindre l'accès à presque tous les aspects du système, à partir de DID entrants vers des téléphones à des boîtes vocales. Le - ALL - option permet aux utilisateurs de ce groupe à voir et à connecter à n'importe quel dossier sur le système si leurs autorisations d'utilisateur le permettent| +Allowed Call Times|Durée des appels autorisés| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Ceci est une liste sélectionnable Durée des appels à laquelle les membres de ce groupe d'utilisateurs peuvent utiliser dans les campagnes, dans les groupes et les menus d'appel. Le - ALL - option permet aux utilisateurs de ce groupe à utiliser tous les temps d'appel dans le système| +All call times in the system|Toutes les heures d'appels dans le système| +You are not allowed to edit your own user group|Vous n'êtes pas autorisé à modifier votre propre groupe d'utilisateurs| +You are not allowed to edit your own user|Vous n'êtes pas autorisé à modifier votre propre utilisateur| +Admin User Group|Groupe d'utilisateurs d'administration| +All Admin User Groups|Tous les groupes d'utilisateurs d'administration| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|C'est le groupe d'utilisateur d'administration pour cette campagne, ce qui permet d'administration visualisation de cette campagne ainsi que les listes assignés à cette campagne pour être limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin avec les autorisations des utilisateurs du groupe de campagne pour voir cette campagne| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|C'est le groupe d'utilisateur d'administration pour ce groupe entrant, ce qui permet la visualisation de cette administration en groupe restreint par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce groupe en| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|C'est le groupe d'utilisateur d'administration pour ce n'a, ce qui permet d'administration de visualisation de ce ne restreint par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce fait| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|C'est le groupe d'utilisateur d'administration pour cet enregistrement, ce qui permet la visualisation de cette administration recoird limité par groupe d'utilisateurs. Par défaut est - ALL - qui permet à tout utilisateur admin pour voir ce record| +User Start for this remote agent does not exist|Démarrer l'utilisateur pour cet agent distant n'existe pas| +ADMIN GROUP|GROUPE ADMIN| +Max Calls Method|Max Appelle la méthode| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Cette option peut permettre le maximum fonction simultanée des appels pour ce en groupe. S'il est défini à TOTAL, alors le nombre total d'appels étant traités par des agents et en file d'attente dans cet en-groupe ne sera pas autorisé à dépasser le nombre maximum Appels comte de lignes tel que défini ci-dessous. S'il est défini à IN_QUEUE, alors si le nombre d'appels en file d'attente pour les agents ne seront pas autorisés à dépasser le maximum Appels comte, peu importe combien d'appels sont des agents à cet effet dans-groupe. Par défaut est DISABLED| +Max Calls Count|Max appelle le comte| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Cette option doit être supérieure à 0 si vous souhaitez utiliser le Max Appels fonction Méthode. Par défaut est 0| +Max Calls Action|Max Appels d'action| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|C'est l'action à prendre si le Max Appelle la méthode est activée et que le nombre d'appels dépasse ce qui est prévu ci-dessus dans le Max Appels Comptez réglage. Les appels au-dessus de ce montant sera envoyé à l'action, soit DROP, l'action ou l'action AFTERHOURS NO_AGENT_NO_QUEUE et sera enregistré comme un statut MAXCAL une raison raccrochage MaxCalls. Par défaut est NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Si une méthode est utilisée avec CIDLOOKUP ALT, il va rechercher le domaine alt_phone pour le numéro de téléphone si aucune correspondance n'est trouvée pour le numéro de téléphone principal. Si une méthode est utilisée avec CIDLOOKUP ADDR3, il va rechercher le domaine address3 pour le numéro de téléphone si aucune correspondance n'est trouvée pour le numéro de téléphone principal et éventuellement le domaine alt_phone| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Un autre domaine dans cette section est de qualité, qui permet pour la campaign_grade_random agent Suivant Appelez la mise à être utilisé. Ce paramètre de qualité va augmenter ou diminuer la probabilité que l'agent recevra l'appel| +gives a higher probability of getting a call to the higher graded agents|donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur| +gives a higher probability of getting a call to the higher graded agents by in-group|donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur par l'intérieur du groupe| +gives a higher probability of getting a call to the higher graded agents by campaign|donne une plus grande probabilité de recevoir un appel aux agents de rang supérieur par la campagne| +Day call count for this in-group|Nombre d'appels pour cette Journée en groupe| +Day call count for this campaign|Nombre d'appels par jour pendant cette campagne| +SUMMARY STATS|Statistiques récapitulatives| +Daily Maximum Stats|Maximum quotidien Statistiques| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Ce sont des statistiques qui sont générées par le système chaque jour pendant toute la journée jusqu'à ce que la minuterie de fin de journée, car il est réglé dans les paramètres système. Ces nombres sont générés à partir des grumes dans le système pour permettre l'affichage beaucoup plus rapide. Les stats sont inclus sont - Nombre total d'appels, les agents maximum, maximum des appels entrants, appels sortants maximum| +Add or Remove In-Group Selected For Active Users in This User Group|Ajouter ou supprimer des en-groupe sélectionné pour les utilisateurs actifs dans ce groupe d'utilisateurs| +Maximum System Stats Reports|Maximum du système des rapports statistiques| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Ces statistiques sont mises en cache totaux qui sont stockés sur chaque journée de en temps réel par le biais des processus back-end. Pour les appels entrants, les appels totaux par en-groupe sont calculés pour chaque appel qui pénètre dans le processus qui calcule. Pour les chefs d'accusation ensemble du système, les totaux sont générés à partir des entrées de journal ainsi que d'autres totaux en groupe et de la campagne. Ces totaux peuvent ne pas s'additionner à cause des paramètres que vous avez dans votre système ainsi que lorsque l'appel est raccroché| +Hopper VLC Dup Check|Hopper VLC Dup Vérifiez| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Un réglage à Y entraîne chaque piste étant insérée dans la trémie étant vérifiée par vendor_lead_code pour s'assurer qu'il n'y sont pas dupliquer conducteurs insérés avec le même vendor_lead_code. Cela est particulièrement utile lorsque la fonction Auto-Alt-numérotation avec MULTI_LEAD. Par défaut est N| +Inventory Report|Rapport d'inventaire| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Si le Rapport d'inventaire est activé sur votre système, cette option permettra de déterminer si cette liste est inclus dans le rapport ou non. Par défaut est O pour oui| +Report Rank|Rapport Rang| +This option allows you to rank shifts in selected reports that support this option|Cette option vous permet de classer les changements dans les rapports sélectionnés qui soutiennent cette option| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|Vous pouvez également utiliser un IGNORENOSCROLL variable spéciale pour forcer les barres de défilement sur l'onglet script même si vous utilisez une iframe en son sein| +Carrier Log Report|Rapport Connexion Transporteur| +ADMINISTRATION: Campaign Multi-Alt-Leads|ADMINISTRATION: campagne multi-Alt-Leads| +Multi-Lead Auto Alt Dialing Settings Form|Multi-plomb Paramètres Auto Alt numérotation Formulaire| +List Custom Fields|Liste Champs Personnalisés| +Select custom template|Sélectionnez modèle personnalisé| +template builder|générateur de modèle| +Load from Lead File|Charger à partir du fichier principal| +Listloader Custom Template Maker|Maker Listloader modèle personnalisé| +Custom template to use|Modèle personnalisé à utiliser| +Create a new template|Créer un nouveau modèle| +Delete an existing template|Supprimer un modèle existant| +Sample file fitting template|Modèle de fichier de l'échantillon de montage| +needed for field assignation||nécessaire pour l'assignation champ| +Select template to delete|Sélectionnez le modèle à supprimer| +DELETE TEMPLATE|Supprimer le modèle| +New template form|Modèle de formulaire Nouveau| +Template ID|ID modèle| +Template Name|Nom du modèle| +Template Description|description du modèle| +List ID template will load into|Modèle ID de liste sera charger dans| +Assign columns to file fields|Attribuer colonnes à des champs de fichiers| +selecting a different list will reset columns|sélection d'une liste différente pour réinitialiser colonnes| +Standard Field|champ standard| +Custom Field|champ personnalisé| +Select a list ID from the drop down menu above to show columns|Sélectionnez un ID de liste à partir du menu déroulant ci-dessus pour afficher les colonnes| +SUBMIT TEMPLATE|SOUMETTRE TEMPLATE| +Click here to see Admin changes to this campaign|Cliquez ici pour voir les changements d'administration à cette campagne| +Click here to see Admin changes to this record|Cliquez ici pour voir les changements d'administration de ce disque| +Click here to see Admin changes to this list|Cliquez ici pour voir les changements d'administration à cette liste| +Click here to see Admin changes to this script|Cliquez ici pour voir les changements d'administration de ce script| +Click here to see Admin changes to this filter|Cliquez ici pour voir les changements d'administration à ce filtre| +Click here to see Admin changes to this In-Group|Cliquez ici pour voir les changements d'administration à cette En-Groupe| +Click here to see Admin changes to this DID|Cliquez ici pour voir les changements d'administration à cette DID| +Click here to see Admin changes to this filter phone group|Cliquez ici pour voir les changements d'administrateur pour ce groupe de téléphone du filtre| +Click here to see Admin changes to this user group|Cliquez ici pour voir les changements d'administrateur pour ce groupe d'utilisateurs| +Click here to see Admin changes to this remote agent|Cliquez ici pour voir les changements d'administration à cet agent à distance| +Click here to see Admin changes|Cliquez ici pour voir les changements d'administration| +CAMPAIGNS USING THIS SCRIPT|CAMPAGNES utilisant ce script| +IN-GROUPS USING THIS SCRIPT|In-groups en utilisant ce script| +LIST OVERRIDES USING THIS SCRIPT|Remplacements LISTE utilisant ce script| +ADMIN REPORT OPTIONS|OPTIONS RAPPORT ADMIN| + Inbound | Entrant | +Audio File|fichier audio| +USING THIS IN-GROUP|D'UTILISER CE GROUPE EN| +Handle Method|Manipuler Méthode| +Search Method|Méthode de recherche| +USING THIS CALL MENU|UTILISER CE MENU APPEL| +DELETE THIS CALL MENU|SUPPRIMER CETTE MENU APPEL| +Click here to see Admin changes to this CALL MENU|Cliquez ici pour voir les changements d'administration à ce menu APPEL| diff --git a/agc_2-X/trunk/translations/it_language_admin.txt b/agc_2-X/trunk/translations/it_language_admin.txt index d0e1bbf9..7ed3e4d0 100644 --- a/agc_2-X/trunk/translations/it_language_admin.txt +++ b/agc_2-X/trunk/translations/it_language_admin.txt @@ -64,20 +64,52 @@ vicidial|welcome_demo.php|1 vicidial|welcome_languages.php|1 vicidial|vicidial_admin_web_logo.gif|1 vicidial|vicidial_admin_web_logo_small.gif|1 -vicidial|user_territories.php|1 +vicidial|user_territories.php|0 vicidial|audio_store.php|1 -vicidial|AST_agent_time_detail.php|1 -vicidial|AST_agent_timeclock_detail.php|1 -vicidial|AST_OUTBOUNDsummary_interval.php|1 -vicidial|call_report_export.php|1 -vicidial|AST_CLOSERsummary_hourly.php|1 -vicidial|functions.php|1 +vicidial|AST_agent_time_detail.php|0 +vicidial|AST_agent_timeclock_detail.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|call_report_export.php|0 +vicidial|AST_CLOSERsummary_hourly.php|0 +vicidial|functions.php|0 +vicidial|realtime_report.php|0 +vicidial|AST_inbound_daily_report.php|0 +vicidial|AST_DIDstats.php|0 +vicidial|AST_OUTBOUNDsummary_interval.php|0 +vicidial|AST_LISTS_campaign_stats.php|0 +vicidial|AST_campaign_status_list_report.php|0 +vicidial|AST_dialer_inventory_report.php|0 +vicidial|lead_report_export.php|0 +vicidial|AST_team_performance_detail.php|0 +vicidial|AST_LIST_UPDATEstats.php|0 +vicidial|callcard_admin.php|0 +vicidial|voice_lab.php|1 +vicidial|send_CID_call.php|1 +vicidial|admin_phones_bulk_insert.php|1 +vicidial|AST_hangup_cause_report.php|0 +vicidial|AST_carrier_log_report.php|0 +vicidial|campaign_debug.php|1 +vicidial|admin_campaign_multi_alt.php|0 +vicidial|AST_VICIDIAL_ingrouplist.php|0 +vicidial|admin_lists_custom.php|0 +vicidial|admin_listloader_fourth_gen.php|0 +vicidial|AST_admin_template_maker.php|0 +vicidial|leadloader_template_display.php|0 +vicidial|admin_listloader_third_gen.php|0 +vicidial|wz_jsgraphics.js|1 +vicidial|verticalbargraph.css|1 +vicidial|horizontalbargraph.css|1 +vicidial|line.js|1 +vicidial|calendar_db.js|0 +vicidial|calendar.css|1 +vicidial|count_functions.inc|1 +vicidial|sheet2tab.pl|1 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### BORDER|Border| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| -\.\/images\/|../agc/images/| +images\/|../vicidial/images/| help.gif|help.gif| ### BEGIN translation phrases through 1.1.11 release ### English|Inglese| @@ -964,7 +996,7 @@ VERSION|VERSIONE| BUILD|BUILD| REPORTS|REPORT| CAMPAIGNS| CAMPAGNE| -LISTS|LISTE| +#LISTS|LISTE| SCRIPTS|SCRIPT| FILTERS|FILTRI| IN-GROUPS|GRUPPI INBOUND| @@ -2186,8 +2218,8 @@ DOWNLOAD|DOWNLOAD| Users|Utenti| User|Utente| Reports|Rapporti| -OUTBOUND|OUTBOUND| -INBOUND|INBOUND| +#OUTBOUND|OUTBOUND| +#INBOUND|INBOUND| Server Stats and Reports|Server Statistiche e rapporti| Click here to see a VDAD report for this campaign|Clicca qui per vedere un VDAD relazione per questa campagna| Show DIDs|Visualizza DIDs| @@ -2596,3 +2628,891 @@ This web URL address is not seen by the agent, but it is called every time a cal Xfer-Conf Number Override|XFER-Conf Numero Override| These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Questi cinque campi consentono di ignorare le impostazioni predefinite Conferenza di trasferimento del numero, quando la guida è da questo elenco. Predefinita è vuota| These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Questi quattro campi consentire di avere due insiemi di trasferimento Conferenza e preset DTMF. Quando la chiamata o la campagna viene caricata, lo script vicidial.php mostrerà due pulsanti per il trasferimento-frame conferenze e auto-popolano il numero-to-dial e l-invio campi DTMF quando viene premuto. Se si desidera consentire consultivo Trasferimenti, un Fronter a una più stretta, hanno l-agente di utilizzare la casella di controllo CONSULTIVO, che non funziona per i non di terze parti ViciDial chiamate consultivo. Per coloro che hanno il solo clic agente Dial Con il tasto del cliente. Poi l-agente può lasciare-3 VIE-CALL e passare alla loro chiamata successiva. Se si desidera consentire i trasferimenti Blind dei clienti di uno script VICIDIAL AGI per la registrazione o un IVR, poi AXFER posto nel numero di-to-dial campo. È inoltre possibile specificare l-estensione personalizzata dopo la AXFER, ad esempio se si vuole fare una chiamata ad un IVR speciale è stato impostato per l-estensione 83.900 si metterebbe AXFER83900 del numero-to-dial campo| +### START translations for 2.4 release ### +All users in the system, even not logged-in users|Tutti gli utenti del sistema, neppure gli utenti registrati| +The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently|Il non-logged-IN-AGENTI opzione consente a tutti gli utenti del sistema da visualizzare, anche se non sono registrati curently| +Voicemail ID|Voicemail ID| +This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL|Questa è la casella vocale che le chiamate verranno indirizzati a in un AGENTDIRECT in gruppo al momento se la caduta in gruppo ha impostato il metodo della goccia alla casella vocale e il campo di Voicemail impostata AGENTVMAIL| +In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare| +Record Call|Record di chiamata| +This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.|Questa opzione permette di impostare le chiamate che viene in questo DID da registrare. Y registrerà l'intera chiamata, Y_QUEUESTOP registrerà la chiamata fino a quando la chiamata è hungup o entra in un gruppo di in-coda, N non registrare la chiamata. Il valore predefinito è N.| +Click here to see a list of recordings and calls for this DID|Clicca qui per vedere un elenco delle registrazioni e chiede per questo DID| +Ignore List Script Override|Ignora Script Override List| +This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N|Questa opzione consente di ignorare l'ID elenco delle opzioni Script Override per le chiamate che entrano in questo In-Group. Impostare questo a Y ignorerà le impostazioni di script ID List. Il valore predefinito è N| +External Server IP|Server IP esterno| +This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty|Questa impostazione è dove si può mettere un indirizzo IP o il nome del server di altra macchina che può essere utilizzato al posto del IP_server quando si utilizza un webphone nell'interfaccia dell'agente. Per farlo funzionare si deve avere anche la voce telefoni impostato per utilizzare l'IP esterno del server. Il valore predefinito è vuoto| +Set As Webphone|Imposta come Webphone| +Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.|Impostando questa opzione su Y tenterà di caricare un web-based telefono quando l'agente accede a loro schermo agente. Il valore predefinito è N.| +Use External Server IP|Utilizzare IP esterno Server| +If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty|Se si utilizza come un telefono web, è possibile impostare questo valore a Y per utilizzare i server IP esterno per la registrazione al posto del IP del server. Il valore predefinito è vuoto| +Default Webphone|Predefinito Webphone| +If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0|Se impostato a 1, questa opzione farà tutti i nuovi telefoni sono creati Imposta come predefinito set Webphone a Y. è 0| +Default External Server IP|IP di default del server esterno| +If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0|Se impostato a 1, questa opzione farà tutti i nuovi telefoni sono creati Usa IP esterno Server impostato su Y. Il valore predefinito è 0| +Webphone URL|URL webphone| +This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|Questo è l'URL del webphone che verrà utilizzato con questo sistema se è abilitato nel record telefoni che un agente sta utilizzando. Il valore predefinito è vuoto| +AGENT ACTIVITY FOR THIS TIME PERIOD|ATTIVITA 'AGENTE PER QUESTO PERIODO DI TEMPO| +these fields are in seconds|questi campi sono in pochi secondi| +Enable Agent Disposition Logfile|Abilita Disposition Logfile agente| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|Questa opzione si accede ad un file di log di testo sul server web ogni volta che viene dispositioned una chiamata da un agente. Il default è 0, disattivato| +Agent Call Log View|Call Agent View Log| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|Questa opzione stabilisce se l'agente sarà in grado di vedere il loro registro delle chiamate per le chiamate gestite attraverso lo schermo agente ViciDial. Il default è n per nulla o disabili| +Agent Call Log View Override|Call Agent View Log Override| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|Questa impostazione avrà la precedenza su ciò che l'utente gli utenti gruppo ha fissato per View Call Log Agent. DISABLED utilizza l'impostazione gruppo di utenti. N non permetterà che mostra la chiamata degli utenti log. Y permetterà mostrando il registro delle chiamate dell'utente. Predefinito è DISABLED| +Custom Dialplan Entry|Personalizzato Entry Dialplan| +This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context|Questo campo consente di inserire in tutti gli elementi dialplan che si desidera per il server, le linee saranno aggiunti al contesto di default| +This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context|Questo campo consente di inserire in tutti gli elementi dialplan che si desidera per tutti i server Asterisk, le linee saranno aggiunti al contesto di default| +This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive|Questa opzione consente di inserire linee di dialplan personalizzati in menu chiamate, server e impostazioni di sistema. Il default è 0 per inattiva| +Custom CallerID|Personalizzato CallerID| +When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N|Quando è impostato su Y, questa opzione consente di utilizzare il campo security_phrase nella tabella vicidial_list come CallerID di inviare quando si posiziona per ogni lead specifico. Se questo campo non ha CID in esso allora la campagna CallerID sopra definito verrà utilizzato. Questa opzione consente di disattivare il CallerID override lista se è presente un CID nel campo security_phrase. Il valore predefinito è N| +CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead|CUSTOM_CID utilizzerà il CID personalizzato che è definita nel campo della tabella security_phrase vicidial_list per il cavo| +Scheduled Callbacks Alert|Richiamate pianificate Alert| +This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line|Questa opzione consente la riga di stato callback nell'interfaccia agente essere rosso, lampeggia o lampeggiare in rosso quando ci sono in programma AGENTONLY callback che hanno colpito il loro tempo e la data di attivazione. Il valore predefinito è NONE per la linea di stato standard| +QueueMetrics Login-Out|QueueMetrics Login-Out| +This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently|Questa opzione influisce sul modo in vicidial registrerà gli accessi e le uscite di un agente nel queue_log. L'impostazione predefinita è STANDARD di utilizzare standard di AGENTLOGIN AGENTLOGOFF, CALLBACK userà AGENTCALLBACKLOGIN e AGENTCALLBACKLOGOFF QM che analizza in modo diverso| +Enable CallCard|Abilita CallCard| +This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled|Questa impostazione consente le funzioni CallCard con ViciDial per consentire ai chiamanti di utilizzare i numeri pin e card_ids che hanno un equilibrio di minuti e gli equilibri possono avere tempo di conversazione agente per le chiamate dei clienti verso a gruppi dedotte. Il default è 0 per disabili| +CallCard Access|CallCard accesso| +Agent Transfer Options|Agente di trasferimento Opzioni| +These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled|Queste opzioni consentono la disattivazione di pulsanti specifici nella sezione di trasferimento Conferenza dell'interfaccia dell'agente. Il valore predefinito è Y per sì o abilitati| +Agent Allow Park Customer Dial Xfer|Agente Lasciare Xfer Clienti Parco Dial| +Agent Allow Dial With Customer Xfer|Agente di permettere chiamate Con Xfer clienti| +Agent Allow Blind Xfer|Agente Consenti Xfer Ciechi| +Agent Allow Voicemail Message Xfer|Agente Permetti messaggi Xfer Voicemail| +Agent Allow Dial Override Xfer|Agente Lasciare Override Xfer Dial| +Agent Allow Consultative Xfer|Agente Consenti Xfer consultivo| +Agent Fullscreen|Agente Fullscreen| +This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled|Questa opzione se impostato a Y impostare l'altezza e la larghezza dello schermo dell'agente ViciDial alle dimensioni della finestra del browser web, senza alcuna indennità per la visualizzazione di agenti, chiamate in coda o Vista chiede in vista della sessione. Il default è n per nulla o disabili| +Add Extension Group|Aggiungi gruppo Extension| +New Group Extension Addition|Nuovo gruppo aggiunta Extension| +Modify Extension Group|Modifica gruppo Extension| +Delete Extension Group|Elimina gruppo Extension| +Extension Groups|Gruppi di estensione| +Add Extension Group Entry|Aggiungi gruppo Entry Extension| +Extension Group|Extension Group| +This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers|Questo campo obbligatorio è dove inserire l'ID gruppo che si desidera questa estensione da mettere in. Non ci sono spazi o caratteri speciali ad eccezione di sottolineatura lettere e numeri| +Extension:|Estensione:| +This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry|Questo campo è richiesto in cui si inserisce l'estensione dialplan che si desidera che l'agente remoto le chiamate da inviare per questa voce gruppo di interni| +This field allows you to rank the extension group entries that share the same extension group. Default is 0|Questo campo consente di classificare le voci di estensione dei gruppi che condividono lo stesso gruppo estensione. Il default è 0| +Campaigns Groups|Campagne Gruppi| +In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string|In questo campo si può mettere un elenco di ID o ID campagna e di gruppo in ingresso che si desidera limitare l'uso del gruppo per estensione. Elenco devono essere separati da tubi ed un condotto all'inizio e alla fine della stringa| +EXTENSION GROUP ENTRY NOT ADDED|GRUPPO ENTRY ESTENSIONE NON AGGIUNTO| +there is already an extension group entry with these values|c'è già una voce gruppo di interni con questi valori| +EXTENSION GROUP ENTRY ADDED|GRUPPO ENTRY ESTENSIONE AGGIUNTO| +MODIFY AN EXTENSION GROUP ENTRY|Modificare una voce gruppo di interni| +Click here to see Admin chages to this extension group entry|Clicca qui per vedere chages Admin a questa voce gruppo di interni| +DELETE THIS EXTENSION GROUP ENTRY|Eliminare questa voce gruppo di interni| +Call Count Today|Chiama contare oggi| +Last Call Time|Chiamata Last Time| +Last Call ID|Chiamata ID Ultimo| +EXTENSION GROUP ENTRY NOT MODIFIED|GRUPPO ENTRY ESTENSIONE NON MODIFICATA| +EXTENSION GROUP ENTRY MODIFIED|GRUPPO ENTRY proroga modificata| +EXTENSION GROUP ENTRY NOT DELETED|GRUPPO ENTRY ESTENSIONE non cancellato| +EXTENSION GROUP ENTRY DELETION CONFIRMATION|EXTENSION GROUP ENTRY conferma dell'eliminazione| +Click here to delete extension group entry|Clicca qui per cancellare gruppo voce dell'estensione| +EXTENSION GROUP ENTRY DELETION COMPLETED|GRUPPO DI CANCELLAZIONE ESTENSIONE di iscrizione compilata| +EXTENSION GROUP LISTINGS|ESTENSIONE DEL GRUPPO ANNUNCI| +Extension Group|Extension Group| +If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated|Se è impostato su qualcosa di diverso da NONE o vuoto questo ridefinire il campo esterno Estensione e utilizzare le voci di estensione del Gruppo che hanno lo stesso ID del gruppo estensione. Il valore predefinito è NONE per disattivato| +Click here to see agents logged in to this inbound group|Clicca qui per vedere gli agenti collegati a questo gruppo in entrata| +Agent Choose Blended|Agente Scegli Blended| +This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled|Questa opzione se impostato a 1 consente all'utente di scegliere se l'agente ha il proprio set campagna per miscelati o meno, e se poi non l'impostazione predefinita mescolato verrà utilizzato. Il valore predefinito è 1 per abilitato| +Click here to see a log of the uploads to the audio store|Clicca qui per vedere un registro degli arrivi al negozio audio| +QueueMetrics CallStatus|QueueMetrics CallStatus| +This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled|Questa opzione se impostato a 0 non metterà nella voce CALLSTATUS in queue_log quando un agente disposizioni una chiamata. Il valore predefinito è 1 per abilitato| +QM CallStatus Override|QM CallStatus Override| +If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting|Se l'integrazione QueueMetrics è abilitato nelle impostazioni di sistema questa impostazione consentono prevalente delle impostazioni di sistema di impostazione per CallStatus voci queue_log. Predefinito è DISABLED che utilizzerà l'impostazione del sistema| +Extension Append CID|Extension Aggiunge CID| +If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Se attivata, le chiamate effettuate da questa campagna avrà uno spazio e l'estensione telefono dell'agente aggiunto alla fine del nome CallerID per la chiamata prima che venga inviato all'agente. Il default è n per disabili| +If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled|Se attivata, le chiamate in arrivo da questo gruppo avrà uno spazio e l'estensione telefono dell'agente aggiunto alla fine del nome CallerID per la chiamata prima che venga inviato all'agente. Il default è n per disabili| +Scheduled Callbacks Count|Richiamate pianificate Conte| +This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE|Questa opzione permette di impostare solo se richiamate VIVI, dall'utente solo richiamate pianificate che hanno colpito la data e l'ora di attivazione, o callback ALL_ACTIVE, user-only callback che sono attivi nel sistema così come callback viviamo, deve BE3 ha contato int agente di avviso sezione richiamata sullo schermo dell'agente. Il valore predefinito è ALL_ACTIVE| +Realtime Block User Info|Realtime Block Info Utente| +This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled|Questa impostazione, se impostato su 1 si bloccherà le informazioni utente e la stazione venga visualizzato in tempo reale report. Il default è 0 per disabili| +Manual Dial Override|Selezione manuale Override| +The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE|L'impostazione può ignorare le possibilità di impostazione per utenti dial manuale per gli agenti quando sono connessi in questa campagna. NONE seguirà l'impostazione di utenti, ALLOW_ALL permetterà a qualsiasi agente collegato in questa campagna di effettuare chiamate di selezione manuale, DISABLE_ALL non permetteremo a nessuno l'accesso a questa campagna per effettuare chiamate di selezione manuale. Il valore predefinito è NONE| +Blind Monitor Warning|Monitor Warning cieca| +This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED|Questa opzione, se attivata farà l'agente di sapere in vari modi opzionali se vengono cieco controllati da qualcuno. DISABILI significa che questa funzione non è attiva, ALERT solo un avviso pop-up sullo schermo agente, AVVISO pubblicherà una nota che rimane sullo schermo agente finché theya re monitorato, AUDIO giocherà il nome del file definito di seguito quando un agente sta cominciando a essere monitorati e le altre opzioni sono combibnations delle suddette opzioni. Predefinito è DISABLED| +Blind Monitor Notice|Cieco Monitor Notice| +This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is|Questo è il messaggio che verrà visualizzato sullo schermo l'agente mentre vengono monitorati se l'opzione AVVISO è selezionata. Il valore predefinito è| +Blind Monitor Filename|Cieco Monitor Filename| +This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty|Questo è il file audio che verrà riprodotto nella sessione agenti all'inizio del monitoraggio che qualcuno li accecano. Questo messaggio sarà giocato per tutta la sessione anche se il cliente è presente. Il valore predefinito è vuoto| +Uniqueid Status Display|Display di stato UniqueID| +If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed|Se abilitato, quando un agente riceve una chiamata tramite questo gruppo vedranno il UniqueID della chiamata aggiunto alla riga di stato nella loro interfaccia agente. L'opzione sarà PREFIX aggiungere il prefisso definito colpo all'inizio della UniqueID sul display. Predefinito è DISABLED. Se ci fosse già un ID univoco definito su una chiamata di entrare in questo gruppo, allora il UniqueID originale sarà visualizzata| +Uniqueid Status Prefix|Stato Prefisso UniqueID| +If PREFIX option is selected above then this is the value of that prefix. Default is empty|Se l'opzione è selezionata PREFISSO sopra allora questo è il valore di quel prefisso. Il valore predefinito è vuoto| +Default Codecs|Predefinite Codecs| +You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty|È possibile definire un elenco delimitato da virgole di codec da impostare come i codec di default per tutti i sistemi. Le opzioni per i codec sono ulaw, alaw, GSM, G729, Speex, G722, G723, G726, iLBC, ... Il valore predefinito è vuoto| +Allowed Codecs|Codec ammessi| +You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty|È possibile definire un elenco delimitato da virgole di codec da impostare come i codec di default per questo telefono. Le opzioni per i codec sono ulaw, alaw, GSM, G729, Speex, G722, G723, G726, iLBC, ... Alcuni di questi codec potrebbero non essere disponibili sul vostro sistema, come il G729 o G726. Se il campo è vuoto, allora i codec di default del sistema o la rubrica telefonica di sopra di questo uno sarà utilizzato per i codec ammissibili. Il valore predefinito è vuoto| +Allowed Codecs With Template|Codec ammessi Con Template| +Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0|Impostando questa opzione a 1 includerà i codec di cui sopra, anche se un modello di file di configurazione viene utilizzato. Il default è 0| +If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent|Se l'opzione PRESERVE viene utilizzato e la chiamata viene inviato ad un secondo agente, e la UniqueID prefisso visualizzato al primo agente verrà visualizzato anche al secondo agente| +Custom Fields Modify|Modifica campi personalizzati| +This option if set to 1 allows the user to modify custom list fields|Questa opzione, se impostato su 1 consente all'utente di modificare i campi elenco personalizzati| +ERROR: Custom Fields are not active on this system|ERRORE: I campi personalizzati non sono attivi su questo sistema| +Lists Custom Field|Elenca Campo personalizzato| +Field Label|Campo Etichetta| +This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Questo è l'identificatore di campo del database per questo campo. Questo deve essere un identificatore univoco all'interno dei campi personalizzati per questa lista. Non utilizzare spazi o segni di punteggiatura per questo campo. max 50 caratteri, un minimo di 2 caratteri| +Field Name|Nome del campo| +This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters|Questo è il nome del campo come apparirà di un agente attraverso la loro interfaccia. È possibile utilizzare gli spazi in questo campo, ma senza punteggiatura caratteri, massimo di 50 caratteri e un minimo di 2 caratteri| +Field Description|Campo Descrizione| +The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters|La descrizione di questo campo come apparirà nell'interfaccia di amministrazione. Questo è un campo opzionale con un massimo di 100 caratteri| +Field Rank|Classifica di Campo| +The order in which these fields is displayed to the agent from lowest on top to highest on the bottom|L'ordine in cui viene visualizzato questi campi per l'agente dal basso in alto al più alto sul fondo| +Field Help|Guida campi| +Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface|Campo opzionale, se lo compila, l'agente sarà in grado di vedere questo testo quando si fa clic su un link di aiuto accanto al campo nella loro interfaccia agente| +Field Type|Tipo di campo| +This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box|Questa opzione definisce il tipo di campo che verrà visualizzato. TEXT è uno standard a riga singola scheda di iscrizione, AREA è un multi-line casella di testo, SELECT è una selezione singola menu a discesa, è un multiplo MULTI-select box, RADIO è un elenco di pulsanti di opzione in cui una sola opzione può essere selezionato, CHECKBOX è una lista di caselle di controllo, dove molteplici opzioni possono essere selezionate, DATE è un giorno mese anno di calendario popup in cui l'agente può selezionare la data e ora è tempo di una casella di selezione. Il valore predefinito è TEXT. Per le opzioni SELECT, MULTI, RADIO e CHECKBOX è necessario definire i valori di opzione di seguito nella casella Opzioni per campo| +Field Options|Opzioni dei campi| +For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter|Per la SELECT, MULTI, RADIO e tipi di campo CheckBox, è necessario definire i valori di opzione in questa casella. È necessario inserire un elenco di etichetta opzionale separati da virgola e il testo qui con opzione di ciascuna opzione una sua propria linea. Il primo valore non deve avere spazi, e né i valori dovrebbero avere alcun segno di punteggiatura. Per esempio - electric_meter, contatore elettrico| +Field Size|Dimensione campo| +This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Questa impostazione significa cose diverse a seconda di quale sia il tipo di campo. Per i campi di testo, la dimensione è il numero di caratteri che mostrerà sul campo. Per i campi di AREA, la dimensione è la larghezza della casella di testo in caratteri. Per i campi MULTI, questa impostazione definisce il numero di opzioni per essere mostrati nella lista multi selezione. Per SELECT, RADIO, CHECKBOX, DATE e TIME questa impostazione viene ignorata| +Field Max|Campo Max| +This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored|Questa impostazione significa cose diverse a seconda di quale sia il tipo di campo. Per il testo, i campi nascosti e READONLY, la dimensione è il numero massimo di caratteri consentiti nel campo. Per i campi della zona, questo campo definisce il numero di righe di testo visibili nella casella di testo. Per MULTI, SELECT, RADIO, CHECKBOX, DATE e TIME questa impostazione viene ignorata| +Field Cost|Campo Costo| +This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space|Questo campo di sola lettura indica che il costo di questo campo è nella tabella campo personalizzato per questa lista. Non vi è alcun limite per il numero di campi personalizzati si possono avere in un elenco, ma il totale del costo di tutti i campi per la lista deve essere inferiore a 65000. Questo permette in genere di centinaia di campi, ma se si specificare i campi di testo che sono centinaia o migliaia di caratteri di lunghezza quindi si può colpire questo limite in fretta. Se avete bisogno di molto più che il testo in un campo si consiglia di scegliere un tipo di AREA, che vengono memorizzati in modo diverso e non utilizzare lo spazio tabella come più| +Field Required|Un campo obbligatorio| +If set to Y, this field will force the agent to enter text or select an option for this field. Default is N|Se impostato su Y, in questo campo forzerà l'agente per inserire il testo o selezionare un'opzione per questo campo. Il valore predefinito è N| +Field Default|Campo di default| +This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function|Questo campo facoltativo consente di definire il valore da assegnare a un campo se non viene caricato in quel campo. Il valore predefinito è NULL che disabilita la funzione predefinita| +MODIFY FIELDS|Modificare i campi| +LIST LISTINGS WITH CUSTOM FIELDS COUNT|ANNUNCI DI LISTINO CON campi personalizzati COUNT| +SUMMARY OF FIELDS|SINTESI DEI CAMPI| +ADD A NEW CUSTOM FIELD FOR THIS LIST|Aggiungere un nuovo campo personalizzato per questo LIST| +ERROR: Field does not exist|ERRORE: Il campo non esiste| +ERROR: Table does not exist|ERRORE: La tabella non esiste| +ERROR: Field already exists for this list|ERRORE: Il campo esiste già per questa lista| +CLICK HERE TO CONFIRM DELETION OF THIS CUSTOM FIELD|CLICCA QUI per confermare l'eliminazione di questo campo CUSTOM| +THIS CUSTOM FIELD HAS BEEN DELETED|QUESTO CAMPO personalizzato è stato eliminato| +Records in this custom table|Record in questa tabella personalizzata| +EXAMPLE OF CUSTOM FORM|ESEMPIO DI MODULO CUSTOM| +For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time|Per i tipi di campo DATE, il default è sempre impostato a oggi meno che un numero viene inserito in nel qual caso la data sarà che molti giorni più o meno oggi. Per i tipi di campo TIME, il default è sempre impostato al tempo corrente del server a meno che un numero viene inserito in nel qual caso il tempo sarà che molti minuti più o meno ora corrente| +MODIFY EXISTING FIELDS|Modificare i campi ESISTENTI| +Field Name Position|Nome del campo Posizione| +If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT|Se impostato a sinistra, questo il nome del campo appare alla sinistra del campo, se impostato al TOP il nome del campo assumerà tutta la linea e appaiono sopra il campo. Predefinito è left| +Option Position|Opzione di posizione| +For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL|Per i tipi di campo CheckBox e RADIO solo, se impostato su ORIZZONTALE le opzioni appariranno sulla stessa linea eventualmente capo alla riga qui sotto se ci sono molte opzioni. Se è impostato su VERTICAL ci sarà una sola opzione per riga. Il valore predefinito è ORIZZONTALE| +Hold Time Option Minimum|Tenere Opzione Tempo minimo| +If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|Se il tempo di attesa opzione abilitata, questo è il numero minimo di secondi la chiamata deve essere in attesa prima di essere presentato con l'opzione tempo di attesa. L'opzione tempo di attesa sarà immediatamente presentata in questo momento se il tempo di attesa stimato è superiore al Hold Time Value Option secondi. Il valore predefinito è 0 secondi| +ADDING COPIED CARRIER|AGGIUNTA CARRIER COPIATO| +ADD COPIED CARRIER|AGGIUNGI CARRIER COPIATO| +Source Carrier|Fonte Carrier| +COPIED CARRIER ADDED|CARRIER copiati hanno aggiunto| +Copy A Carrier|Copia A Carrier| +Field OrderIf more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right|Campo OrderIf più di un campo ha lo stesso rango, che verrà posizionato sulla stessa linea e saranno disposti in ordine da questo valore dal più basso al più alto, da sinistra a destra| +Copy Fields to Another List|Copia campi ad un'altra lista| +List ID to Copy Fields to|Elencare ID Copia Campi| +List ID to Copy Fields From|Elencare ID per copiare i campi da| +Copy Option|Copy Option| +When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option|Quando si copiano le definizioni dei campi da un elenco ad un altro, avete alcune opzioni per come funziona il processo di copia. APPEND aggiungere i campi che non sono presenti nella lista di destinazione, se vi sono corrispondenti etichette dei campi volontà quelli rimasti intatti, non di dati di campo personalizzati saranno cancellati o modificati utilizzando questa opzione. UPDATE aggiornare i campi comuni field_label nella lista di destinazione per le definizioni dei campi dalla lista sorgente. dati di campo personalizzato può essere modificato o perso con questa opzione. SOSTITUIRE rimuoverà tutti i campi personalizzati esistenti nella lista di destinazione e sostituirli con i campi personalizzati dalla lista sorgente, tutti i dati di campo personalizzato saranno eliminati utilizzando questa opzione| +ERROR: Source list has no custom fields|ERROR: nell'elenco Sorgente non ha campi personalizzati| +SUCCESS: Custom Field Added|SUCCESSO: Campo personalizzato Aggiunto| +SUCCESS: Custom Field Modified|SUCCESSO: Campo personalizzato modificato| +SUCCESS: Custom Field Deleted|SUCCESSO: Campo personalizzato eliminata| +Copy List Custom Fields|Copiare campi elenco personalizzati| +ERROR: You cannot copy fields to the same list|ERRORE: Non è possibile copiare i campi alla stessa lista| +DISPLAY will display only and not allow for modification by the agent|DISPLAY visualizzerà solo e non consentire la modifica da parte dell'agente| +Hold Time Option Callmenu|Tenere Opzione Callmenu Tempo| +Hold Time Option Press Filename|Tenere opzione filename Tempo Press| +If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Se il tempo di attesa opzione è impostata su CALL_MENU, questo è il Menu di chiamata che la chiamata verrà inviato se il tempo di attesa stimato supera i Attesa seconds Tempo| +If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back|Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto se il tempo di attesa stimato supera i Attesa seconds tempo per dare al cliente la possibilità di premere 1 sul loro telefono cellulare per eseguire il tempo selezionato attesa Premere Option. E 'molto importante che questo file audio è di 10 secondi o meno o ci saranno problemi. L'impostazione predefinita è di-essere-chiamato-back| +If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option|Se una delle opzioni PRESS_ è selezionata, si svolgerà il Filename Press definito di seguito e dare al cliente la possibilità di premere 1 sul telefono a lasciare la coda ed eseguire l'opzione selezionata| +Hold Time Option After Press Filename|Tenere Option Time After Nome Press| +If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list|Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_ o CALLERID_CALLBACK, questo è il prompt nome del file che viene riprodotto dopo che il cliente ha premuto 1 o la chiamata è stato aggiunto alla lista callback| +Inbound Queue No Dial|Coda in ingresso No Dial| +This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED|Questa funzione, se impostata su ENABLED permette di evitare che in uscita auto-selezione di questa campagna se ci sono chiamate in entrata in attesa in coda che fanno parte dei gruppi ammessi in entrata di cui in questa campagna. Impostare questo a ALL_SERVERS cambierà l'algoritmo per calcolare tutte le chiamate in entrata, come le chiamate attive su questo server, anche se sono su un altro server che si riducono le possibilità di porre inutili chiamate in uscita se si dispone di chiamate in arrivo su un altro server. Predefinito è DISABLED| +After Hours Filename Override|Dopo Nome file Override Hours| +These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty|Questi campi consentono di ignorare il messaggio After Hours per i gruppi in arrivo se è impostato a qualcosa. Il valore predefinito è vuoto| +On Hold Prompt No Block|In attesa Prompt No Block| +Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N|Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in attesa in cui la richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre l'On Hold messaggio Nome Prompt sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N| +On Hold Prompt Seconds|In attesa Secondi Prompt| +This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10|Questo campo deve essere impostato il numero di secondi che l'On Hold Filename Prompt gioca. Il valore predefinito è 10| +Hold Time Option Press No Block|Tenere Option Press Tempo No Block| +Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in cui l'attesa opzione di stampa Nome richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre il tempo di attesa Option messaggio Press Filename sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N| +Hold Time Option Press Filename Seconds|Tenere opzione di secondi Nome del file Stampa| +This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10|Questo campo deve essere impostato il numero di secondi che il tempo di attesa Nome Opzione Press gioca. Il valore predefinito è 10| +CallCard Generate New Numbers|CallCard generazione di numeri nuovi| +Call Menu In-Group Settings|Chiama Menu In-Impostazioni del gruppo| +If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled|Se il percorso è impostato su ingroup poi ci sono molte opzioni che si possono impostare per definire la modalità di chiamata viene inviato nella coda. In-Group è il gruppo in entrata a cui si desidera la chiamata per andare a. Metodo Handle è il modo in cui si desidera che la chiamata a essere gestito| +Click here to see a list of the available handle methods|Clicca qui per vedere un elenco dei metodi di maniglie disponibili| +VID Enter Filename|Inserisci il Nome del file VID| +VID ID Number Filename|VID ID Number Filename| +VID Confirm Filename|VID Conferma Filename| +VID Digits|VID cifre| +Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be entered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|Metodo di ricerca definisce come la coda si trova l'agente successivo, consigliamo lasciarlo su LB. ID List è l'elenco che il piombo viene inserito nel nuovo, anche se il metodo non è un metodo di ricerca e il piombo non viene trovato. ID campagna è la campagna per la ricerca attraverso liste se uno dei metodi RC viene utilizzato. Codice Phone è la voce del campo phone_code per il piombo che viene inserito con. VID Inserisci Nome viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato a chiedere al cliente di inserire il proprio ID. VID Nome Numero ID viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato dopo che il cliente entra nel loro ID, qualcosa di simile che hai inserito. Nome del file VID Conferma viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, è il prompt audio giocato a confermare il loro ID, qualcosa di simile PRESS 1 per confermare e 2 per rientrare. Cifre VID viene utilizzato se il metodo è impostato su uno dei metodi VIDPROMPT, se è impostato su un numero è il numero di cifre che devono essere inseriti dal Cliente quando richiesto per il loro ID, se impostato a vuoto o poi la X cliente dovrà premere sterlina o hash per terminare il loro ingresso del loro ID| +Admin Web Directory|Web Directory Admin| +This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|Questa è la directory che la vostra Amministrazione di contenuti web, come admin.php, trovi di default è vicidial. Per capire la directory Admin web, è tutto ciò che è tra il nome del dominio e la admin.php l'URL su questa pagina, senza le barre iniziali e finali| +TTS Voice|TTS Voice| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|Questo è dove si definisce la voce da utilizzare nella generazione TTS. Il valore predefinito è Allison-8kHz| +Default Field Labels|Di campo predefiniti di etichette| +These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface|Questi 19 campi permettono di impostare il nome che verrà visualizzato nell'interfaccia agente ViciDial così come la pagina principale modifica amministrativa. Il valore predefinito è vuoto, che utilizzerà i valori predefiniti hardcoded nell'interfaccia agente| +Label Title|Titolo Label| +Label First Name|Etichetta Nome| +Label Middle Initial|Label Middle Initial| +Label Last Name|Etichetta Cognome| +Label Address1|Etichetta Indirizzo1| +Label Address2|Etichetta Indirizzo2| +Label Address3|Etichetta Indirizzo3| +Label City|Label Città| +Label State|Etichetta Stato| +Label Province|Etichetta Provincia| +Label Postal Code|Codice Etichetta postale| +Label Vendor Lead Code|Etichetta Vendor Code Piombo| +Label Gender|Etichetta di genere| +Label Phone Number|Label Numero di telefono| +Label Phone Code|Etichetta Telefono Codice| +Label Alt Phone|Etichetta Alt Phone| +Label Security Phrase|Label Security frase| +Label Email|Etichetta e-mail| +Label Comments|Label Comments| +We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|Si consiglia di non impostare le chiamate in entrata a una priorità maggiore rispetto alle campagne outbound chiamate perché le persone si aspettano di chiamata in attesa e le persone si aspettano di essere chiamati per qualcuno di essere lì al telefono| +Formerly called Conf File Secret|Precedentemente chiamato Secret File Conf| +Registration Password|Registrazione password| +Login Password|Login Password| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|La password utilizzata per l'utente del telefono per accedere alle applicazioni web-based client. IMPORTANTE, questa è la password solo per il login Phone Agent interfaccia web, per cambiare il sip.conf o la password iax.conf, o il segreto, per questo dispositivo cellulare è necessario modificare la password di registrazione nel campo successivo| +SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does|SCRIPT mostrerà anche solo, ma voi siete in grado di utilizzare le variabili dello script, proprio come nella funzione Scripts. Campi SCRIPT anche solo visualizzare il contenuto nelle opzioni, e non il nome del campo come il tipo DISPLAY fa| +You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are|È inoltre possibile includere i campi predefiniti ViciDial in un campo personalizzato di configurazione, e li vedrete in rosso nella lista. Questi campi non verranno aggiunti alla tabella di database personalizzato lista, l'interfaccia agente invece riferimento alla tabella vicidial_list direttamente. Le etichette che è possibile utilizzare per includere le fieds di default sono| +If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent|Se i campi elenco personalizzati sono attivati ​​sul vostro sistema, FORM si aprirà la scheda FORM al momento della connessione di una chiamata a un agente| +Enable Custom List Fields|Abilita campi elenco personalizzati| +This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled|Questa impostazione consente l'usanza caratteristica dei campi che consente di personalizzare i campi dati da definire l'interfaccia di amministrazione web per ogni base-list e quindi avere a disposizione quei campi in una scheda FORM all'agente nell'interfaccia web agent. Il default è 0 per disabili| +CUSTOM FIELDS FOR THIS LEAD|Campi personalizzati per QUESTO FILO| +Slave Database Server|Slave Database Server| +If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled|Se avete un server slave database MySQL, quindi immettere l'indirizzo IP locale per il server qui. Questa opzione è attualmente utilizzato solo dai rapporti selezionati l'opzione successiva e non ha nulla a che fare con la configurazione automatica di MySQL master-slave di replica. Il valore predefinito è vuota per disabili| +Reports to use Slave DB|Rapporti da utilizzare DB Slave| +This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled|Questa opzione consente di selezionare i report che si desidera utilizzare il database è schiavo MySQL come definito la suddetta opzione al posto del database master che il vostro sistema live ViciDial è in esecuzione. È necessario impostare la replica slave MySQL prima di poter attivare questa opzione. Il valore predefinito è vuota per disabili| +Custom fields defined for this list|I campi personalizzati definiti per questa lista| +Go to the list modification page for this list|Vai alla pagina di modifica della lista per questa lista| +Estimated Hold Time Option|Tempo di attesa stimato Option| +Hold Time Second Option|Tenere Opzione Second Time| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered|Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo si verifica per il cliente premendo il tasto 2. Il valore predefinito è NONE. Se non prima opzione Hold Time è selezionata questa opzione non sarà disponibile| +Hold Time Third Option|Tenere Opzione terza volta| +Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered|Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo si verifica per il cliente preme il tasto 3. Il valore predefinito è NONE. Se non seconda opzione Hold Time è selezionata questa opzione non sarà disponibile| +Wait Time Option|Attendere Opzione Tempo| +This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line|Ciò consente di offrire ai clienti opzioni per lasciare la coda se il loro tempo di attesa è finita la quantità di secondi specificato qui di seguito. Il valore predefinito è NONE. Se una delle opzioni PRESS_ è selezionata, si svolgerà il Filename Press definito di seguito e dare al cliente la possibilità di premere 1 sul telefono a lasciare la coda ed eseguire l'opzione selezionata. L'opzione PRESS_STAY invierà al cliente alla coda senza perdere il loro posto in linea| +Wait Time Second Option|Attendere Opzione Second Time| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered|Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo controllerà per il cliente premendo il tasto 2. Il valore predefinito è NONE. Se nessun tempo di attesa prima opzione è selezionata questa opzione non sarà disponibile| +Wait Time Third Option|Attendere Opzione terza volta| +Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered|Stesso come il primo campo Opzione Tempo di attesa al di sopra, tranne questo controllerà per il cliente preme il tasto 3. Il valore predefinito è NONE. Se non seconda opzione tempo di attesa è selezionata questa opzione non sarà disponibile| +Wait Time Option Seconds|Attendere seconds Tempo| +If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds|Se il tempo di attesa opzione è impostata a nulla, ma NONE, questo è il numero di secondi che il cliente ha atteso in coda che attiveranno le opzioni di tempo di attesa. Il valore predefinito è 120 secondi| +Wait Time Option Extension|Attendere Opzione proroga| +If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option|Se il tempo di attesa opzione è impostato PRESS_EXTEN, questa è l'estensione dialplan che la chiamata sarà inviata se il cliente preme il tasto opzione presentati con l'opzione| +Wait Time Option Callmenu|Attendere Opzione Callmenu Tempo| +If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option|Se il tempo di attesa opzione è impostata su PRESS_CALLMENU, questo è il Menu di chiamata che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione| +Wait Time Option Voicemail|Attendere Opzione Voicemail Tempo| +If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use|Se il tempo di attesa opzione è impostata su PRESS_VMAIL, questa è la casella vocale che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione. In un AGENTDIRECT in gruppo, l'impostazione a AGENTVMAIL selezionerà il voicemail ID utente da utilizzare| +Wait Time Option Transfer In-Group|Attendere Option Transfer Time In-Group| +If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option|Se il tempo di attesa opzione è impostata su PRESS_INGROUP, questo è il gruppo in entrata che la chiamata verrà inviato se il cliente preme il tasto Opzione quando presentati con l'opzione| +Wait Time Option Press Filename|Attendere opzione filename Tempo Press| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back|Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto se il tempo di attesa dei clienti supera i Secondi opzione di Wait dare al cliente la possibilità di premere 1, 2 o 3 sul loro telefono cellulare per l'esecuzione i selezionati tempo di attesa premere Opzioni. E 'molto importante includere le opzioni nel file audio per tutte le opzioni selezionate tempo di attesa, e che la lunghezza del file audio in secondi è propriamente definito nel campo Nome file Seconds sotto o ci saranno problemi. L'impostazione predefinita è di-essere-chiamato-back| +Wait Time Option Press No Block|Attendere Option Press Tempo No Block| +Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N|Impostando questa opzione su Y consentire le chiamate in fila dietro una chiamata in cui il tempo di attesa Option Press Nome richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio. Mentre il tempo di attesa Option messaggio Press Filename sta giocando a un cliente che non possono essere inviati a un agente. Il valore predefinito è N| +Wait Time Option Press Filename Seconds|Attendere opzione di secondi Nome del file Stampa| +This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10|Questo campo deve essere impostato il numero di secondi che il tempo di attesa Nome Opzione Press gioca. Il valore predefinito è 10| +Wait Time Option After Press Filename|Attendere opzione Time After Nome Press| +If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3|Se il tempo di attesa opzione è impostata su una delle opzioni PRESS_, questo è il prompt nome del file che viene riprodotto dopo che il cliente ha premuto 1, 2 o 3| +Wait Time Option Callback List ID|Attendere Opzione Tempo ID Callback List| +If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option|Se il tempo di attesa opzione è impostata su PRESS_CID_CALLBACK, questo è l'ID List la chiamata viene aggiunto come un nuovo capo se il cliente preme il tasto Opzione quando presentati con l'opzione| +Wait Hold Option Priority|Attendere Tenere Priority Option| +If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only|Se entrambe le opzioni Stima tempo di mantenimento e attendere opzioni di tempo sono attive, questa impostazione definisce se uno, l'altra o entrambe queste funzioni sono attive. Ad esempio, se il tempo di attesa stimato opzione è impostata su 360, l'opzione di tempo di attesa è impostato a 120 e il cliente è in attesa di 120 secondi e ci sono ancora 400 secondi il tempo di attesa stimato, allora sono entrambe attive nello stesso momento e questa impostazione verrà controllato per vedere quali opzioni verranno offerti. Il valore predefinito è aspettare solo| +The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button|Le opzioni BLOCCATE vengono utilizzate per bloccare il valore per il pulsante di trasferimento rapido anche se l'agente utilizza le funzionalità di trasferimento conferenza durante una chiamata prima di utilizzare il pulsante Quick Transfer| +HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field|CHIUDI si bloccherà la chiamata quando il timer è attivato, CALLMENU invierà la chiamata al Menu chiamata specificato nel campo Destinazione Timer Action, ESTENSIONE invierà la chiamata per l'estensione che è specificato nel campo Destinazione Timer Action, IN_GROUP invierà la chiamata alla In-gruppo specificato nel campo Destinazione Timer Action| +Timer Action Destination|Timer Azione Destination| +This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty|Questo campo è dove si specifica il Menu di chiamata, l'estensione o In-gruppo che si desidera la chiamata inviata se l'azione ora è impostato su CALLMENU, l'estensione o IN_GROUP. Il valore predefinito è vuoto| +You must enter field options when adding a|Devi inserire opzioni di campo quando si aggiunge un| +You must enter field options when updating a|Devi inserire opzioni di campo quando si aggiorna un| +Allowed Reports|Rapporti ammessi| +If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports|Se un utente in questo gruppo è impostata su livello di utente 7 o superiore, questa funzione può essere utilizzata per limitare i rapporti che gli utenti possono visualizzare. Il valore predefinito è ALL. Se si desidera selezionare più di una relazione, quindi premere il tasto Ctrl della tastiera mentre si selezionano i rapporti| +You are not allowed to view this report|Non sei autorizzato a visualizzare questa relazione| +CAMPLISTS_ALL - will include inactive lists in the search for the number|CAMPLISTS_ALL - si includono gli elenchi inattivi nella ricerca per il numero| +Add-Delete DNC Number|Add-Cancellare il numero DNC| +Add DNC Number|Aggiungi numero DNC| +Copy Custom Fields|Copia campi personalizzati| +Add Filter Phone Group|Aggiungi gruppo Filter Phone| +New Filter Phone Group|Nuovo gruppo Phone Filter| +Modify Filter Phone Group|Modifica gruppo Filter Phone| +Delete Phone Filter Group|Elimina Phone filtro gruppo| +Filter Phone Groups|Gruppi di Telefono filtro| +Filter Phone Group ID|Filter Phone ID Group| +Filter Phone Group Name|Filter Nome Telefono Group| +Filter Phone Group Description|Filter Phone Descrizione Gruppo| +PHONE FILTER GROUP NOT ADDED|GRUPPO FILTRO TELEFONO NON AGGIUNTO| +there is already a PHONE FILTER GROUP in the system with this ID|c'è già un gruppo PHONE FILTER nel sistema con questo ID| +Phone Filter Group ID must be between 2 and 20 characters in length and contain no|Telefono ID Group filtro deve essere compresa tra 2 e 20 caratteri e non contengono| +PHONE FILTER GROUP ADDED|TELEFONO GRUPPO FILTRO AGGIUNTO| +Add Filter Phone Group|Aggiungi gruppo Filter Phone| +Add-Delete FPG Number|Add-FPG Numero Elimina| +Add FPG Number|Aggiungi numero FPG| +FILTER PHONE GROUP NOT MODIFIED|GRUPPO FILTRO TELEFONO NON MODIFICATA| +FILTER PHONE GROUP MODIFIED|GRUPPO DI TELEFONO FILTRO MODIFICATO| +FILTER PHONE GROUP NOT DELETED|TELEFONO GRUPPO FILTRO non cancellato| +Click here to delete FILTER PHONE GROUP|Clicca qui per cancellare GRUPPO FILTRO TELEFONO| +FILTER PHONE GROUP DELETION CONFIRMATION|FILTRO TELEFONO GROUP CONFERMA CANCELLAZIONE| +FILTER PHONE GROUP DELETION COMPLETED|CANCELLAZIONE DEL GRUPPO FILTRO TELEFONO COMPLETATO| +Click here to see Admin chages to this filter phone group|Clicca qui per vedere chages Admin a questo gruppo cellulare filtro| +DELETE THIS FILTER PHONE GROUP|Eliminare il gruppo FILTRO TELEFONO| +FILTER PHONE GROUP LISTINGS|FILTRO TELEFONO ANNUNCI DI GRUPPO| +Filter Phone Group Numbers|Numeri di telefono del Gruppo filtro| +This phone number is not in the Filter Phone Group List|Questo numero di telefono non è nell'elenco dei filtri Gruppo Phone| +This phone number is already in the Filter Phone Group List|Questo numero di telefono è già nell'elenco dei filtri Gruppo Phone| +FILTER PHONE GROUP NUMBER NOT DELETED|FILTRO GROUP numero di telefono non Videoclip| +FILTER PHONE GROUP NUMBER DELETED|FILTRO DEL GRUPPO NUMERO DI TELEFONO Videoclip| +FILTER PHONE GROUP NUMBER NOT ADDED|FILTRO NUMERO DI TELEFONO NON AGGIUNTA DI GRUPPO| +FILTER PHONE GROUP NUMBER ADDED|FILTRO NUMERO DI TELEFONO GROUP AGGIUNTO| +Numbers in this Filter Phone Group|I numeri in questo Gruppo Phone Filter| +There are no phone numbers in list|Non ci sono numeri di telefono in elenco| +There are no leads in Campaign DNC list|Non ci sono cavi in ​​lista Campagna DNC| +There are no leads in this filter phone group|Non ci sono contatti in questo gruppo cellulare filtro| +Click here to download the numbers in this filter phone group|Clicca qui per scaricare i numeri in questo gruppo cellulare filtro| +Filter Inbound Number|Filter Number Inbound| +This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back|Questa opzione, se attivata permette di filtrare le chiamate che entrano in questo DID e inviarli ad una azione alternativa se corrispondono a un numero di telefono che è nel gruppo telefonico filtro o una risposta URL se si è configurato uno. Predefinito è DISABLED. GRUPPO cercherà in un gruppo di Phone Filter. URL invierà un URL e corrisponde se un 1 viene inviato| +If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call|Se il campo Filter Number ingresso è impostato su GROUP allora questo è l'ID del gruppo Phone Filter che avrà i suoi numeri di ricerca per trovare una corrispondenza per il numero del chiamante ID della chiamata in entrata| +Filter URL|URL Filter| +If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on|Se il campo Filter Number ingresso è impostato su URL, allora questo è l'indirizzo web di un script che cercherà un sistema remoto e restituire un 1 per un incontro e uno 0 per nessuna partita. Solo due variabili sono disponibili l'indirizzo se si utilizza il prefisso VAR come con indirizzi webform nelle campagne, - A - phone_number - B - e - A - did_pattern - B - può essere utilizzato nella URL per indicare l'ID chiamante del chiamante e il DID che il cliente chiamato in su| +Filter Action|Action Filter| +If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing|Se il filtro numero in ingresso viene attivato e viene rilevata una corrispondenza, allora questo è l'azione che deve essere presa. Questo è lo stesso del percorso che si seleziona per un fatto, e le seguenti impostazioni funzionano proprio come fanno di uno standard di routing| +This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore|Questo è l'ID del gruppo Phone Filter, che è il contenitore per un gruppo di numeri di telefono che si può avere automaticamente cercato attraverso quando arriva una chiamata in un file. DID e inviare a un percorso alternativo se esiste una corrispondenza Il campo deve essere tra i 2 ei 20 caratteri e non hanno punteggiatura ad eccezione di sottolineatura| +Filter Phone Group Description|Filter Phone Descrizione Gruppo| +This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field|Questa è la descrizione del gruppo Phone Filter, è puramente notazione e non è un campo obbligatorio| +Clean CID Number|Pulire Numero CID| +This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L|Questo campo consente di specificare un numero di cifre per limitare il numero ID del chiamante in ingresso al ponendo R davanti al numero di cifre, ad esempio per limitare verso destra di 10 cifre è necessario immettere in R10. È inoltre possibile utilizzare questa funzione per rimuovere solo una cifra iniziale oi numeri ponendo L di fronte alle cifre specifiche che si desidera rimuovere, ad esempio per rimuovere un 1 come prima cifra è necessario immettere in L1. Il valore predefinito è vuoto. Se più di una regola viene specificato assicurarsi di separarle con uno spazio e la R verrà eseguito prima della L| +must be an existing vicidial user|deve essere un utente esistente vicidial| +you must use a valid user as the user_start for remote agents|è necessario utilizzare un utente valido come user_start per gli agenti remoti| +your number of lines overlaps with another remote agent|il tuo numero di sovrapposizioni di linee con un altro agente remoto| +Webphone URL Override|URL Override webphone| +This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty|Questa impostazione consente di impostare un URL alternativo webphone solo per i membri di un gruppo di utenti. Il valore predefinito è vuoto| +Calculate Estimated Hold Seconds|Calcolare Secondi Attesa stimato| +This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0|Definisce il numero di secondi nella coda, che il cliente dovrà attendere prima il tempo di attesa stimato sarà calcolato ed eventualmente riprodotti. Minima è di 3 secondi, anche se impostato inferiore a 3. Il default è 0| +Campaign Preset Added|Preset Campagna Aggiunto| +Campaign Presets|Campagna Presets| +Modify Campaign Preset|Modifica Preset Campagna| +Campaign Preset Removed|Preset Campagna Rimosso| +If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent|Se l'impostazione della campagna per i preset è impostato su ENABLED allora avete la possibilità di definire Transfer-conferenza preset che saranno disponibili per l'agente permettendo loro di 3-way chiamare questi preset o trasferire chiamate cieche a questi numeri preimpostati. Questi preset hanno anche un opzione per nascondere il numero associato ad ogni preset dall'agente| +PRESET NOT ADDED|PRESET NON AGGIUNTO| +there is already an entry for this campaign with this preset|esiste già una voce per questa campagna con questo preset| +PRESET NOT MODIFIED|PRESET NON MODIFICATA| +>Presets<|<> Presets| +Hide Transfer Number to Dial|Nascondi numero di trasferimento da chiamare| +Enable Transfer Presets|Abilita Presets di trasferimento| +This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED|Questa opzione permetterà ai Presets menu secondario ad apparire nella parte superiore della pagina Modifica campagna, e inoltre si avrà la possibilità di specificare i numeri preimpostati di composizione per agenti da utilizzare nel Transfer-Conference struttura dell'interfaccia dell'agente. Predefinito è DISABLED| +This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED|Questa opzione consente di nascondere il numero da comporre campo nella Transfer-Conference struttura dell'interfaccia dell'agente. Predefinito è DISABLED| +PRESETS FOR THIS CAMPAIGN|PRESETS di questa campagna| +ADD NEW PRESET|ADD NEW PRESET| +Hide Number|Nascondi numero| +Preset Name|Nome Preset| +Preset Number|Numero Preset| +Preset DTMF|Preset DTMF| +CAMPAIGN PRESET LISTINGS|ANNUNCI DI CAMPAGNA PRESET| +CAMPAIGN PRESET NOT DELETED|PRESET CAMPAGNA non vengono eliminati| +Show Presets Stats|Mostra statistiche Presets| +AGENT DIAL PRESETS NAMES|AGENTE PRESETS DIAL NOMI| +Manual Dial Prefix|Selezione prefisso manuale| +This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option|Questo campo opzionale consente di impostare il prefisso di selezione da utilizzare solo quando effettuano le chiamate dial manuali dall'interfaccia agente, come ad esempio utilizzando la funzione MANUAL DIAL, o Dial Number successiva quando il metodo di selezione MANUAL, o la composizione manuale alt numero, oppure programmato dall'utente solo richiamate. Il valore predefinito è vuoto per disabili, che utilizzano il prefisso di selezione definita nel campo precedente. Questa opzione non interferisce con l'opzione Dial Prefix 3way| +Here is a list of reserved phrases that cannot be used as menu IDs|Ecco un elenco di frasi riservate che non possono essere utilizzati come menù ID| +Call Menu ID cannot use reserved words|Call ID Menu non è possibile utilizzare parole riservate| +Webphone System Key Override|Webphone Key System Override| +This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty|Questa impostazione consente di impostare un supplente Key System webphone solo per i membri di un gruppo di utenti. Il valore predefinito è vuoto| +Webphone Dialpad Override|Webphone Dialpad Override| +This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link|Questa impostazione consente di attivare o disattivare la tastiera sul webphone solo per i membri di un gruppo di utenti. Predefinito è DISABLED. TOGGLE permetterà all'utente di visualizzare e nascondere la tastiera cliccando su un link| +Webphone Dialpad|Webphone Dialpad| +This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions|Questa impostazione consente di attivare o disattivare la tastiera di questo webphone. Y è predefinita per abilitato. TOGGLE permetterà all'utente di visualizzare e nascondere la tastiera facendo clic su un link. Questa funzione non è disponibile su tutte le versioni webphone| +Webphone System Key|Webphone Key System| +If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty|Se il vostro sistema o il provider lo richiede, è qui la chiave di sistema per la webphone deve essere inserito dentro di default è vuota| + Strength| Forza| +A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Una password di registrazione forte deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero| +A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|Un forte secret file di configurazione deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero| +A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number|La password utente forte deve essere di almeno 8 caratteri di lunghezza e di minuscole e maiuscole, nonché almeno un numero| +Force Change Password|Forza Cambia password| +If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N|Se questa opzione è impostata su Y, allora l'utente verrà richiesto di cambiare la propria password la prossima volta che accedi alla pagina web di amministrazione. Il valore predefinito è N| +First Login Trigger|Accedi primo trigger| +This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system|Questa impostazione consente la configurazione iniziale dello schermo del server da mostrare all'amministratore al primo accesso al sistema| +Default Phone Registration Password|Predefinito Phone Password Registrazione| +This is the default registration password used when new phones are added to the system. Default is test|Questa è la password di registrazione predefinita utilizzata quando nuovi telefoni vengono aggiunte al sistema. Il valore predefinito è di prova| +Default Phone Login Password|Predefinito Phone Password Login| +This is the default phone web login password used when new phones are added to the system. Default is test|Questo è il telefono predefinito password di accesso utilizzata per la web nuovi telefoni vengono aggiunti al sistema. Il valore predefinito è di prova| +Default Server Password|Default Server password| +This is the default server password used when new servers are added to the system. Default is test|Questa è la password del server predefinito utilizzato quando i server vengono aggiunti nuovi al sistema. Il valore predefinito è di prova| +CHANGE PASSWORD|CAMBIO PASSWORD| +INITIAL INSTALL WELCOME|L'installazione iniziale BENVENUTI| +COPYRIGHT TRADEMARK LICENSE|COPYRIGHT MARCHIO DI LICENZA| +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|Si sono tenuti a modificare la password prima di poter continuare a Administration. Una password complessa ha sia lettere minuscole e maiuscole, nonché almeno un numero. La password deve contenere da 2 a 20 caratteri e non può contenere qualsiasi carattere che non siano lettere o numeri| +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|Assicurarsi che la password è qualcosa che si possa ricordare, perché non appena si apporta questa modifica vi verrà richiesto di inserire la nuova password per riaccedere ad Amministrazione| +Password has not been changed, please try again|La password non è stato modificato, riprova| +New Password|Nuova password| +Password has been updated, you may now continue|La password è stata aggiornata, ora è possibile continuare| +Passwords have been updated, you may now continue on into Administration|Le password sono state aggiornate, si può ora continuare in Amministrazione| +You may want to start by reading the ViciDial Manager Manual available at|Si consiglia di iniziare leggendo il manuale ViciDial Manager disponibile a| +there is a free version available|c'è una versione gratuita disponibile| +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|Assicurarsi che la password è qualcosa che si possa ricordare, perché non appena completata questa schermata iniziale di installazione vi verrà richiesto di inserire la nuova password per accedere di nuovo tornare ad Amministrazione| +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|I prossimi tre password di default sono definiti nella sezione Impostazioni di sistema, ed è possibile cambiare dopo che li definiscono qui. E 'una buona idea fare queste password forte in modo che nessuno possa incidere sul tuo account di telefono e telefonate luogo senza di voi saperlo. La password di registrazione predefinito utilizzato quando nuovi telefoni vengono aggiunti al sistema come il SIP o IAX password del telefono VOIP. Il telefono password predefinita Web di accesso utilizzata quando nuovi telefoni vengono aggiunti al sistema, come la password del telefono che un agente avrebbe usato nell'interfaccia agente ViciDial. La password di default del server utilizzato quando nuovi server vengono aggiunti al sistema per i server di comunicare con l'altro| +Passwords have been updated, you may now continue on into Administration|Le password sono state aggiornate, si può ora continuare in Amministrazione| +You may want to start by reading the ViciDial Manager Manual available at|Si consiglia di iniziare leggendo il manuale ViciDial Manager disponibile a| +there is a free version available|c'è una versione gratuita disponibile| +Welcome to ViciDial|Benvenuti a ViciDial| +initial setup screen|schermata di impostazione iniziale| +copyright, trademark and license page|copyright, marchi e licenze pagina| +The ViciDial Call Center Suite is maintained by the|Il ViciDial Call Center Suite è gestito dal| +is a registered trademark of the|è un marchio registrato della| +Here is our|Ecco la nostra| +trademark use policy|marchio di fabbrica 'utilizzo politica| +The ViciDial Call Center Suite is released under the|Il ViciDial Call Center Suite è rilasciato sotto la| +open source license|licenza open source| +The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install|Il Centro ViciDial software chiamata Suite è disponibile per il download, e per l'uso, gratuitamente. È possibile scaricare il facile da installare| +ViciBox CD ISO version|ViciBox CD ISO versione| +or only the|o solo| +source code|codice sorgente| +Continue on to the Initial Setup|Proseguimento per la configurazione iniziale| +Customer 3-Way Hangup Logging|Clienti 3-Way Hangup Logging| +If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED|Se questa opzione è abilitata, la user_call_log registrerà quando un cliente fino hangup se riagganciare nel corso di un 3-way chiamata. Inoltre, questo può consentire al Cliente 3-way azione hangup se è defineed seguito. Predefinito è ABILITATO| +Customer 3-Way Hangup Seconds|Cliente 3-Way Hangup Secondi| +If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds|Se il Cliente 3-way la registrazione è attivata, questa opzione consente di definire il numero di secondi dopo l'hangup cliente viene rilevato prima che sia effettivamente registrato e opzionale cliente 3-way hangup azione viene eseguita. Il valore predefinito è 5 secondi| +Customer 3-Way Hangup Action|Clienti 3-Way Hangup Action| +If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE|Se il Cliente 3-way la registrazione è attivata, questa opzione permette di avere lo schermo automaticamente agente di riagganciare la chiamata e passare alla schermata DISPO se questa opzione è impostata su DISPO. Il valore predefinito è NONE| +Inbound Report by DID|Relazione ingresso da DID| +Lists Campaign Status Stats|Elenchi delle campagne di stato Statistiche| +Add Lead URL|Aggiungi URL piombo| +This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function|Questo indirizzo URL web non si vede l'agente, ma è chiamato ogni volta che viene aggiunto un vantaggio al sistema attraverso il processo di entrata. Predefinita è vuota. Si deve iniziare con questo URL VAR, se si desidera utilizzare le variabili, e naturalmente - A - e - B - attorno al variabile effettiva nell'URL in cui si desidera utilizzarlo. Ecco l'elenco delle variabili che sono disponibili per questa funzione| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Questa utility consente di caricare file audio sul server web in modo che possano essere distribuiti a tutti i server ViciDial in un multi-server cluster. Una nota importante, solo due tipi di file audio funzionerà. File wav che sono 8k Mono PCM 16bit e file. Gsm che sono 8k 8bit. Si prega di verificare che i file siano correttamente formattati prima di caricarli qui| +We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files|Si consiglia VIVAMENTE caricare solo 16bit Mono 8k file audio WAV PCM| +Park Music-on-Hold|Parco della Musica-on-Hold| +This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default|Qui è dove è possibile definire on-hold contesto musicale per questa campagna. Assicurarsi di selezionare una musica valida sul contesto attesa dalla lista di selezione e che il contesto che hai selezionato ha file validi in esso. Il valore predefinito è di default| +Park Call IVR|Parcheggia chiamata IVR| +This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED|Questa opzione permetterà un agente di parcheggiare una chiamata con un apposito tasto CALL IVR PARK sulla loro interfaccia agente se questo è abilitato o ENABLED_PARK_ONLY. L'opzione ENABLED_PARK_ONLY permetterà all'agente di inviare la chiamata a parco, ma non fare clic per recuperare la chiamata come l'opzione abilitata. L'opzione ENABLED_BUTTON_HIDDEN consente alla funzione tramite l'API solo. Predefinito è DISABLED| +Park Call IVR AGI|Parcheggia chiamata IVR AGI| +If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible|Se il campo Chiamata Parco IVR non è disattivato, allora questo campo viene utilizzato come stringa di applicazione AGI che il cliente viene inviato. Si tratta di una impostazione che deve essere impostata dall'amministratore, se possibile,| +Manual Preview Dial|Anteprima composizione manuale| +This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP|In questo modo l'agente in modalità di selezione manuale per visualizzare le informazioni di piombo quando si fa clic su Componi Numero successiva prima che attivamente comporre la telefonata. C'è un collegamento opzionale per SALTA il cavo e passare a quella successiva se selezionata. Il valore predefinito è PREVIEW_AND_SKIP| +Estimated Hold Time Minimum Filename|Tenere minimo stimato Filename Tempo| +If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive|Se il tempo di attesa stimato è attivo e si calcola sia pari o inferiore al minimo di 15 secondi, allora questo file sarà tempestivamente svolto invece l'annuncio di default. Il valore predefinito è vuoto per inattiva| +Estimated Hold Time Minimum Prompt No Block|Tempo di attesa stimato minimo Prompt No Block| +If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N|Se il tempo di attesa stimato è attiva e la stima del tempo minimo di attesa campo Nome del file è al di sopra compilata, quindi questa opzione per consentire le chiamate in fila dietro a una chiamata in cui la richiesta sta giocando per andare ad un agente, se uno diventa disponibile durante la riproduzione del messaggio . Mentre la richiesta sta giocando a un cliente che non possono essere inviati ad un agente. Il valore predefinito è N| +Estimated Hold Time Minimum Prompt Seconds|Tempo di attesa stimato secondi minimo Prompt| +This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10|Questo campo deve essere impostato il numero di secondi che il tempo stimato di attesa minima richiesta Nome gioca. Il valore predefinito è 10| +This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are|Questo campo vi permette di personalizzare il nome della registrazione quando la campagna è OnDemand o ALLCALLS. Le variabili sono consentiti| +The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this|Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che sarebbe simile a questa| +Real-Time Agent Time Stats|Real-Time Agente Statistiche temporali| +Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED|L'impostazione di questo a nulla, ma DISABLED consentirà la raccolta di statistiche temporali agente per oggi per questa campagna, che sono visualizzabili attraverso il rapporto in tempo reale. Le chiamate sono in media le chiamate gestite per agente, WAIT è il tempo medio di attesa agente, CUST è il tempo medio di conversazione del cliente, ACW è la media Dopo il tempo di lavoro a chiamata, PAUSE è il tempo di pausa media. Predefinito è DISABLED| +Add A Dial Status to Call|Aggiungere un titolo Comp. per chiamare| +Admin Modify Auto-Refresh|Admin Modificare Auto-Refresh| +This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0|Questo è l'intervallo di aggiornamento in secondi degli schermi modificano in questa interfaccia di amministrazione. L'impostazione di questo a 0 lo disabilita, impostandolo di sotto del 5 saranno principalmente rendere gli schermi modificano inutilizzabili perché si aggiorna troppo in fretta di modificare i campi. Questa opzione è utile in situazioni in cui più di un manager è il controllo delle impostazioni su una campagna attiva o in gruppo in modo che le impostazioni vengono aggiornate frequentemente. Il default è 0| +Admin No-Cache|Admin No-Cache| +Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled|L'impostazione di questo ad 1 impostare tutte le pagine di amministrazione al browser web no-cache, in modo che ogni schermo deve essere ricaricata ogni volta che viene visualizzato, anche se cliccando di nuovo sul browser. Il default è 0 per disabili| +Generate Cross-Server Phone Extensions|Genera Cross-Server Extensions Phone| +This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive|Questa opzione, se impostato a 1 genererà voci dialplan per ogni telefono su un sistema multi-server. Il default è 0 per inattiva| +QueueMetrics Addmember Enabled|QueueMetrics Addmember Enabled| +This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled|Questa opzione, se impostato a 1 genererà ADDMEMBER2 e le voci REMOVEMEMBER in queue_log. Il default è 0 per disabili| +Minimum Hopper Level|Hopper Livello Minimo| +This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Questo è il numero minimo di guida dello script VDhopper cerca di mantenere nella tabella vicidial_hopper per questa campagna. Se si esegue lo script VDhopper ogni minuto, fanno di questo un po 'maggiore del numero di porta si attraversa in un minuto| +Automatic Hopper Level|Hopper Automatic Level| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|Impostare questo a Y permetterà Vicidial per regolare automaticamente la tramoggia in base al largo le impostazioni che hai nella tua campagna. La formula si usa per fare questo è| +Automatic Hopper Multiplier|Hopper Moltiplicatore automatico| +This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|Questo è il moltiplicatore per Hopper Auto. L'impostazione di questo a meno di 1 farà sì che l'algoritmo di Hopper Auto per caricare meno contatti rispetto al normale. L'impostazione di questa maggiore di 1 farà sì che l'algoritmo di Hopper Auto per caricare più contatti di quanto non farebbe normalmente. Default è 1| +Auto Trim Hopper|Auto Trim Hopper| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|Impostare questo a Y permetterà Vicidial per rimuovere automaticamente cavi in ​​eccesso dalla tramoggia. Il valore predefinito è Y| +Manual Dial API|Selezione manuale API| +This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|Questa opzione consente di impostare l'API agente per fare uno dei due chiamate contemporaneamente, STANDARD, o la capacità di mettere in coda le chiamate di selezione manuale e li hanno comporre automaticamente una volta che l'agente va in pausa o è disponibile a prendere il loro chiamata successiva con il opzione per disattivare la composizione automatica di queste chiamate, una coda o QUEUE_AND_AUTOCALL che è lo stesso di coda, ma senza l'opzione per disattivare la composizione automatica di queste chiamate. Se un agente ha più di una chiamata in coda per loro vedranno il conteggio di quante chiamate dial manuali sono in coda proprio sotto il pulsante Pausa, o Dial Number pulsante Avanti. Suggeriamo che se coda viene utilizzato di inviare azioni API usando l'anteprima = YES opzione in modo non si è più volte chiamata chiamate per l'agente senza preavviso. Inoltre, se usate QUEUE e pesantemente utilizzando le chiamate con linea manuali in un metodo non composizione manuale, si consiglia l'impostazione della pausa agente dopo ogni opzione Call to Y. Il valore predefinito è STANDARD| +Manual Call Time Check|Tempo di chiamata Controllo manuale| +If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|Se questa opzione è attivata, controlla tutte le chiamate di selezione manuale per assicurarsi che essi si trovano le impostazioni dell'ora delle chiamate previste per la campagna. Predefinito è DISABLED| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|Se si desidera modificare il cavo a un callback previsto, innanzitutto modificare la disposizione a CBHOLD, quindi inviare e sarete in grado di impostare la data e l'ora callback| +Web Form Override - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list|Override Web Form - Questo è l'indirizzo personalizzato che cliccando sul pulsante WEB FORM in VICIDIAL vi porterà per le chiamate che arrivano su questo elenco| +Agent Screen Login|Agente schermata di login| +The login used for the phone user to login to the client applications, like the ViciDial agent screen|L'account di accesso utilizzato per l'utente del telefono per accedere alle applicazioni client, come lo schermo agente ViciDial| +Phone Extension|Phone Extension| +This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone|Questo campo è dove si inserisce il nome di telefoni come appare ad Asterisk non è compreso il protocollo o barra all'inizio. Ad esempio: per il telefono SIP SIP/test101 l'estensione Phone sarebbe test101. Inoltre, per i telefoni IAX2: IAX2/IAXphone1 @ IAXphone1 sarebbe IAXphone1. Per Zap e dahdi allegato channelbank FXS o telefoni assicuratevi di mettere l'intero numero dei canali senza il prefisso: Zap/25-1 sarebbe 25-1. Un'altra nota, assicuratevi di impostare il campo protocollo di seguito correttamente per il tipo di telefono| +STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN|STATUS all'interno delle liste ATTIVI PER QUESTA CAMPAGNA| +SHOW LEAD STATUSES IN THIS CAMPAIGN|MOSTRA STATUS PIOMBO IN QUESTA CAMPAGNA| +RELOAD NOW|RELOAD NOW| +refresh|rinfrescare| +You can also set a label to ---HIDE--- to hide both the label and the field|È inoltre possibile impostare un'etichetta --- --- HIDE per nascondere sia l'etichetta e il campo| +For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time|Per solo in ingresso, è possibile anche impostare la durata delle chiamate di arresto superiore a 2400 se si desidera che la durata delle chiamate di andare oltre la mezzanotte. Quindi, se volete che il vostro tempo di chiamata per eseguire dalle 6 del mattino fino alle 2 del mattino del giorno successivo, si metterebbe 0600 come l'ora di inizio e 2600 come il tempo di arresto| +TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link|TOGGLE_OFF per impostazione predefinita per non mostrare la tastiera il primo carico, ma permette all'utente di visualizzare la tastiera facendo clic sul link tastiera| +Add Multi-Server Phones Form|Aggiungi Multi-Form Server Cellulari| +Phones Bulk Insert|Cellulari Inserimento di massa| +List Order Randomize|Order List Randomize| +This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script|Questa opzione consente di casuale l'ordine dei cavi nella tramoggia di carico all'interno dei risultati definiti dai criteri di cui sopra. Per esempio, l'ordine di graduatoria saranno conservati, ma i risultati saranno randomizzati all'interno di tale ordinamento. Impostando questa opzione su Y abilitare questa funzione. Il default è n per disabili. NOTE, se si dispone di un gran numero di porta questa opzione può rallentare la velocità dello script tramoggia di carico| +NONE will not log any logins and logouts within queue_log|NONE non registrerà alcun login e logout all'interno queue_log| +QueueMetrics Dispo Pause Code|QueueMetrics Dispo Pause Codice| +This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled|Questa opzione, se popolato, permette di definire se un codice di pausa dispo viene inserito in queue_log quando un agente è in stato di dispo. Il valore predefinito è vuota per disabili| +List Order Secondary|Elenco Ordine Secondario| +This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script|Questa opzione consente di selezionare secondo ordine smistamento dei cavi in ​​carico tramoggia dopo l'ordine di graduatoria e nei risultati definiti dai criteri di cui sopra. Ad esempio, l'Ordine elenco verrà utilizzato per il primo tipo dei fili conduttori, ma i risultati saranno ordinati una seconda volta all'interno di tale ordinamento attraverso lo stesso insieme dell'Ordine primo elenco. Ad esempio, se avete Order List impostato conto alla rovescia e si dispone solo di cavi che sono state tentate 1 e 2 volte, quindi se avete il set dell'Ordine secondaria List per LEAD_ASCEND tutti i 1 conduce tentativo verranno ordinati dai più antichi conduttori prima e sarà messa nella tramoggia in quel modo. Predefinito è LEAD_ASCEND. NOTE, se si dispone di un gran numero di cavi utilizzando una delle opzioni CALLTIME può rallentare la velocità dello script tramoggia di carico| +My Callbacks Checkbox Default|Il mio richiamate Casella di default| +This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED|Questa opzione consente di pre-impostare la mia casella di controllo richiamata sullo schermo agente pianificato callback. CHECKED controllerà la casella di controllo automaticamente per ogni chiamata. Il valore predefinito è UNCHECKED| +Call Notes Per Call|Chiama Note per chiamata| +Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|Impostando questa opzione a ENABLED consentirà agli agenti di entrare in note per ogni chiamata che gestiscono l'interfaccia agente. La voce le note campo verrà visualizzato sotto il campo Commenti nell'interfaccia dell'agente. Inoltre, se il gruppo User Agent è autorizzato a visualizzare dei registri delle chiamate quindi l'agente sarà in grado di visualizzare le note di chiamata passate per un lead in qualsiasi momento. Predefinito è DISABLED| +If List Order Randomize is enabled, this option will be ignored|Se Order List Randomize è attivata, questa opzione verrà ignorata| +ERROR: Lead not added, please go back and look at what you entered|ERRORE: Il piombo non sono stati aggiunti, per favore torna indietro e guardare a ciò che hai inserito| +Lead has been added|Il piombo è stato aggiunto| +Add A New Lead|Aggiungi un nuovo elettrocatetere| +Agent Lead Search Override|Agente di piombo Override Search| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|Questa impostazione avrà la precedenza su ciò che la campagna ha fissato per la Ricerca Agente di piombo. NOT_ACTIVE utilizza l'impostazione della campagna. ENABLED permette la ricerca di piombo ei disabili non permette la ricerca di piombo. Il valore predefinito è NOT_ACTIVE| +Agent Lead Search|Agente di piombo Search| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|Impostando questa opzione su ENABLED consentirà agli agenti di cercare contatti e visualizzare le informazioni di piombo durante la pausa nell'interfaccia dell'agente. Inoltre, se il gruppo User Agent è autorizzato a visualizzare dei registri delle chiamate quindi l'agente sarà in grado di visualizzare le note di chiamata per ogni ultimi piombo che si sta visualizzando informazioni su. Predefinito è DISABLED| +Agent Lead Search Method|Agente di piombo Metodo di ricerca| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|Se il piombo Agente di ricerca è attivata, questa impostazione definisce dove l'agente sarà consentito per la ricerca di conduttori. Sistema cercherà l'intero sistema, CAMPAIGNLISTS cercherà all'interno di tutte le liste attive all'interno della campagna, CAMPLISTS_ALL cercherà all'interno di tutte le liste attivi e inattivi all'interno della campagna, LIST cercherà solo all'interno della ID Manuale delle liste Dial come definito nella campagna . Il valore predefinito è CAMPLISTS_ALL| +LEAD SEARCHES FOR THIS TIME PERIOD|PIOMBO RICERCHE PER QUESTO PERIODO DI TEMPO| +Routing Extension|Routing Extension| +This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension|Questo campo permette di un'estensione personalizzata di routing in uscita. Questo consente di utilizzare diversi metodi di gestione delle chiamate a seconda di come si desidera instradare le chiamate in uscita attraverso la vostra campagna. Precedentemente chiamato Campagna estensione VDAD| +same as|stesso| +Will send the call only to an agent on the same server as the call is placed on|Invierà la chiamata solo per un agente sullo stesso server come la chiamata viene messa in| +Used for press-1, broadcast and survey campaigns|Utilizzato per la stampa-1, radiofonici e televisivi e campagne di indagine| +Will try to first send the call to an agent on the local server, then it will look on other servers|Will tenta di inviare prima la chiamata a un agente sul server locale, quindi cercherà su altri server| +DEFAULT - Will send the call to the next available agent no matter what server they are on|DEFAULT - Può inviare la chiamata al prossimo agente disponibile non importa a quale server sono in| +Used for Answering Machine Detection after that, same behavior as|Utilizzati esclusivamente per rispondere Detection macchina dopo che, lo stesso comportamento| +Used for Answering Machine Detection after that same behavior as|Utilizzati esclusivamente per rispondere Detection macchina dopo che il comportamento stesso| +Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Utilizzato per la stampa-1, trasmissione e campagne di indagine con Cepstral Text-to-speech| +Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech|Utilizzati esclusivamente per rispondere Detection macchina, quindi premere-1, trasmissione e con campagne di indagine Cepstral Text-to-speech| +One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected|Una di queste opzioni con Utente_ di fronte solo cercare all'interno di cavi che hanno il campo corrispondente al proprietario ID utente dell'agente, le opzioni con GROUP_ di fronte solo cercare all'interno di cavi che hanno il campo proprietario che corrisponde al gruppo di utenti che l'utente è un membro, le opzioni con TERRITORY_ di fronte solo cercare all'interno di cavi che hanno il campo proprietario corrispondenti ai territori che l'agente ha selezionato| +QM Phone Environment|QM Phone Ambiente| +If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled|Se l'integrazione QueueMetrics è abilitato nelle impostazioni di sistema questa impostazione consente l'inserimento di questo valore dei dati nel campo data4 del queue_log per le registrazioni delle attività dell'agente. Il valore predefinito è vuota per disabili| +Active Twin Server IP|Attivo IP server Twin| +Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled|Alcuni sistemi vicidial necessario istituire server vicidial a coppie. Questa impostazione è dove si può mettere l'IP del server di un altro server vicidial che questo server è gemellata con. Il valore predefinito è vuota per disabili| +NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups|NOTE: Per ring_all, gli agenti che utilizzano i telefoni che hanno su Enabled Hook agente avranno il loro anello di telefoni e il primo a rispondere riceverà la chiamata e le informazioni sullo schermo dell'agente. Dal momento che ring_all ignora i tempi di attesa agente e ranking e chiamerà tutti gli agenti che è disponibile per la coda, si consiglia di non utilizzare questo metodo per le code di grandi dimensioni. Quando si utilizza ring_all, gli agenti registrati con i telefoni che hanno l'Agente On Hook disabili dovranno utilizzare le chiamate nel pannello Coda e cliccare sul link CALL PRESA a prendere le chiamate in coda. La quantità di tempo gli agenti del telefono squillerà per ring_all è impostato su On-Hook impostazione squilli o il tempo più breve anello dei telefoni che saranno chiamati. Si consiglia di non utilizzare ring_all su code ad alto volume di chiamata, o le code con molti agenti. Il metodo ring_all è destinato ad essere utilizzato con solo pochi agenti e il volume chiamata basso in gruppi| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15|Questa opzione viene utilizzata solo per gli agenti che vengono registrati con i telefoni che hanno l'agente-on-hook funzione attivata. Questo è il numero di secondi che ogni tentativo di chiamata all'agente suonerà per fino a quando il sistema attende un secondo e iniziano a suonare i telefoni degli agenti disponibili di nuovo. Questo campo può essere ignorato se i telefoni degli agenti sono impostate per un tempo di anello inferiore che può essere necessario per evitare che le chiamate vengano inviate uno segreteria telefoni. Il valore predefinito è 15| +On-Hook Agent|On-Hook agente| +On-Hook Ring Time|On-Hook squilli| +This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled|Questa opzione viene utilizzata solo per le chiamate in entrata che vanno a questo agente remoto. Questa funzione consente di chiamare l'agente remoto e non inviare al cliente all'agente remoto fino a quando la linea viene risposto. Il default è n per disabili| +This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15|Questa opzione viene utilizzata solo quando l'On-Hook campo agente sopra è impostato a Y e quindi solo per le chiamate in entrata che arrivano a questo agente remoto. Questo è il numero di secondi che ogni tentativo di chiamata squillerà per cercare di ottenere una risposta. Si consiglia di impostare questo a pochi secondi in meno di quanto necessario per una chiamata da inviare alla segreteria telefonica. Il valore predefinito è 15| +On-Hook Agent Login|On-Hook Login Agente| +This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled|Questa opzione viene utilizzata solo per le chiamate in entrata che vanno ad un agente effettuato l'accesso con questo telefono. Questa funzione consente di chiamare l'agente e non inviare al cliente alla sessione agenti fino a quando la linea si risponde. Il default è n per disabili| +This is a Phone On-Hook Agent|Si tratta di un telefono On-Hook agente| +Maximum Ring Time|Anello Tempo massimo di| +The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes|Le opzioni rinviano smette di lampeggiare e-o la visualizzazione in rosso quando si controlla i callback, finché il numero di callback modifiche| +Auto Pause Pre-Call Work|Auto Pause Pre-Call Work| +In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|In auto-selettore di modalità, questa impostazione se abilitata imposterà l'agente automaticamente messa in pausa quando si fa clic su qualsiasi agente delle seguenti funzioni che richiede loro di essere in pausa-Manual Dial, chiamata rapida, Ricerca Piombo, Call View Log, richiamate Check, Inserisci il codice Pausa. Il default è n per inattivo| +Auto Resume Pre-Call Work|Auto Resume Pre-Call Work| +In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive|In auto-selettore di modalità, questa impostazione se abilitata imposterà l'agente attiva automaticamente quando l'agente fa clic fuori, o annulla, su qualsiasi delle seguenti funzioni che richiede loro di essere in pausa Dial-Manual, chiamata rapida, Ricerca Piombo, Call Log View, richiamate di controllo, immettere codice di pausa. Il default è n per inattivo| +Auto Pause Pre-Call Code|Auto Pause Pre-Call Codice| +If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL|Se l'Auto Pause Pre-Call funzione di lavoro di cui sopra è attiva e codici Pause agente è attivo, questa impostazione sarà il codice pausa che viene utilizzato quando l'agente è in pausa per queste attività. Il valore predefinito è PRECAL| +This campaign is not set to Auto-Alt-Dial|Questa campagna non è impostata su Auto-Alt-Dial| +Multi-Alt-Settings|Multi-Alt-Settings| +Reload Dialplan On Servers|Ricarica Dialplan sui server| +This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers|Questa opzione permette di forzare un reload del dialplan Asterisk su tutti i server nel cluster. Se sono state apportate modifiche nella voce personalizzata Dialplan sopra si consiglia di impostare questo valore a 1 e presentare ad avere tali modifiche entreranno in vigore sui server| +Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified|Utilizzando MULTI_LEAD consente di utilizzare un cavo separato per ogni numero su un conto cliente che tutti condividono un vendor_lead_code comune, e il tipo di numero di telefono per ciascuno è definito con una etichetta nel campo Proprietario. Questa opzione consente di disattivare alcune opzioni sulla schermata Campaign Modifica e mostrare un link al Multi-Alt pagina Impostazioni che permette di impostare quali tipi numero di telefono, definiti dalla etichetta di ogni cavo, viene selezionato e in quale ordine. Questo creerà un filtro speciale di piombo e alterare il campo Rango di tutti i cavi all'interno degli elenchi di cui a questa campagna per chiamare nell'ordine specificato| +Manual Dial CID|Selezione manuale CID| +This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN|Questo definisce se un agente di effettuare le chiamate di selezione manuale avrà le impostazioni della campagna identificativi dei chiamanti utilizzati, o dei loro agenti impostazioni del telefono utilizzato identificativi dei chiamanti. Il valore predefinito è CAMPAGNA| +If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored|Se l'opzione Custom campagna Usa CID è abilitata o la campagna elenco CID impostazione Override viene utilizzato, questa impostazione verrà ignorata| +Phone Post Time Difference Alert|Phone messaggio Ora Alert Difference| +This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED|Questo manuale-dial-unica caratteristica, se attivata, verrà visualizzato un avviso se il fuso orario per il codice postale di piombo, o il codice postale, è diverso dal fuso orario del prefisso del numero di telefono per il piombo. L'opzione OUTSIDE_CALLTIME_ONLY mostrerà solo l'avviso se i due fusi orari sono diversi e uno dei fusi orari è al di fuori del tempo di chiamata selezionata per la campagna. OUTSIDE_CALLTIME_PHONE solo controllare il fuso orario del numero di telefono del piombo e avvisa se è al di fuori del tempo di chiamata locale. OUTSIDE_CALLTIME_POSTAL solo controllare il fuso orario del codice postale del piombo e avvisa se è al di fuori del tempo di chiamata locale. OUTSIDE_CALLTIME_BOTH controllerà il codice postale e numero di telefono per essere dentro il tempo di chiamata locale, anche se sono nello stesso fuso orario. Questi avvisi mostrerà le informazioni nel registro delle chiamate, elenco callback informazioni, risultati di ricerca di informazioni, quando un cavo viene composto e quando è previsto un cavo. Predefinito è DISABLED| +Custom 3-Way Button Transfer|Custom 3-Way Button Transfer| +This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED|Questa opzione aggiungere un pulsante personalizzato Transfer alla schermata agente sotto il Transfer-Conf pulsante che permette uno scatto a tre vie chiamate utilizzando il preset selezionato o sul campo. Le opzioni saranno PRESET_ effettuare chiamate utilizzando il valore predefinito definito. Le opzioni saranno FIELD_ effettuare chiamate utilizzando il numero nel campo selezionato dal piombo. DISABILI non verrà visualizzato il pulsante sullo schermo dell'agente. Le opzioni saranno PARK_ parcheggiare al cliente prima della composizione. Predefinito è DISABLED| +Auto Dial Level Threshold|Auto Dial Threshold Level| +This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Questa impostazione funziona solo con una ADAPT o RATIO Metodo di selezione, e deve essere impostato a qualcosa di diverso da Disabilitato e il numero di agenti impostazione deve essere superiore a 0. Questa funzione consente di impostare un numero minimo di agenti che l'algoritmo predittivo lavorare. Se il numero di agenti scende al di sotto del numero che avete impostato, allora il livello dial andrà a 1.0 fino a più agenti il ​​login o andare nello stato selezionato. LOGGED di IN_AGENTS conterà tutti gli agenti registrati nella campagna, NON PAUSED_AGENTS conterà solo gli agenti che sono in attesa o di parlare, e WAITING_AGENTS conterà solo agenti che sono in attesa di una chiamata. Predefinito è DISABLED| +Available Only Tally Threshold|Disponibile Soglia Tally Solo| +This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED|Questa impostazione funziona solo con una ADAPT o RATIO Metodo di selezione, disponibile solo Tally deve essere impostato su N, questa impostazione deve essere impostato a qualcosa di diverso da Disabilitato e il numero di agenti impostazione deve essere superiore a 0. Questa funzione consente di impostare il numero di agenti di sotto del quale Tally Disponibile solo verrà attivato. Se il numero di agenti scende al di sotto del numero che avete impostato, l'impostazione Disponibile solo con Tally andare a Y temporaneamente fino a quando altri agenti il ​​login o andare nello stato selezionato. LOGGED di IN_AGENTS conterà tutti gli agenti registrati nella campagna, NON PAUSED_AGENTS conterà solo gli agenti che sono in attesa o di parlare, e WAITING_AGENTS conterà solo agenti che sono in attesa di una chiamata. Predefinito è DISABLED| +Time Zone Setting|Impostazione del fuso orario| +This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect|Questa opzione consente di impostare il metodo di mantenere l'attuale ricerca fuso orario per i cavi all'interno di questa lista. Questo processo viene fatto solo di notte quindi tutte le modifiche apportate non saranno immediati. COUNTRY_AND_AREA_CODE è l'impostazione predefinita, e utilizzerà il prefisso del paese e il prefisso interurbano del numero di telefono per determinare il fuso orario del piombo. Postal_Code utilizzerà il codice postale se disponibile, per determinare il fuso orario del piombo. NANPA_PREFIX funziona solo negli Stati Uniti e utilizzerà il prefisso e il prefisso del numero di telefono per determinare il fuso orario del piombo, ma questo non è abilitato di default nel sistema, in modo da assicurarsi di disporre dei dati prefisso NANPA caricati su il sistema prima di selezionare questa opzione. OWNER_TIME_ZONE_CODE utilizzerà lo standard abbraviation fuso orario caricato nel campo proprietario del piombo per determinare il fuso orario, negli esempi USA sono AST, EST, CST, MST, PST, AKST, HST. Questa funzione deve essere abilitata dall'amministratore di sistema potrà entrare in vigore| +Dial Level Difference Target|Comporre Differenza destinazione Level| +This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods|Questo campo è utilizzato per definire se si vuole indirizzare avere un determinato numero di agenti di attesa per le chiamate o le chiamate in attesa per gli agenti. Ad esempio se si vorrebbe sempre avere in media un agente libero di prendere immediatamente le chiamate è necessario impostare questo a -1, se si desidera avere sempre di mira una chiamata in attesa in attesa di un agente è necessario impostare questo valore a 1. Di default è 0. Questo campo non viene utilizzato dal manuale o metodi di selezione INBOUND_MAN| +Admin Utilities|Utilities Admin| +hidden utilities page - If you do not know what these utilities do, you probably should not use them|hidden page utilità - Se non sai cosa fare queste utilità, probabilmente non dovrebbe usarli| +Welcome Languages Page|Benvenuti Lingue Pagina| +Campaign Debug Page|Campagna Pagina Debug| +Bulk Phone Insert Page|Bulk Phone Inserisci pagina| +Send a Call With Custom CID Page|Inviare una chiamata con pagina personalizzata CID| +Speech Voice Lab Page|Speech Voice Lab Pagina| +Safe Harbor Audio|Safe Harbor Audio| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|Questo è il prompt dei file audio che viene riprodotto se l'azione è impostata su Goccia AUDIO. Il valore predefinito è Buzz| +Safe Harbor Call Menu|Safe Harbor Menu chiamata| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|Questo è il menu chiamata che una chiamata viene inviato se l'azione è impostata su Goccia CALLMENU| +Log Key Press|Log pressione di un tasto| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|Questa opzione, se attivata registrerà la stampa DTMF da parte del chiamante in questo menu Chiama. Il default è 0 per disabili| +No DTMF Logging|No DTMF Logging| +DTMF Logging Enabled|DTMF Logging Enabled| +Webphone Auto-Answer|Webphone Risposta automatica| +This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y|Questa impostazione permette al telefono web per essere impostato per rispondere automaticamente alle chiamate che arrivano impostando a Y, o avere anello chiamate impostando per default è N. Y| +CALLMENU will send the customer to the Call Menu defined in the select list below|CALLMENU invierà al cliente al menu chiamate definito nell'elenco di selezione di seguito| +Survey Call Menu|Indagine chiamate Menu| +If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in|Se il metodo è impostato CALLMENU, questo è il Menu di chiamata che il cliente viene inviato a se opt-in| +Scheduled Callbacks Days Limit|Programmato richiamate Giorni Limit| +This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|Questa opzione consente di ridurre l'agente richiamate in programma calendario per un numero selezionabile di giorni da oggi, 12 l'intero mese di calendario verrà comunque visualizzato, ma solo il numero di giorni sarà selezionabile. Il default è 0 per un numero illimitato| +Dial Level Difference Target Method|Comporre Differenza Metodo Target Level| +This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|Questa opzione consente di definire se il livello di rotella di regolazione differenza di destinazione viene applicato solo al calcolo del livello di quadrante o anche per la composizione reale su ogni server di composizione. Se si esegue una piccola campagna con agenti collegati in su molti server si potrebbe desiderare di utilizzare l'opzione ADAPT_CALC_ONLY, perché l'opzione CALLS_PLACED può comportare un minor numero di chiamate di essere immessi che deisred. Questa opzione è attiva solo se il livello Dial Difference è impostato su qualcosa di diverso da 0. Il valore predefinito è ADAPT_CALC_ONLY| +If you want to use custom fields in a web form address, you need to add|Se si desidera utilizzare i campi personalizzati in un indirizzo web form, è necessario aggiungere| +as part of your URL|come parte del tuo URL| +Disable Dispo Screen|Disable Screen Dispo| +This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is|Questa opzione consente di disattivare lo schermo disposizione nell'interfaccia dell'agente. Il campo Stato Disattiva Dispo di seguito devono essere compilati per far funzionare questa opzione. Il valore predefinito è| +Disable Dispo Status|Disabilita Stato Dispo| +If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers|Se l'opzione Dispo schermo è impostata su Disabilita DISPO_DISABLED, allora questo campo deve essere compilati Puoi usare qualsiasi disposizione che si desidera per il campo finché è di 1 a 6 caratteri di lunghezza, con solo lettere e numeri| +This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports|Questa impostazione, se impostato a 1 consentirà un manager di accedere alla chiamata di esportazione e le relazioni di piombo sullo schermo Report. Di default è 0. Per l'esportazione chiamate e conduce Reports, l'ordine seguente campo viene utilizzato per le esportazioni| +This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.|Questo rapporto raccoglie le informazioni di piombo per le chiamate effettuate nell'intervallo di date selezionato. Un cavo è esportato solo una volta, non importa quante chiamate sono state gestite. Lo stato attuale piombo viene utilizzato.| +Export Leads Report|Export Leads Rapporto| +Screen Labels|Etichette schermo| +Add A Screen Label|Aggiungi un Label schermo| +ADD NEW SCREEN LABEL|Aggiungere la nuova etichetta SCREEN| +ADDING NEW SCREEN LABEL|AGGIUNTA DI ETICHETTA NEW SCREEN| +MODIFY SCREEN LABEL|Modificare l'etichetta SCREEN| +DELETE SCREEN LABEL|DELETE LABEL SCREEN| +SCREEN LABELS LIST|SCREEN ETICHETTE LIST| +Screen Label ID|Schermo Label ID| +Screen Label Name|Nome schermata Etichetta| +SCREEN LABEL NOT ADDED|LABEL SCREEN NON AGGIUNTO| +there is already a label in the system with this ID|c'è già una etichetta nel sistema con questo ID| +SCREEN LABEL ADDED|LABEL SCREEN AGGIUNTO| +SCREEN LABEL NOT DELETED|LABEL SCREEN non vengono eliminati| +SCREEN LABEL DELETION CONFIRMATION|SCREEN LABEL conferma dell'eliminazione| +Click here to delete screen label|Clicca qui per cancellare l'etichetta sullo schermo| +SCREEN LABEL DELETION COMPLETED|CANCELLAZIONE LABEL SCREEN COMPLETATO| +DELETE THIS SCREEN LABEL|CANCELLARE QUESTA ETICHETTA SCREEN| +Click here to see Admin changes to this screen label|Clicca qui per vedere i cambiamenti di amministratore per questa etichetta sullo schermo| +Hide Label in Call Logs|Nascondi etichette in registri delle chiamate| +If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N|Se l'etichetta è impostato su HIDE --- --- poi i registri delle chiamate degli agenti, se abilitata sulla campagna, si mostrano ancora sul campo e dati a meno che questa opzione è impostata su Y. Il valore predefinito è N| +SCREEN LABEL NOT MODIFIED|LABEL SCREEN NON MODIFICATA| +SCREEN LABEL MODIFIED|LABEL SCREEN MODIFICATO| +This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system|Questo campo deve essere di almeno 2 caratteri di lunghezza e non più di 20 caratteri, senza spazi o caratteri speciali. Questo è l'ID che verrà utilizzato per identificare l'etichetta schermo tutto il sistema| +This is the descriptive name of the screen label entry|Questo è il nome descrittivo della voce label schermo| +Agent Screen Labels|Agente schermo etichette| +You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels|È possibile selezionare un set di etichette schermo agenti da utilizzare con questa opzione. Il valore predefinito è - System-Settings - per le etichette predefinite| +Status Display Fields|Visualizzazione dello stato Fields| +You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID|È possibile selezionare quali variabili per le chiamate verrà visualizzato nella riga di stato della schermata agente. CallID visualizzerà il 20 ID chiamata il suo carattere unico, LEADID visualizzerà l'ID di piombo del sistema, LISTID visualizzerà la lista di ID. Il valore predefinito è CallID| +CAMPAIGNS USING THIS SCREEN LABEL|Campagne che utilizzano QUESTA ETICHETTA SCREEN| +QueueMetrics Phone Environment Phone Append|Telefono Telefono QueueMetrics Ambiente Append| +This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled|Questa opzione, se attivata, aggiungere il login telefono dell'agente al record data4 nella tabella log coda se il telefono campo Campagna ambiente è popolato. Il default è 0 per disabili| +HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data|HIDDEN non mostrerà l'agente del campo, ma permetterà al settore di disporre di dati importati ed esportati in esso da esso, così come hanno a disposizione la scheda script e forma l'indirizzo web. READONLY visualizzare il valore dei dati nel campo, ma non consentirà l'agente di modificare i dati| +Enable Campaign Test Calls|Abilita chiamate di prova della campagna| +This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled|Questa impostazione consente la possibilità di inserire un codice telefono e numero di telefono nei campi nella parte inferiore dello schermo Detail campagna ed effettuare una telefonata a quel numero, come se si trattasse di un vantaggio di essere auto-selezionato nel sistema. Il numero di telefono viene memorizzato come una nuova guida nel Manuale delle liste ID lista di selezione. La campagna deve essere attivo per questa funzione deve essere abilitata, e si raccomanda che le liste assegnati alla campagna tutti essere impostato su inattivo. Il prefisso di selezione, timeout di composizione e di tutte le funzioni di selezione altre collegate, fatta eccezione per la DNC opzioni call e di tempo, influenzerà la composizione del numero di test. La telefonata sarà posizionato sul server selezionato come server voicemail nelle impostazioni di sistema. Il default è 0 per disabili| +Test calling disabled|Test chiamando disattivato| +PLACE TEST CALL|LUOGO TEST CALL| +Test Outbound Call|Prova chiamate in uscita| +Agents Calls Reset|Agenti chiamate Ripristina| +This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|Questa impostazione definisce se connesso in agenti attivi telefonate e le registrazioni devono essere resettato alla fine Timeclock del giorno. Il valore predefinito è 1 per abilitato| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|La personalizzato 5 campo può essere utilizzato come campo per definire un numero dialplan di inviare una chiamata a da un AGENTDIRECT in gruppo se l'utente non è disponibile, basta mettere AGENTEXT nel campo del messaggio o gli ampliamenti di AGENTDIRECT l'in-group e il sistema cercherà il costume cinque campo e inviare la chiamata a quel numero dialplan| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Per AGENTDIRECT in gruppi, se l'utente non è disponibile, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|Per AGENTDIRECT in gruppi, si può mettere AGENTEXT in questo campo e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|Si può anche mettere AGENTEXT in questo campo se è impostato per estensione e il sistema cercherà l'utente personalizzata cinque campo e inviare la chiamata a quel numero dialplan| +orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall|ordini per l'ultima volta che un agente è stato inviato una chiamata in ingresso. Risultati in agenti che ricevono lo stesso numero complessivo di chiamate| +orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call|ordini per l'ultima volta che un agente finito una chiamata in ingresso. Agente AKA attesa più lunga riceve per la prima chiamata| +Servers|Servers| +This is a list of the server IP addresses of existing servers in the system that you want the phone entries to be populated across. These must be valid IP addresses, they must be active in the system and you must put one per line in this text area input box|Questo è un elenco di indirizzi IP dei server di server esistenti nel sistema che si desidera che le voci di telefono per essere popolato attraverso. Questi devono essere gli indirizzi IP validi, devono essere attivi nel sistema e devi mettere uno per riga in questa finestra di immissione testo zona| +Phones|Cellulari| +This is a list of the phone extensions that you want to be created on all of the servers listed above. The phone extensions should be letters and numbers only, with no special characters and you must put one per line in this text area box|Questa è una lista delle estensioni di telefono che si desidera essere create in tutti i server elencati in precedenza. Le estensioni telefoniche dovrebbero essere solo lettere e numeri, senza caratteri speciali e devi mettere uno per riga in questa casella di testo| +Registration Password|Registrazione password| +This is the registration password that will be used for all of the phones that are created. For SIP and IAX2 protocol you should use a complex password for secutiry reasons|Questa è la password di registrazione che verrà utilizzata per tutti i telefoni che vengono creati. Per il protocollo SIP e IAX2 è necessario utilizzare una password complessa per motivi secutiry| +Login Password|Login Password| +This is the agent screen login password that will be used for all of the phones that are created|Questa è la schermata password di login agente che verrà utilizzata per tutti i telefoni che sono creati| +Create Alias Entries|Creare voci di Alias| +Setting this option to YES will create a phones alias entry for each of the extensions listed above that will tie all of the same extension entries on each server together allowing phone login load balancing to work in the agent interface|Impostando questa opzione su YES creerà una voce telefoni alias per ciascuna delle estensioni elencate sopra che legherà tutte le voci di estensione stessi su ogni server insieme permettendo un login bilanciamento del carico di telefono per lavorare nell'interfaccia agente| +Alias Suffix|Alias ​​Suffisso| +This is the suffix that will be added to the extension to form the phone alias id. For example, if the extension is cc100 and the alias suffix is x, then the phone alias id used for that would be cc100x|Questo è il suffisso che verrà aggiunto alla estensione per formare il telefono id alias. Ad esempio, se l'estensione è CC100 e il suffisso alias è x, allora l'alias ID del telefono utilizzato per questo sarebbe cc100x| +Client Protocol|Client Protocol| +This is the phone protocol that will be used for all phones created when submitted. SIP and IAX2 are VOIP protocols that will create conf file entries to allow those phoens to register on the servers|Questo è il protocollo cellulare che verrà utilizzato per tutti i telefoni creati quando viene sottoposto. SIP e IAX2 sono protocolli VOIP che creeranno le voci del file di configurazione per consentire a tali phoens di registrare sui server| +Local GMT|Locale GMT| +This is the time zone that all of the phones will be created with|Questo è il fuso orario che tutti i telefoni saranno creati con| +HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured|HIDEBLOB è simile al HIDDEN eccezione del tipo di memorizzazione dei dati nel database è di tipo BLOB, adatto per i dati binari o dati che deve essere garantito| +Default Local GMT|Predefinito locale GMT| +This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5|Questa impostazione definisce ciò che verrà utilizzato per impostazione predefinita quando nuovi telefoni e server vengono aggiunti utilizzando questa interfaccia di amministrazione web. Il valore predefinito è -5| +Default Voicemail Zone|Predefinito Voicemail Zone| +This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern|Questa impostazione definisce quale zona verrà utilizzato per impostazione predefinita quando nuovi telefoni e caselle vocali vengono creati. L'elenco delle zone disponibili è direttamente presa dal file voicemail.conf. Il valore predefinito è orientale| +Voicemail Zone|Voicemail Zone| +This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings|Questa impostazione consente di impostare la zona che questa casella voicemail sarà impostato quando il tempo viene registrato un messaggio. Di default è impostato in Impostazioni di sistema| +Voicemail Options|Voicemail Opzioni| +This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing|Questa impostazione opzionale consente di definire le impostazioni vocali aggiuntive. Si consiglia di lasciare vuoto questo se non sai cosa stai facendo| +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|I prossimi due impostazioni sono anche definiti nella sezione Impostazioni di sistema, ed è possibile cambiare dopo che li definiscono qui. È necessario impostare di default locale GMT per il fuso orario che gli agenti vogliono essere dentro la zona Voicemail è l'elenco dei fusi orari segreteria telefonica che i messaggi vocali sarà tempo registrato con nuovi messaggi vengono lasciati| +ERROR: You cannot use reserved words for field labels|ERRORE: Non è possibile utilizzare le parole riservate per le etichette dei campi| +The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API|L'opzione DISPO_SELECT_DISABLED non disattivare la schermata dispo completamente, ma viene visualizzata la schermata dispo senza disposizioni, questa opzione deve essere utilizzata solo se si desidera forzare i vostri agenti di utilizzare il software CRM, che invierà lo stato del sistema tramite l'API| +No Agent Call URL|Nessun agente URL chiamata| +This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank|Questo indirizzo URL web non si vede l'agente, ma se è popolato è chiamato ogni volta che viene appeso a una chiamata che non è gestito da un agente verso l'alto o trasferiti. Utilizza le stesse variabili i campi del modulo web e script. dispo può essere utilizzato per recuperare il sistema definito disposizione per la chiamata. Questo URL non può essere un percorso relativo. Il valore predefinito è vuoto| +On-Hook CID|On-Hook CID| +This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number|Questa opzione viene utilizzata solo per gli agenti che vengono registrati con i telefoni che hanno l'agente-on-hook funzione attivata. Questo è l'ID chiamante che apparirà sui loro telefoni agenti quando le chiamate vengono chiamata. GENERIC è un generico RINGAGENT00000000001 tipo di notifica. Ingroup mostrerà solo l'in-group la chiamata proviene. CUSTOMER_PHONE mostrerà solo il numero telefonico del cliente. CUSTOMER_PHONE_RINGAGENT mostrerà RINGAGENT_3125551212 con il RINGAGENT come parte del CID con il numero di telefono del cliente. CUSTOMER_PHONE_INGROUP mostrerà i primi 10 caratteri del gruppo in-seguito dal numero di telefono del cliente| +Please wait for the whole page to load before submitting the form|Si prega di attendere per l'intera pagina da caricare prima di inviare il modulo| +In-Group Calldate|In-Group Calldate| +This is the last date and time that a call was directed to this inbound group|Questa è l'ultima data e l'ora che una chiamata è stata rivolta a questo gruppo in entrata| +No-Answer Log|Risposta No-Log| +This option will log the auto-dial calls that are not answered to a separate table. Default is N|Questa opzione consente di registrare le chiamate di auto-selezione che non trovano risposta in una tabella separata. Il valore predefinito è N| +Alt-Log DB Server|Alt-Log DB Server| +This is the alternate log database server. This is optional, and allows some logs to be written to a separate database. Default is empty|Questo è il server di database alternativo log. Questo è opzionale, e permette di alcuni registri di essere scritta in un database separato. Il valore predefinito è vuoto| +Alt-Log Tables|Alt-Log tabelle| +These are the tables that are available for logging on the alternate log database server. Default is blank|Queste sono le tabelle che sono disponibili per la registrazione sul server di database alternativo log. Il valore predefinito è vuoto| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Questo è il Text To Speech attuale campo di dati che viene inviato al Cepstral per la creazione del file audio da riprodurre al cliente. è possibile utilizzare Speech Synthesis Markup Language-SSML-in questo campo, per esempio| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|per una pausa di 1 secondo. È inoltre possibile utilizzare diverse variabili come il nome, il cognome e il titolo come variabili ViciDial proprio come si fa in uno script: - A - first_name - B -| +If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|Se avete statici file audio che si desidera utilizzare in base al valore di uno dei campi che è possibile utilizzare anche quelli con la C e D tag. I nomi dei file devono essere tutti in lettere minuscole e devono essere 8k 16bit i file WAV PCM. Il nome del campo deve essere lo stesso, ma senza l'estensione. Wav nel nome del file. Per esempio - C ---- A - Indirizzo3 - B ---- D - per prima cosa trovare il valore per Indirizzo3, poi avrebbe cercato di trovare un file audio corrispondente a quel valore per metterlo nel prompt| +Here is a list of the available variables|Ecco un elenco delle variabili disponibili| +DID Agent Log|DID Log in agenzia| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|Questa opzione registrerà l'ingresso DID chiamate insieme ad un in-group e l'ID utente, se del caso, in una tabella separata. Il valore predefinito è N| +TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|TIMEOUT vi permetterà di impostare cosa succede alla chiamata quando si verifica un timeout senza alcun input dal chiamante. INVALID vi permetterà di impostare ciò che accade quando il chiamante entra un'opzione non valida. INVALID_2ND e 3 può essere attivo solo se INVALID non viene utilizzato, si attenderà fino all'entrata seconda o terza non valida da parte del chiamante prima di eseguire l'opzione| +Survey Recording|Indagine di registrazione| +If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|Se attivata, questa inizierà la registrazione quando si risponde alla chiamata. Consigliato solo se il metodo non è impostato per trasferire ad un agente. Il default è n per disabili| +Campaign Areacode CID|Campagna Prefisso CID| +AREACODE CIDS FOR THIS CAMPAIGN|CIDS IndicativoLocalità di questa campagna| +ADD NEW AREACODE CID|AGGIUNGI IndicativoLocalità NEW CID| +AREACODE|Prefisso| +SUBMIT CHANGES|Invia modifiche| +AREACODE CID NOT ADDED|Prefisso NON CID AGGIUNTO| +there is already an entry for this campaign with this CID|esiste già una voce per questa campagna con questo CID| +AREACODE CID ADDED|Prefisso CID AGGIUNTO| +AREACODE CID NOT DELETED|Prefisso CID non vengono eliminati| +this entry does not exist|questa voce non esiste| +AREACODE CID DELETED|Prefisso CID DELETED| +AREACODE CID MODIFIED|Prefisso CID MODIFICATO| +Campaign Areacode CID Modify|Campagna Modifica Prefisso CID| +CAMPAIGN AREACODE CID LISTINGS|CAMPAGNA IN LISTA Prefisso CID| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|Quando è impostato su IndicativoLocalità si avrà la possibilità di entrare nel sottomenu AC-CID e definire callerids più da utilizzare per prefisso locale| +Enable Campaign Areacode CID|Abilita IndicativoLocalità Campagna CID| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|Questa impostazione consente la possibilità di impostare specifici numeri identificativi dei chiamanti in uscita da utilizzare per campagna. Il valore predefinito è 1 per abilitato| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|Se l'impostazione di sistema per IndicativoLocalità CID è attivata e l'impostazione della campagna per l'uso personalizzato CallerID è impostato su IndicativoLocalità allora avete la possibilità di definire CID prefisso locale che verranno utilizzati quando si chiama in uscita per cavi in ​​questa campagna specifica. È possibile aggiungere callerIDs multipli per ogni prefisso locale e si può attivare e disattivare ogni loro in tempo reale. Se più di un callerID è attiva per un prefisso locale specifica allora il sistema userà il CallerID che è stato utilizzato il minor numero di volte oggi. Se non callerIDs sono attivi per il prefisso locale poi il CallerID campagna o di un elenco di override CallerID verrà utilizzato| +PLLB Grouping|PLLB Raggruppamento| +Phone Login Load Balancing Grouping, only allowed if there are multiple agent servers and phone aliases are present on the system. If set to ONE_SERVER_ONLY it will force all agents for this campaign to login to the same server. If set to CASCADING it will group logged in agents on the same server until PLLB Grouping Limit number of agents are reached, then the next agent will login to the next server with the least number of agents. If set to DISABLED the standard Phone Aliases behavior of each agent finding the server with the least number of non-remote agents logged into it will be used. Default is DISABLED|Accedi Phone Raggruppamento Load Balancing, consentito solo se ci sono server multipli e alias agente del telefono sono presenti sul sistema. Se è impostato su ONE_SERVER_ONLY che costringerà tutti gli agenti di questa campagna per accedere allo stesso server. Se è impostato su CASCATA si raggruppare i registrato nel agenti sullo stesso server fino al numero Raggruppamento PLLB Limite di agenti sono raggiunti, allora l'agente prossimo per accedere al server successivo con il minor numero di agenti. Se impostato su Disabilitato il comportamento standard Phone alias di ciascun agente trovare il server con il minor numero di agenti non-remoti collegati in esso sarà utilizzato. Predefinito è DISABLED| +PLLB Grouping Limit|PLLB Raggruppamento Limit| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING then this setting will determine the number of agents acceptable in each server for this campaign. Default is 50|Telefono Accedi Load Balancing Limit Raggruppamento. Se Raggruppamento PLLB è impostato su CASCATA questa impostazione determinerà il numero di agenti accettabile in ogni server per questa campagna. Il valore predefinito è 50| +Phone Login Load Balancing Grouping Limit. If PLLB Grouping is set to CASCADING at the campaign level then this setting will determine the number of agents acceptable on each server across all campaigns. Default is 100|Telefono Accedi Load Balancing Limit Raggruppamento. Se Raggruppamento PLLB è impostato su CASCATA a livello di campagna questa impostazione determinerà il numero di agenti accettabile su ogni server in tutte le campagne. Il valore predefinito è 100| +Modify DID RA Extension Overrides|Modificare DID RA Extension Overrides| +DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED|NON REMOTE OVERRIDE PROLUNGA AGENTE AGGIUNTO| +there is already an entry for this DID with this RA EXTENSION|esiste già una voce per questo DID con questa estensione RA| +DID REMOTE AGENT EXTENSION OVERRIDE ADDED|HA REMOTE OVERRIDE ESTENSIONE AGENTE AGGIUNTO| +DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED|DID Remote Agent OVERRIDE non cancellato| +DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED|DID Remote Agent OVERRIDE MODIFICATO| +MODIFY THIS DID|MODIFICARE QUESTO DID| +Enable Remote Agent Extension Overrides|Abilita distanza sostituisce interno di un agente| +This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled|Questa impostazione consente di avere DID sostituzioni di estensione per agente remoto le chiamate instradate attraverso in-gruppi. Il default è 0 per disabili| +REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|Distanza sostituisce agente di estensione PER QUESTA DID| +REMOTE AGENT EXTENSION OVERRIDE LISTINGS|Remote Agent ESTENSIONE Override ANNUNCI| +DID Remote Agent Extension Overrides|DID distanza sostituisce interno di un agente| +This section allows you to enable DIDs to have extension overrides for remote agent routed calls through in-groups. The User Start must be a valid Remote Agent User Start or if you want the Extension Override entry to work for all calls then you can use ---ALL--- in the User Start field. If there are multiple entries for the same DID and User Start then the active entries will be used in a round robin method|Questa sezione permette di abilitare DID di avere sostituzioni di estensione per agente remoto le chiamate instradate attraverso in-gruppi. The Start utente deve essere un valido Remote Start User Agent o se si desidera l'estensione Override voce a lavorare per tutte le chiamate è possibile utilizzare --- Tutte --- nel campo Inizio User. Se ci sono più voci per la stessa DID utente e Start, quindi le voci attive saranno utilizzati in un metodo round robin| +SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID|VEDERE LO distanza sostituisce agente di estensione PER QUESTA DID| +THERE ARE|CI SONO| +DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT|DID distanza sostituisce agente di estensione per l'agente REMOTE| +Action Transfer CID|Azione Transfer CID| +Used for Drop, After-hours and No-agent-no-queue actions. This is the caller ID number that the call uses before it is transferred to extensions, messages, voicemail or call menus. You can use CUSTOMER in this field to use the customer phone number, or CAMPAIGN to use the first allowed campaign caller id number. Default is CUSTOMER|Usato per Drop, Dopo mezzanotte e No-agent-no-coda azioni. Questo è il numero ID del chiamante che la chiamata utilizza prima del loro trasferimento alle estensioni, messaggi, casella vocale o menu di chiamata. È possibile utilizzare CLIENTE in questo campo per utilizzare il numero telefonico del cliente, o campagna per utilizzare il primo numero del chiamante consentito campagna id. Il valore predefinito è CLIENTE| +After Hours Call Menu|After Hours chiamate Menu| +If After Hours Action is set to CALLMENU, the call will be sent to this Call Menu if it enters the in-group outside of the call time scheme defined for the in-group|Se After Hours azione è impostata su CALLMENU, la chiamata verrà inviata a questo Menu chiamata se si entra in gruppo al di fuori del regime di tempo definito per la chiamata in gruppo| +Drop Call Menu|Menu a discesa chiamata| +If Drop Action is set to CALLMENU, the call will be sent to this call menu if it reaches Drop Call Seconds|Se l'azione è impostata su Goccia CALLMENU, la chiamata verrà inviato a questo menu chiamata, se arriva secondi di chiamata Goccia| +Custom DID Fields - These five fields can be used for various purposes, mostly relating to custom programming and reports|I campi personalizzati DID - Questi cinque campi possono essere utilizzati per vari scopi, per lo più relative alla programmazione personalizzata e relazioni| +If set to Y_WITH_AMD even answering machine detected message calls will be recorded|Se è impostato su Y_WITH_AMD anche segreteria telefonica le chiamate dei messaggi rilevati saranno registrati| +Log Field|Log campo| +If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field|Se il tasto opzione Log Press è attivata, questa impostazione opzionale può permettere la risposta anche essere memorizzati in questo campo elenco| +Default is NONE for disabled|Il valore predefinito è NONE per disabili| +Call Count Limit|Conteggio chiamate Limit| +This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit|Questo impone un limite al numero di tentativi di chiamata per i cavi selezionati in questa campagna. Un cavo può andare oltre questo limite un po 'Se il riciclaggio di piombo o Auto-Alt-Dialing è abilitata. Di default è 0 per nessun limite| +Call Count Target|Conteggio chiamate di destinazione| +This option is only used for reporting purposes and has no effect on leads dialed. Default is 3|Questa opzione viene utilizzata solo per fini di comunicazione e non ha alcun effetto sulla porta composti. Di default è 3| +Enable Expanded List Stats|Abilita Statistiche elenco esteso| +This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled|Questa impostazione consente a due colonne aggiuntive per essere visualizzati sulla maggior parte delle tabelle nell'elenco di disaggregazione di stato la modifica dell'elenco e le pagine di modifica della campagna. Penetrazione è definita come la percentuale di cavi che sono pari o superiore al limite di conteggio di campagna chiamata e, oppure lo stato è contrassegnato come completato. Il valore predefinito è 1 per abilitato| +Report Option|Segnala Option| +This option allows this specific shift to show up in selected reports that support this option|Questa opzione consente questo cambiamento specifico di presentarsi nei rapporti selezionati che supportano questa opzione| +There are|Esistono| +completed leads in those lists|cavi completati in tali elenchi| +The VIEW_PRESET option will simply open the transfer frame and the preset frame|L'opzione sarà VIEW_PRESET aprire semplicemente la cornice di trasferimento e il telaio preset| +CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature|CONTATTI è un'opzione solo se contact_information è abilitata sul sistema, che è una funzione personalizzata| +Preset Contact Search|Ricerca Contatto Preset| +If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is|Se l'utente è connesso in una campagna che ha Presets di trasferimento impostate CONTATTI, questa impostazione è possibile disattivare la ricerca di contatto solo per questo utente. Il valore predefinito è NOT_ACTIVE che userà qualunque sia l'impostazione della campagna è| +The VIEW_CONTACTS option will open a contacts search window, this will only work if Enable Presets is set to CONTACTS|L'opzione VIEW_CONTACTS aprirà una finestra di ricerca di contatti, questo funziona solo se Presets Enable è impostato su CONTATTI| +Contacts Enabled|Contatti Enabled| +This setting enables the Contacts sub-section in Admin which allows a manager to add modify or delete contacts in the system that can be used as part of a Custom Transfer in a campaign where an agent can search for contacts by first name last name or office number and then select one of many numbers associated with that contact. This feature is often used by operators or in switchboard functions where the user would need to transfer a call to a non-agent phone. Default is 0 for disabled|Questa impostazione consente ai Contatti sotto-sezione in Admin che consente al gestore di aggiungere modificare o cancellare i contatti nel sistema che possono essere utilizzati come parte di un trasferimento personalizzato in una campagna in cui un agente può cercare i contatti in base al nome Cognome o in ufficio numero e quindi selezionare uno dei tanti numeri associati a tale contatto. Questa funzione viene spesso utilizzata dagli operatori o funzioni del quadro in cui l'utente avrebbe bisogno di trasferire una chiamata a un non-agent telefono. Il default è 0 per disabili| +CONTACTS LIST|CONTATTI LISTA| +Add A Contact|Aggiungere un contatto| +ADD NEW CONTACT|Aggiungi nuovo contatto| +ADDING NEW CONTACT|AGGIUNTA DI NUOVO CONTATTO| +MODIFY CONTACT|Modifica contatto| +CONTACT NOT ADDED|Contatto non AGGIUNTO| +there is already a contact in the system with this name and number|c'è già un contatto nel sistema con questo nome e numero di| +CONTACT ADDED|CONTATTO AGGIUNTO| +DELETE THIS CONTACT|Cancellare questo contatto| +Click here to see Admin changes to this contact|Clicca qui per vedere i cambiamenti di amministratore per questo contatto| +DELETE CONTACT|Elimina contatto| +CONTACT NOT DELETED|CONTATTO non vengono eliminati| +CONTACT DELETION CONFIRMATION|CONTATTO CONFERMA CANCELLAZIONE| +Office Number|Office Number| +Cell Number|Cell Number| +Other Number|Numero Altro| +CONTACT NOT MODIFIED|CONTATTO NON MODIFICATA| +Scheduled Callbacks Hours Block|Programmato richiamate Ore Block| +This option allows you to restrict a USERONLY scheduled callback from being displayed on the agent callback list until X hours after it has been set. Default is 0 for no block|Questa opzione consente di limitare un callback USERONLY prevista la visualizzazione della lista agente di callback fino a X ore dopo che è stato impostato. Il valore predefinito è 0 per nessun blocco| +Scheduled Callbacks Calltime Block|Richiamate pianificate blocco Calltime| +This option if enabled will prevent the scheduled callback in the agent callback list from being dialed if it is outside of the scheduled calltime for the campaign. Default is DISABLED|Questa opzione, se abilitata impedirà la richiamata classificata nella lista callback agente di essere composto se è al di fuori del calltime previsto per la campagna. Predefinito è DISABLED| +Modify Same User Level|Modificare stesso livello utente| +This setting only applies to level 9 users. If enabled it allows the level 9 user to modify their own settings as well as other level 9 users. Default is 1 for enabled|Questa impostazione si applica solo al livello 9 utenti. Se abilitato permette al livello 9 all'utente di modificare le proprie impostazioni così come altri a livello di 9 utenti. Il valore predefinito è 1 per abilitato| +Admin Hide Lead Data|Admin nascondere i dati di piombo| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer lead data in the many reports and screens in the system with Xs. Default is 0 for disabled|Questa impostazione si applica solo a livello 7, 8 e 9 utenti. Se abilitato sostituisce i dati del cliente di piombo nei molti rapporti e le schermate del sistema con Xs. Il default è 0 per disabili| +Admin Hide Phone Data|Admin nascondere i dati del telefono| +This setting only applies to level 7, 8 and 9 users. If enabled it replaces the customer phone numbers in the many reports and screens in the system with Xs. The DIGITS settings will show only the last X digits of the phone number. Default is 0 for disabled|Questa impostazione si applica solo a livello 7, 8 e 9 utenti. Se abilitato sostituisce i numeri telefonici dei clienti in numerosi rapporti e le schermate del sistema con Xs. Le impostazioni CIFRE mostra solo le ultime X cifre del numero di telefono. Il default è 0 per disabili| +Allowed User Groups|Gruppi di utenti ammessi| +This is a selectable list of User Groups to which members of this user group can view and possibly edit. User Groups can restrict access to almost all aspects of the system, from inbound DIDs to phones to voicemail boxes. The --ALL-- option allows the users in this group to see and log in to any record on the system if their user permissions allow for it|Questa è una lista selezionabile di gruppi di utenti a cui i membri di questo gruppo di utenti può visualizzare ed eventualmente modificare. Gruppi di utenti possibile limitare l'accesso a quasi tutti gli aspetti del sistema, da DID in entrata ai telefoni a caselle vocali. The - ALL - opzione consente agli utenti in questo gruppo da vedere e accedere a qualsiasi record sul sistema se i loro permessi dell'utente lo consentono| +Allowed Call Times|Tempi di chiamata ammessi| +This is a selectable list of Call Times to which members of this user group can use in campaigns, in-groups and call menus. The --ALL-- option allows the users in this group to use all call times in the system|Questa è una lista selezionabile di durata delle chiamate a cui i membri di questo gruppo utente può utilizzare nelle campagne, nei gruppi e menu di chiamata. The - ALL - opzione consente agli utenti di questo gruppo di utilizzare tutti i tempi delle chiamate al sistema| +All call times in the system|Tutti gli orari delle chiamate del sistema| +You are not allowed to edit your own user group|Non sei autorizzato a modificare il tuo gruppo utente| +You are not allowed to edit your own user|Non sei autorizzato a modificare il proprio utente| +Admin User Group|Admin User Group| +All Admin User Groups|Tutti i gruppi di utenti Admin| +This is the administrative user group for this campaign, this allows admin viewing of this campaign as well as the lists assigned to this campaign to be restricted by user group. Default is --ALL-- which allows any admin user with user group campaign permissions to view this campaign|Questo è il gruppo utente amministrativo per questa campagna, questo permette la visualizzazione amministratore di questa campagna così come le liste assegnati a questa campagna per essere limitato dal gruppo di utenti. Il default è - ALL - che consente a qualsiasi utente amministratore con le autorizzazioni di gruppi di utenti delle campagne per visualizzare questa campagna| +This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group|Questo è il gruppo utente amministrativo per questo gruppo in entrata, questo permette la visualizzazione di questa amministrazione in-gruppo limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo gruppo| +This is the administrative user group for this did, this allows admin viewing of this did restricted by user group. Default is --ALL-- which allows any admin user to view this did|Questo è il gruppo utente amministrativo per questo si, questo permette la visualizzazione di questa amministrazione ha limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore, per visualizzare questo ha fatto| +This is the administrative user group for this record, this allows admin viewing of this recoird restricted by user group. Default is --ALL-- which allows any admin user to view this record|Questo è il gruppo utente amministrativo per questo disco, questo permette la visualizzazione di questa amministrazione recoird limitato dal gruppo di utenti. Il default è - ALL - che permette a qualsiasi utente amministratore per visualizzare questo record| +User Start for this remote agent does not exist|Avvio utente per questo agente remoto non esiste| +ADMIN GROUP|GRUPPO ADMIN| +Max Calls Method|Max Chiama il metodo| +This option can enable the maximum concurrent calls feature for this in-group. If set to TOTAL, then the total number of calls being handled by agents and in queue in this in-group will not be allowed to exceed the Max Calls Count number of lines as defined below. If set to IN_QUEUE, then if the number of calls in queue waiting for agents will not be allowed to exceed the Max Calls Count no matter how many calls are with agents for this in-group. Default is DISABLED|Questa opzione può consentire la massima funzionalità concorrente chiede che tale in-gruppo. Se impostato a TOTAL, quindi il numero totale di chiamate gestite dagli agenti e in coda in questo gruppo non potrà superare il Conte Max chiama il numero di linee come di seguito definiti. Se impostato su IN_QUEUE, quindi se il numero di chiamate in coda in attesa per gli agenti non potranno superare il Conte Max chiamate non importa quante chiamate sono con gli agenti per questo in-gruppo. Predefinito è DISABLED| +Max Calls Count|Chiamate Conte Max| +This option must be set higher than 0 if you want to use the Max Calls Method feature. Default is 0|Questa opzione deve essere superiore a 0 se si desidera utilizzare la funzione di chiamate Max metodo. Il default è 0| +Max Calls Action|Max chiamate Azione| +This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE|Questa è l'azione da intraprendere se il Max Chiama il metodo è abilitata e il numero di chiamate superiore a quello che si trova al di sopra del Conte Max Chiamate impostazione. Le chiamate oltre tale importo verrà inviato sia l'azione DROP, l'azione AFTERHOURS o l'azione NO_AGENT_NO_QUEUE e verrà registrato come uno status MAXCAL con una ragione hangup MaxCalls. Il valore predefinito è NO_AGENT_NO_QUEUE| +If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field|Se un metodo CIDLOOKUP viene utilizzato con ALT, cercherà il campo alt_phone per il numero di telefono se non vengono trovate corrispondenze per il numero di telefono principale. Se un metodo viene utilizzato con CIDLOOKUP ADDR3, cercherà il campo Indirizzo3 per il numero di telefono se non vengono trovate corrispondenze per il numero di telefono principale e facoltativamente il campo alt_phone| +Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call|Un altro campo in questa sezione è GRADE, che consente la campaign_grade_random agente successiva chiamata l'impostazione da utilizzare. Questa impostazione grado aumenta o diminuisce la probabilità che l'agente riceve la chiamata| +gives a higher probability of getting a call to the higher graded agents|fornisce una maggiore probabilità di ottenere una chiamata agli agenti superiori graduate| +gives a higher probability of getting a call to the higher graded agents by in-group|dà una probabilità maggiore di ottenere una chiamata agli agenti più alti graduati di in-group| +gives a higher probability of getting a call to the higher graded agents by campaign|dà una probabilità maggiore di ottenere una chiamata agli agenti più alti graduati per campagna| +Day call count for this in-group|Day conteggio delle chiamate per questo nel gruppo| +Day call count for this campaign|Day conteggio delle chiamate per questa campagna| +SUMMARY STATS|SINTESI STATS| +Daily Maximum Stats|Massimo giornaliero Stats| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|Sono dati che vengono generati dal sistema ogni giorno per tutta la giornata fino alla Timeclock fine della giornata in quanto si trova in Impostazioni di sistema. Questi numeri sono generati dai registri all'interno del sistema per consentire visualizzazione molto più veloce. Le statistiche sono inclusi sono: - Chiamate totali, Agenti Massimo, Massimo chiamate in entrata, Massimo chiamate outbound| +Add or Remove In-Group Selected For Active Users in This User Group|Aggiungi o rimuovi In-gruppo selezionato per gli utenti attivi in ​​questo gruppo di utenti| +Maximum System Stats Reports|Massimo sistema Statistiche Reports| +These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|Queste statistiche sono memorizzate nella cache totali che vengono memorizzati nel corso di ogni giorno in tempo reale attraverso processi back-end. Per le chiamate in entrata, le chiamate totali per in-gruppo sono calcolati per ciascuna chiamata che entra nel processo che calcola. Per i conti tutto il sistema, i totali sono generati da voci di registro così come altre totali in gruppo e campagna. I totali potrebbero non corrispondere a causa delle impostazioni che avete nel vostro sistema, nonché quando la chiamata viene riagganciato| +Hopper VLC Dup Check|Hopper VLC Dup Verifica| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|Impostare questo a Y si tradurrà in ogni lead essere inserito nella tramoggia di essere controllato da vendor_lead_code per assicurarsi che non ci sono duplicati conduttori inseriti con la vendor_lead_code stessa. Questo è molto utile quando Auto-Alt-Dialing con MULTI_LEAD. Il valore predefinito è N| +Inventory Report|Inventory report| +If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes|Se nel verbale di inventario è abilitata sul sistema, questa opzione di verificare se questo elenco è incluso nella relazione oppure no. Il valore predefinito è Y per yes| +Report Rank|Segnala Rango| +This option allows you to rank shifts in selected reports that support this option|Questa opzione consente di classificare cambiamenti nei rapporti selezionati che supportano questa opzione| +You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|È inoltre possibile utilizzare uno IGNORENOSCROLL variabile speciale per forzare le barre di scorrimento nella scheda script anche se si utilizza un iframe all'interno di esso| +Carrier Log Report|Carrier registro per i rapporti| +ADMINISTRATION: Campaign Multi-Alt-Leads|AMMINISTRAZIONE: campagna multi-Alt-Leads| +Multi-Lead Auto Alt Dialing Settings Form|Multi-Lead automatica delle impostazioni di composizione Alt Forma| +List Custom Fields|Elenco Campi Personalizzati| +Select custom template|Seleziona modello personalizzato| +template builder|template builder| +Load from Lead File|Load from File Piombo| +Listloader Custom Template Maker|Listloader Maker modello personalizzato| +Custom template to use|Template personalizzato da utilizzare| +Create a new template|Creare un nuovo modello| +Delete an existing template|Eliminare un modello esistente| +Sample file fitting template|Esempio di modello di file di montaggio| +needed for field assignation||necessari per assegnazione campo| +Select template to delete|Selezionare il modello da eliminare| +DELETE TEMPLATE|Elimina modello| +New template form|Nuovo modello di modulo| +Template ID|Template ID| +Template Name|Nome modello| +Template Description|Template Description| +List ID template will load into|ID modello di elenco verrà caricata in| +Assign columns to file fields|Assegnare le colonne ai campi di file| +selecting a different list will reset columns|la selezione di un elenco diverso si resetterà colonne| +Standard Field|campo standard| +Custom Field|campo personalizzato| +Select a list ID from the drop down menu above to show columns|Selezionare un elenco di ID dal menu a tendina in alto per mostrare le colonne| +SUBMIT TEMPLATE|Carica modello| +Click here to see Admin changes to this campaign|Clicca qui per vedere i cambiamenti di amministratore per questa campagna| +Click here to see Admin changes to this record|Clicca qui per vedere i cambiamenti di amministratore per questo record| +Click here to see Admin changes to this list|Clicca qui per vedere i cambiamenti Admin a questa lista| +Click here to see Admin changes to this script|Clicca qui per vedere i cambiamenti di amministratore per questo script| +Click here to see Admin changes to this filter|Clicca qui per vedere i cambiamenti di amministratore per questo filtro| +Click here to see Admin changes to this In-Group|Clicca qui per vedere i cambiamenti di amministratore per questo In-Group| +Click here to see Admin changes to this DID|Clicca qui per vedere i cambiamenti Admin a questo DID| +Click here to see Admin changes to this filter phone group|Clicca qui per vedere i cambiamenti di amministratore per questo gruppo cellulare filtro| +Click here to see Admin changes to this user group|Clicca qui per vedere i cambiamenti di amministratore per questo gruppo di utenti| +Click here to see Admin changes to this remote agent|Clicca qui per vedere i cambiamenti Admin a questo agente remoto| +Click here to see Admin changes|Clicca qui per vedere i cambiamenti Admin| +CAMPAIGNS USING THIS SCRIPT|CAMPAGNE utilizzando questo script| +IN-GROUPS USING THIS SCRIPT|IN-GRUPPI utilizzando questo script| +LIST OVERRIDES USING THIS SCRIPT|Elenca gli override utilizzando questo script| +ADMIN REPORT OPTIONS|OPZIONI DI RELAZIONE ADMIN| + Inbound | Inbound | +Audio File|file Audio| +USING THIS IN-GROUP|UTILIZZO DI QUESTO GRUPPO IN| +Handle Method|Maniglia Metodo| +Search Method|Metodo di ricerca| +USING THIS CALL MENU|UTILIZZO DI QUESTO MENU CALL| +DELETE THIS CALL MENU|CANCELLA QUESTO MENU CALL| +Click here to see Admin changes to this CALL MENU|Clicca qui per vedere i cambiamenti di amministratore per questo MENU CALL| diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 63954cde..cc3d7627 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -838,6 +838,8 @@ Report Rank|| This option allows you to rank shifts in selected reports that support this option|| You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it|| Carrier Log Report|| +ADMINISTRATION: Campaign Multi-Alt-Leads|| +Multi-Lead Auto Alt Dialing Settings Form|| lead_report_export.php @@ -891,8 +893,6 @@ Callback Comments|| To see information on one of the callbacks below, click on the INFO link. To call the customer back now, click on the DIAL link. If you click on a record below to dial it, it will be removed from the list|| rings all available agents until one picks up the phone|| No calls for this lead|| -ADMINISTRATION: Campaign Multi-Alt-Leads|| -Multi-Lead Auto Alt Dialing Settings Form|| Time Zone Warning|| Phone Area Code Outside Dialable Zone|| Postal Code Outside Dialable Zone|| @@ -904,6 +904,21 @@ Notes: when doing a search for a contact, wildcard or partial search terms are n Contact search requests are all logged in the system|| SEARCH FOR A CONTACT|| CONTACTS SEARCH RESULTS|| +LEAD SEARCH +Customer Time +TERRITORY SELECTION +TERRITORIES NOT SELECTED +SELECTED TERRITORIES +Dialable Leads +You have now logged-in +You logged in at +Refresh Campaign List +PLEASE SELECT A CAMPAIGN +Agents View +-READY +-INCALL +-PAUSED +CALL DISPOSITION ############################################################ MANAGER Manual diff --git a/agc_2-X/trunk/www/vicidial/images/br.gif b/agc_2-X/trunk/www/vicidial/images/br.gif new file mode 100644 index 0000000000000000000000000000000000000000..423b8a0cc6e0f1370e9f9a9a7249323954c30a27 GIT binary patch literal 397 zcmV;80doFFNk%w1VIBY!0K@08l zZ05uTk+2&7$^o^BC3C4F?zsj4k3(NXQ(0w^7M3~yi96T46Z^#gAPsQ#!vO%0LI9CK z0F6BWjy(XAKLCKEys2>)Ndy`Wi9#W9Gy+g*j%vjL zAB)QX!|x9o3lAR}I&?^70R{~g6B7jr1buE70SQq!h8hPC8BG@mjR*jskrEjf1{n_r zgmfDM7EPxR3Vj3x2nYoP5ErKg7GSQhvKO=j$dMSh2))0-8=0G(z7ojw9_XVR=`^Tv`KO#R~Z(847j7(zn~ r9pQ0+0jekNA|@Qd!$*uG{5sH>5o6?w4k9`Vs9edirAwC;LI40es)CL7 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/de.gif b/agc_2-X/trunk/www/vicidial/images/de.gif new file mode 100644 index 0000000000000000000000000000000000000000..4dd34f6a6bbfdbdbfdfb23f49aad444b14ca1981 GIT binary patch literal 162 zcmZ?wbhEHblw%NK*v!E2jDg|*d4^{@7@oy2{J+ca>d996FAK}<=@NL!p2OG?M^s0|PGm%)EXME#b2@8WY E04O>?s{jB1 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/dk.gif b/agc_2-X/trunk/www/vicidial/images/dk.gif new file mode 100644 index 0000000000000000000000000000000000000000..9cc2c236bdc66279c08fe7ce2aa22f437a69e2d1 GIT binary patch literal 1707 zcmZ?wbhEHblw%NKc*ekRv!U&RchFI0-s8-?5Bet`=MX+EAahb)0_J%x9i)FGVz=M8q2_SoL%T%SN{difYZEE|Ni|u?-OuTOyTd}zlRwZUthU;l!5E_ z-@hm2)vu=JJlVPXA z|M~y_jI-xq2BuSjQb!or?siSMR#pG!-~T7eRz2vObdZ7NYE|QLR>9wY|NQ>{?^;aq zVFs4#vB@U|B~P#l9A_0e#VdJAK*!jeSKy zVsdtBi9%9pdS;%j()-=}l@u~lY?Z=IeGPmIoKrJ0J*tXQgRA^PlB=?lEmM^2?G$V( ztSWK~a#KqZ6)JLb@`|l0Y?TsI@{>}nfNYSkzLEl1NlCV?k|Rh$0c59heo?A|sh)vu zvVoa_f|;S7p|Od%xw(#lk%6IszJZaxp^>hkxs|bzm4Sf*6et00D@sYT3UYCS+6Cm< zDrJ|Cs(pQ}JoAc667!N%JzZ>-fco_^GgGV#EL~g-Ei4QzEL|)O4PAju zXJ-p@6H`+ILqj(ULt~g;m;B_?+|;}hnBEkGUL%}(K?xzZ0BEyIYEfocYKmJ?ey#%8 z!&aF%-C_TITuzuazHLF*xT(NxF(j|)* zEnF~v-rPB}XU&{3ecIG1lP67_(BIeF)7{nC(caeD(%jV8P+wPDQ(aYAQC?PBQe0G6 zke`>Elbw~Bk)D>ClAM&75FZyC6CD*95gryA5*!p5;P2<_Vr&G=PT0Sg%1Vj~@^Z2=(o&KV;$osA!a{-q{CvDT++3U- z>};$o%uI|742nNlz-5vShy<0^4D9b3ls#2~THCZm!@}GY+WPuic^O&R!lzAVV(4OF zo<48>H1^3;=g*uycfrao3nD&;>POl z&YabB4h?g%KYjMvbwepLBW}NYem7$p9_var!IXS!j z{(UbP@a2R1hJ+?@*A*Hu9+2~Sy=_{5{;5>eIJeNgH|dn;mKB_Q4jMKyt*$z= TyIQja+&%S`vyZ2dfx#L8Dgti1 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/el.gif b/agc_2-X/trunk/www/vicidial/images/el.gif new file mode 100644 index 0000000000000000000000000000000000000000..9e79d8bfee73ff55997a1643470b07bf73d5c23c GIT binary patch literal 245 zcmVs;j1#u1!_3va__Z0Askhy1Tp#9Sgw0!o$SH3K0N1P<3y8 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/en.gif b/agc_2-X/trunk/www/vicidial/images/en.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb45f5f4e26b8b9f4bb93784217f944c8bb92198 GIT binary patch literal 322 zcmV-I0lof5Nk%w1VIBY!0J8u9Ra%|T4-e#-oCE}9-&a-Y)Y;CulsiDHs6cf)3 z3;pr&|K{V%007JY0RR90A^8LV00000EC2ui03HAo000EfF4pFeUM1`-7j0Pkn6e`vWm23rLv)bU6+f_1DUj;S<8Idce%XnH9 z3{YC3X9d0haQK>#Jfs-{`f3~3EdC1y3kM4fe+&Ub1%D5O27-Va36qqSCLJ9CmYWIBhGT_NHR-64$boy3Ny;>2Ya##uJ6{KZqyPW_ literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/es.gif b/agc_2-X/trunk/www/vicidial/images/es.gif new file mode 100644 index 0000000000000000000000000000000000000000..308ea3cb1fed4dc419f0fbb49c051ded44e42fef GIT binary patch literal 222 zcmZ?wbhEHblw%NK*v!E2I8o}wRL)Ot_+HOVzI%`H%i+LBC9|KO5#6#|=fnlY|8)$v z85r&}F#Jzr_zxuiGbsLKVE_Rg5CJlSfu*}(qwDIuKh8bf^*=$wFDbL`$;vjK3wsK5 z&YL*cRIGbn<9}y2ixT4-N%{SE84s{<^c`E`C&0kMcOm1WV=e;^^Fia)lZ)7|H8RF1 zOz&=LTx7W7`d!Q7KMNAfxN<8zqB&~nI60e|tvJj%*_k@JSQxmbO`kDy)@%kD?fJ5r W3$zz4Ru|@3xoY*Awd=SA8LR5;2;kGE}IHDpba>c-5LnxOg`M> z^8Whz05F{ZF`V8Z5dZ)GA^8LV00000EC2ui03HAo000Dr@UTW}G3x29S3*uGhEio= z9Or?fSenh1rQO%M6D-p;d%va~Z*?Q(f~cXb2t3VbMCQ@SdqjUziV(WQ!eU9TuhrCs zQ&(~p{6u%v->rK*DzmHU`dY4f>*HsAbU1)*f<+E?d>eT#0t}Fm0)dPl1echX00Eqx ToB#?7qNAb;2?MC9sSyA>Do$Bc literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/it.gif b/agc_2-X/trunk/www/vicidial/images/it.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c7b17921936a8feb27e9a0cf2c668f07732c6a1 GIT binary patch literal 198 zcmZ?wbhEHblw%NK*v!Ci_1*R3Dn?h{0!hO&eDYV{UHkF=?J*UjBX;mDRX;}1?48FH%GSCwrkils5-`0E4O*Y=?XGf0{}SvQi1>g literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/nl.gif b/agc_2-X/trunk/www/vicidial/images/nl.gif new file mode 100644 index 0000000000000000000000000000000000000000..0fb464b9ab399c9570cb387a013363fa4b72e477 GIT binary patch literal 250 zcmZ?wbhEHblw%NKIKseimY@HUoV*rXKZ?tZ-X_|JEnB@d)}=t%W@ zI4n7oV>SQ63#UUXqt@S8Bev*5)&B5yMxSeP$DWpay%4ZklC!+3X~B*6Klar9*NFJn u(Ad=6!YU!v(b?7A(<{;5J8@EH|Kw?XEYoLovM}|}U$Ah|VhJWi25SJg2zNsO literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/pl.gif b/agc_2-X/trunk/www/vicidial/images/pl.gif new file mode 100644 index 0000000000000000000000000000000000000000..cde0790592ab20556bb06754b81dd7cf5b9e46b3 GIT binary patch literal 276 zcmV+v0qg!pNk%w1VIBY!0K@;sK9K^(ZFa-rn{S4deFq z|M2kt4-fzU|Nj60A^8LV00000EC2ui03HAo000G%peK%`cL4y$p;zg?WRWC>F*9&p z4w%qDg2+Kf^e`$5h-5(+7IO^3B!iep2G86;u*qbS&a7)-5lAErOIS=|I2sj#K(l6x zD40kihzSr?fPpFi4-^Fj6b~taf(adukdYk<3Nw_Fn2sNtoSmMZppT%Vq@ALrsGp~) atRJhbsIRc3va_KMwx|w{n7zK4Apkoeh=KM1 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/pt.gif b/agc_2-X/trunk/www/vicidial/images/pt.gif new file mode 100644 index 0000000000000000000000000000000000000000..646b76ac68792d5bb88a7ac96f94cbaccc4da1a3 GIT binary patch literal 208 zcmZ?wbhEHblw%NK*v!CiOF>4aRsMFU-pwiV{TCZ-UE*+NiA&EO$14XfoUb=8uho2) zkZ}04|K`*08K%jMdj3txF;<0617+v zZcjQ=DAB1h($ literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/ru.gif b/agc_2-X/trunk/www/vicidial/images/ru.gif new file mode 100644 index 0000000000000000000000000000000000000000..c51ebece28fdcb38b5790a8c3fa75c9b2decdfda GIT binary patch literal 166 zcmZ?wbhEHblw%NK*v!Dd&;S3woZR~L|CjM+{O9Igz!1M`)&KuMQ3fFR4+J0@2`K(# z0rPY~B*+W~mf(Pso~!p-ygs}8e}YC@Q{udgRqL20>?zPWZ}Q+$1>fze`1|`3n$&rO zx@`|EIFMsC|H6w04J)G7-&pg_;cC_XFujUBZzrAaU}o%9W7+XxM~$C7ixPu10G9VZ A!vFvP literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/se.gif b/agc_2-X/trunk/www/vicidial/images/se.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f329d6583325ac0e09ae2aa4233732524b751e3 GIT binary patch literal 712 zcmc(c+e=en0KmWR+xa}ZrDSeprY)V$%tVHit1z{>i^pu%S@fzTOo+fRLI{$1o0qc0 zd?_u&rG+^a?FQl8tq0qhOdUZ45nUeiMcP*GoX^%@(U0H5@BODY>Pj{BSs)GgE&%{s z0Js700N@3{2cR234<&Fw=mOA-pc6nJf=dv30DMOy2Sy7Bx+%(msD-3NBPT>25oO2J z45nr&?7-N8@GFdG5PpsEEW&Su!Uv45i_vv6I$K@UEk@tT=)0;79R@>Rt+93agJ#*U z4F=TjgC%}{WgwilvRb?rDqIT{h1QO&hlsuNxD{eHkSQMxw=!I2K>{hqQ+^l)^vvwLj($;9AO8(WqEZ%>a54bRQLcu6ffljVC# z%;ppOagvo1C5c3W#b7|S9?n0Udz`&^xwyJ)D@G@3t@YU*{VE}%TtGCt;2RkTTG&wuOj4k#+7_ZhdUB=XW!S#!ml zeR-Hx8f>k=)h;QXWIyhNd!%2N5tgsD%be(ZGjo9$Px7nqiw uP1d}fFH;8>eBqe}I=8sREbp3*Pr*M04sN@*5AaPluZc5USV literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/sk.gif b/agc_2-X/trunk/www/vicidial/images/sk.gif new file mode 100644 index 0000000000000000000000000000000000000000..fa13224e73aecb9424595f09cde5011adb6cc755 GIT binary patch literal 334 zcmV-U0kQr^Nk%w1VIBY!0K@iE{#z*=_N9W2uZ z8P!Bq)GR-dUylGYspyN9>Yk_LZ+uc`v#k?1-e7OO%;^9)sR22t05+!pI<0#lTG|gD z063`8A2ZGoCjbBcA^8LV00000EC2ui03HAo000Hc;3tk`X`X1Ru59bRX7B~H44cm| zMEOA7hKkTYQFI;xhNlx0I-gJj;Bvtf79PmqkW5G%)UbFA0AMf{z=A=62q+7$<4mvH z%N&k%u@Gzp5psEhgoSu|00;^S5fBO+3k4X3l!Ij!791H36B7jmod^IKn5CwtWf`gt z5(N&g4h0gbw6(UX00bJlyA1%Z01djl#KpV>2^-4G2(1krkIT~2%LyGG*x4HcaoOJA g;2qcC9tz~=-s0%%=<4k6=?voY^!4`l9Sk7=J1xYF1poj5 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/images/tw.gif b/agc_2-X/trunk/www/vicidial/images/tw.gif new file mode 100644 index 0000000000000000000000000000000000000000..8a974c44a01a91bb29fd9ef434693e49045aa590 GIT binary patch literal 1259 zcmV)YVq zfB*m}000&q9zirTwzjtN!^8Xk|JK&l^YimwVPR%qVD$9#eE+3fg8{&b2&?6*1A|k)Pzd1QMLPA3C^YiTL>OCGFDk>_r!NJJM z$(fm%-{0RuKR?~w-PF|7UR74~_V(LbTYpv zUuI_CZEn!k*7w!c%moEcPftM)58`xnva+(UwzkgB&N?|bQ&LhyL_|6r9qQ`p)iX0g z3=FijwdLvQ)jT~{S6A?+r^Fv0&lnlw>+ARU`0(}hp`oGm($njurS*q~{p;&C5)!Yl zusstK``_Q?g@(~5DEayM)I&t#czEP~e*e+Y+)7GhWMupM`)qD*;^N`}007%lREvv? z@xH$N^78DcsqLw$rlzL&;^S~|a8XiH{r2|y?d?WJMmicAtgNiPDl3zdliSKYwWVaCw>p`nv0?v;?1=*=% zP}9VjG7Mi8K{f#ZfC&u9?ZWmi5w}SdoH~G{hoPu^0|X%Ohd|DN0cK{=VrEE$fHlv+ zIkVDW3qc4S9NF6TC0VC8YBU+!a4*M(QP~Rkn!;)siee=)2vm_mLxVBV_Pm%jL_sNC z1fB#Vzyr~OETOyb}Bhc~~(A&>`c V8YGBF|KPAmo_SUS0!0A<06R%oU_Sr= literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/leadloader_template_display.php b/agc_2-X/trunk/www/vicidial/leadloader_template_display.php index 74c221e5..8c80474c 100644 --- a/agc_2-X/trunk/www/vicidial/leadloader_template_display.php +++ b/agc_2-X/trunk/www/vicidial/leadloader_template_display.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 #